cleaning up

main
Tom Early 4 years ago
parent a76b4e952c
commit 187d0e5313

@ -17,6 +17,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/select.h> #include <sys/select.h>
#include <iostream> #include <iostream>
#include <iomanip>
#include "TranscoderPacket.h" #include "TranscoderPacket.h"
#include "Controller.h" #include "Controller.h"
@ -214,7 +215,6 @@ void CController::ReadReflector()
dmr_device[devnum]->packet_queue.push(packet); dmr_device[devnum]->packet_queue.push(packet);
//increment the dmr vocoder index //increment the dmr vocoder index
IncrementDMRVocoder(); IncrementDMRVocoder();
std::cout << "packet_queue sizes: DStar=" << dstar_device[0]->packet_queue.size() << " DMR=" << dmr_device[0]->packet_queue.size() << std::endl;
break; break;
case ECodecType::none: case ECodecType::none:
default: default:
@ -260,8 +260,6 @@ void CController::ReadAmbeDevices()
} }
//wait for up to 40 ms to read anthing from all devices //wait for up to 40 ms to read anthing from all devices
if (rval > 0) { if (rval > 0) {
if (rval > 1)
std::cout << "GOT MULTIPLE READ REQUESTS, " << rval << std::endl;
// from the device file descriptor, we'll know if it's dstar or dmr // from the device file descriptor, we'll know if it's dstar or dmr
for (unsigned int i=0 ; i<dstar_device.size(); i++) for (unsigned int i=0 ; i<dstar_device.size(); i++)
{ {
@ -277,7 +275,6 @@ void CController::ReadAmbeDevices()
{ {
ReadDevice(dmr_device[i], EAmbeType::dmr); ReadDevice(dmr_device[i], EAmbeType::dmr);
FD_CLR(dmr_device[i]->GetFd(), &FdSet); FD_CLR(dmr_device[i]->GetFd(), &FdSet);
std::cout << "Read DMR device " << i << std::endl;
} }
} }
} }
@ -387,12 +384,6 @@ void CController::ReadDevice(std::shared_ptr<CDV3003> device, EAmbeType type)
Dump(spPacket, "Completed Transcoder packet"); Dump(spPacket, "Completed Transcoder packet");
#endif #endif
} }
#ifdef DEBUG
else
{
Dump(spPacket, "Not quite ready");
}
#endif
} }
} }
@ -424,31 +415,28 @@ void CController::Dump(const std::shared_ptr<CTranscoderPacket> p, const std::st
if (p->IsLast()) if (p->IsLast())
std::cout << " IsLast"; std::cout << " IsLast";
std::cout << std::endl; std::cout << std::endl;
auto width = std::cout.width(2);
auto fill = std::cout.fill('0');
if (p->DStarIsSet()) if (p->DStarIsSet())
{ {
std::cout << "DStar data: "; std::cout << "DStar data: ";
for (unsigned int i=0; i<9; i++) for (unsigned int i=0; i<9; i++)
std::cout << unsigned(*(p->GetDStarData()+i)); std::cout << std::setw(2) << std::setfill('0') << unsigned(*(p->GetDStarData()+i));
std::cout << std::endl; std::cout << std::endl;
} }
if (p->DMRIsSet()) if (p->DMRIsSet())
{ {
std::cout << "DMR Data: "; std::cout << "DMR Data: ";
for (unsigned int i=0; i<9; i++) for (unsigned int i=0; i<9; i++)
std::cout << unsigned(*(p->GetDMRData()+i)); std::cout << std::setw(2) << std::setfill('0') << unsigned(*(p->GetDMRData()+i));
std::cout << std::endl; std::cout << std::endl;
} }
if (p->M17IsSet()) if (p->M17IsSet())
{ {
std::cout << "M17 Data: "; std::cout << "M17 Data: ";
for (unsigned int i=0; i<16; i++) for (unsigned int i=0; i<16; i++)
std::cout << unsigned(*(p->GetM17Data()+i)); std::cout << std::setw(2) << std::setfill('0') << unsigned(*(p->GetM17Data()+i));
std::cout << std::endl; std::cout << std::endl;
} }
std::cout << std::dec; std::cout << std::dec;
std::cout.width(width);
std::cout.fill(fill);
} }
#endif #endif

@ -25,7 +25,7 @@ int main()
if (controller.Start()) if (controller.Start())
return EXIT_FAILURE; return EXIT_FAILURE;
std::cout << "Hybrid Transcoder Version #211205 Successfully started" << std::endl; std::cout << "Hybrid Transcoder Version #211209 Successfully started" << std::endl;
pause(); pause();

Loading…
Cancel
Save

Powered by TurnKey Linux.