Updated docs for mt py

This commit is contained in:
Jm Casler
2021-12-06 17:48:18 -08:00
parent 163021de2a
commit 6896e70c31
12 changed files with 454 additions and 327 deletions

View File

@@ -39,9 +39,9 @@ from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from . import channel_pb2 as channel__pb2
from . import mesh_pb2 as mesh__pb2
from . import radioconfig_pb2 as radioconfig__pb2
from . import channel_pb2 as channel__pb2
DESCRIPTOR = _descriptor.FileDescriptor(
@@ -49,9 +49,9 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package='',
syntax='proto3',
serialized_options=b'\n\023com.geeksville.meshB\013AdminProtosH\003Z!github.com/meshtastic/gomeshproto',
serialized_pb=b'\n\x0b\x61\x64min.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\x1a\rchannel.proto\"\xfb\x02\n\x0c\x41\x64minMessage\x12!\n\tset_radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1a\n\tset_owner\x18\x02 \x01(\x0b\x32\x05.UserH\x00\x12\x1f\n\x0bset_channel\x18\x03 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_radio_request\x18\x04 \x01(\x08H\x00\x12*\n\x12get_radio_response\x18\x05 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1d\n\x13get_channel_request\x18\x06 \x01(\rH\x00\x12(\n\x14get_channel_response\x18\x07 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1d\n\x13\x63onfirm_set_channel\x18 \x01(\x08H\x00\x12\x1b\n\x11\x63onfirm_set_radio\x18! \x01(\x08H\x00\x12\x18\n\x0e\x65xit_simulator\x18\" \x01(\x08H\x00\x12\x18\n\x0ereboot_seconds\x18# \x01(\x05H\x00\x42\t\n\x07variantBG\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
serialized_pb=b'\n\x0b\x61\x64min.proto\x1a\rchannel.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\"\xfb\x02\n\x0c\x41\x64minMessage\x12!\n\tset_radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1a\n\tset_owner\x18\x02 \x01(\x0b\x32\x05.UserH\x00\x12\x1f\n\x0bset_channel\x18\x03 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1b\n\x11get_radio_request\x18\x04 \x01(\x08H\x00\x12*\n\x12get_radio_response\x18\x05 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1d\n\x13get_channel_request\x18\x06 \x01(\rH\x00\x12(\n\x14get_channel_response\x18\x07 \x01(\x0b\x32\x08.ChannelH\x00\x12\x1d\n\x13\x63onfirm_set_channel\x18 \x01(\x08H\x00\x12\x1b\n\x11\x63onfirm_set_radio\x18! \x01(\x08H\x00\x12\x18\n\x0e\x65xit_simulator\x18\" \x01(\x08H\x00\x12\x18\n\x0ereboot_seconds\x18# \x01(\x05H\x00\x42\t\n\x07variantBG\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
,
dependencies=[mesh__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,channel__pb2.DESCRIPTOR,])
dependencies=[channel__pb2.DESCRIPTOR,mesh__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,])

View File

@@ -46,7 +46,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package='',
syntax='proto3',
serialized_options=b'\n\023com.geeksville.meshB\rChannelProtosH\003Z!github.com/meshtastic/gomeshproto',
serialized_pb=b'\n\rchannel.proto\"\xe6\x02\n\x0f\x43hannelSettings\x12\x10\n\x08tx_power\x18\x01 \x01(\x05\x12\x32\n\x0cmodem_config\x18\x03 \x01(\x0e\x32\x1c.ChannelSettings.ModemConfig\x12\x11\n\tbandwidth\x18\x06 \x01(\r\x12\x15\n\rspread_factor\x18\x07 \x01(\r\x12\x13\n\x0b\x63oding_rate\x18\x08 \x01(\r\x12\x13\n\x0b\x63hannel_num\x18\t \x01(\r\x12\x0b\n\x03psk\x18\x04 \x01(\x0c\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\n\n\x02id\x18\n \x01(\x07\x12\x16\n\x0euplink_enabled\x18\x10 \x01(\x08\x12\x18\n\x10\x64ownlink_enabled\x18\x11 \x01(\x08\"`\n\x0bModemConfig\x12\x12\n\x0e\x42w125Cr45Sf128\x10\x00\x12\x12\n\x0e\x42w500Cr45Sf128\x10\x01\x12\x14\n\x10\x42w31_25Cr48Sf512\x10\x02\x12\x13\n\x0f\x42w125Cr48Sf4096\x10\x03\"\x8b\x01\n\x07\x43hannel\x12\r\n\x05index\x18\x01 \x01(\x05\x12\"\n\x08settings\x18\x02 \x01(\x0b\x32\x10.ChannelSettings\x12\x1b\n\x04role\x18\x03 \x01(\x0e\x32\r.Channel.Role\"0\n\x04Role\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02\x42I\n\x13\x63om.geeksville.meshB\rChannelProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
serialized_pb=b'\n\rchannel.proto\"\x91\x03\n\x0f\x43hannelSettings\x12\x10\n\x08tx_power\x18\x01 \x01(\x05\x12\x32\n\x0cmodem_config\x18\x03 \x01(\x0e\x32\x1c.ChannelSettings.ModemConfig\x12\x11\n\tbandwidth\x18\x06 \x01(\r\x12\x15\n\rspread_factor\x18\x07 \x01(\r\x12\x13\n\x0b\x63oding_rate\x18\x08 \x01(\r\x12\x13\n\x0b\x63hannel_num\x18\t \x01(\r\x12\x0b\n\x03psk\x18\x04 \x01(\x0c\x12\x0c\n\x04name\x18\x05 \x01(\t\x12\n\n\x02id\x18\n \x01(\x07\x12\x16\n\x0euplink_enabled\x18\x10 \x01(\x08\x12\x18\n\x10\x64ownlink_enabled\x18\x11 \x01(\x08\"\x8a\x01\n\x0bModemConfig\x12\x12\n\x0e\x42w125Cr45Sf128\x10\x00\x12\x12\n\x0e\x42w500Cr45Sf128\x10\x01\x12\x14\n\x10\x42w31_25Cr48Sf512\x10\x02\x12\x13\n\x0f\x42w125Cr48Sf4096\x10\x03\x12\x13\n\x0f\x42w250Cr46Sf2048\x10\x04\x12\x13\n\x0f\x42w250Cr47Sf1024\x10\x05\"\x8b\x01\n\x07\x43hannel\x12\r\n\x05index\x18\x01 \x01(\x05\x12\"\n\x08settings\x18\x02 \x01(\x0b\x32\x10.ChannelSettings\x12\x1b\n\x04role\x18\x03 \x01(\x0e\x32\r.Channel.Role\"0\n\x04Role\x12\x0c\n\x08\x44ISABLED\x10\x00\x12\x0b\n\x07PRIMARY\x10\x01\x12\r\n\tSECONDARY\x10\x02\x42I\n\x13\x63om.geeksville.meshB\rChannelProtosH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3'
)
@@ -73,11 +73,19 @@ _CHANNELSETTINGS_MODEMCONFIG = _descriptor.EnumDescriptor(
name='Bw125Cr48Sf4096', index=3, number=3,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='Bw250Cr46Sf2048', index=4, number=4,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='Bw250Cr47Sf1024', index=5, number=5,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=280,
serialized_end=376,
serialized_start=281,
serialized_end=419,
)
_sym_db.RegisterEnumDescriptor(_CHANNELSETTINGS_MODEMCONFIG)
@@ -102,8 +110,8 @@ _CHANNEL_ROLE = _descriptor.EnumDescriptor(
],
containing_type=None,
serialized_options=None,
serialized_start=470,
serialized_end=518,
serialized_start=513,
serialized_end=561,
)
_sym_db.RegisterEnumDescriptor(_CHANNEL_ROLE)
@@ -206,7 +214,7 @@ _CHANNELSETTINGS = _descriptor.Descriptor(
oneofs=[
],
serialized_start=18,
serialized_end=376,
serialized_end=419,
)
@@ -251,8 +259,8 @@ _CHANNEL = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=379,
serialized_end=518,
serialized_start=422,
serialized_end=561,
)
_CHANNELSETTINGS.fields_by_name['modem_config'].enum_type = _CHANNELSETTINGS_MODEMCONFIG
@@ -915,6 +923,14 @@ shown below.</p></div>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.channel_pb2.ChannelSettings.Bw250Cr46Sf2048"><code class="name">var <span class="ident">Bw250Cr46Sf2048</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.channel_pb2.ChannelSettings.Bw250Cr47Sf1024"><code class="name">var <span class="ident">Bw250Cr47Sf1024</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.channel_pb2.ChannelSettings.Bw31_25Cr48Sf512"><code class="name">var <span class="ident">Bw31_25Cr48Sf512</span></code></dt>
<dd>
<div class="desc"></div>
@@ -1667,6 +1683,8 @@ and propagates this to our listener iff this was a state change.</p></div>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.BANDWIDTH_FIELD_NUMBER" href="#meshtastic.channel_pb2.ChannelSettings.BANDWIDTH_FIELD_NUMBER">BANDWIDTH_FIELD_NUMBER</a></code></li>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.Bw125Cr45Sf128" href="#meshtastic.channel_pb2.ChannelSettings.Bw125Cr45Sf128">Bw125Cr45Sf128</a></code></li>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.Bw125Cr48Sf4096" href="#meshtastic.channel_pb2.ChannelSettings.Bw125Cr48Sf4096">Bw125Cr48Sf4096</a></code></li>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.Bw250Cr46Sf2048" href="#meshtastic.channel_pb2.ChannelSettings.Bw250Cr46Sf2048">Bw250Cr46Sf2048</a></code></li>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.Bw250Cr47Sf1024" href="#meshtastic.channel_pb2.ChannelSettings.Bw250Cr47Sf1024">Bw250Cr47Sf1024</a></code></li>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.Bw31_25Cr48Sf512" href="#meshtastic.channel_pb2.ChannelSettings.Bw31_25Cr48Sf512">Bw31_25Cr48Sf512</a></code></li>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.Bw500Cr45Sf128" href="#meshtastic.channel_pb2.ChannelSettings.Bw500Cr45Sf128">Bw500Cr45Sf128</a></code></li>
<li><code><a title="meshtastic.channel_pb2.ChannelSettings.ByteSize" href="#meshtastic.channel_pb2.ChannelSettings.ByteSize">ByteSize</a></code></li>

View File

