From e89be6d56a92a47ae23962a2ff92383d6a94107a Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Sun, 27 Dec 2020 16:24:12 +0800 Subject: [PATCH] add test code for #47 --- tests/tcp-test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/tcp-test.py diff --git a/tests/tcp-test.py b/tests/tcp-test.py new file mode 100644 index 0000000..37411b2 --- /dev/null +++ b/tests/tcp-test.py @@ -0,0 +1,10 @@ + +# reported by @ScriptBlock + +import meshtastic, sys +from pubsub import pub +def onConnection(interface, topic=pub.AUTO_TOPIC): # called when we (re)connect to the radio + print(interface.myInfo) + interface.close() +pub.subscribe(onConnection, "meshtastic.connection.established") +interface = meshtastic.TCPInterface(sys.argv[1])