mirror of
https://github.com/meshtastic/python.git
synced 2026-01-14 18:57:56 -05:00
add test code for #47
This commit is contained in:
10
tests/tcp-test.py
Normal file
10
tests/tcp-test.py
Normal 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])
|
||||
Reference in New Issue
Block a user