From 2432bb6606666e35e0998d6d2f5db986e836d5af Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 10 Feb 2021 15:00:13 +0800 Subject: [PATCH] fix bitrot in stress test --- meshtastic/test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/meshtastic/test.py b/meshtastic/test.py index fc862c8..21578a9 100644 --- a/meshtastic/test.py +++ b/meshtastic/test.py @@ -20,10 +20,10 @@ testNumber = 0 def onReceive(packet, interface): """Callback invoked when a packet arrives""" - print(f"From {interface.devPath}: {packet}") + print(f"From {interface.stream.port}: {packet}") p = DotMap(packet) - if p.decoded.data.typ == "CLEAR_TEXT": + if p.decoded.data.portnum == "TEXT_MESSAGE_APP": # We only care a about clear text packets receivedPackets.append(p) @@ -78,8 +78,9 @@ def testThread(numTests=50): global testNumber testNumber = testNumber + 1 isBroadcast = True + # asBinary=(i % 2 == 0) success = testSend( - interfaces[0], interfaces[1], isBroadcast, asBinary=(i % 2 == 0)) + interfaces[0], interfaces[1], isBroadcast, asBinary = False) if not success: numFail = numFail + 1 logging.error(