From 7d0531eb26fdc434dff69280465ec1faaf8593a8 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Thu, 8 Apr 2021 15:23:50 -0500 Subject: [PATCH] Some changes to the way missed APRS packets are handled. --- ir-aprsisd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ir-aprsisd b/ir-aprsisd index 430654e..d272cee 100755 --- a/ir-aprsisd +++ b/ir-aprsisd @@ -333,15 +333,16 @@ def sendAPRS(device, DevID, ARPreamble, tstamp, lat, long, alt, course, speed, c try: aprslib.parse(aprsPacket) # For syntax AIS.sendall(aprsPacket) + #If the above doesn't raise an exception, we should assume we've sent the packet. + lastUpdate[DevID] = calendar.timegm(tstamp) + transmitted[DevID] += 1 + print("Sent: " + aprsPacket) except Exception as e: print("Could not send APRS packet: ") print(aprsPacket) print("Attempting reconnect just in case.") reconnect() - pass - #Last update in UTC - lastUpdate[DevID] = calendar.timegm(tstamp) - transmitted[DevID] += 1 + return None def stats(): global transmitted, lastStats