This commit is contained in:
SpudGunMan
2024-10-06 16:27:26 -07:00
parent a0eb4a6a6e
commit 124d5af2f2
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -902,7 +902,7 @@ def onDisconnect(interface):
elif interface2_enabled and interface2_type == 'ble':
retry_int2 = True
numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr = [0,0], [0,0], [0,0], [0,0]
numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr = ([-1, -1],) * 4
def onReceive(packet, interface):
# Priocess the incoming packet, handles the responses to the packet with auto_response()
# Sends the packet to the correct handler for processing
@@ -956,7 +956,8 @@ def onReceive(packet, interface):
if telemetry_packet.get('localStats'):
localStats = telemetry_packet['localStats']
if localStats.get('numPacketsTx') and localStats.get('numPacketsRx') != 0:
#print(f"numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}")
if numPacketsRx != 0:
print(f"numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}")
# Assign the values and include rxNode
numPacketsTx = (localStats['numPacketsTx'], rxNode)
numPacketsRx = (localStats['numPacketsRx'], rxNode)
+1 -1
View File
@@ -700,7 +700,7 @@ def getNodeTelemetry(nodeID=0, rxNode=1):
# packet telemetry
if numPacketsRx != 0:
print(f"sys numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}")
print(f"set new value numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}")
if numPacketsTx[1] == 1:
dataResponse += f"Telemetry:{rxNode} numPacketsTx:{numPacketsTx[0]} numPacketsRx:{numPacketsRx[0]} numPacketsTxErr:{numPacketsTxErr[0]} numPacketsRxErr:{numPacketsRxErr[0]}"
elif numPacketsTx[1] == 2: