add test code for #47

This commit is contained in:
Kevin Hester
2020-12-27 16:24:12 +08:00
parent 3bfec71e0a
commit e89be6d56a

10
tests/tcp-test.py Normal file
View File

@@ -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])