make the program status variable m_running a static s_running for dvmpatch; ensure PeerNetwork for dvmpatch uses m_packetDump instead of m_debug for packet dumping;

r05a04_dev
Bryan Biedenkapp 4 weeks ago
parent 504fa39580
commit b9b366a8a2

@ -38,7 +38,7 @@ namespace analog
*/
const uint32_t AUDIO_SAMPLES_LENGTH = 160U; //!< Sample size for 20ms of 16-bit audio at 8kHz.
const uint32_t AUDIO_SAMPLES_LENGTH_BYTES = 320U; //!< Sample size for 20ms of 16-bit audio at 8kHz in bytes.
const uint32_t AUDIO_SAMPLES_LENGTH_BYTES = 320U; //!< Sample size for 20ms of 16-bit audio at 8kHz in bytes. (AUDIO_SAMPLES_LENGTH * 2)
/** @} */
/** @brief Audio Frame Type(s) */

@ -58,6 +58,7 @@ using namespace network::udp;
// ---------------------------------------------------------------------------
std::mutex HostPatch::s_networkMutex;
bool HostPatch::s_running = false;
// ---------------------------------------------------------------------------
// Public Class Members
@ -106,7 +107,6 @@ HostPatch::HostPatch(const std::string& confFile) :
m_p25DstCrypto(nullptr),
m_netId(P25DEF::WACN_STD_DEFAULT),
m_sysId(P25DEF::SID_STD_DEFAULT),
m_running(false),
m_trace(false),
m_debug(false)
{
@ -237,7 +237,7 @@ int HostPatch::run()
::LogInfoEx(LOG_HOST, "Patch is up and running");
m_running = true;
s_running = true;
StopWatch stopWatch;
stopWatch.start();
@ -284,6 +284,8 @@ int HostPatch::run()
Thread::sleep(1U);
}
s_running = false;
::LogSetNetwork(nullptr);
if (m_network != nullptr) {
m_network->close();
@ -2096,8 +2098,9 @@ void* HostPatch::threadNetworkProcess(void* arg)
#endif // _GNU_SOURCE
while (!g_killed) {
if (!patch->m_running) {
Thread::sleep(1U);
if (!HostPatch::s_running) {
LogError(LOG_HOST, "HostPatch::threadNetworkProcess(), thread not running");
Thread::sleep(1000U);
continue;
}
@ -2186,8 +2189,9 @@ void* HostPatch::threadMMDVMProcess(void* arg)
stopWatch.start();
while (!g_killed) {
if (!patch->m_running) {
Thread::sleep(1U);
if (!HostPatch::s_running) {
LogError(LOG_HOST, "HostPatch::threadMMDVMProcess(), thread not running");
Thread::sleep(1000U);
continue;
}

@ -119,7 +119,7 @@ private:
uint32_t m_netId;
uint32_t m_sysId;
bool m_running;
static bool s_running;
bool m_trace;
bool m_debug;

@ -199,7 +199,7 @@ bool PeerNetwork::writeConfig()
::memcpy(buffer + 0U, TAG_REPEATER_CONFIG, 4U);
::snprintf(buffer + 8U, json.length() + 1U, "%s", json.c_str());
if (m_debug) {
if (m_packetDump) {
Utils::dump(1U, "PeerNetowrk::writeConfig(), Message, Configuration", (uint8_t*)buffer, json.length() + 8U);
}
@ -278,7 +278,7 @@ UInt8Array PeerNetwork::createP25_LDU1Message_Raw(uint32_t& length, const p25::l
buffer[23U] = count;
if (m_debug)
if (m_packetDump)
Utils::dump(1U, "PeerNetwork::createP25_LDU1Message_Raw(), Message, P25 LDU1", buffer, (P25_LDU1_PACKET_LENGTH + PACKET_PAD));
length = (P25_LDU1_PACKET_LENGTH + PACKET_PAD);
@ -353,7 +353,7 @@ UInt8Array PeerNetwork::createP25_LDU2Message_Raw(uint32_t& length, const p25::l
buffer[23U] = count;
if (m_debug)
if (m_packetDump)
Utils::dump(1U, "PeerNetwork::createP25_LDU2Message_Raw(), Message, P25 LDU2", buffer, (P25_LDU2_PACKET_LENGTH + PACKET_PAD));
length = (P25_LDU2_PACKET_LENGTH + PACKET_PAD);

Loading…
Cancel
Save

Powered by TurnKey Linux.