@@ -39,8 +39,8 @@ from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from . import mesh_pb2 as mesh__pb2
from . import channel_pb2 as channel__pb2
from . import mesh_pb2 as mesh__pb2
from . import radioconfig_pb2 as radioconfig__pb2
@@ -49,9 +49,9 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package=&#39;&#39;,
syntax=&#39;proto3&#39;,
serialized_options=b&#39;\n\023com.geeksville.meshB\nDeviceOnlyH\003Z!github.com/meshtastic/gomeshproto&#39;,
serialized_pb=b&#39;\n\x10\x64\x65viceonly.proto\x1a\nmesh.proto\x1a\rchannel.proto\x1a\x11radioconfig.proto\&#34;\x80\x01\n\x11LegacyRadioConfig\x12\x39\n\x0bpreferences\x18\x01 \x01(\x0b\x32$.LegacyRadioConfig.LegacyPreferences\x1a\x30\n\x11LegacyPreferences\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\&#34;\x8f\x02\n\x0b\x44\x65viceState\x12\&#39;\n\x0blegacyRadio\x18\x01 \x01(\x0b\x32\x12.LegacyRadioConfig\x12\x1c\n\x07my_node\x18\x02 \x01(\x0b\x32\x0b.MyNodeInfo\x12\x14\n\x05owner\x18\x03 \x01(\x0b\x32\x05.User\x12\x1a\n\x07node_db\x18\x04 \x03(\x0b\x32\t.NodeInfo\x12\&#34;\n\rreceive_queue\x18\x05 \x03(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07version\x18\x08 \x01(\r\x12$\n\x0frx_text_message\x18\x07 \x01(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07no_save\x18\t \x01(\x08\x12\x15\n\rdid_gps_reset\x18\x0b \x01(\x08J\x04\x08\x0c\x10\r\&#34;)\n\x0b\x43hannelFile\x12\x1a\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x08.ChannelBF\n\x13\x63om.geeksville.meshB\nDeviceOnlyH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3&#39;
serialized_pb=b&#39;\n\x10\x64\x65viceonly.proto\x1a\rchannel.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\&#34;\x80\x01\n\x11LegacyRadioConfig\x12\x39\n\x0bpreferences\x18\x01 \x01(\x0b\x32$.LegacyRadioConfig.LegacyPreferences\x1a\x30\n\x11LegacyPreferences\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\&#34;\x8f\x02\n\x0b\x44\x65viceState\x12\&#39;\n\x0blegacyRadio\x18\x01 \x01(\x0b\x32\x12.LegacyRadioConfig\x12\x1c\n\x07my_node\x18\x02 \x01(\x0b\x32\x0b.MyNodeInfo\x12\x14\n\x05owner\x18\x03 \x01(\x0b\x32\x05.User\x12\x1a\n\x07node_db\x18\x04 \x03(\x0b\x32\t.NodeInfo\x12\&#34;\n\rreceive_queue\x18\x05 \x03(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07version\x18\x08 \x01(\r\x12$\n\x0frx_text_message\x18\x07 \x01(\x0b\x32\x0b.MeshPacket\x12\x0f\n\x07no_save\x18\t \x01(\x08\x12\x15\n\rdid_gps_reset\x18\x0b \x01(\x08J\x04\x08\x0c\x10\r\&#34;)\n\x0b\x43hannelFile\x12\x1a\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x08.ChannelBF\n\x13\x63om.geeksville.meshB\nDeviceOnlyH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3&#39;
,
dependencies=[mesh__pb2.DESCRIPTOR,channel__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,])
dependencies=[channel__pb2.DESCRIPTOR,mesh__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,])

View File

