File: tcp-test.py

package info (click to toggle)
meshtastic 2.7.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,616 kB
  • sloc: python: 10,936; sh: 76; makefile: 33
file content (18 lines) | stat: -rw-r--r-- 350 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# reported by @ScriptBlock

import sys

from pubsub import pub

import meshtastic


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