Files
archy-messh/host-bridge/adapters/__pycache__/meshtastic_adapter.cpython-313.pyc
T

24 lines
3.3 KiB
Plaintext
Raw Normal View History

ó
•^Djˆãó4SrSSKJr SSKJr "SS5rg)u6Meshtastic adapter — wraps the official `meshtastic` Python client.
Uses the same pubsub pattern as meshtastic/python's own examples
(examples/replymessage.py, examples/tcp_pubsub_send_and_receive.py):
subscribe to the "meshtastic.receive" topic, filter for text packets,
send via MeshInterface.sendText().
é)ÚCallable)ÚpubcóŠ\rSrSrSrSS\\\\/S4S\S-S\S-4SjjrSS jrS
\ SS4S jr
S \SS4S
jr SSjr Sr
g)ÚMeshtasticAdapteréÚ
meshtasticNÚ
on_messageÚportÚhostcó6XlX lX0lSUlg)zµport: serial device path (e.g. /dev/ttyUSB0). host: TCP hostname/IP.
Exactly one of port/host should be set; if neither is set, the
underlying library auto-detects a serial device.
N)Ú _on_messageÚ_portÚ_hostÚ_iface)Úselfr r
r s Úadapters/meshtastic_adapter.pyÚ__init__ÚMeshtasticAdapter.__init__sðØŒ
،
؈ óÚreturncóSSKnSSKn[R"URS5 UR
(a*UR RUR
SS9UlgURRURSS9Ulg)Nrzmeshtastic.receiveé
)ÚhostnameÚtimeout)ÚdevPathr) Úmeshtastic.serial_interfaceÚmeshtastic.tcp_interfacerÚ subscribeÚ_handle_receiverÚ
tcp_interfaceÚ TCPInterfacerÚserial_interfaceÚSerialInterfacer)rrs rÚconnectÚMeshtasticAdapter.connect shÛ