@@ -115,10 +115,10 @@ type of packet, you should subscribe to the full topic name. If you want to see
- meshtastic.receive.data.portnum(packet) (where portnum is an integer or well known PortNum enum)
- meshtastic.node.updated(node = NodeInfo) - published when a node in the DB changes (appears, location changed, username changed, etc...)
We receive position, user, or data packets from the mesh. You probably only care about meshtastic.receive.data. The first argument for
that publish will be the packet. Text or binary data packets (from sendData or sendText) will both arrive this way. If you print packet
you&#39;ll see the fields in the dictionary. decoded.data.payload will contain the raw bytes that were sent. If the packet was sent with
sendText, decoded.data.text will **also** be populated with the decoded string. For ASCII these two strings will be the same, but for
We receive position, user, or data packets from the mesh. You probably only care about meshtastic.receive.data. The first argument for
that publish will be the packet. Text or binary data packets (from sendData or sendText) will both arrive this way. If you print packet
you&#39;ll see the fields in the dictionary. decoded.data.payload will contain the raw bytes that were sent. If the packet was sent with
sendText, decoded.data.text will **also** be populated with the decoded string. For ASCII these two strings will be the same, but for
unicode scripts they can be different.
# Example Usage
@@ -142,30 +142,30 @@ interface = meshtastic.SerialInterface()
&#34;&#34;&#34;
import pygatt
import google.protobuf.json_format
import serial
import threading
import base64
import logging
import sys
import os
import platform
import random
import socket
import sys
import stat
import threading
import traceback
import time
import base64
import platform
import socket
from datetime import datetime
from typing import *
import serial
import timeago
import os
import stat
from . import mesh_pb2, portnums_pb2, apponly_pb2, admin_pb2, environmental_measurement_pb2, remote_hardware_pb2, channel_pb2, radioconfig_pb2, util
from .util import fixme, catchAndIgnore, stripnl, DeferredExecution, Timeout
from .node import Node
import google.protobuf.json_format
import pygatt
from pubsub import pub
from dotmap import DotMap
from datetime import datetime
from tabulate import tabulate
from typing import *
from google.protobuf.json_format import MessageToJson
from .util import fixme, catchAndIgnore, stripnl, DeferredExecution, Timeout
from .node import Node
from . import mesh_pb2, portnums_pb2, apponly_pb2, admin_pb2, environmental_measurement_pb2, remote_hardware_pb2, channel_pb2, radioconfig_pb2, util
START1 = 0x94
START2 = 0xc3
@@ -359,7 +359,7 @@ class MeshInterface:
wantResponse=wantResponse,
hopLimit=hopLimit,
onResponse=onResponse,
channelIndex=channelIndex);
channelIndex=channelIndex)
def sendData(self, data, destinationId=BROADCAST_ADDR,
portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False,
@@ -375,7 +375,8 @@ class MeshInterface:
portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list
wantAck -- True if you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)
wantResponse -- True if you want the service on the other side to send an application layer response
onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives (or the transaction is NAKed due to non receipt)
onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives
(or the transaction is NAKed due to non receipt)
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
&#34;&#34;&#34;
@@ -413,13 +414,13 @@ class MeshInterface:
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
&#34;&#34;&#34;
p = mesh_pb2.Position()
if(latitude != 0.0):
if latitude != 0.0:
p.latitude_i = int(latitude / 1e-7)
if(longitude != 0.0):
if longitude != 0.0:
p.longitude_i = int(longitude / 1e-7)
if(altitude != 0):
if altitude != 0:
p.altitude = int(altitude)
if timeSec == 0:
@@ -440,7 +441,7 @@ class MeshInterface:
&#34;&#34;&#34;Send a MeshPacket to the specified node (or if unspecified, broadcast).
You probably don&#39;t want this - use sendData instead.
Returns the sent packet. The id field will be populated in this packet and
Returns the sent packet. The id field will be populated in this packet and
can be used to track future message acks/naks.
&#34;&#34;&#34;
@@ -489,23 +490,27 @@ class MeshInterface:
raise Exception(&#34;Timed out waiting for interface config&#34;)
def getMyNodeInfo(self):
&#34;&#34;&#34;Get info about my node.&#34;&#34;&#34;
if self.myInfo is None:
return None
return self.nodesByNum.get(self.myInfo.my_node_num)
def getMyUser(self):
&#34;&#34;&#34;Get user&#34;&#34;&#34;
nodeInfo = self.getMyNodeInfo()
if nodeInfo is not None:
return nodeInfo.get(&#39;user&#39;)
return None
def getLongName(self):
&#34;&#34;&#34;Get long name&#34;&#34;&#34;
user = self.getMyUser()
if user is not None:
return user.get(&#39;longName&#39;, None)
return None
def getShortName(self):
&#34;&#34;&#34;Get short name&#34;&#34;&#34;
user = self.getMyUser()
if user is not None:
return user.get(&#39;shortName&#39;, None)
@@ -839,7 +844,7 @@ class StreamInterface(MeshInterface):
&#34;&#34;&#34;Interface class for meshtastic devices over a stream link (serial, TCP, etc)&#34;&#34;&#34;
def __init__(self, debugOut=None, noProto=False, connectNow=True):
&#34;&#34;&#34;Constructor, opens a connection to self.stream
&#34;&#34;&#34;Constructor, opens a connection to self.stream
Keyword Arguments:
devPath {string} -- A filepath to a device, i.e. /dev/ttyUSB0 (default: {None})
@@ -1019,7 +1024,7 @@ class SerialInterface(StreamInterface):
# rts=False Needed to prevent TBEAMs resetting on OSX, because rts is connected to reset
self.stream.port = devPath
# HACK: If the platform driving the serial port is unable to leave the RTS pin in high-impedance
# mode, set RTS to false so that the device platform won&#39;t be reset spuriously.
# Linux does this properly, so don&#39;t apply this hack on Linux (because it makes the reset button not work).
@@ -1029,30 +1034,30 @@ class SerialInterface(StreamInterface):
StreamInterface.__init__(
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow)
&#34;&#34;&#34;true if platform driving the serial port is Windows Subsystem for Linux 1.&#34;&#34;&#34;
def _isWsl1(self):
# WSL1 identifies itself as Linux, but has a special char device at /dev/lxss for use with session control,
# e.g. /init. We should treat WSL1 as Windows for the RTS-driving hack because the underlying platfrom
# WSL1 identifies itself as Linux, but has a special char device at /dev/lxss for use with session control,
# e.g. /init. We should treat WSL1 as Windows for the RTS-driving hack because the underlying platfrom
# serial driver for the CP21xx still exhibits the buggy behavior.
# WSL2 is not covered here, as it does not (as of 2021-May-25) support the appropriate functionality to
# WSL2 is not covered here, as it does not (as of 2021-May-25) support the appropriate functionality to
# share or pass-through serial ports.
try:
# Claims to be Linux, but has /dev/lxss; must be WSL 1
return platform.system() == &#39;Linux&#39; and stat.S_ISCHR(os.stat(&#39;/dev/lxss&#39;).st_mode);
return platform.system() == &#39;Linux&#39; and stat.S_ISCHR(os.stat(&#39;/dev/lxss&#39;).st_mode)
except:
# Couldn&#39;t stat /dev/lxss special device; not WSL1
return False;
return False
def _hostPlatformAlwaysDrivesUartRts(self):
# OS-X/Windows seems to have a bug in its CP21xx serial drivers. It ignores that we asked for no RTSCTS
# control and will always drive RTS either high or low (rather than letting the CP102 leave
# it as an open-collector floating pin).
# TODO: When WSL2 supports USB passthrough, this will get messier. If/when WSL2 gets virtual serial
# ports that &#34;share&#34; the Windows serial port (and thus the Windows drivers), this code will need to be
# TODO: When WSL2 supports USB passthrough, this will get messier. If/when WSL2 gets virtual serial
# ports that &#34;share&#34; the Windows serial port (and thus the Windows drivers), this code will need to be
# updated to reflect that as well -- or if T-Beams get made with an alternate USB to UART bridge that has
# a less buggy driver.
return platform.system() != &#39;Linux&#39; or self._isWsl1();
return platform.system() != &#39;Linux&#39; or self._isWsl1()
class TCPInterface(StreamInterface):
&#34;&#34;&#34;Interface class for meshtastic devices over a TCP link&#34;&#34;&#34;
@@ -1217,15 +1222,15 @@ protocols = {
</dd>
<dt><code class="name"><a title="meshtastic.test" href="test.html">meshtastic.test</a></code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Testing</p></div>
</dd>
<dt><code class="name"><a title="meshtastic.tunnel" href="tunnel.html">meshtastic.tunnel</a></code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Code for IP tunnel over a mesh …</p></div>
</dd>
<dt><code class="name"><a title="meshtastic.util" href="util.html">meshtastic.util</a></code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Utility functions.</p></div>
</dd>
</dl>
</section>
@@ -1312,7 +1317,11 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
<li><code><b><a title="meshtastic.MeshInterface" href="#meshtastic.MeshInterface">MeshInterface</a></b></code>:
<ul class="hlist">
<li><code><a title="meshtastic.MeshInterface.close" href="#meshtastic.MeshInterface.close">close</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getLongName" href="#meshtastic.MeshInterface.getLongName">getLongName</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getMyNodeInfo" href="#meshtastic.MeshInterface.getMyNodeInfo">getMyNodeInfo</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getMyUser" href="#meshtastic.MeshInterface.getMyUser">getMyUser</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getNode" href="#meshtastic.MeshInterface.getNode">getNode</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getShortName" href="#meshtastic.MeshInterface.getShortName">getShortName</a></code></li>
<li><code><a title="meshtastic.MeshInterface.sendData" href="#meshtastic.MeshInterface.sendData">sendData</a></code></li>
<li><code><a title="meshtastic.MeshInterface.sendPosition" href="#meshtastic.MeshInterface.sendPosition">sendPosition</a></code></li>
<li><code><a title="meshtastic.MeshInterface.sendText" href="#meshtastic.MeshInterface.sendText">sendText</a></code></li>
@@ -1530,7 +1539,7 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
wantResponse=wantResponse,
hopLimit=hopLimit,
onResponse=onResponse,
channelIndex=channelIndex);
channelIndex=channelIndex)
def sendData(self, data, destinationId=BROADCAST_ADDR,
portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False,
@@ -1546,7 +1555,8 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list
wantAck -- True if you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)
wantResponse -- True if you want the service on the other side to send an application layer response
onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives (or the transaction is NAKed due to non receipt)
onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives
(or the transaction is NAKed due to non receipt)
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
&#34;&#34;&#34;
@@ -1584,13 +1594,13 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
&#34;&#34;&#34;
p = mesh_pb2.Position()
if(latitude != 0.0):
if latitude != 0.0:
p.latitude_i = int(latitude / 1e-7)
if(longitude != 0.0):
if longitude != 0.0:
p.longitude_i = int(longitude / 1e-7)
if(altitude != 0):
if altitude != 0:
p.altitude = int(altitude)
if timeSec == 0:
@@ -1611,7 +1621,7 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
&#34;&#34;&#34;Send a MeshPacket to the specified node (or if unspecified, broadcast).
You probably don&#39;t want this - use sendData instead.
Returns the sent packet. The id field will be populated in this packet and
Returns the sent packet. The id field will be populated in this packet and
can be used to track future message acks/naks.
&#34;&#34;&#34;
@@ -1660,23 +1670,27 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
raise Exception(&#34;Timed out waiting for interface config&#34;)
def getMyNodeInfo(self):
&#34;&#34;&#34;Get info about my node.&#34;&#34;&#34;
if self.myInfo is None:
return None
return self.nodesByNum.get(self.myInfo.my_node_num)
def getMyUser(self):
&#34;&#34;&#34;Get user&#34;&#34;&#34;
nodeInfo = self.getMyNodeInfo()
if nodeInfo is not None:
return nodeInfo.get(&#39;user&#39;)
return None
def getLongName(self):
&#34;&#34;&#34;Get long name&#34;&#34;&#34;
user = self.getMyUser()
if user is not None:
return user.get(&#39;longName&#39;, None)
return None
def getShortName(self):
&#34;&#34;&#34;Get short name&#34;&#34;&#34;
user = self.getMyUser()
if user is not None:
return user.get(&#39;shortName&#39;, None)
@@ -1988,12 +2002,13 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
<span>def <span class="ident">getLongName</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Get long name</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getLongName(self):
&#34;&#34;&#34;Get long name&#34;&#34;&#34;
user = self.getMyUser()
if user is not None:
return user.get(&#39;longName&#39;, None)
@@ -2004,12 +2019,13 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
<span>def <span class="ident">getMyNodeInfo</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Get info about my node.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getMyNodeInfo(self):
&#34;&#34;&#34;Get info about my node.&#34;&#34;&#34;
if self.myInfo is None:
return None
return self.nodesByNum.get(self.myInfo.my_node_num)</code></pre>
@@ -2019,12 +2035,13 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
<span>def <span class="ident">getMyUser</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Get user</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getMyUser(self):
&#34;&#34;&#34;Get user&#34;&#34;&#34;
nodeInfo = self.getMyNodeInfo()
if nodeInfo is not None:
return nodeInfo.get(&#39;user&#39;)
@@ -2056,12 +2073,13 @@ noProto &ndash; If True, don't try to run our protocol on the link - just be a d
<span>def <span class="ident">getShortName</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Get short name</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getShortName(self):
&#34;&#34;&#34;Get short name&#34;&#34;&#34;
user = self.getMyUser()
if user is not None:
return user.get(&#39;shortName&#39;, None)
@@ -2079,7 +2097,8 @@ destinationId {nodeId or nodeNum} &ndash; where to send this message (default: {
portNum &ndash; the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list
wantAck &ndash; True if you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)
wantResponse &ndash; True if you want the service on the other side to send an application layer response
onResponse &ndash; A closure of the form funct(packet), that will be called when a response packet arrives (or the transaction is NAKed due to non receipt)</p>
onResponse &ndash; A closure of the form funct(packet), that will be called when a response packet arrives
(or the transaction is NAKed due to non receipt)</p>
<p>Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.</p></div>
<details class="source">
<summary>
@@ -2099,7 +2118,8 @@ onResponse &ndash; A closure of the form funct(packet), that will be called when
portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list
wantAck -- True if you want the message sent in a reliable manner (with retries and ack/nak provided for delivery)
wantResponse -- True if you want the service on the other side to send an application layer response
onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives (or the transaction is NAKed due to non receipt)
onResponse -- A closure of the form funct(packet), that will be called when a response packet arrives
(or the transaction is NAKed due to non receipt)
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
&#34;&#34;&#34;
@@ -2151,13 +2171,13 @@ the local position.</p>
Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
&#34;&#34;&#34;
p = mesh_pb2.Position()
if(latitude != 0.0):
if latitude != 0.0:
p.latitude_i = int(latitude / 1e-7)
if(longitude != 0.0):
if longitude != 0.0:
p.longitude_i = int(longitude / 1e-7)
if(altitude != 0):
if altitude != 0:
p.altitude = int(altitude)
if timeSec == 0:
@@ -2213,7 +2233,7 @@ wantResponse &ndash; True if you want the service on the other side to send an a
wantResponse=wantResponse,
hopLimit=hopLimit,
onResponse=onResponse,
channelIndex=channelIndex);</code></pre>
channelIndex=channelIndex)</code></pre>
</details>
</dd>
<dt id="meshtastic.MeshInterface.showInfo"><code class="name flex">
@@ -2394,7 +2414,7 @@ debugOut {stream} &ndash; If a stream is provided, any debug serial output from
# rts=False Needed to prevent TBEAMs resetting on OSX, because rts is connected to reset
self.stream.port = devPath
# HACK: If the platform driving the serial port is unable to leave the RTS pin in high-impedance
# mode, set RTS to false so that the device platform won&#39;t be reset spuriously.
# Linux does this properly, so don&#39;t apply this hack on Linux (because it makes the reset button not work).
@@ -2404,30 +2424,30 @@ debugOut {stream} &ndash; If a stream is provided, any debug serial output from
StreamInterface.__init__(
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow)
&#34;&#34;&#34;true if platform driving the serial port is Windows Subsystem for Linux 1.&#34;&#34;&#34;
def _isWsl1(self):
# WSL1 identifies itself as Linux, but has a special char device at /dev/lxss for use with session control,
# e.g. /init. We should treat WSL1 as Windows for the RTS-driving hack because the underlying platfrom
# WSL1 identifies itself as Linux, but has a special char device at /dev/lxss for use with session control,
# e.g. /init. We should treat WSL1 as Windows for the RTS-driving hack because the underlying platfrom
# serial driver for the CP21xx still exhibits the buggy behavior.
# WSL2 is not covered here, as it does not (as of 2021-May-25) support the appropriate functionality to
# WSL2 is not covered here, as it does not (as of 2021-May-25) support the appropriate functionality to
# share or pass-through serial ports.
try:
# Claims to be Linux, but has /dev/lxss; must be WSL 1
return platform.system() == &#39;Linux&#39; and stat.S_ISCHR(os.stat(&#39;/dev/lxss&#39;).st_mode);
return platform.system() == &#39;Linux&#39; and stat.S_ISCHR(os.stat(&#39;/dev/lxss&#39;).st_mode)
except:
# Couldn&#39;t stat /dev/lxss special device; not WSL1
return False;
return False
def _hostPlatformAlwaysDrivesUartRts(self):
# OS-X/Windows seems to have a bug in its CP21xx serial drivers. It ignores that we asked for no RTSCTS
# control and will always drive RTS either high or low (rather than letting the CP102 leave
# it as an open-collector floating pin).
# TODO: When WSL2 supports USB passthrough, this will get messier. If/when WSL2 gets virtual serial
# ports that &#34;share&#34; the Windows serial port (and thus the Windows drivers), this code will need to be
# TODO: When WSL2 supports USB passthrough, this will get messier. If/when WSL2 gets virtual serial
# ports that &#34;share&#34; the Windows serial port (and thus the Windows drivers), this code will need to be
# updated to reflect that as well -- or if T-Beams get made with an alternate USB to UART bridge that has
# a less buggy driver.
return platform.system() != &#39;Linux&#39; or self._isWsl1();</code></pre>
return platform.system() != &#39;Linux&#39; or self._isWsl1()</code></pre>
</details>
<h3>Ancestors</h3>
<ul class="hlist">
@@ -2440,7 +2460,11 @@ debugOut {stream} &ndash; If a stream is provided, any debug serial output from
<ul class="hlist">
<li><code><a title="meshtastic.StreamInterface.close" href="#meshtastic.StreamInterface.close">close</a></code></li>
<li><code><a title="meshtastic.StreamInterface.connect" href="#meshtastic.StreamInterface.connect">connect</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getLongName" href="#meshtastic.MeshInterface.getLongName">getLongName</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getMyNodeInfo" href="#meshtastic.MeshInterface.getMyNodeInfo">getMyNodeInfo</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getMyUser" href="#meshtastic.MeshInterface.getMyUser">getMyUser</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getNode" href="#meshtastic.MeshInterface.getNode">getNode</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getShortName" href="#meshtastic.MeshInterface.getShortName">getShortName</a></code></li>
<li><code><a title="meshtastic.StreamInterface.sendData" href="#meshtastic.MeshInterface.sendData">sendData</a></code></li>
<li><code><a title="meshtastic.StreamInterface.sendPosition" href="#meshtastic.MeshInterface.sendPosition">sendPosition</a></code></li>
<li><code><a title="meshtastic.StreamInterface.sendText" href="#meshtastic.MeshInterface.sendText">sendText</a></code></li>
@@ -2457,7 +2481,7 @@ debugOut {stream} &ndash; If a stream is provided, any debug serial output from
</code></dt>
<dd>
<div class="desc"><p>Interface class for meshtastic devices over a stream link (serial, TCP, etc)</p>
<p>Constructor, opens a connection to self.stream </p>
<p>Constructor, opens a connection to self.stream</p>
<p>Keyword Arguments:
devPath {string} &ndash; A filepath to a device, i.e. /dev/ttyUSB0 (default: {None})
debugOut {stream} &ndash; If a stream is provided, any debug serial output from the device will be emitted to that stream. (default: {None})</p>
@@ -2476,7 +2500,7 @@ debugOut {stream} &ndash; If a stream is provided, any debug serial output from
&#34;&#34;&#34;Interface class for meshtastic devices over a stream link (serial, TCP, etc)&#34;&#34;&#34;
def __init__(self, debugOut=None, noProto=False, connectNow=True):
&#34;&#34;&#34;Constructor, opens a connection to self.stream
&#34;&#34;&#34;Constructor, opens a connection to self.stream
Keyword Arguments:
devPath {string} -- A filepath to a device, i.e. /dev/ttyUSB0 (default: {None})
@@ -2692,7 +2716,11 @@ start the reading thread later.</p></div>
<ul class="hlist">
<li><code><b><a title="meshtastic.MeshInterface" href="#meshtastic.MeshInterface">MeshInterface</a></b></code>:
<ul class="hlist">
<li><code><a title="meshtastic.MeshInterface.getLongName" href="#meshtastic.MeshInterface.getLongName">getLongName</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getMyNodeInfo" href="#meshtastic.MeshInterface.getMyNodeInfo">getMyNodeInfo</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getMyUser" href="#meshtastic.MeshInterface.getMyUser">getMyUser</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getNode" href="#meshtastic.MeshInterface.getNode">getNode</a></code></li>
<li><code><a title="meshtastic.MeshInterface.getShortName" href="#meshtastic.MeshInterface.getShortName">getShortName</a></code></li>
<li><code><a title="meshtastic.MeshInterface.sendData" href="#meshtastic.MeshInterface.sendData">sendData</a></code></li>
<li><code><a title="meshtastic.MeshInterface.sendPosition" href="#meshtastic.MeshInterface.sendPosition">sendPosition</a></code></li>
<li><code><a title="meshtastic.MeshInterface.sendText" href="#meshtastic.MeshInterface.sendText">sendText</a></code></li>
@@ -2772,7 +2800,11 @@ hostname {string} &ndash; Hostname/IP address of the device to connect to</p></d
<ul class="hlist">
<li><code><a title="meshtastic.StreamInterface.close" href="#meshtastic.StreamInterface.close">close</a></code></li>
<li><code><a title="meshtastic.StreamInterface.connect" href="#meshtastic.StreamInterface.connect">connect</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getLongName" href="#meshtastic.MeshInterface.getLongName">getLongName</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getMyNodeInfo" href="#meshtastic.MeshInterface.getMyNodeInfo">getMyNodeInfo</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getMyUser" href="#meshtastic.MeshInterface.getMyUser">getMyUser</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getNode" href="#meshtastic.MeshInterface.getNode">getNode</a></code></li>
<li><code><a title="meshtastic.StreamInterface.getShortName" href="#meshtastic.MeshInterface.getShortName">getShortName</a></code></li>
<li><code><a title="meshtastic.StreamInterface.sendData" href="#meshtastic.MeshInterface.sendData">sendData</a></code></li>
<li><code><a title="meshtastic.StreamInterface.sendPosition" href="#meshtastic.MeshInterface.sendPosition">sendPosition</a></code></li>
<li><code><a title="meshtastic.StreamInterface.sendText" href="#meshtastic.MeshInterface.sendText">sendText</a></code></li>

View File

File diff suppressed because one or more lines are too long

View File

@@ -115,10 +115,10 @@ type of packet, you should subscribe to the full topic name. If you want to see
- meshtastic.receive.data.portnum(packet) (where portnum is an integer or well known PortNum enum)
- meshtastic.node.updated(node = NodeInfo) - published when a node in the DB changes (appears, location changed, username changed, etc...)
We receive position, user, or data packets from the mesh. You probably only care about meshtastic.receive.data. The first argument for
that publish will be the packet. Text or binary data packets (from sendData or sendText) will both arrive this way. If you print packet
you&#39;ll see the fields in the dictionary. decoded.data.payload will contain the raw bytes that were sent. If the packet was sent with
sendText, decoded.data.text will **also** be populated with the decoded string. For ASCII these two strings will be the same, but for
We receive position, user, or data packets from the mesh. You probably only care about meshtastic.receive.data. The first argument for
that publish will be the packet. Text or binary data packets (from sendData or sendText) will both arrive this way. If you print packet
you&#39;ll see the fields in the dictionary. decoded.data.payload will contain the raw bytes that were sent. If the packet was sent with
sendText, decoded.data.text will **also** be populated with the decoded string. For ASCII these two strings will be the same, but for
unicode scripts they can be different.
# Example Usage
@@ -142,24 +142,12 @@ interface = meshtastic.SerialInterface()
&#34;&#34;&#34;
import pygatt
import google.protobuf.json_format
import serial
import threading
import logging
import sys
import random
import traceback
import time
import base64
import platform
import socket
from . import mesh_pb2, portnums_pb2, apponly_pb2, admin_pb2, environmental_measurement_pb2, remote_hardware_pb2, channel_pb2, radioconfig_pb2, util
from .util import fixme, catchAndIgnore, stripnl, DeferredExecution, Timeout
from pubsub import pub
from dotmap import DotMap
from typing import *
from google.protobuf.json_format import MessageToJson
from . import portnums_pb2, apponly_pb2, admin_pb2, channel_pb2
from .util import stripnl, Timeout
@@ -229,7 +217,7 @@ class Node:
def writeConfig(self):
&#34;&#34;&#34;Write the current (edited) radioConfig to the device&#34;&#34;&#34;
if self.radioConfig == None:
if self.radioConfig is None:
raise Exception(&#34;No RadioConfig has been read&#34;)
p = admin_pb2.AdminMessage()
@@ -292,7 +280,7 @@ class Node:
else:
return 0
def setOwner(self, long_name, short_name=None, is_licensed=False):
def setOwner(self, long_name=None, short_name=None, is_licensed=False, team=None):
&#34;&#34;&#34;Set device owner name&#34;&#34;&#34;
nChars = 3
minChars = 2
@@ -320,6 +308,8 @@ class Node:
short_name = short_name[:nChars]
p.set_owner.short_name = short_name
p.set_owner.is_licensed = is_licensed
if team is not None:
p.set_owner.team = team
return self._sendAdmin(p)
@@ -337,7 +327,7 @@ class Node:
def setURL(self, url):
&#34;&#34;&#34;Set mesh network URL&#34;&#34;&#34;
if self.radioConfig == None:
if self.radioConfig is None:
raise Exception(&#34;No RadioConfig has been read&#34;)
# URLs are of the form https://www.meshtastic.org/d/#{base64_channel_set}
@@ -356,6 +346,9 @@ class Node:
channelSet = apponly_pb2.ChannelSet()
channelSet.ParseFromString(decodedURL)
if len(channelSet.settings) == 0:
raise Exception(&#34;There were no settings.&#34;)
i = 0
for chs in channelSet.settings:
ch = channel_pb2.Channel()
@@ -588,7 +581,7 @@ class Node:
def writeConfig(self):
&#34;&#34;&#34;Write the current (edited) radioConfig to the device&#34;&#34;&#34;
if self.radioConfig == None:
if self.radioConfig is None:
raise Exception(&#34;No RadioConfig has been read&#34;)
p = admin_pb2.AdminMessage()
@@ -651,7 +644,7 @@ class Node:
else:
return 0
def setOwner(self, long_name, short_name=None, is_licensed=False):
def setOwner(self, long_name=None, short_name=None, is_licensed=False, team=None):
&#34;&#34;&#34;Set device owner name&#34;&#34;&#34;
nChars = 3
minChars = 2
@@ -679,6 +672,8 @@ class Node:
short_name = short_name[:nChars]
p.set_owner.short_name = short_name
p.set_owner.is_licensed = is_licensed
if team is not None:
p.set_owner.team = team
return self._sendAdmin(p)
@@ -696,7 +691,7 @@ class Node:
def setURL(self, url):
&#34;&#34;&#34;Set mesh network URL&#34;&#34;&#34;
if self.radioConfig == None:
if self.radioConfig is None:
raise Exception(&#34;No RadioConfig has been read&#34;)
# URLs are of the form https://www.meshtastic.org/d/#{base64_channel_set}
@@ -715,6 +710,9 @@ class Node:
channelSet = apponly_pb2.ChannelSet()
channelSet.ParseFromString(decodedURL)
if len(channelSet.settings) == 0:
raise Exception(&#34;There were no settings.&#34;)
i = 0
for chs in channelSet.settings:
ch = channel_pb2.Channel()
@@ -998,7 +996,7 @@ class Node:
</details>
</dd>
<dt id="meshtastic.node.Node.setOwner"><code class="name flex">
<span>def <span class="ident">setOwner</span></span>(<span>self, long_name, short_name=None, is_licensed=False)</span>
<span>def <span class="ident">setOwner</span></span>(<span>self, long_name=None, short_name=None, is_licensed=False, team=None)</span>
</code></dt>
<dd>
<div class="desc"><p>Set device owner name</p></div>
@@ -1006,7 +1004,7 @@ class Node:
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def setOwner(self, long_name, short_name=None, is_licensed=False):
<pre><code class="python">def setOwner(self, long_name=None, short_name=None, is_licensed=False, team=None):
&#34;&#34;&#34;Set device owner name&#34;&#34;&#34;
nChars = 3
minChars = 2
@@ -1034,6 +1032,8 @@ class Node:
short_name = short_name[:nChars]
p.set_owner.short_name = short_name
p.set_owner.is_licensed = is_licensed
if team is not None:
p.set_owner.team = team
return self._sendAdmin(p)</code></pre>
</details>
@@ -1049,7 +1049,7 @@ class Node:
</summary>
<pre><code class="python">def setURL(self, url):
&#34;&#34;&#34;Set mesh network URL&#34;&#34;&#34;
if self.radioConfig == None:
if self.radioConfig is None:
raise Exception(&#34;No RadioConfig has been read&#34;)
# URLs are of the form https://www.meshtastic.org/d/#{base64_channel_set}
@@ -1068,6 +1068,9 @@ class Node:
channelSet = apponly_pb2.ChannelSet()
channelSet.ParseFromString(decodedURL)
if len(channelSet.settings) == 0:
raise Exception(&#34;There were no settings.&#34;)
i = 0
for chs in channelSet.settings:
ch = channel_pb2.Channel()
@@ -1163,7 +1166,7 @@ class Node:
</summary>
<pre><code class="python">def writeConfig(self):
&#34;&#34;&#34;Write the current (edited) radioConfig to the device&#34;&#34;&#34;
if self.radioConfig == None:
if self.radioConfig is None:
raise Exception(&#34;No RadioConfig has been read&#34;)
p = admin_pb2.AdminMessage()

View File

File diff suppressed because one or more lines are too long

View File

@@ -26,8 +26,8 @@
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">from . import portnums_pb2, remote_hardware_pb2
from pubsub import pub
<pre><code class="python">from pubsub import pub
from . import portnums_pb2, remote_hardware_pb2
def onGPIOreceive(packet, interface):
@@ -40,7 +40,7 @@ def onGPIOreceive(packet, interface):
class RemoteHardwareClient:
&#34;&#34;&#34;
This is the client code to control/monitor simple hardware built into the
This is the client code to control/monitor simple hardware built into the
meshtastic devices. It is intended to be both a useful API/service and example
code for how you can connect to your own custom meshtastic services
&#34;&#34;&#34;
@@ -141,7 +141,7 @@ code for how you can connect to your own custom meshtastic services</p>
</summary>
<pre><code class="python">class RemoteHardwareClient:
&#34;&#34;&#34;
This is the client code to control/monitor simple hardware built into the
This is the client code to control/monitor simple hardware built into the
meshtastic devices. It is intended to be both a useful API/service and example
code for how you can connect to your own custom meshtastic services
&#34;&#34;&#34;

View File

@@ -46,14 +46,14 @@ DESCRIPTOR = _descriptor.FileDescriptor(
package=&#39;&#39;,
syntax=&#39;proto3&#39;,
serialized_options=b&#39;\n\023com.geeksville.meshB\017StoreAndForwardH\003Z!github.com/meshtastic/gomeshproto&#39;,
serialized_pb=b&#39;\n\x12storeforward.proto\&#34;\x8d\x05\n\x16StoreAndForwardMessage\x12\x33\n\x02rr\x18\x01 \x01(\x0e\x32\&#39;.StoreAndForwardMessage.RequestResponse\x12\x31\n\x05stats\x18\x02 \x01(\x0b\x32\&#34;.StoreAndForwardMessage.Statistics\x12\x30\n\x07history\x18\x03 \x01(\x0b\x32\x1f.StoreAndForwardMessage.History\x1a\xc6\x01\n\nStatistics\x12\x15\n\rMessagesTotal\x18\x01 \x01(\r\x12\x15\n\rMessagesSaved\x18\x02 \x01(\r\x12\x13\n\x0bMessagesMax\x18\x03 \x01(\r\x12\x0e\n\x06UpTime\x18\x04 \x01(\r\x12\x10\n\x08Requests\x18\x05 \x01(\r\x12\x17\n\x0fRequestsHistory\x18\x06 \x01(\r\x12\x11\n\tHeartbeat\x18\x07 \x01(\x08\x12\x11\n\tReturnMax\x18\x08 \x01(\r\x12\x14\n\x0cReturnWindow\x18\t \x01(\r\x1a\x32\n\x07History\x12\x17\n\x0fHistoryMessages\x18\x01 \x01(\r\x12\x0e\n\x06Window\x18\x02 \x01(\r\&#34;\xdb\x01\n\x0fRequestResponse\x12\t\n\x05UNSET\x10\x00\x12\x10\n\x0cROUTER_ERROR\x10\x01\x12\x14\n\x10ROUTER_HEARTBEAT\x10\x02\x12\x0f\n\x0bROUTER_PING\x10\x03\x12\x0f\n\x0bROUTER_PONG\x10\x04\x12\x0f\n\x0bROUTER_BUSY\x10\x05\x12\x10\n\x0c\x43LIENT_ERROR\x10\x65\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x66\x12\x10\n\x0c\x43LIENT_STATS\x10g\x12\x0f\n\x0b\x43LIENT_PING\x10h\x12\x0f\n\x0b\x43LIENT_PONG\x10i\x12\x08\n\x03MAX\x10\xff\x01\x42K\n\x13\x63om.geeksville.meshB\x0fStoreAndForwardH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3&#39;
serialized_pb=b&#39;\n\x12storeforward.proto\&#34;\xe7\x04\n\x0fStoreAndForward\x12,\n\x02rr\x18\x01 \x01(\x0e\x32 .StoreAndForward.RequestResponse\x12*\n\x05stats\x18\x02 \x01(\x0b\x32\x1b.StoreAndForward.Statistics\x12)\n\x07history\x18\x03 \x01(\x0b\x32\x18.StoreAndForward.History\x1a\xc6\x01\n\nStatistics\x12\x15\n\rMessagesTotal\x18\x01 \x01(\r\x12\x15\n\rMessagesSaved\x18\x02 \x01(\r\x12\x13\n\x0bMessagesMax\x18\x03 \x01(\r\x12\x0e\n\x06UpTime\x18\x04 \x01(\r\x12\x10\n\x08Requests\x18\x05 \x01(\r\x12\x17\n\x0fRequestsHistory\x18\x06 \x01(\r\x12\x11\n\tHeartbeat\x18\x07 \x01(\x08\x12\x11\n\tReturnMax\x18\x08 \x01(\r\x12\x14\n\x0cReturnWindow\x18\t \x01(\r\x1a\x32\n\x07History\x12\x17\n\x0fHistoryMessages\x18\x01 \x01(\r\x12\x0e\n\x06Window\x18\x02 \x01(\r\&#34;\xd1\x01\n\x0fRequestResponse\x12\t\n\x05UNSET\x10\x00\x12\x10\n\x0cROUTER_ERROR\x10\x01\x12\x14\n\x10ROUTER_HEARTBEAT\x10\x02\x12\x0f\n\x0bROUTER_PING\x10\x03\x12\x0f\n\x0bROUTER_PONG\x10\x04\x12\x0f\n\x0bROUTER_BUSY\x10\x05\x12\x10\n\x0c\x43LIENT_ERROR\x10\x65\x12\x12\n\x0e\x43LIENT_HISTORY\x10\x66\x12\x10\n\x0c\x43LIENT_STATS\x10g\x12\x0f\n\x0b\x43LIENT_PING\x10h\x12\x0f\n\x0b\x43LIENT_PONG\x10iBK\n\x13\x63om.geeksville.meshB\x0fStoreAndForwardH\x03Z!github.com/meshtastic/gomeshprotob\x06proto3&#39;
)
_STOREANDFORWARDMESSAGE_REQUESTRESPONSE = _descriptor.EnumDescriptor(
_STOREANDFORWARD_REQUESTRESPONSE = _descriptor.EnumDescriptor(
name=&#39;RequestResponse&#39;,
full_name=&#39;StoreAndForwardMessage.RequestResponse&#39;,
full_name=&#39;StoreAndForward.RequestResponse&#39;,
filename=None,
file=DESCRIPTOR,
values=[
@@ -101,84 +101,80 @@ _STOREANDFORWARDMESSAGE_REQUESTRESPONSE = _descriptor.EnumDescriptor(
name=&#39;CLIENT_PONG&#39;, index=10, number=105,
serialized_options=None,
type=None),
_descriptor.EnumValueDescriptor(
name=&#39;MAX&#39;, index=11, number=255,
serialized_options=None,
type=None),
],
containing_type=None,
serialized_options=None,
serialized_start=457,
serialized_end=676,
serialized_start=429,
serialized_end=638,
)
_sym_db.RegisterEnumDescriptor(_STOREANDFORWARDMESSAGE_REQUESTRESPONSE)
_sym_db.RegisterEnumDescriptor(_STOREANDFORWARD_REQUESTRESPONSE)
_STOREANDFORWARDMESSAGE_STATISTICS = _descriptor.Descriptor(
_STOREANDFORWARD_STATISTICS = _descriptor.Descriptor(
name=&#39;Statistics&#39;,
full_name=&#39;StoreAndForwardMessage.Statistics&#39;,
full_name=&#39;StoreAndForward.Statistics&#39;,
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name=&#39;MessagesTotal&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.MessagesTotal&#39;, index=0,
name=&#39;MessagesTotal&#39;, full_name=&#39;StoreAndForward.Statistics.MessagesTotal&#39;, index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;MessagesSaved&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.MessagesSaved&#39;, index=1,
name=&#39;MessagesSaved&#39;, full_name=&#39;StoreAndForward.Statistics.MessagesSaved&#39;, index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;MessagesMax&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.MessagesMax&#39;, index=2,
name=&#39;MessagesMax&#39;, full_name=&#39;StoreAndForward.Statistics.MessagesMax&#39;, index=2,
number=3, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;UpTime&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.UpTime&#39;, index=3,
name=&#39;UpTime&#39;, full_name=&#39;StoreAndForward.Statistics.UpTime&#39;, index=3,
number=4, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;Requests&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.Requests&#39;, index=4,
name=&#39;Requests&#39;, full_name=&#39;StoreAndForward.Statistics.Requests&#39;, index=4,
number=5, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;RequestsHistory&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.RequestsHistory&#39;, index=5,
name=&#39;RequestsHistory&#39;, full_name=&#39;StoreAndForward.Statistics.RequestsHistory&#39;, index=5,
number=6, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;Heartbeat&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.Heartbeat&#39;, index=6,
name=&#39;Heartbeat&#39;, full_name=&#39;StoreAndForward.Statistics.Heartbeat&#39;, index=6,
number=7, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;ReturnMax&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.ReturnMax&#39;, index=7,
name=&#39;ReturnMax&#39;, full_name=&#39;StoreAndForward.Statistics.ReturnMax&#39;, index=7,
number=8, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;ReturnWindow&#39;, full_name=&#39;StoreAndForwardMessage.Statistics.ReturnWindow&#39;, index=8,
name=&#39;ReturnWindow&#39;, full_name=&#39;StoreAndForward.Statistics.ReturnWindow&#39;, index=8,
number=9, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
@@ -196,26 +192,26 @@ _STOREANDFORWARDMESSAGE_STATISTICS = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=204,
serialized_end=402,
serialized_start=176,
serialized_end=374,
)
_STOREANDFORWARDMESSAGE_HISTORY = _descriptor.Descriptor(
_STOREANDFORWARD_HISTORY = _descriptor.Descriptor(
name=&#39;History&#39;,
full_name=&#39;StoreAndForwardMessage.History&#39;,
full_name=&#39;StoreAndForward.History&#39;,
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name=&#39;HistoryMessages&#39;, full_name=&#39;StoreAndForwardMessage.History.HistoryMessages&#39;, index=0,
name=&#39;HistoryMessages&#39;, full_name=&#39;StoreAndForward.History.HistoryMessages&#39;, index=0,
number=1, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;Window&#39;, full_name=&#39;StoreAndForwardMessage.History.Window&#39;, index=1,
name=&#39;Window&#39;, full_name=&#39;StoreAndForward.History.Window&#39;, index=1,
number=2, type=13, cpp_type=3, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
@@ -233,33 +229,33 @@ _STOREANDFORWARDMESSAGE_HISTORY = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=404,
serialized_end=454,
serialized_start=376,
serialized_end=426,
)
_STOREANDFORWARDMESSAGE = _descriptor.Descriptor(
name=&#39;StoreAndForwardMessage&#39;,
full_name=&#39;StoreAndForwardMessage&#39;,
_STOREANDFORWARD = _descriptor.Descriptor(
name=&#39;StoreAndForward&#39;,
full_name=&#39;StoreAndForward&#39;,
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name=&#39;rr&#39;, full_name=&#39;StoreAndForwardMessage.rr&#39;, index=0,
name=&#39;rr&#39;, full_name=&#39;StoreAndForward.rr&#39;, index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;stats&#39;, full_name=&#39;StoreAndForwardMessage.stats&#39;, index=1,
name=&#39;stats&#39;, full_name=&#39;StoreAndForward.stats&#39;, index=1,
number=2, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name=&#39;history&#39;, full_name=&#39;StoreAndForwardMessage.history&#39;, index=2,
name=&#39;history&#39;, full_name=&#39;StoreAndForward.history&#39;, index=2,
number=3, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
@@ -268,9 +264,9 @@ _STOREANDFORWARDMESSAGE = _descriptor.Descriptor(
],
extensions=[
],
nested_types=[_STOREANDFORWARDMESSAGE_STATISTICS, _STOREANDFORWARDMESSAGE_HISTORY, ],
nested_types=[_STOREANDFORWARD_STATISTICS, _STOREANDFORWARD_HISTORY, ],
enum_types=[
_STOREANDFORWARDMESSAGE_REQUESTRESPONSE,
_STOREANDFORWARD_REQUESTRESPONSE,
],
serialized_options=None,
is_extendable=False,
@@ -279,40 +275,40 @@ _STOREANDFORWARDMESSAGE = _descriptor.Descriptor(
oneofs=[
],
serialized_start=23,
serialized_end=676,
serialized_end=638,
)
_STOREANDFORWARDMESSAGE_STATISTICS.containing_type = _STOREANDFORWARDMESSAGE
_STOREANDFORWARDMESSAGE_HISTORY.containing_type = _STOREANDFORWARDMESSAGE
_STOREANDFORWARDMESSAGE.fields_by_name[&#39;rr&#39;].enum_type = _STOREANDFORWARDMESSAGE_REQUESTRESPONSE
_STOREANDFORWARDMESSAGE.fields_by_name[&#39;stats&#39;].message_type = _STOREANDFORWARDMESSAGE_STATISTICS
_STOREANDFORWARDMESSAGE.fields_by_name[&#39;history&#39;].message_type = _STOREANDFORWARDMESSAGE_HISTORY
_STOREANDFORWARDMESSAGE_REQUESTRESPONSE.containing_type = _STOREANDFORWARDMESSAGE
DESCRIPTOR.message_types_by_name[&#39;StoreAndForwardMessage&#39;] = _STOREANDFORWARDMESSAGE
_STOREANDFORWARD_STATISTICS.containing_type = _STOREANDFORWARD
_STOREANDFORWARD_HISTORY.containing_type = _STOREANDFORWARD
_STOREANDFORWARD.fields_by_name[&#39;rr&#39;].enum_type = _STOREANDFORWARD_REQUESTRESPONSE
_STOREANDFORWARD.fields_by_name[&#39;stats&#39;].message_type = _STOREANDFORWARD_STATISTICS
_STOREANDFORWARD.fields_by_name[&#39;history&#39;].message_type = _STOREANDFORWARD_HISTORY
_STOREANDFORWARD_REQUESTRESPONSE.containing_type = _STOREANDFORWARD
DESCRIPTOR.message_types_by_name[&#39;StoreAndForward&#39;] = _STOREANDFORWARD
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
StoreAndForwardMessage = _reflection.GeneratedProtocolMessageType(&#39;StoreAndForwardMessage&#39;, (_message.Message,), {
StoreAndForward = _reflection.GeneratedProtocolMessageType(&#39;StoreAndForward&#39;, (_message.Message,), {
&#39;Statistics&#39; : _reflection.GeneratedProtocolMessageType(&#39;Statistics&#39;, (_message.Message,), {
&#39;DESCRIPTOR&#39; : _STOREANDFORWARDMESSAGE_STATISTICS,
&#39;DESCRIPTOR&#39; : _STOREANDFORWARD_STATISTICS,
&#39;__module__&#39; : &#39;storeforward_pb2&#39;
# @@protoc_insertion_point(class_scope:StoreAndForwardMessage.Statistics)
# @@protoc_insertion_point(class_scope:StoreAndForward.Statistics)
})
,
&#39;History&#39; : _reflection.GeneratedProtocolMessageType(&#39;History&#39;, (_message.Message,), {
&#39;DESCRIPTOR&#39; : _STOREANDFORWARDMESSAGE_HISTORY,
&#39;DESCRIPTOR&#39; : _STOREANDFORWARD_HISTORY,
&#39;__module__&#39; : &#39;storeforward_pb2&#39;
# @@protoc_insertion_point(class_scope:StoreAndForwardMessage.History)
# @@protoc_insertion_point(class_scope:StoreAndForward.History)
})
,
&#39;DESCRIPTOR&#39; : _STOREANDFORWARDMESSAGE,
&#39;DESCRIPTOR&#39; : _STOREANDFORWARD,
&#39;__module__&#39; : &#39;storeforward_pb2&#39;
# @@protoc_insertion_point(class_scope:StoreAndForwardMessage)
# @@protoc_insertion_point(class_scope:StoreAndForward)
})
_sym_db.RegisterMessage(StoreAndForwardMessage)
_sym_db.RegisterMessage(StoreAndForwardMessage.Statistics)
_sym_db.RegisterMessage(StoreAndForwardMessage.History)
_sym_db.RegisterMessage(StoreAndForward)
_sym_db.RegisterMessage(StoreAndForward.Statistics)
_sym_db.RegisterMessage(StoreAndForward.History)
DESCRIPTOR._options = None
@@ -328,8 +324,8 @@ DESCRIPTOR._options = None
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage"><code class="flex name class">
<span>class <span class="ident">StoreAndForwardMessage</span></span>
<dt id="meshtastic.storeforward_pb2.StoreAndForward"><code class="flex name class">
<span>class <span class="ident">StoreAndForward</span></span>
<span>(</span><span>**kwargs)</span>
</code></dt>
<dd>
@@ -344,35 +340,35 @@ shown below.</p></div>
</ul>
<h3>Class variables</h3>
<dl>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_ERROR"><code class="name">var <span class="ident">CLIENT_ERROR</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_ERROR"><code class="name">var <span class="ident">CLIENT_ERROR</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_HISTORY"><code class="name">var <span class="ident">CLIENT_HISTORY</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_HISTORY"><code class="name">var <span class="ident">CLIENT_HISTORY</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_PING"><code class="name">var <span class="ident">CLIENT_PING</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_PING"><code class="name">var <span class="ident">CLIENT_PING</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_PONG"><code class="name">var <span class="ident">CLIENT_PONG</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_PONG"><code class="name">var <span class="ident">CLIENT_PONG</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_STATS"><code class="name">var <span class="ident">CLIENT_STATS</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_STATS"><code class="name">var <span class="ident">CLIENT_STATS</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.DESCRIPTOR"><code class="name">var <span class="ident">DESCRIPTOR</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.DESCRIPTOR"><code class="name">var <span class="ident">DESCRIPTOR</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.HISTORY_FIELD_NUMBER"><code class="name">var <span class="ident">HISTORY_FIELD_NUMBER</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.HISTORY_FIELD_NUMBER"><code class="name">var <span class="ident">HISTORY_FIELD_NUMBER</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.History"><code class="name">var <span class="ident">History</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.History"><code class="name">var <span class="ident">History</span></code></dt>
<dd>
<div class="desc"><p>Abstract base class for protocol messages.</p>
<p>Protocol message classes are almost always generated by the protocol
@@ -380,43 +376,39 @@ compiler.
These generated types subclass Message and implement the methods
shown below.</p></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.MAX"><code class="name">var <span class="ident">MAX</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_BUSY"><code class="name">var <span class="ident">ROUTER_BUSY</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_BUSY"><code class="name">var <span class="ident">ROUTER_BUSY</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_ERROR"><code class="name">var <span class="ident">ROUTER_ERROR</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_ERROR"><code class="name">var <span class="ident">ROUTER_ERROR</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_HEARTBEAT"><code class="name">var <span class="ident">ROUTER_HEARTBEAT</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_HEARTBEAT"><code class="name">var <span class="ident">ROUTER_HEARTBEAT</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_PING"><code class="name">var <span class="ident">ROUTER_PING</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_PING"><code class="name">var <span class="ident">ROUTER_PING</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_PONG"><code class="name">var <span class="ident">ROUTER_PONG</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_PONG"><code class="name">var <span class="ident">ROUTER_PONG</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.RR_FIELD_NUMBER"><code class="name">var <span class="ident">RR_FIELD_NUMBER</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.RR_FIELD_NUMBER"><code class="name">var <span class="ident">RR_FIELD_NUMBER</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.RequestResponse"><code class="name">var <span class="ident">RequestResponse</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.RequestResponse"><code class="name">var <span class="ident">RequestResponse</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.STATS_FIELD_NUMBER"><code class="name">var <span class="ident">STATS_FIELD_NUMBER</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.STATS_FIELD_NUMBER"><code class="name">var <span class="ident">STATS_FIELD_NUMBER</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.Statistics"><code class="name">var <span class="ident">Statistics</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.Statistics"><code class="name">var <span class="ident">Statistics</span></code></dt>
<dd>
<div class="desc"><p>Abstract base class for protocol messages.</p>
<p>Protocol message classes are almost always generated by the protocol
@@ -424,14 +416,14 @@ compiler.
These generated types subclass Message and implement the methods
shown below.</p></div>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.UNSET"><code class="name">var <span class="ident">UNSET</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.UNSET"><code class="name">var <span class="ident">UNSET</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
<h3>Static methods</h3>
<dl>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.FromString"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.FromString"><code class="name flex">
<span>def <span class="ident">FromString</span></span>(<span>s)</span>
</code></dt>
<dd>
@@ -446,7 +438,7 @@ shown below.</p></div>
return message</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.RegisterExtension"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.RegisterExtension"><code class="name flex">
<span>def <span class="ident">RegisterExtension</span></span>(<span>extension_handle)</span>
</code></dt>
<dd>
@@ -466,7 +458,7 @@ shown below.</p></div>
</dl>
<h3>Instance variables</h3>
<dl>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.history"><code class="name">var <span class="ident">history</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.history"><code class="name">var <span class="ident">history</span></code></dt>
<dd>
<div class="desc"><p>Getter for history.</p></div>
<details class="source">
@@ -489,7 +481,7 @@ shown below.</p></div>
return field_value</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.rr"><code class="name">var <span class="ident">rr</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.rr"><code class="name">var <span class="ident">rr</span></code></dt>
<dd>
<div class="desc"><p>Getter for rr.</p></div>
<details class="source">
@@ -502,7 +494,7 @@ shown below.</p></div>
return self._fields.get(field, default_value)</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.stats"><code class="name">var <span class="ident">stats</span></code></dt>
<dt id="meshtastic.storeforward_pb2.StoreAndForward.stats"><code class="name">var <span class="ident">stats</span></code></dt>
<dd>
<div class="desc"><p>Getter for stats.</p></div>
<details class="source">
@@ -528,7 +520,7 @@ shown below.</p></div>
</dl>
<h3>Methods</h3>
<dl>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ByteSize"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ByteSize"><code class="name flex">
<span>def <span class="ident">ByteSize</span></span>(<span>self)</span>
</code></dt>
<dd>
@@ -559,7 +551,7 @@ shown below.</p></div>
return size</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.Clear"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.Clear"><code class="name flex">
<span>def <span class="ident">Clear</span></span>(<span>self)</span>
</code></dt>
<dd>
@@ -581,7 +573,7 @@ shown below.</p></div>
self._Modified()</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ClearField"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ClearField"><code class="name flex">
<span>def <span class="ident">ClearField</span></span>(<span>self, field_name)</span>
</code></dt>
<dd>
@@ -624,7 +616,7 @@ shown below.</p></div>
self._Modified()</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.DiscardUnknownFields"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.DiscardUnknownFields"><code class="name flex">
<span>def <span class="ident">DiscardUnknownFields</span></span>(<span>self)</span>
</code></dt>
<dd>
@@ -649,7 +641,7 @@ shown below.</p></div>
value.DiscardUnknownFields()</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.FindInitializationErrors"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.FindInitializationErrors"><code class="name flex">
<span>def <span class="ident">FindInitializationErrors</span></span>(<span>self)</span>
</code></dt>
<dd>
@@ -707,7 +699,7 @@ the top-level message, e.g. "foo.bar[5].baz".</p></div>
return errors</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.HasField"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.HasField"><code class="name flex">
<span>def <span class="ident">HasField</span></span>(<span>self, field_name)</span>
</code></dt>
<dd>
@@ -735,7 +727,7 @@ the top-level message, e.g. "foo.bar[5].baz".</p></div>
return field in self._fields</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.IsInitialized"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.IsInitialized"><code class="name flex">
<span>def <span class="ident">IsInitialized</span></span>(<span>self, errors=None)</span>
</code></dt>
<dd>
@@ -792,7 +784,7 @@ paths of all missing required fields.</dd>
return True</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.ListFields"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.ListFields"><code class="name flex">
<span>def <span class="ident">ListFields</span></span>(<span>self)</span>
</code></dt>
<dd>
@@ -807,7 +799,7 @@ paths of all missing required fields.</dd>
return all_fields</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.MergeFrom"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.MergeFrom"><code class="name flex">
<span>def <span class="ident">MergeFrom</span></span>(<span>self, msg)</span>
</code></dt>
<dd>
@@ -859,7 +851,7 @@ paths of all missing required fields.</dd>
self._unknown_field_set._extend(msg._unknown_field_set)</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.MergeFromString"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.MergeFromString"><code class="name flex">
<span>def <span class="ident">MergeFromString</span></span>(<span>self, serialized)</span>
</code></dt>
<dd>
@@ -884,7 +876,7 @@ paths of all missing required fields.</dd>
return length # Return this for legacy reasons.</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.SerializePartialToString"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.SerializePartialToString"><code class="name flex">
<span>def <span class="ident">SerializePartialToString</span></span>(<span>self, **kwargs)</span>
</code></dt>
<dd>
@@ -899,7 +891,7 @@ paths of all missing required fields.</dd>
return out.getvalue()</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.SerializeToString"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.SerializeToString"><code class="name flex">
<span>def <span class="ident">SerializeToString</span></span>(<span>self, **kwargs)</span>
</code></dt>
<dd>
@@ -917,7 +909,7 @@ paths of all missing required fields.</dd>
return self.SerializePartialToString(**kwargs)</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.SetInParent"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.SetInParent"><code class="name flex">
<span>def <span class="ident">SetInParent</span></span>(<span>self)</span>
</code></dt>
<dd>
@@ -943,7 +935,7 @@ and propagates this to our listener iff this was a state change.</p></div>
self._listener.Modified()</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.UnknownFields"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.UnknownFields"><code class="name flex">
<span>def <span class="ident">UnknownFields</span></span>(<span>self)</span>
</code></dt>
<dd>
@@ -959,7 +951,7 @@ and propagates this to our listener iff this was a state change.</p></div>
return self._unknown_field_set # pylint: disable=protected-access</code></pre>
</details>
</dd>
<dt id="meshtastic.storeforward_pb2.StoreAndForwardMessage.WhichOneof"><code class="name flex">
<dt id="meshtastic.storeforward_pb2.StoreAndForward.WhichOneof"><code class="name flex">
<span>def <span class="ident">WhichOneof</span></span>(<span>self, oneof_name)</span>
</code></dt>
<dd>
@@ -1002,47 +994,46 @@ and propagates this to our listener iff this was a state change.</p></div>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage">StoreAndForwardMessage</a></code></h4>
<h4><code><a title="meshtastic.storeforward_pb2.StoreAndForward" href="#meshtastic.storeforward_pb2.StoreAndForward">StoreAndForward</a></code></h4>
<ul class="">
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ByteSize" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ByteSize">ByteSize</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_ERROR" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_ERROR">CLIENT_ERROR</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_HISTORY" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_HISTORY">CLIENT_HISTORY</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_PING" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_PING">CLIENT_PING</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_PONG" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_PONG">CLIENT_PONG</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_STATS" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.CLIENT_STATS">CLIENT_STATS</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.Clear" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.Clear">Clear</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ClearField" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ClearField">ClearField</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.DESCRIPTOR" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.DESCRIPTOR">DESCRIPTOR</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.DiscardUnknownFields" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.DiscardUnknownFields">DiscardUnknownFields</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.FindInitializationErrors" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.FindInitializationErrors">FindInitializationErrors</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.FromString" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.FromString">FromString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.HISTORY_FIELD_NUMBER" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.HISTORY_FIELD_NUMBER">HISTORY_FIELD_NUMBER</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.HasField" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.HasField">HasField</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.History" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.History">History</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.IsInitialized" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.IsInitialized">IsInitialized</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ListFields" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ListFields">ListFields</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.MAX" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.MAX">MAX</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.MergeFrom" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.MergeFrom">MergeFrom</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.MergeFromString" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.MergeFromString">MergeFromString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_BUSY" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_BUSY">ROUTER_BUSY</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_ERROR" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_ERROR">ROUTER_ERROR</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_HEARTBEAT" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_HEARTBEAT">ROUTER_HEARTBEAT</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_PING" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_PING">ROUTER_PING</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_PONG" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.ROUTER_PONG">ROUTER_PONG</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.RR_FIELD_NUMBER" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.RR_FIELD_NUMBER">RR_FIELD_NUMBER</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.RegisterExtension" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.RegisterExtension">RegisterExtension</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.RequestResponse" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.RequestResponse">RequestResponse</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.STATS_FIELD_NUMBER" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.STATS_FIELD_NUMBER">STATS_FIELD_NUMBER</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.SerializePartialToString" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.SerializePartialToString">SerializePartialToString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.SerializeToString" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.SerializeToString">SerializeToString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.SetInParent" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.SetInParent">SetInParent</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.Statistics" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.Statistics">Statistics</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.UNSET" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.UNSET">UNSET</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.UnknownFields" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.UnknownFields">UnknownFields</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.WhichOneof" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.WhichOneof">WhichOneof</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.history" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.history">history</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.rr" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.rr">rr</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForwardMessage.stats" href="#meshtastic.storeforward_pb2.StoreAndForwardMessage.stats">stats</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ByteSize" href="#meshtastic.storeforward_pb2.StoreAndForward.ByteSize">ByteSize</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_ERROR" href="#meshtastic.storeforward_pb2.StoreAndForward.CLIENT_ERROR">CLIENT_ERROR</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_HISTORY" href="#meshtastic.storeforward_pb2.StoreAndForward.CLIENT_HISTORY">CLIENT_HISTORY</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_PING" href="#meshtastic.storeforward_pb2.StoreAndForward.CLIENT_PING">CLIENT_PING</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_PONG" href="#meshtastic.storeforward_pb2.StoreAndForward.CLIENT_PONG">CLIENT_PONG</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.CLIENT_STATS" href="#meshtastic.storeforward_pb2.StoreAndForward.CLIENT_STATS">CLIENT_STATS</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.Clear" href="#meshtastic.storeforward_pb2.StoreAndForward.Clear">Clear</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ClearField" href="#meshtastic.storeforward_pb2.StoreAndForward.ClearField">ClearField</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.DESCRIPTOR" href="#meshtastic.storeforward_pb2.StoreAndForward.DESCRIPTOR">DESCRIPTOR</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.DiscardUnknownFields" href="#meshtastic.storeforward_pb2.StoreAndForward.DiscardUnknownFields">DiscardUnknownFields</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.FindInitializationErrors" href="#meshtastic.storeforward_pb2.StoreAndForward.FindInitializationErrors">FindInitializationErrors</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.FromString" href="#meshtastic.storeforward_pb2.StoreAndForward.FromString">FromString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.HISTORY_FIELD_NUMBER" href="#meshtastic.storeforward_pb2.StoreAndForward.HISTORY_FIELD_NUMBER">HISTORY_FIELD_NUMBER</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.HasField" href="#meshtastic.storeforward_pb2.StoreAndForward.HasField">HasField</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.History" href="#meshtastic.storeforward_pb2.StoreAndForward.History">History</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.IsInitialized" href="#meshtastic.storeforward_pb2.StoreAndForward.IsInitialized">IsInitialized</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ListFields" href="#meshtastic.storeforward_pb2.StoreAndForward.ListFields">ListFields</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.MergeFrom" href="#meshtastic.storeforward_pb2.StoreAndForward.MergeFrom">MergeFrom</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.MergeFromString" href="#meshtastic.storeforward_pb2.StoreAndForward.MergeFromString">MergeFromString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_BUSY" href="#meshtastic.storeforward_pb2.StoreAndForward.ROUTER_BUSY">ROUTER_BUSY</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_ERROR" href="#meshtastic.storeforward_pb2.StoreAndForward.ROUTER_ERROR">ROUTER_ERROR</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_HEARTBEAT" href="#meshtastic.storeforward_pb2.StoreAndForward.ROUTER_HEARTBEAT">ROUTER_HEARTBEAT</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_PING" href="#meshtastic.storeforward_pb2.StoreAndForward.ROUTER_PING">ROUTER_PING</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.ROUTER_PONG" href="#meshtastic.storeforward_pb2.StoreAndForward.ROUTER_PONG">ROUTER_PONG</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.RR_FIELD_NUMBER" href="#meshtastic.storeforward_pb2.StoreAndForward.RR_FIELD_NUMBER">RR_FIELD_NUMBER</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.RegisterExtension" href="#meshtastic.storeforward_pb2.StoreAndForward.RegisterExtension">RegisterExtension</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.RequestResponse" href="#meshtastic.storeforward_pb2.StoreAndForward.RequestResponse">RequestResponse</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.STATS_FIELD_NUMBER" href="#meshtastic.storeforward_pb2.StoreAndForward.STATS_FIELD_NUMBER">STATS_FIELD_NUMBER</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.SerializePartialToString" href="#meshtastic.storeforward_pb2.StoreAndForward.SerializePartialToString">SerializePartialToString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.SerializeToString" href="#meshtastic.storeforward_pb2.StoreAndForward.SerializeToString">SerializeToString</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.SetInParent" href="#meshtastic.storeforward_pb2.StoreAndForward.SetInParent">SetInParent</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.Statistics" href="#meshtastic.storeforward_pb2.StoreAndForward.Statistics">Statistics</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.UNSET" href="#meshtastic.storeforward_pb2.StoreAndForward.UNSET">UNSET</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.UnknownFields" href="#meshtastic.storeforward_pb2.StoreAndForward.UnknownFields">UnknownFields</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.WhichOneof" href="#meshtastic.storeforward_pb2.StoreAndForward.WhichOneof">WhichOneof</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.history" href="#meshtastic.storeforward_pb2.StoreAndForward.history">history</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.rr" href="#meshtastic.storeforward_pb2.StoreAndForward.rr">rr</a></code></li>
<li><code><a title="meshtastic.storeforward_pb2.StoreAndForward.stats" href="#meshtastic.storeforward_pb2.StoreAndForward.stats">stats</a></code></li>
</ul>
</li>
</ul>

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.10.0" />
<title>meshtastic.test API documentation</title>
<meta name="description" content="" />
<meta name="description" content="Testing" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
@@ -22,18 +22,21 @@
<h1 class="title">Module <code>meshtastic.test</code></h1>
</header>
<section id="section-intro">
<p>Testing</p>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">import logging
from . import util
from . import SerialInterface, TCPInterface, BROADCAST_NUM
from pubsub import pub
<pre><code class="python">&#34;&#34;&#34; Testing
&#34;&#34;&#34;
import logging
import time
import sys
import threading, traceback
import traceback
from dotmap import DotMap
from pubsub import pub
from . import util
from . import SerialInterface, TCPInterface, BROADCAST_NUM
&#34;&#34;&#34;The interfaces we are using for our tests&#34;&#34;&#34;
interfaces = None
@@ -59,7 +62,7 @@ def onReceive(packet, interface):
if p.decoded.portnum == &#34;TEXT_MESSAGE_APP&#34;:
# We only care a about clear text packets
if receivedPackets != None:
if receivedPackets is not None:
receivedPackets.append(p)
@@ -103,18 +106,19 @@ def testSend(fromInterface, toInterface, isBroadcast=False, asBinary=False, want
else:
fromInterface.sendData((f&#34;Binary {testNumber}&#34;).encode(
&#34;utf-8&#34;), toNode, wantAck=wantAck)
for sec in range(60): # max of 60 secs before we timeout
for _ in range(60): # max of 60 secs before we timeout
time.sleep(1)
if (len(receivedPackets) &gt;= 1):
if len(receivedPackets) &gt;= 1:
return True
return False # Failed to send
def runTests(numTests=50, wantAck=False, maxFailures=0):
&#34;&#34;&#34;Run the tests.&#34;&#34;&#34;
logging.info(f&#34;Running {numTests} tests with wantAck={wantAck}&#34;)
numFail = 0
numSuccess = 0
for i in range(numTests):
for _ in range(numTests):
global testNumber
testNumber = testNumber + 1
isBroadcast = True
@@ -144,6 +148,7 @@ def runTests(numTests=50, wantAck=False, maxFailures=0):
def testThread(numTests=50):
&#34;&#34;&#34;Test thread&#34;&#34;&#34;
logging.info(&#34;Found devices, starting tests...&#34;)
runTests(numTests, wantAck=True)
# Allow a few dropped packets
@@ -156,6 +161,7 @@ def onConnection(topic=pub.AUTO_TOPIC):
def openDebugLog(portName):
&#34;&#34;&#34;Open the debug log file&#34;&#34;&#34;
debugname = &#34;log&#34; + portName.replace(&#34;/&#34;, &#34;_&#34;)
logging.info(f&#34;Writing serial debugging to {debugname}&#34;)
return open(debugname, &#39;w+&#39;, buffering=1)
@@ -169,7 +175,7 @@ def testAll():
Exception: If not enough devices are found
&#34;&#34;&#34;
ports = util.findPorts()
if (len(ports) &lt; 2):
if len(ports) &lt; 2:
raise Exception(&#34;Must have at least two devices connected to USB&#34;)
pub.subscribe(onConnection, &#34;meshtastic.connection&#34;)
@@ -272,7 +278,7 @@ def testSimulator():
if p.decoded.portnum == &#34;TEXT_MESSAGE_APP&#34;:
# We only care a about clear text packets
if receivedPackets != None:
if receivedPackets is not None:
receivedPackets.append(p)</code></pre>
</details>
</dd>
@@ -280,12 +286,13 @@ def testSimulator():
<span>def <span class="ident">openDebugLog</span></span>(<span>portName)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Open the debug log file</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def openDebugLog(portName):
&#34;&#34;&#34;Open the debug log file&#34;&#34;&#34;
debugname = &#34;log&#34; + portName.replace(&#34;/&#34;, &#34;_&#34;)
logging.info(f&#34;Writing serial debugging to {debugname}&#34;)
return open(debugname, &#39;w+&#39;, buffering=1)</code></pre>
@@ -295,16 +302,17 @@ def testSimulator():
<span>def <span class="ident">runTests</span></span>(<span>numTests=50, wantAck=False, maxFailures=0)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Run the tests.</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def runTests(numTests=50, wantAck=False, maxFailures=0):
&#34;&#34;&#34;Run the tests.&#34;&#34;&#34;
logging.info(f&#34;Running {numTests} tests with wantAck={wantAck}&#34;)
numFail = 0
numSuccess = 0
for i in range(numTests):
for _ in range(numTests):
global testNumber
testNumber = testNumber + 1
isBroadcast = True
@@ -370,7 +378,7 @@ def testSimulator():
Exception: If not enough devices are found
&#34;&#34;&#34;
ports = util.findPorts()
if (len(ports) &lt; 2):
if len(ports) &lt; 2:
raise Exception(&#34;Must have at least two devices connected to USB&#34;)
pub.subscribe(onConnection, &#34;meshtastic.connection&#34;)
@@ -429,9 +437,9 @@ toInterface {[type]} &ndash; [description]</p>
else:
fromInterface.sendData((f&#34;Binary {testNumber}&#34;).encode(
&#34;utf-8&#34;), toNode, wantAck=wantAck)
for sec in range(60): # max of 60 secs before we timeout
for _ in range(60): # max of 60 secs before we timeout
time.sleep(1)
if (len(receivedPackets) &gt;= 1):
if len(receivedPackets) &gt;= 1:
return True
return False # Failed to send</code></pre>
</details>
@@ -478,12 +486,13 @@ python3 -c 'from meshtastic.test import testSimulator; testSimulator()'</p></div
<span>def <span class="ident">testThread</span></span>(<span>numTests=50)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Test thread</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def testThread(numTests=50):
&#34;&#34;&#34;Test thread&#34;&#34;&#34;
logging.info(&#34;Found devices, starting tests...&#34;)
runTests(numTests, wantAck=True)
# Allow a few dropped packets

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.10.0" />
<title>meshtastic.tunnel API documentation</title>
<meta name="description" content="" />
<meta name="description" content="Code for IP tunnel over a mesh …" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
@@ -22,11 +22,25 @@
<h1 class="title">Module <code>meshtastic.tunnel</code></h1>
</header>
<section id="section-intro">
<p>Code for IP tunnel over a mesh</p>
<h1 id="note-python-pytuntap-was-too-buggy">Note python-pytuntap was too buggy</h1>
<h1 id="using-pip3-install-pytap2">using pip3 install pytap2</h1>
<h1 id="make-sure-to-sudo-setcap-cap_net_admineip-usrbinpython38-so-python-can-access-tun-device-without-being-root">make sure to "sudo setcap cap_net_admin+eip /usr/bin/python3.8" so python can access tun device without being root</h1>
<h1 id="sudo-ip-tuntap-del-mode-tun-tun0">sudo ip tuntap del mode tun tun0</h1>
<h1 id="sudo-binrunsh-port-devttyusb0-setch-shortfast">sudo bin/run.sh &ndash;port /dev/ttyUSB0 &ndash;setch-shortfast</h1>
<h1 id="sudo-binrunsh-port-devttyusb0-tunnel-debug">sudo bin/run.sh &ndash;port /dev/ttyUSB0 &ndash;tunnel &ndash;debug</h1>
<h1 id="ssh-y-root19216810151-or-dietpi-default-password-p">ssh -Y root@192.168.10.151 (or dietpi), default password p</h1>
<h1 id="ncat-e-bincat-k-u-l-1235">ncat -e /bin/cat -k -u -l 1235</h1>
<h1 id="ncat-u-1011564152-1235">ncat -u 10.115.64.152 1235</h1>
<h1 id="ping-c-1-w-20-1011564152">ping -c 1 -W 20 10.115.64.152</h1>
<h1 id="ping-i-30-w-30-1011564152">ping -i 30 -W 30 10.115.64.152</h1>
<h1 id="fixme-use-a-more-optimal-mtu">FIXME: use a more optimal MTU</h1>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python"># code for IP tunnel over a mesh
<pre><code class="python">&#34;&#34;&#34; Code for IP tunnel over a mesh
# Note python-pytuntap was too buggy
# using pip3 install pytap2
# make sure to &#34;sudo setcap cap_net_admin+eip /usr/bin/python3.8&#34; so python can access tun device without being root
@@ -40,11 +54,12 @@
# ping -i 30 -W 30 10.115.64.152
# FIXME: use a more optimal MTU
&#34;&#34;&#34;
from . import portnums_pb2
from pubsub import pub
import logging
import threading
from pubsub import pub
from . import portnums_pb2
# A new non standard log level that is lower level than DEBUG
LOG_TRACE = 5
@@ -545,7 +560,20 @@ subnet is used to construct our network number (normally 10.115.x.x)</p></div>
<nav id="sidebar">
<h1>Index</h1>
<div class="toc">
<ul></ul>
<ul>
<li><a href="#note-python-pytuntap-was-too-buggy">Note python-pytuntap was too buggy</a></li>
<li><a href="#using-pip3-install-pytap2">using pip3 install pytap2</a></li>
<li><a href="#make-sure-to-sudo-setcap-cap_net_admineip-usrbinpython38-so-python-can-access-tun-device-without-being-root">make sure to "sudo setcap cap_net_admin+eip /usr/bin/python3.8" so python can access tun device without being root</a></li>
<li><a href="#sudo-ip-tuntap-del-mode-tun-tun0">sudo ip tuntap del mode tun tun0</a></li>
<li><a href="#sudo-binrunsh-port-devttyusb0-setch-shortfast">sudo bin/run.sh &ndash;port /dev/ttyUSB0 &ndash;setch-shortfast</a></li>
<li><a href="#sudo-binrunsh-port-devttyusb0-tunnel-debug">sudo bin/run.sh &ndash;port /dev/ttyUSB0 &ndash;tunnel &ndash;debug</a></li>
<li><a href="#ssh-y-root19216810151-or-dietpi-default-password-p">ssh -Y root@192.168.10.151 (or dietpi), default password p</a></li>
<li><a href="#ncat-e-bincat-k-u-l-1235">ncat -e /bin/cat -k -u -l 1235</a></li>
<li><a href="#ncat-u-1011564152-1235">ncat -u 10.115.64.152 1235</a></li>
<li><a href="#ping-c-1-w-20-1011564152">ping -c 1 -W 20 10.115.64.152</a></li>
<li><a href="#ping-i-30-w-30-1011564152">ping -i 30 -W 30 10.115.64.152</a></li>
<li><a href="#fixme-use-a-more-optimal-mtu">FIXME: use a more optimal MTU</a></li>
</ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.10.0" />
<title>meshtastic.util API documentation</title>
<meta name="description" content="" />
<meta name="description" content="Utility functions." />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
@@ -22,15 +22,21 @@
<h1 class="title">Module <code>meshtastic.util</code></h1>
</header>
<section id="section-intro">
<p>Utility functions.</p>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">from collections import defaultdict
import serial, traceback
import serial.tools.list_ports
<pre><code class="python">&#34;&#34;&#34; Utility functions.
&#34;&#34;&#34;
import traceback
from queue import Queue
import threading, sys, time, logging
import sys
import time
import logging
import threading
import serial
import serial.tools.list_ports
&#34;&#34;&#34;Some devices such as a seger jlink we never want to accidentally open&#34;&#34;&#34;
blacklistVids = dict.fromkeys([0x1366])
@@ -43,6 +49,7 @@ def stripnl(s):
def fixme(message):
&#34;&#34;&#34;raise an exception for things that needs to be fixed&#34;&#34;&#34;
raise Exception(f&#34;FIXME: {message}&#34;)
@@ -61,7 +68,7 @@ def findPorts():
list -- a list of device paths
&#34;&#34;&#34;
l = list(map(lambda port: port.device,
filter(lambda port: port.vid != None and port.vid not in blacklistVids,
filter(lambda port: port.vid is not None and port.vid not in blacklistVids,
serial.tools.list_ports.comports())))
l.sort()
return l
@@ -75,6 +82,7 @@ class dotdict(dict):
class Timeout:
&#34;&#34;&#34;Timeout class&#34;&#34;&#34;
def __init__(self, maxSecs=20):
self.expireTime = 0
self.sleepInterval = 0.1
@@ -104,6 +112,7 @@ class DeferredExecution():
self.thread.start()
def queueWork(self, runnable):
&#34;&#34;&#34; Queue up the work&#34;&#34;&#34;
self.queue.put(runnable)
def _run(self):
@@ -159,7 +168,7 @@ class DeferredExecution():
list -- a list of device paths
&#34;&#34;&#34;
l = list(map(lambda port: port.device,
filter(lambda port: port.vid != None and port.vid not in blacklistVids,
filter(lambda port: port.vid is not None and port.vid not in blacklistVids,
serial.tools.list_ports.comports())))
l.sort()
return l</code></pre>
@@ -169,12 +178,13 @@ class DeferredExecution():
<span>def <span class="ident">fixme</span></span>(<span>message)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>raise an exception for things that needs to be fixed</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def fixme(message):
&#34;&#34;&#34;raise an exception for things that needs to be fixed&#34;&#34;&#34;
raise Exception(f&#34;FIXME: {message}&#34;)</code></pre>
</details>
</dd>
@@ -218,6 +228,7 @@ class DeferredExecution():
self.thread.start()
def queueWork(self, runnable):
&#34;&#34;&#34; Queue up the work&#34;&#34;&#34;
self.queue.put(runnable)
def _run(self):
@@ -236,12 +247,13 @@ class DeferredExecution():
<span>def <span class="ident">queueWork</span></span>(<span>self, runnable)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Queue up the work</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def queueWork(self, runnable):
&#34;&#34;&#34; Queue up the work&#34;&#34;&#34;
self.queue.put(runnable)</code></pre>
</details>
</dd>
@@ -252,12 +264,13 @@ class DeferredExecution():
<span>(</span><span>maxSecs=20)</span>
</code></dt>
<dd>
<div class="desc"></div>
<div class="desc"><p>Timeout class</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class Timeout:
&#34;&#34;&#34;Timeout class&#34;&#34;&#34;
def __init__(self, maxSecs=20):
self.expireTime = 0
self.sleepInterval = 0.1