From fd73e431fde608d66554523ee89a76aad794d3e3 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Sat, 9 May 2020 13:50:42 -0700 Subject: [PATCH] ack after a ' F' --- QnetLink.cpp | 21 +++++++++++---------- QnetLink.h | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/QnetLink.cpp b/QnetLink.cpp index 916efb8..357dfac 100644 --- a/QnetLink.cpp +++ b/QnetLink.cpp @@ -142,7 +142,7 @@ void CQnetLink::send_heartbeat() } } -void CQnetLink::rptr_ack(short i) +void CQnetLink::rptr_ack(int i) { static char mod_and_RADIO_ID[3][22]; @@ -889,7 +889,7 @@ void CQnetLink::Process() } while (keep_running) { - static bool loadG = false; + static bool loadG[3] = { false, false, false }; time(&tnow); if (keep_running && (tnow - hb) > 0) { /* send heartbeat to connected donglers */ @@ -2762,7 +2762,7 @@ void CQnetLink::Process() if (admin.size()>0 && admin.end()==admin.find(call)) { printf("%s not found in admin list, ignoring gwys read request\n", call); } else { - loadG = true; + loadG[i] = true; } } } @@ -3019,16 +3019,17 @@ void CQnetLink::Process() } FD_CLR (Gate2Link.GetFD(), &fdset); } - for (int i=0; i<3; i++) { - if (keep_running && notify_msg[i][0] && 0x0U == tracing[i].streamid) { + for (int i=0; i<3 && keep_running; i++) { + if (notify_msg[i][0] && 0x0U == tracing[i].streamid) { PlayAudioNotifyThread(notify_msg[i]); notify_msg[i][0] = '\0'; } - } - if (loadG && 0x0U==(tracing[0].streamid | tracing[1].streamid | tracing[2].streamid)) { - qnDB.ClearGW(); - LoadGateways(gwys); - loadG = false; + if (loadG[i] && 0x0U == tracing[i].streamid) { + qnDB.ClearGW(); + LoadGateways(gwys); + loadG[i] = false; + rptr_ack(i); + } } } } diff --git a/QnetLink.h b/QnetLink.h index 8a283ed..2332ab7 100644 --- a/QnetLink.h +++ b/QnetLink.h @@ -95,7 +95,7 @@ private: void g2link(const char from_mod, const char *call, const char to_mod); void send_heartbeat(); bool resolve_rmt(const char *name, const unsigned short port, CSockAddress &addr); - void rptr_ack(short i); + void rptr_ack(int i); void PlayAudioNotifyThread(char *msg); void AudioNotifyThread(SECHO &edata); void RptrAckThread(char *arg);