|
|
|
|
@ -47,7 +47,7 @@ bool CController::Start()
|
|
|
|
|
usrp_rx_num = calcNumerator(g_Conf.GetGain(EGainType::usrprx));
|
|
|
|
|
usrp_tx_num = calcNumerator(g_Conf.GetGain(EGainType::usrptx));
|
|
|
|
|
|
|
|
|
|
if (InitVocoders() || tcClient.Initialize(g_Conf.GetAddress(), g_Conf.GetTCMods(), g_Conf.GetPort()))
|
|
|
|
|
if (InitVocoders() || tcClient.Open(g_Conf.GetAddress(), g_Conf.GetTCMods(), g_Conf.GetPort()))
|
|
|
|
|
{
|
|
|
|
|
keep_running = false;
|
|
|
|
|
return true;
|
|
|
|
|
@ -250,12 +250,17 @@ void CController::ReadReflectorThread()
|
|
|
|
|
{
|
|
|
|
|
while (keep_running)
|
|
|
|
|
{
|
|
|
|
|
tcClient.ReConnect();
|
|
|
|
|
|
|
|
|
|
std::queue<std::unique_ptr<STCPacket>> queue;
|
|
|
|
|
// wait up to 100 ms to read something on the unix port
|
|
|
|
|
if (tcClient.Receive(queue, 100))
|
|
|
|
|
{
|
|
|
|
|
if (tcClient.ReConnect())
|
|
|
|
|
{
|
|
|
|
|
std::cerr << "Unrecoverable ERROR! Quitting..." << std::endl;
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
while (! queue.empty())
|
|
|
|
|
{
|
|
|
|
|
// create a shared pointer to a new packet
|
|
|
|
|
@ -290,7 +295,6 @@ void CController::ReadReflectorThread()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This is only called when codec_in was dstar or dmr. Obviously, the incoming
|
|
|
|
|
@ -602,7 +606,14 @@ void CController::ProcessUSRPThread()
|
|
|
|
|
void CController::SendToReflector(std::shared_ptr<CTranscoderPacket> packet)
|
|
|
|
|
{
|
|
|
|
|
// send the packet over the socket
|
|
|
|
|
tcClient.Send(packet->GetTCPacket());
|
|
|
|
|
while (tcClient.Send(packet->GetTCPacket()))
|
|
|
|
|
{
|
|
|
|
|
if (tcClient.ReConnect())
|
|
|
|
|
{
|
|
|
|
|
std::cerr << "Unrecoverable ERROR, quiting!" << std::endl;
|
|
|
|
|
exit(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
packet->Sent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|