Skip to content

Commit da7fa31

Browse files
committed
tweak documentation formatting
1 parent 12fd29b commit da7fa31

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

meshtastic/__init__.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,44 @@
22
# A library for the Meshtastic Client API
33
44
Primary interfaces: SerialInterface, TCPInterface, BLEInterface
5+
56
Install with pip: "[pip3 install meshtastic](https://pypi.org/project/meshtastic/)"
7+
68
Source code on [github](https://github.com/meshtastic/python)
79
810
notable properties of interface classes:
911
10-
- nodes - The database of received nodes. Includes always up-to-date location and username information for each
12+
- `nodes` - The database of received nodes. Includes always up-to-date location and username information for each
1113
node in the mesh. This is a read-only datastructure.
12-
- nodesByNum - like "nodes" but keyed by nodeNum instead of nodeId
13-
- myInfo & metadata - Contain read-only information about the local radio device (software version, hardware version, etc)
14-
- localNode - Pointer to a node object for the local node
14+
- `nodesByNum` - like "nodes" but keyed by nodeNum instead of nodeId. As such, includes "unknown" nodes which haven't seen a User packet yet
15+
- `myInfo` & `metadata` - Contain read-only information about the local radio device (software version, hardware version, etc)
16+
- `localNode` - Pointer to a node object for the local node
1517
1618
notable properties of nodes:
17-
- localConfig - Current radio settings, can be written to the radio with the `writeConfig` method.
18-
- moduleConfig - Current module settings, can be written to the radio with the `writeConfig` method.
19-
- channels - The node's channels, keyed by index.
19+
20+
- `localConfig` - Current radio settings, can be written to the radio with the `writeConfig` method.
21+
- `moduleConfig` - Current module settings, can be written to the radio with the `writeConfig` method.
22+
- `channels` - The node's channels, keyed by index.
2023
2124
# Published PubSub topics
2225
2326
We use a [publish-subscribe](https://pypubsub.readthedocs.io/en/v4.0.3/) model to communicate asynchronous events. Available
2427
topics:
2528
26-
- meshtastic.connection.established - published once we've successfully connected to the radio and downloaded the node DB
27-
- meshtastic.connection.lost - published once we've lost our link to the radio
28-
- meshtastic.receive.text(packet) - delivers a received packet as a dictionary, if you only care about a particular
29+
- `meshtastic.connection.established` - published once we've successfully connected to the radio and downloaded the node DB
30+
- `meshtastic.connection.lost` - published once we've lost our link to the radio
31+
- `meshtastic.receive.text(packet)` - delivers a received packet as a dictionary, if you only care about a particular
2932
type of packet, you should subscribe to the full topic name. If you want to see all packets, simply subscribe to "meshtastic.receive".
30-
- meshtastic.receive.position(packet)
31-
- meshtastic.receive.user(packet)
32-
- meshtastic.receive.data.portnum(packet) (where portnum is an integer or well known PortNum enum)
33-
- meshtastic.node.updated(node = NodeInfo) - published when a node in the DB changes (appears, location changed, username changed, etc...)
34-
- meshtastic.log.line(line) - a raw unparsed log line from the radio
35-
36-
We receive position, user, or data packets from the mesh. You probably only care about meshtastic.receive.data. The first argument for
37-
that publish will be the packet. Text or binary data packets (from sendData or sendText) will both arrive this way. If you print packet
38-
you'll see the fields in the dictionary. decoded.data.payload will contain the raw bytes that were sent. If the packet was sent with
39-
sendText, decoded.data.text will **also** be populated with the decoded string. For ASCII these two strings will be the same, but for
33+
- `meshtastic.receive.position(packet)`
34+
- `meshtastic.receive.user(packet)`
35+
- `meshtastic.receive.data.portnum(packet)` (where portnum is an integer or well known PortNum enum)
36+
- `meshtastic.node.updated(node = NodeInfo)` - published when a node in the DB changes (appears, location changed, username changed, etc...)
37+
- `meshtastic.log.line(line)` - a raw unparsed log line from the radio
38+
39+
We receive position, user, or data packets from the mesh. You probably only care about `meshtastic.receive.data`. The first argument for
40+
that publish will be the packet. Text or binary data packets (from `sendData` or `sendText`) will both arrive this way. If you print packet
41+
you'll see the fields in the dictionary. `decoded.data.payload` will contain the raw bytes that were sent. If the packet was sent with
42+
`sendText`, `decoded.data.text` will **also** be populated with the decoded string. For ASCII these two strings will be the same, but for
4043
unicode scripts they can be different.
4144
4245
# Example Usage

0 commit comments

Comments
 (0)