stop wrapping messages in DotMap, some users might not want that

This commit is contained in:
geeksville
2020-05-03 18:36:24 -07:00
parent 56bf66c926
commit 06a00e317b
3 changed files with 19 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ from pubsub import pub
import time
import sys
import threading
from dotmap import DotMap
"""The interfaces we are using for our tests"""
interfaces = None
@@ -17,12 +18,14 @@ testsRunning = False
testNumber = 0
def onReceive(packet):
def onReceive(packet, interface):
"""Callback invoked when a packet arrives"""
print(f"Received: {packet}")
if packet.payload.data.typ == "CLEAR_TEXT":
print(f"From {interface.devPath}: {packet}")
p = DotMap(packet)
if p.payload.data.typ == "CLEAR_TEXT":
# We only care a about clear text packets
receivedPackets.append(packet)
receivedPackets.append(p)
def onNode(node):