mirror of
https://github.com/meshtastic/python.git
synced 2026-01-01 20:38:03 -05:00
fix markdown
This commit is contained in:
@@ -4,5 +4,5 @@ A python client for using Meshtastic devices. This small library (and example ap
|
||||
|
||||
You probably don't want this yet because it is a pre-alpha WIP.
|
||||
|
||||
For the rough notes/implementation plan see [TODO.md].
|
||||
For the rough notes/implementation plan see [TODO](./TODO.md).
|
||||
|
||||
|
||||
45
TODO.md
45
TODO.md
@@ -1,40 +1,41 @@
|
||||
# TODO
|
||||
|
||||
* protobuf docs https://developers.google.com/protocol-buffers/docs/pythontutorial
|
||||
- protobuf docs https://developers.google.com/protocol-buffers/docs/pythontutorial
|
||||
|
||||
## Primary API: MeshInterface
|
||||
|
||||
Contains a reader thread that is always trying to read on the serial port.
|
||||
|
||||
methods:
|
||||
constructor(serialPort)
|
||||
send(meshPacket) - throws errors if we have errors talking to the device
|
||||
close() - shuts down the interface
|
||||
init() - starts the enumeration process to download nodedb etc... - we will not publish to topics until this enumeration completes
|
||||
radioConfig
|
||||
nodeDB
|
||||
myNodeInfo
|
||||
myNodeId
|
||||
|
||||
## PubSub topics:
|
||||
- constructor(serialPort)
|
||||
- send(meshPacket) - throws errors if we have errors talking to the device
|
||||
- close() - shuts down the interface
|
||||
- init() - starts the enumeration process to download NodeDB etc... - we will not publish to topics until this enumeration completes
|
||||
- radioConfig
|
||||
- nodeDB
|
||||
- myNodeInfo
|
||||
- myNodeId
|
||||
|
||||
## PubSub topics
|
||||
|
||||
Use a pubsub model to communicate events [https://pypubsub.readthedocs.io/en/v4.0.3/ ]
|
||||
|
||||
meshtastic.send(MeshPacket) - Not implemented, instead call send(packet) on MeshInterface
|
||||
meshtastic.connection.established - published once we've successfully connected to the radio and downloaded the node DB
|
||||
meshtastic.connection.lost - published once we've lost our link to the radio
|
||||
meshtastic.receive.position(MeshPacket)
|
||||
meshtastic.receive.user(MeshPacket)
|
||||
meshtastic.receive.data(MeshPacket)
|
||||
meshtastic.debugMessage(string)
|
||||
- meshtastic.send(MeshPacket) - Not implemented, instead call send(packet) on MeshInterface
|
||||
- meshtastic.connection.established - published once we've successfully connected to the radio and downloaded the node DB
|
||||
- meshtastic.connection.lost - published once we've lost our link to the radio
|
||||
- meshtastic.receive.position(MeshPacket)
|
||||
- meshtastic.receive.user(MeshPacket)
|
||||
- meshtastic.receive.data(MeshPacket)
|
||||
- meshtastic.debugMessage(string)
|
||||
|
||||
## Wire encoding
|
||||
|
||||
When sending protobuf packets over serial or TCP each packet is preceeded by uint32_t sent in network byte order (big endian).
|
||||
The upper 16 bits must be 0x4403. The lower 16 bits are packet length (this encoding gives room to eventually allow quite large packets).
|
||||
When sending protobuf packets over serial or TCP each packet is preceded by uint32_t sent in network byte order (big endian).
|
||||
The upper 16 bits must be 0x4403. The lower 16 bits are packet length (this encoding gives room to eventually allow quite large packets).
|
||||
|
||||
Implementations validate length against the maximum possible size of a BLE packet (our lowest common denominator) of 512 bytes. If the
|
||||
Implementations validate length against the maximum possible size of a BLE packet (our lowest common denominator) of 512 bytes. If the
|
||||
length provided is larger than that we assume the packet is corrupted and begin again looking for 0x4403 framing.
|
||||
|
||||
The packets flowing towards the device are ToRadio protobufs, the packets flowing from the device are FromRadio protobufs.
|
||||
The 0x4403 marker can be used as framing to (eventually) resync if packets are corrupted over the wire.
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user