From 171c79b414fa8adb7d80c5f68abd18699530743c Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 3 Mar 2021 11:21:37 +0800 Subject: [PATCH] 1.2.0 release to pypi --- docs/meshtastic/admin_pb2.html | 277 +++++ docs/meshtastic/apponly_pb2.html | 85 +- docs/meshtastic/channel_pb2.html | 504 ++++++++ docs/meshtastic/deviceonly_pb2.html | 28 +- docs/meshtastic/index.html | 967 ++++++++++----- docs/meshtastic/mesh_pb2.html | 1710 +++++--------------------- docs/meshtastic/portnums_pb2.html | 38 +- docs/meshtastic/radioconfig_pb2.html | 815 ++++++++++++ docs/meshtastic/test.html | 33 +- docs/meshtastic/tunnel.html | 150 ++- docs/meshtastic/util.html | 44 + 11 files changed, 2848 insertions(+), 1803 deletions(-) create mode 100644 docs/meshtastic/admin_pb2.html create mode 100644 docs/meshtastic/channel_pb2.html create mode 100644 docs/meshtastic/radioconfig_pb2.html diff --git a/docs/meshtastic/admin_pb2.html b/docs/meshtastic/admin_pb2.html new file mode 100644 index 0000000..46d9221 --- /dev/null +++ b/docs/meshtastic/admin_pb2.html @@ -0,0 +1,277 @@ + + + + + + +meshtastic.admin_pb2 API documentation + + + + + + + + + + + +
+
+
+

Module meshtastic.admin_pb2

+
+
+

Generated protocol buffer code.

+
+ +Expand source code + +
# -*- coding: utf-8 -*-
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: admin.proto
+"""Generated protocol buffer code."""
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import mesh_pb2 as mesh__pb2
+from . import radioconfig_pb2 as radioconfig__pb2
+from . import channel_pb2 as channel__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='admin.proto',
+  package='',
+  syntax='proto3',
+  serialized_options=b'\n\023com.geeksville.meshB\013AdminProtosH\003',
+  create_key=_descriptor._internal_create_key,
+  serialized_pb=b'\n\x0b\x61\x64min.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\x1a\rchannel.proto\"\x8b\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\x42\t\n\x07variantB$\n\x13\x63om.geeksville.meshB\x0b\x41\x64minProtosH\x03\x62\x06proto3'
+  ,
+  dependencies=[mesh__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,channel__pb2.DESCRIPTOR,])
+
+
+
+
+_ADMINMESSAGE = _descriptor.Descriptor(
+  name='AdminMessage',
+  full_name='AdminMessage',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  create_key=_descriptor._internal_create_key,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='set_radio', full_name='AdminMessage.set_radio', index=0,
+      number=1, 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,  create_key=_descriptor._internal_create_key),
+    _descriptor.FieldDescriptor(
+      name='set_owner', full_name='AdminMessage.set_owner', 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,  create_key=_descriptor._internal_create_key),
+    _descriptor.FieldDescriptor(
+      name='set_channel', full_name='AdminMessage.set_channel', 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,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
+    _descriptor.FieldDescriptor(
+      name='get_radio_request', full_name='AdminMessage.get_radio_request', index=3,
+      number=4, 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,  create_key=_descriptor._internal_create_key),
+    _descriptor.FieldDescriptor(
+      name='get_radio_response', full_name='AdminMessage.get_radio_response', index=4,
+      number=5, 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,  create_key=_descriptor._internal_create_key),
+    _descriptor.FieldDescriptor(
+      name='get_channel_request', full_name='AdminMessage.get_channel_request', 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,  create_key=_descriptor._internal_create_key),
+    _descriptor.FieldDescriptor(
+      name='get_channel_response', full_name='AdminMessage.get_channel_response', index=6,
+      number=7, 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,  create_key=_descriptor._internal_create_key),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto3',
+  extension_ranges=[],
+  oneofs=[
+    _descriptor.OneofDescriptor(
+      name='variant', full_name='AdminMessage.variant',
+      index=0, containing_type=None,
+      create_key=_descriptor._internal_create_key,
+    fields=[]),
+  ],
+  serialized_start=62,
+  serialized_end=329,
+)
+
+_ADMINMESSAGE.fields_by_name['set_radio'].message_type = radioconfig__pb2._RADIOCONFIG
+_ADMINMESSAGE.fields_by_name['set_owner'].message_type = mesh__pb2._USER
+_ADMINMESSAGE.fields_by_name['set_channel'].message_type = channel__pb2._CHANNEL
+_ADMINMESSAGE.fields_by_name['get_radio_response'].message_type = radioconfig__pb2._RADIOCONFIG
+_ADMINMESSAGE.fields_by_name['get_channel_response'].message_type = channel__pb2._CHANNEL
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+  _ADMINMESSAGE.fields_by_name['set_radio'])
+_ADMINMESSAGE.fields_by_name['set_radio'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+  _ADMINMESSAGE.fields_by_name['set_owner'])
+_ADMINMESSAGE.fields_by_name['set_owner'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+  _ADMINMESSAGE.fields_by_name['set_channel'])
+_ADMINMESSAGE.fields_by_name['set_channel'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+  _ADMINMESSAGE.fields_by_name['get_radio_request'])
+_ADMINMESSAGE.fields_by_name['get_radio_request'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+  _ADMINMESSAGE.fields_by_name['get_radio_response'])
+_ADMINMESSAGE.fields_by_name['get_radio_response'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+  _ADMINMESSAGE.fields_by_name['get_channel_request'])
+_ADMINMESSAGE.fields_by_name['get_channel_request'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+_ADMINMESSAGE.oneofs_by_name['variant'].fields.append(
+  _ADMINMESSAGE.fields_by_name['get_channel_response'])
+_ADMINMESSAGE.fields_by_name['get_channel_response'].containing_oneof = _ADMINMESSAGE.oneofs_by_name['variant']
+DESCRIPTOR.message_types_by_name['AdminMessage'] = _ADMINMESSAGE
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+AdminMessage = _reflection.GeneratedProtocolMessageType('AdminMessage', (_message.Message,), {
+  'DESCRIPTOR' : _ADMINMESSAGE,
+  '__module__' : 'admin_pb2'
+  # @@protoc_insertion_point(class_scope:AdminMessage)
+  })
+_sym_db.RegisterMessage(AdminMessage)
+
+
+DESCRIPTOR._options = None
+# @@protoc_insertion_point(module_scope)
+
+
+
+
+
+
+
+
+
+

Classes

+
+
+class AdminMessage +(*args, **kwargs) +
+
+

A ProtocolMessage

+

Ancestors

+
    +
  • google.protobuf.pyext._message.CMessage
  • +
  • google.protobuf.message.Message
  • +
+

Class variables

+
+
var DESCRIPTOR
+
+
+
+
+

Instance variables

+
+
var get_channel_request
+
+

Field AdminMessage.get_channel_request

+
+
var get_channel_response
+
+

Field AdminMessage.get_channel_response

+
+
var get_radio_request
+
+

Field AdminMessage.get_radio_request

+
+
var get_radio_response
+
+

Field AdminMessage.get_radio_response

+
+
var set_channel
+
+

Field AdminMessage.set_channel

+
+
var set_owner
+
+

Field AdminMessage.set_owner

+
+
var set_radio
+
+

Field AdminMessage.set_radio

+
+
+
+
+
+
+ +
+ + + \ No newline at end of file diff --git a/docs/meshtastic/apponly_pb2.html b/docs/meshtastic/apponly_pb2.html index 879f970..ba968d5 100644 --- a/docs/meshtastic/apponly_pb2.html +++ b/docs/meshtastic/apponly_pb2.html @@ -41,17 +41,18 @@ _sym_db = _symbol_database.Default() from . import mesh_pb2 as mesh__pb2 +from . import channel_pb2 as channel__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='apponly.proto', package='', syntax='proto3', - serialized_options=b'\n\023com.geeksville.meshB\007AppOnlyH\003', + serialized_options=b'\n\023com.geeksville.meshB\rAppOnlyProtosH\003', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\rapponly.proto\x1a\nmesh.proto\"V\n\x0fServiceEnvelope\x12\x1b\n\x06packet\x18\x01 \x01(\x0b\x32\x0b.MeshPacket\x12\x12\n\nchannel_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\tB \n\x13\x63om.geeksville.meshB\x07\x41ppOnlyH\x03\x62\x06proto3' + serialized_pb=b'\n\rapponly.proto\x1a\nmesh.proto\x1a\rchannel.proto\"V\n\x0fServiceEnvelope\x12\x1b\n\x06packet\x18\x01 \x01(\x0b\x32\x0b.MeshPacket\x12\x12\n\nchannel_id\x18\x02 \x01(\t\x12\x12\n\ngateway_id\x18\x03 \x01(\t\"0\n\nChannelSet\x12\"\n\x08settings\x18\x01 \x03(\x0b\x32\x10.ChannelSettingsB&\n\x13\x63om.geeksville.meshB\rAppOnlyProtosH\x03\x62\x06proto3' , - dependencies=[mesh__pb2.DESCRIPTOR,]) + dependencies=[mesh__pb2.DESCRIPTOR,channel__pb2.DESCRIPTOR,]) @@ -97,12 +98,46 @@ _SERVICEENVELOPE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=29, - serialized_end=115, + serialized_start=44, + serialized_end=130, +) + + +_CHANNELSET = _descriptor.Descriptor( + name='ChannelSet', + full_name='ChannelSet', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='settings', full_name='ChannelSet.settings', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=132, + serialized_end=180, ) _SERVICEENVELOPE.fields_by_name['packet'].message_type = mesh__pb2._MESHPACKET +_CHANNELSET.fields_by_name['settings'].message_type = channel__pb2._CHANNELSETTINGS DESCRIPTOR.message_types_by_name['ServiceEnvelope'] = _SERVICEENVELOPE +DESCRIPTOR.message_types_by_name['ChannelSet'] = _CHANNELSET _sym_db.RegisterFileDescriptor(DESCRIPTOR) ServiceEnvelope = _reflection.GeneratedProtocolMessageType('ServiceEnvelope', (_message.Message,), { @@ -112,6 +147,13 @@ ServiceEnvelope = _reflection.GeneratedProtocolMessageType('ServiceEnvelope& }) _sym_db.RegisterMessage(ServiceEnvelope) +ChannelSet = _reflection.GeneratedProtocolMessageType('ChannelSet', (_message.Message,), { + 'DESCRIPTOR' : _CHANNELSET, + '__module__' : 'apponly_pb2' + # @@protoc_insertion_point(class_scope:ChannelSet) + }) +_sym_db.RegisterMessage(ChannelSet) + DESCRIPTOR._options = None # @@protoc_insertion_point(module_scope) @@ -126,6 +168,32 @@ DESCRIPTOR._options = None

Classes

+
+class ChannelSet +(*args, **kwargs) +
+
+

A ProtocolMessage

+

Ancestors

+
    +
  • google.protobuf.pyext._message.CMessage
  • +
  • google.protobuf.message.Message
  • +
+

Class variables

+
+
var DESCRIPTOR
+
+
+
+
+

Instance variables

+
+
var settings
+
+

Field ChannelSet.settings

+
+
+
class ServiceEnvelope (*args, **kwargs) @@ -177,6 +245,13 @@ DESCRIPTOR._options = None
  • Classes

    • +

      ChannelSet

      + +
    • +
    • ServiceEnvelope

      • DESCRIPTOR
      • diff --git a/docs/meshtastic/channel_pb2.html b/docs/meshtastic/channel_pb2.html new file mode 100644 index 0000000..cd9b0b7 --- /dev/null +++ b/docs/meshtastic/channel_pb2.html @@ -0,0 +1,504 @@ + + + + + + +meshtastic.channel_pb2 API documentation + + + + + + + + + + + +
        +
        +
        +

        Module meshtastic.channel_pb2

        +
        +
        +

        Generated protocol buffer code.

        +
        + +Expand source code + +
        # -*- coding: utf-8 -*-
        +# Generated by the protocol buffer compiler.  DO NOT EDIT!
        +# source: channel.proto
        +"""Generated protocol buffer code."""
        +from google.protobuf import descriptor as _descriptor
        +from google.protobuf import message as _message
        +from google.protobuf import reflection as _reflection
        +from google.protobuf import symbol_database as _symbol_database
        +# @@protoc_insertion_point(imports)
        +
        +_sym_db = _symbol_database.Default()
        +
        +
        +
        +
        +DESCRIPTOR = _descriptor.FileDescriptor(
        +  name='channel.proto',
        +  package='',
        +  syntax='proto3',
        +  serialized_options=b'\n\023com.geeksville.meshB\rChannelProtosH\003',
        +  create_key=_descriptor._internal_create_key,
        +  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(\r\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\x42&\n\x13\x63om.geeksville.meshB\rChannelProtosH\x03\x62\x06proto3'
        +)
        +
        +
        +
        +_CHANNELSETTINGS_MODEMCONFIG = _descriptor.EnumDescriptor(
        +  name='ModemConfig',
        +  full_name='ChannelSettings.ModemConfig',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  create_key=_descriptor._internal_create_key,
        +  values=[
        +    _descriptor.EnumValueDescriptor(
        +      name='Bw125Cr45Sf128', index=0, number=0,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='Bw500Cr45Sf128', index=1, number=1,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='Bw31_25Cr48Sf512', index=2, number=2,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='Bw125Cr48Sf4096', index=3, number=3,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +  ],
        +  containing_type=None,
        +  serialized_options=None,
        +  serialized_start=280,
        +  serialized_end=376,
        +)
        +_sym_db.RegisterEnumDescriptor(_CHANNELSETTINGS_MODEMCONFIG)
        +
        +_CHANNEL_ROLE = _descriptor.EnumDescriptor(
        +  name='Role',
        +  full_name='Channel.Role',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  create_key=_descriptor._internal_create_key,
        +  values=[
        +    _descriptor.EnumValueDescriptor(
        +      name='DISABLED', index=0, number=0,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='PRIMARY', index=1, number=1,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='SECONDARY', index=2, number=2,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +  ],
        +  containing_type=None,
        +  serialized_options=None,
        +  serialized_start=470,
        +  serialized_end=518,
        +)
        +_sym_db.RegisterEnumDescriptor(_CHANNEL_ROLE)
        +
        +
        +_CHANNELSETTINGS = _descriptor.Descriptor(
        +  name='ChannelSettings',
        +  full_name='ChannelSettings',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  containing_type=None,
        +  create_key=_descriptor._internal_create_key,
        +  fields=[
        +    _descriptor.FieldDescriptor(
        +      name='tx_power', full_name='ChannelSettings.tx_power', index=0,
        +      number=1, type=5, cpp_type=1, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='modem_config', full_name='ChannelSettings.modem_config', index=1,
        +      number=3, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='bandwidth', full_name='ChannelSettings.bandwidth', index=2,
        +      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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='spread_factor', full_name='ChannelSettings.spread_factor', index=3,
        +      number=7, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='coding_rate', full_name='ChannelSettings.coding_rate', index=4,
        +      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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='channel_num', full_name='ChannelSettings.channel_num', index=5,
        +      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,
        +      is_extension=False, extension_scope=None,
        +      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='psk', full_name='ChannelSettings.psk', index=6,
        +      number=4, type=12, cpp_type=9, label=1,
        +      has_default_value=False, default_value=b"",
        +      message_type=None, enum_type=None, containing_type=None,
        +      is_extension=False, extension_scope=None,
        +      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='name', full_name='ChannelSettings.name', index=7,
        +      number=5, type=9, cpp_type=9, label=1,
        +      has_default_value=False, default_value=b"".decode('utf-8'),
        +      message_type=None, enum_type=None, containing_type=None,
        +      is_extension=False, extension_scope=None,
        +      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='id', full_name='ChannelSettings.id', index=8,
        +      number=10, type=7, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='uplink_enabled', full_name='ChannelSettings.uplink_enabled', index=9,
        +      number=16, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='downlink_enabled', full_name='ChannelSettings.downlink_enabled', index=10,
        +      number=17, 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,  create_key=_descriptor._internal_create_key),
        +  ],
        +  extensions=[
        +  ],
        +  nested_types=[],
        +  enum_types=[
        +    _CHANNELSETTINGS_MODEMCONFIG,
        +  ],
        +  serialized_options=None,
        +  is_extendable=False,
        +  syntax='proto3',
        +  extension_ranges=[],
        +  oneofs=[
        +  ],
        +  serialized_start=18,
        +  serialized_end=376,
        +)
        +
        +
        +_CHANNEL = _descriptor.Descriptor(
        +  name='Channel',
        +  full_name='Channel',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  containing_type=None,
        +  create_key=_descriptor._internal_create_key,
        +  fields=[
        +    _descriptor.FieldDescriptor(
        +      name='index', full_name='Channel.index', 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='settings', full_name='Channel.settings', 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='role', full_name='Channel.role', index=2,
        +      number=3, 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,  create_key=_descriptor._internal_create_key),
        +  ],
        +  extensions=[
        +  ],
        +  nested_types=[],
        +  enum_types=[
        +    _CHANNEL_ROLE,
        +  ],
        +  serialized_options=None,
        +  is_extendable=False,
        +  syntax='proto3',
        +  extension_ranges=[],
        +  oneofs=[
        +  ],
        +  serialized_start=379,
        +  serialized_end=518,
        +)
        +
        +_CHANNELSETTINGS.fields_by_name['modem_config'].enum_type = _CHANNELSETTINGS_MODEMCONFIG
        +_CHANNELSETTINGS_MODEMCONFIG.containing_type = _CHANNELSETTINGS
        +_CHANNEL.fields_by_name['settings'].message_type = _CHANNELSETTINGS
        +_CHANNEL.fields_by_name['role'].enum_type = _CHANNEL_ROLE
        +_CHANNEL_ROLE.containing_type = _CHANNEL
        +DESCRIPTOR.message_types_by_name['ChannelSettings'] = _CHANNELSETTINGS
        +DESCRIPTOR.message_types_by_name['Channel'] = _CHANNEL
        +_sym_db.RegisterFileDescriptor(DESCRIPTOR)
        +
        +ChannelSettings = _reflection.GeneratedProtocolMessageType('ChannelSettings', (_message.Message,), {
        +  'DESCRIPTOR' : _CHANNELSETTINGS,
        +  '__module__' : 'channel_pb2'
        +  # @@protoc_insertion_point(class_scope:ChannelSettings)
        +  })
        +_sym_db.RegisterMessage(ChannelSettings)
        +
        +Channel = _reflection.GeneratedProtocolMessageType('Channel', (_message.Message,), {
        +  'DESCRIPTOR' : _CHANNEL,
        +  '__module__' : 'channel_pb2'
        +  # @@protoc_insertion_point(class_scope:Channel)
        +  })
        +_sym_db.RegisterMessage(Channel)
        +
        +
        +DESCRIPTOR._options = None
        +# @@protoc_insertion_point(module_scope)
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +

        Classes

        +
        +
        +class Channel +(*args, **kwargs) +
        +
        +

        A ProtocolMessage

        +

        Ancestors

        +
          +
        • google.protobuf.pyext._message.CMessage
        • +
        • google.protobuf.message.Message
        • +
        +

        Class variables

        +
        +
        var DESCRIPTOR
        +
        +
        +
        +
        var DISABLED
        +
        +
        +
        +
        var PRIMARY
        +
        +
        +
        +
        var Role
        +
        +
        +
        +
        var SECONDARY
        +
        +
        +
        +
        +

        Instance variables

        +
        +
        var index
        +
        +

        Field Channel.index

        +
        +
        var role
        +
        +

        Field Channel.role

        +
        +
        var settings
        +
        +

        Field Channel.settings

        +
        +
        +
        +
        +class ChannelSettings +(*args, **kwargs) +
        +
        +

        A ProtocolMessage

        +

        Ancestors

        +
          +
        • google.protobuf.pyext._message.CMessage
        • +
        • google.protobuf.message.Message
        • +
        +

        Class variables

        +
        +
        var Bw125Cr45Sf128
        +
        +
        +
        +
        var Bw125Cr48Sf4096
        +
        +
        +
        +
        var Bw31_25Cr48Sf512
        +
        +
        +
        +
        var Bw500Cr45Sf128
        +
        +
        +
        +
        var DESCRIPTOR
        +
        +
        +
        +
        var ModemConfig
        +
        +
        +
        +
        +

        Instance variables

        +
        +
        var bandwidth
        +
        +

        Field ChannelSettings.bandwidth

        +
        +
        var channel_num
        +
        +

        Field ChannelSettings.channel_num

        +
        +
        var coding_rate
        +
        +

        Field ChannelSettings.coding_rate

        +
        + +
        +

        Field ChannelSettings.downlink_enabled

        +
        +
        var id
        +
        +

        Field ChannelSettings.id

        +
        +
        var modem_config
        +
        +

        Field ChannelSettings.modem_config

        +
        +
        var name
        +
        +

        Field ChannelSettings.name

        +
        +
        var psk
        +
        +

        Field ChannelSettings.psk

        +
        +
        var spread_factor
        +
        +

        Field ChannelSettings.spread_factor

        +
        +
        var tx_power
        +
        +

        Field ChannelSettings.tx_power

        +
        + +
        +

        Field ChannelSettings.uplink_enabled

        +
        +
        +
        +
        +
        +
        + +
        + + + \ No newline at end of file diff --git a/docs/meshtastic/deviceonly_pb2.html b/docs/meshtastic/deviceonly_pb2.html index 40933a4..e9b1ec6 100644 --- a/docs/meshtastic/deviceonly_pb2.html +++ b/docs/meshtastic/deviceonly_pb2.html @@ -41,6 +41,8 @@ _sym_db = _symbol_database.Default() 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 +51,9 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=b'\n\023com.geeksville.meshB\nDeviceOnlyH\003', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x10\x64\x65viceonly.proto\x1a\nmesh.proto\"\xab\x02\n\x0b\x44\x65viceState\x12\x1b\n\x05radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfig\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\"\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(\x08\x12,\n\x12secondary_channels\x18\x0c \x03(\x0b\x32\x10.ChannelSettingsB#\n\x13\x63om.geeksville.meshB\nDeviceOnlyH\x03\x62\x06proto3' + serialized_pb=b'\n\x10\x64\x65viceonly.proto\x1a\nmesh.proto\x1a\x11radioconfig.proto\x1a\rchannel.proto\"\x9f\x02\n\x0b\x44\x65viceState\x12\x1b\n\x05radio\x18\x01 \x01(\x0b\x32\x0c.RadioConfig\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\"\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(\x08\x12\x1a\n\x08\x63hannels\x18\r \x03(\x0b\x32\x08.ChannelJ\x04\x08\x0c\x10\rB#\n\x13\x63om.geeksville.meshB\nDeviceOnlyH\x03\x62\x06proto3' , - dependencies=[mesh__pb2.DESCRIPTOR,]) + dependencies=[mesh__pb2.DESCRIPTOR,radioconfig__pb2.DESCRIPTOR,channel__pb2.DESCRIPTOR,]) @@ -128,8 +130,8 @@ _DEVICESTATE = _descriptor.Descriptor( is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='secondary_channels', full_name='DeviceState.secondary_channels', index=9, - number=12, type=11, cpp_type=10, label=3, + name='channels', full_name='DeviceState.channels', index=9, + number=13, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -146,17 +148,17 @@ _DEVICESTATE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=33, - serialized_end=332, + serialized_start=67, + serialized_end=354, ) -_DEVICESTATE.fields_by_name['radio'].message_type = mesh__pb2._RADIOCONFIG +_DEVICESTATE.fields_by_name['radio'].message_type = radioconfig__pb2._RADIOCONFIG _DEVICESTATE.fields_by_name['my_node'].message_type = mesh__pb2._MYNODEINFO _DEVICESTATE.fields_by_name['owner'].message_type = mesh__pb2._USER _DEVICESTATE.fields_by_name['node_db'].message_type = mesh__pb2._NODEINFO _DEVICESTATE.fields_by_name['receive_queue'].message_type = mesh__pb2._MESHPACKET _DEVICESTATE.fields_by_name['rx_text_message'].message_type = mesh__pb2._MESHPACKET -_DEVICESTATE.fields_by_name['secondary_channels'].message_type = mesh__pb2._CHANNELSETTINGS +_DEVICESTATE.fields_by_name['channels'].message_type = channel__pb2._CHANNEL DESCRIPTOR.message_types_by_name['DeviceState'] = _DEVICESTATE _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -201,6 +203,10 @@ DESCRIPTOR._options = None
  • Instance variables

    +
    var channels
    +
    +

    Field DeviceState.channels

    +
    var did_gps_reset

    Field DeviceState.did_gps_reset

    @@ -233,10 +239,6 @@ DESCRIPTOR._options = None

    Field DeviceState.rx_text_message

    -
    var secondary_channels
    -
    -

    Field DeviceState.secondary_channels

    -
    var version

    Field DeviceState.version

    @@ -263,6 +265,7 @@ DESCRIPTOR._options = None

    DeviceState

    diff --git a/docs/meshtastic/index.html b/docs/meshtastic/index.html index 55c5cdd..485594d 100644 --- a/docs/meshtastic/index.html +++ b/docs/meshtastic/index.html @@ -142,13 +142,23 @@ interface = meshtastic.SerialInterface() """ -import socket import pygatt import google.protobuf.json_format -import serial, threading, logging, sys, random, traceback, time, base64, platform -from . import mesh_pb2, portnums_pb2, util +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 from pubsub import pub from dotmap import DotMap +from typing import * START1 = 0x94 START2 = 0xc3 @@ -166,7 +176,25 @@ MY_CONFIG_ID = 42 format is Mmmss (where M is 1+the numeric major number. i.e. 20120 means 1.1.20 """ -OUR_APP_VERSION = 20120 +OUR_APP_VERSION = 20200 + + +class ResponseHandler(NamedTuple): + """A pending response callback, waiting for a response to one of our messages""" + # requestId: int - used only as a key + callback: Callable + # FIXME, add timestamp and age out old requests + + +class KnownProtocol(NamedTuple): + """Used to automatically decode known protocol payloads""" + name: str + # portnum: int, now a key + # If set, will be called to prase as a protocol buffer + protobufFactory: Callable = None + # If set, invoked as onReceive(interface, packet) + onReceive: Callable = None + class MeshInterface: """Interface class for meshtastic devices @@ -188,7 +216,10 @@ class MeshInterface: self.nodes = None # FIXME self.isConnected = threading.Event() self.noProto = noProto - random.seed() # FIXME, we should not clobber the random seedval here, instead tell user they must call it + self.myInfo = None # We don't have device info yet + self.responseHandlers = {} # A map from request ID to the handler + self.failure = None # If we've encountered a fatal exception it will be kept here + random.seed() # FIXME, we should not clobber the random seedval here, instead tell user they must call it self.currentPacketId = random.randint(0, 0xffffffff) self._startConfig() @@ -197,12 +228,17 @@ class MeshInterface: def __exit__(self, exc_type, exc_value, traceback): if exc_type is not None and exc_value is not None: - logging.error(f'An exception of type {exc_type} with value {exc_value} has occurred') + logging.error( + f'An exception of type {exc_type} with value {exc_value} has occurred') if traceback is not None: logging.error(f'Traceback: {traceback}') self.close() - def sendText(self, text, destinationId=BROADCAST_ADDR, wantAck=False, wantResponse=False): + def sendText(self, text: AnyStr, + destinationId=BROADCAST_ADDR, + wantAck=False, + wantResponse=False, + onResponse=None): """Send a utf8 string to some other node, if the node has a display it will also be shown on the device. Arguments: @@ -212,13 +248,20 @@ class MeshInterface: destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR}) 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 Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. """ return self.sendData(text.encode("utf-8"), destinationId, - portNum=portnums_pb2.PortNum.TEXT_MESSAGE_APP, wantAck=wantAck, wantResponse=wantResponse) + portNum=portnums_pb2.PortNum.TEXT_MESSAGE_APP, + wantAck=wantAck, + wantResponse=wantResponse, + onResponse=onResponse) - def sendData(self, data, destinationId=BROADCAST_ADDR, portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False, wantResponse=False): + def sendData(self, data, destinationId=BROADCAST_ADDR, + portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False, + wantResponse=False, + onResponse=None): """Send a data packet to some other node Keyword Arguments: @@ -226,6 +269,8 @@ class MeshInterface: destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR}) 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) Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. """ @@ -236,10 +281,14 @@ class MeshInterface: if len(data) > mesh_pb2.Constants.DATA_PAYLOAD_LEN: raise Exception("Data payload too big") meshPacket = mesh_pb2.MeshPacket() - meshPacket.decoded.data.payload = data - meshPacket.decoded.data.portnum = portNum + meshPacket.decoded.payload = data + meshPacket.decoded.portnum = portNum meshPacket.decoded.want_response = wantResponse - return self.sendPacket(meshPacket, destinationId, wantAck=wantAck) + + p = self._sendPacket(meshPacket, destinationId, wantAck=wantAck) + if onResponse is not None: + self._addResponseHandler(p.id, onResponse) + return p def sendPosition(self, latitude=0.0, longitude=0.0, altitude=0, timeSec=0, destinationId=BROADCAST_ADDR, wantAck=False, wantResponse=False): """ @@ -266,18 +315,29 @@ class MeshInterface: timeSec = time.time() # returns unix timestamp in seconds p.time = int(timeSec) - return self.sendData(p, destinationId, portNum=portnums_pb2.PortNum.POSITION_APP, wantAck=wantAck, wantResponse=wantResponse) + return self.sendData(p, destinationId, + portNum=portnums_pb2.PortNum.POSITION_APP, + wantAck=wantAck, + wantResponse=wantResponse) - def sendPacket(self, meshPacket, destinationId=BROADCAST_ADDR, wantAck=False): + def _addResponseHandler(self, requestId, callback): + self.responseHandlers[requestId] = ResponseHandler(callback) + + def _sendPacket(self, meshPacket, + destinationId=BROADCAST_ADDR, + wantAck=False): """Send a MeshPacket to the specified node (or if unspecified, broadcast). You probably don't want this - use sendData instead. - Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. + Returns the sent packet. The id field will be populated in this packet and + can be used to track future message acks/naks. """ - self._waitConnected() + + # We allow users to talk to the local node before we've completed the full connection flow... + if(self.myInfo is not None and destinationId != self.myInfo.my_node_num): + self._waitConnected() toRadio = mesh_pb2.ToRadio() - # FIXME add support for non broadcast addresses if destinationId is None: raise Exception("destinationId must not be None") @@ -300,7 +360,7 @@ class MeshInterface: self._sendToRadio(toRadio) return meshPacket - def waitForConfig(self, sleep=.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig')): + def waitForConfig(self, sleep=.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig', 'channels')): """Block until radio config is received. Returns True if config has been received.""" for _ in range(int(maxsecs/sleep)): if all(map(lambda a: getattr(self, a, None), attrs)): @@ -313,9 +373,12 @@ class MeshInterface: if self.radioConfig == None: raise Exception("No RadioConfig has been read") - t = mesh_pb2.ToRadio() - t.set_radio.CopyFrom(self.radioConfig) - self._sendToRadio(t) + p = admin_pb2.AdminMessage() + p.set_radio.CopyFrom(self.radioConfig) + + self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True) logging.debug("Wrote config") def getMyNodeInfo(self): @@ -358,43 +421,58 @@ class MeshInterface: short_name = long_name[0] + long_name[1:].translate(trans) if len(short_name) < nChars: short_name = long_name[:nChars] - t = mesh_pb2.ToRadio() + + p = admin_pb2.AdminMessage() + if long_name is not None: - t.set_owner.long_name = long_name + p.set_owner.long_name = long_name if short_name is not None: short_name = short_name.strip() if len(short_name) > nChars: short_name = short_name[:nChars] - t.set_owner.short_name = short_name - self._sendToRadio(t) + p.set_owner.short_name = short_name + + return self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True) @property def channelURL(self): """The sharable URL that describes the current channel """ - bytes = self.radioConfig.channel_settings.SerializeToString() + # Only keep the primary/secondary channels, assume primary is first + channelSet = apponly_pb2.ChannelSet() + for c in self.channels: + if c.role != channel_pb2.Channel.Role.DISABLED: + channelSet.settings.append(c.settings) + bytes = channelSet.SerializeToString() s = base64.urlsafe_b64encode(bytes).decode('ascii') - return f"https://www.meshtastic.org/c/#{s}" + return f"https://www.meshtastic.org/d/#{s}" - def setURL(self, url, write=True): + def setURL(self, url): """Set mesh network URL""" if self.radioConfig == None: raise Exception("No RadioConfig has been read") - # URLs are of the form https://www.meshtastic.org/c/#{base64_channel_settings} + # URLs are of the form https://www.meshtastic.org/d/#{base64_channel_set} # Split on '/#' to find the base64 encoded channel settings splitURL = url.split("/#") decodedURL = base64.urlsafe_b64decode(splitURL[-1]) - self.radioConfig.channel_settings.ParseFromString(decodedURL) - if write: - self.writeConfig() + channelSet = apponly_pb2.ChannelSet() + channelSet.ParseFromString(decodedURL) + fixme("set self.channels, see https://developers.google.com/protocol-buffers/docs/reference/python-generated?csw=1#repeated-fields") + self._writeChannels() def _waitConnected(self): """Block until the initial node db download is complete, or timeout and raise an exception""" - if not self.isConnected.wait(5.0): # timeout after 5 seconds + if not self.isConnected.wait(5.0): # timeout after 5 seconds raise Exception("Timed out waiting for connection completion") + # If we failed while connecting, raise the connection to the client + if self.failure: + raise self.failure + def _generatePacketId(self): """Get a new unique packet ID""" if self.currentPacketId is None: @@ -406,13 +484,15 @@ class MeshInterface: def _disconnected(self): """Called by subclasses to tell clients this interface has disconnected""" self.isConnected.clear() - pub.sendMessage("meshtastic.connection.lost", interface=self) + catchAndIgnore("disconnection publish", lambda: pub.sendMessage( + "meshtastic.connection.lost", interface=self)) def _connected(self): """Called by this class to tell clients we are now fully connected to a node """ self.isConnected.set() - pub.sendMessage("meshtastic.connection.established", interface=self) + catchAndIgnore("connection publish", lambda: pub.sendMessage( + "meshtastic.connection.established", interface=self)) def _startConfig(self): """Start device packets flowing""" @@ -420,6 +500,8 @@ class MeshInterface: self.nodes = {} # nodes keyed by ID self.nodesByNum = {} # nodes keyed by nodenum self.radioConfig = None + self.channels = None + self.partialChannels = [] # We keep our channels in a temp array until finished startConfig = mesh_pb2.ToRadio() startConfig.want_config_id = MY_CONFIG_ID # we don't use this value @@ -428,14 +510,69 @@ class MeshInterface: def _sendToRadio(self, toRadio): """Send a ToRadio protobuf to the device""" if self.noProto: - logging.warn(f"Not sending packet because protocol use is disabled by noProto") + logging.warn( + f"Not sending packet because protocol use is disabled by noProto") else: + logging.debug(f"Sending toRadio: {toRadio}") self._sendToRadioImpl(toRadio) def _sendToRadioImpl(self, toRadio): """Send a ToRadio protobuf to the device""" logging.error(f"Subclass must provide toradio: {toRadio}") + def _handleConfigComplete(self): + """ + Done with initial config messages, now send regular MeshPackets to ask for settings and channels + """ + self._requestSettings() + self._requestChannel(0) + + def _requestSettings(self): + """ + Done with initial config messages, now send regular MeshPackets to ask for settings + """ + p = admin_pb2.AdminMessage() + p.get_radio_request = True + + def onResponse(p): + """A closure to handle the response packet""" + self.radioConfig = p["decoded"]["admin"]["raw"].get_radio_response + + return self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True, + wantResponse=True, + onResponse=onResponse) + + def _requestChannel(self, channelNum: int): + """ + Done with initial config messages, now send regular MeshPackets to ask for settings + """ + p = admin_pb2.AdminMessage() + p.get_channel_request = channelNum + 1 + logging.debug(f"Requesting channel {channelNum}") + + def onResponse(p): + """A closure to handle the response packet""" + c = p["decoded"]["admin"]["raw"].get_channel_response + self.partialChannels.append(c) + logging.debug(f"Received channel {c}") + # for stress testing, download all channels + # if channelNum >= self.myInfo.max_channels - 1: + if c.role == channel_pb2.Channel.Role.DISABLED or channelNum >= self.myInfo.max_channels - 1: + # Once we see a response that has NO settings, assume we are at the end of channels and stop fetching + self.channels = self.partialChannels + # FIXME, the following should only be called after we have settings and channels + self._connected() # Tell everone else we are ready to go + else: + self._requestChannel(channelNum + 1) + + return self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True, + wantResponse=True, + onResponse=onResponse) + def _handleFromRadio(self, fromRadioBytes): """ Handle a packet that arrived from the radio(update model and publish events) @@ -447,12 +584,21 @@ class MeshInterface: logging.debug(f"Received: {asDict}") if fromRadio.HasField("my_info"): self.myInfo = fromRadio.my_info + + failmsg = None + # Check for app too old if self.myInfo.min_app_version > OUR_APP_VERSION: - raise Exception( - "This device needs a newer python client, please \"pip install --upgrade meshtastic\"") - # start assigning our packet IDs from the opposite side of where our local device is assigning them - elif fromRadio.HasField("radio"): - self.radioConfig = fromRadio.radio + failmsg = "This device needs a newer python client, please \"pip install --upgrade meshtastic\". For more information see https://tinyurl.com/5bjsxu32" + + # check for firmware too old + if self.myInfo.max_channels == 0: + failmsg = "This version of meshtastic-python requires device firmware version 1.2 or later. For more information see https://tinyurl.com/5bjsxu32" + + if failmsg: + self.failure = Exception(failmsg) + self.isConnected.set() # let waitConnected return this exception + self.close() + elif fromRadio.HasField("node_info"): node = asDict["nodeInfo"] try: @@ -462,10 +608,11 @@ class MeshInterface: self.nodesByNum[node["num"]] = node if "user" in node: # Some nodes might not have user/ids assigned yet self.nodes[node["user"]["id"]] = node - pub.sendMessage("meshtastic.node.updated", node=node, interface=self) + pub.sendMessage("meshtastic.node.updated", + node=node, interface=self) elif fromRadio.config_complete_id == MY_CONFIG_ID: # we ignore the config_complete_id, it is unneeded for our stream API fromRadio.config_complete_id - self._connected() + self._handleConfigComplete() elif fromRadio.HasField("packet"): self._handlePacketFromRadio(fromRadio.packet) elif fromRadio.rebooted: @@ -528,6 +675,12 @@ class MeshInterface: """ asDict = google.protobuf.json_format.MessageToDict(meshPacket) + + # We normally decompose the payload into a dictionary so that the client + # doesn't need to understand protobufs. But advanced clients might + # want the raw protobuf, so we provide it in "raw" + asDict["raw"] = meshPacket + # /add fromId and toId fields based on the node ID asDict["fromId"] = self._nodeNumToId(asDict["from"]) asDict["toId"] = self._nodeNumToId(asDict["to"]) @@ -536,68 +689,59 @@ class MeshInterface: # asObj = DotMap(asDict) topic = "meshtastic.receive" # Generic unknown packet type - # Warn users if firmware doesn't use new portnum based data encodings - # But do not crash, because the lib will still basically work and ignore those packet types - if meshPacket.decoded.HasField("user") or meshPacket.decoded.HasField("position"): - logging.warn("Ignoring old position/user message. Recommend you update firmware to 1.1.20 or later") + decoded = asDict["decoded"] + # The default MessageToDict converts byte arrays into base64 strings. + # We don't want that - it messes up data payload. So slam in the correct + # byte array. + decoded["payload"] = meshPacket.decoded.payload - if meshPacket.decoded.HasField("data"): + # UNKNOWN_APP is the default protobuf portnum value, and therefore if not set it will not be populated at all + # to make API usage easier, set it to prevent confusion + if not "portnum" in decoded: + decoded["portnum"] = portnums_pb2.PortNum.Name( + portnums_pb2.PortNum.UNKNOWN_APP) - # The default MessageToDict converts byte arrays into base64 strings. - # We don't want that - it messes up data payload. So slam in the correct - # byte array. - asDict["decoded"]["data"]["payload"] = meshPacket.decoded.data.payload + portnum = decoded["portnum"] - # UNKNOWN_APP is the default protobuf portnum value, and therefore if not set it will not be populated at all - # to make API usage easier, set it to prevent confusion - if not "portnum" in asDict["decoded"]["data"]: - asDict["decoded"]["data"]["portnum"] = portnums_pb2.PortNum.Name(portnums_pb2.PortNum.UNKNOWN_APP) + topic = f"meshtastic.receive.data.{portnum}" - portnum = asDict["decoded"]["data"]["portnum"] + # decode position protobufs and update nodedb, provide decoded version as "position" in the published msg + # move the following into a 'decoders' API that clients could register? + portNumInt = meshPacket.decoded.portnum # we want portnum as an int + handler = protocols.get(portNumInt) + # The decoded protobuf as a dictionary (if we understand this message) + p = None + if handler is not None: + topic = f"meshtastic.receive.{handler.name}" - topic = f"meshtastic.receive.data.{portnum}" - - # For text messages, we go ahead and decode the text to ascii for our users - if portnum == portnums_pb2.PortNum.Name(portnums_pb2.PortNum.TEXT_MESSAGE_APP): - topic = "meshtastic.receive.text" - - # We don't throw if the utf8 is invalid in the text message. Instead we just don't populate - # the decoded.data.text and we log an error message. This at least allows some delivery to - # the app and the app can deal with the missing decoded representation. - # - # Usually btw this problem is caused by apps sending binary data but setting the payload type to - # text. - try: - asDict["decoded"]["data"]["text"] = meshPacket.decoded.data.payload.decode("utf-8") - except Exception as ex: - logging.error(f"Malformatted utf8 in text message: {ex}") - - # decode position protobufs and update nodedb, provide decoded version as "position" in the published msg - if portnum == portnums_pb2.PortNum.Name(portnums_pb2.PortNum.POSITION_APP): - topic = "meshtastic.receive.position" - pb = mesh_pb2.Position() - pb.ParseFromString(meshPacket.decoded.data.payload) + # Convert to protobuf if possible + if handler.protobufFactory is not None: + pb = handler.protobufFactory() + pb.ParseFromString(meshPacket.decoded.payload) p = google.protobuf.json_format.MessageToDict(pb) - self._fixupPosition(p) - asDict["decoded"]["data"]["position"] = p - # update node DB as needed - self._getOrCreateByNum(asDict["from"])["position"] = p + asDict["decoded"][handler.name] = p + # Also provide the protobuf raw + asDict["decoded"][handler.name]["raw"] = pb - # decode user protobufs and update nodedb, provide decoded version as "position" in the published msg - if portnum == portnums_pb2.PortNum.Name(portnums_pb2.PortNum.NODEINFO_APP): - topic = "meshtastic.receive.user" - pb = mesh_pb2.User() - pb.ParseFromString(meshPacket.decoded.data.payload) - u = google.protobuf.json_format.MessageToDict(pb) - asDict["decoded"]["data"]["user"] = u - # update node DB as needed - n = self._getOrCreateByNum(asDict["from"]) - n["user"] = u - # We now have a node ID, make sure it is uptodate in that table - self.nodes[u["id"]] = n + # Call specialized onReceive if necessary + if handler.onReceive is not None: + handler.onReceive(self, asDict) + + # Is this message in response to a request, if so, look for a handler + requestId = decoded.get("requestId") + if requestId is not None: + # We ignore ACK packets, but send NAKs and data responses to the handlers + routing = decoded.get("routing") + isAck = routing is not None and ("errorReason" not in routing) + if not isAck: + # we keep the responseHandler in dict until we get a non ack + handler = self.responseHandlers.pop(requestId, None) + if handler is not None: + handler.callback(asDict) logging.debug(f"Publishing topic {topic}") - pub.sendMessage(topic, packet=asDict, interface=self) + catchAndIgnore(f"publishing {topic}", lambda: pub.sendMessage( + topic, packet=asDict, interface=self)) # Our standard BLE characteristics @@ -686,7 +830,7 @@ class StreamInterface(MeshInterface): time.sleep(0.1) # wait 100ms to give device time to start running self._rxThread.start() - if not self.noProto: # Wait for the db download if using the protocol + if not self.noProto: # Wait for the db download if using the protocol self._waitConnected() def _disconnected(self): @@ -772,13 +916,16 @@ class StreamInterface(MeshInterface): # logging.debug(f"timeout") pass except serial.SerialException as ex: - if not self._wantExit: # We might intentionally get an exception during shutdown - logging.warn(f"Meshtastic serial port disconnected, disconnecting... {ex}") + if not self._wantExit: # We might intentionally get an exception during shutdown + logging.warn( + f"Meshtastic serial port disconnected, disconnecting... {ex}") except OSError as ex: - if not self._wantExit: # We might intentionally get an exception during shutdown - logging.error(f"Unexpected OSError, terminating meshtastic reader... {ex}") + if not self._wantExit: # We might intentionally get an exception during shutdown + logging.error( + f"Unexpected OSError, terminating meshtastic reader... {ex}") except Exception as ex: - logging.error(f"Unexpected exception, terminating meshtastic reader... {ex}") + logging.error( + f"Unexpected exception, terminating meshtastic reader... {ex}") finally: logging.debug("reader is exiting") self._disconnected() @@ -826,10 +973,11 @@ class SerialInterface(StreamInterface): StreamInterface.__init__( self, debugOut=debugOut, noProto=noProto, connectNow=connectNow) + class TCPInterface(StreamInterface): """Interface class for meshtastic devices over a TCP link""" - def __init__(self, hostname, debugOut=None, noProto=False, connectNow=True, portNumber=4403): + def __init__(self, hostname: AnyStr, debugOut=None, noProto=False, connectNow=True, portNumber=4403): """Constructor, opens a connection to a specified IP address/hostname Keyword Arguments: @@ -852,9 +1000,9 @@ class TCPInterface(StreamInterface): def close(self): """Close a connection to the device""" logging.debug("Closing TCP stream") - # Sometimes the socket read might be blocked in the reader thread. Therefore we force the shutdown by closing + # Sometimes the socket read might be blocked in the reader thread. Therefore we force the shutdown by closing # the socket here - self._wantExit = True + self._wantExit = True if not self.socket is None: self.socket.shutdown(socket.SHUT_RDWR) self.socket.close() @@ -866,12 +1014,63 @@ class TCPInterface(StreamInterface): def _readBytes(self, len): """Read an array of bytes from our stream""" - return self.socket.recv(len)
    + return self.socket.recv(len) + + +def _onTextReceive(iface, asDict): + """Special text auto parsing for received messages""" + # We don't throw if the utf8 is invalid in the text message. Instead we just don't populate + # the decoded.data.text and we log an error message. This at least allows some delivery to + # the app and the app can deal with the missing decoded representation. + # + # Usually btw this problem is caused by apps sending binary data but setting the payload type to + # text. + try: + asDict["decoded"]["text"] = meshPacket.decoded.payload.decode( + "utf-8") + except Exception as ex: + logging.error(f"Malformatted utf8 in text message: {ex}") + + +def _onPositionReceive(iface, asDict): + """Special auto parsing for received messages""" + p = asDict["decoded"]["position"] + iface._fixupPosition(p) + # update node DB as needed + iface._getOrCreateByNum(asDict["from"])["position"] = p + + +def _onNodeInfoReceive(iface, asDict): + """Special auto parsing for received messages""" + p = asDict["decoded"]["user"] + # decode user protobufs and update nodedb, provide decoded version as "position" in the published msg + # update node DB as needed + n = iface._getOrCreateByNum(asDict["from"]) + n["user"] = p + # We now have a node ID, make sure it is uptodate in that table + iface.nodes[p["id"]] = n + + +"""Well known message payloads can register decoders for automatic protobuf parsing""" +protocols = { + portnums_pb2.PortNum.TEXT_MESSAGE_APP: KnownProtocol("text", onReceive=_onTextReceive), + portnums_pb2.PortNum.POSITION_APP: KnownProtocol("position", mesh_pb2.Position, _onPositionReceive), + portnums_pb2.PortNum.NODEINFO_APP: KnownProtocol("user", mesh_pb2.User, _onNodeInfoReceive), + portnums_pb2.PortNum.ADMIN_APP: KnownProtocol("admin", admin_pb2.AdminMessage), + portnums_pb2.PortNum.ROUTING_APP: KnownProtocol("routing", mesh_pb2.Routing), + portnums_pb2.PortNum.ENVIRONMENTAL_MEASUREMENT_APP: KnownProtocol("environmental", environmental_measurement_pb2.EnvironmentalMeasurement), + portnums_pb2.PortNum.REMOTE_HARDWARE_APP: KnownProtocol( + "remotehw", remote_hardware_pb2.HardwareMessage) +}

    Sub-modules

    +
    meshtastic.admin_pb2
    +
    +

    Generated protocol buffer code.

    +
    meshtastic.apponly_pb2

    Generated protocol buffer code.

    @@ -880,6 +1079,10 @@ class TCPInterface(StreamInterface):
    +
    meshtastic.channel_pb2
    +
    +

    Generated protocol buffer code.

    +
    meshtastic.deviceonly_pb2

    Generated protocol buffer code.

    @@ -896,6 +1099,10 @@ class TCPInterface(StreamInterface):

    Generated protocol buffer code.

    +
    meshtastic.radioconfig_pb2
    +
    +

    Generated protocol buffer code.

    +
    meshtastic.remote_hardware
    @@ -1009,7 +1216,6 @@ noProto – If True, don't try to run our protocol on the link - just be a d
    +
    +class KnownProtocol +(name: str, protobufFactory: Callable = None, onReceive: Callable = None) +
    +
    +

    Used to automatically decode known protocol payloads

    +
    + +Expand source code + +
    class KnownProtocol(NamedTuple):
    +    """Used to automatically decode known protocol payloads"""
    +    name: str
    +    # portnum: int, now a key
    +    # If set, will be called to prase as a protocol buffer
    +    protobufFactory: Callable = None
    +    # If set, invoked as onReceive(interface, packet)
    +    onReceive: Callable = None
    +
    +

    Ancestors

    +
      +
    • builtins.tuple
    • +
    +

    Instance variables

    +
    +
    var name : str
    +
    +

    Alias for field number 0

    +
    +
    var onReceive : Callable
    +
    +

    Alias for field number 2

    +
    +
    var protobufFactory : Callable
    +
    +

    Alias for field number 1

    +
    +
    +
    class MeshInterface (debugOut=None, noProto=False) @@ -1057,7 +1302,10 @@ noProto – If True, don't try to run our protocol on the link - just be a d self.nodes = None # FIXME self.isConnected = threading.Event() self.noProto = noProto - random.seed() # FIXME, we should not clobber the random seedval here, instead tell user they must call it + self.myInfo = None # We don't have device info yet + self.responseHandlers = {} # A map from request ID to the handler + self.failure = None # If we've encountered a fatal exception it will be kept here + random.seed() # FIXME, we should not clobber the random seedval here, instead tell user they must call it self.currentPacketId = random.randint(0, 0xffffffff) self._startConfig() @@ -1066,12 +1314,17 @@ noProto – If True, don't try to run our protocol on the link - just be a d def __exit__(self, exc_type, exc_value, traceback): if exc_type is not None and exc_value is not None: - logging.error(f'An exception of type {exc_type} with value {exc_value} has occurred') + logging.error( + f'An exception of type {exc_type} with value {exc_value} has occurred') if traceback is not None: logging.error(f'Traceback: {traceback}') self.close() - def sendText(self, text, destinationId=BROADCAST_ADDR, wantAck=False, wantResponse=False): + def sendText(self, text: AnyStr, + destinationId=BROADCAST_ADDR, + wantAck=False, + wantResponse=False, + onResponse=None): """Send a utf8 string to some other node, if the node has a display it will also be shown on the device. Arguments: @@ -1081,13 +1334,20 @@ noProto – If True, don't try to run our protocol on the link - just be a d destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR}) 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 Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. """ return self.sendData(text.encode("utf-8"), destinationId, - portNum=portnums_pb2.PortNum.TEXT_MESSAGE_APP, wantAck=wantAck, wantResponse=wantResponse) + portNum=portnums_pb2.PortNum.TEXT_MESSAGE_APP, + wantAck=wantAck, + wantResponse=wantResponse, + onResponse=onResponse) - def sendData(self, data, destinationId=BROADCAST_ADDR, portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False, wantResponse=False): + def sendData(self, data, destinationId=BROADCAST_ADDR, + portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False, + wantResponse=False, + onResponse=None): """Send a data packet to some other node Keyword Arguments: @@ -1095,6 +1355,8 @@ noProto – If True, don't try to run our protocol on the link - just be a d destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR}) 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) Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. """ @@ -1105,10 +1367,14 @@ noProto – If True, don't try to run our protocol on the link - just be a d if len(data) > mesh_pb2.Constants.DATA_PAYLOAD_LEN: raise Exception("Data payload too big") meshPacket = mesh_pb2.MeshPacket() - meshPacket.decoded.data.payload = data - meshPacket.decoded.data.portnum = portNum + meshPacket.decoded.payload = data + meshPacket.decoded.portnum = portNum meshPacket.decoded.want_response = wantResponse - return self.sendPacket(meshPacket, destinationId, wantAck=wantAck) + + p = self._sendPacket(meshPacket, destinationId, wantAck=wantAck) + if onResponse is not None: + self._addResponseHandler(p.id, onResponse) + return p def sendPosition(self, latitude=0.0, longitude=0.0, altitude=0, timeSec=0, destinationId=BROADCAST_ADDR, wantAck=False, wantResponse=False): """ @@ -1135,18 +1401,29 @@ noProto – If True, don't try to run our protocol on the link - just be a d timeSec = time.time() # returns unix timestamp in seconds p.time = int(timeSec) - return self.sendData(p, destinationId, portNum=portnums_pb2.PortNum.POSITION_APP, wantAck=wantAck, wantResponse=wantResponse) + return self.sendData(p, destinationId, + portNum=portnums_pb2.PortNum.POSITION_APP, + wantAck=wantAck, + wantResponse=wantResponse) - def sendPacket(self, meshPacket, destinationId=BROADCAST_ADDR, wantAck=False): + def _addResponseHandler(self, requestId, callback): + self.responseHandlers[requestId] = ResponseHandler(callback) + + def _sendPacket(self, meshPacket, + destinationId=BROADCAST_ADDR, + wantAck=False): """Send a MeshPacket to the specified node (or if unspecified, broadcast). You probably don't want this - use sendData instead. - Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. + Returns the sent packet. The id field will be populated in this packet and + can be used to track future message acks/naks. """ - self._waitConnected() + + # We allow users to talk to the local node before we've completed the full connection flow... + if(self.myInfo is not None and destinationId != self.myInfo.my_node_num): + self._waitConnected() toRadio = mesh_pb2.ToRadio() - # FIXME add support for non broadcast addresses if destinationId is None: raise Exception("destinationId must not be None") @@ -1169,7 +1446,7 @@ noProto – If True, don't try to run our protocol on the link - just be a d self._sendToRadio(toRadio) return meshPacket - def waitForConfig(self, sleep=.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig')): + def waitForConfig(self, sleep=.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig', 'channels')): """Block until radio config is received. Returns True if config has been received.""" for _ in range(int(maxsecs/sleep)): if all(map(lambda a: getattr(self, a, None), attrs)): @@ -1182,9 +1459,12 @@ noProto – If True, don't try to run our protocol on the link - just be a d if self.radioConfig == None: raise Exception("No RadioConfig has been read") - t = mesh_pb2.ToRadio() - t.set_radio.CopyFrom(self.radioConfig) - self._sendToRadio(t) + p = admin_pb2.AdminMessage() + p.set_radio.CopyFrom(self.radioConfig) + + self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True) logging.debug("Wrote config") def getMyNodeInfo(self): @@ -1227,43 +1507,58 @@ noProto – If True, don't try to run our protocol on the link - just be a d short_name = long_name[0] + long_name[1:].translate(trans) if len(short_name) < nChars: short_name = long_name[:nChars] - t = mesh_pb2.ToRadio() + + p = admin_pb2.AdminMessage() + if long_name is not None: - t.set_owner.long_name = long_name + p.set_owner.long_name = long_name if short_name is not None: short_name = short_name.strip() if len(short_name) > nChars: short_name = short_name[:nChars] - t.set_owner.short_name = short_name - self._sendToRadio(t) + p.set_owner.short_name = short_name + + return self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True) @property def channelURL(self): """The sharable URL that describes the current channel """ - bytes = self.radioConfig.channel_settings.SerializeToString() + # Only keep the primary/secondary channels, assume primary is first + channelSet = apponly_pb2.ChannelSet() + for c in self.channels: + if c.role != channel_pb2.Channel.Role.DISABLED: + channelSet.settings.append(c.settings) + bytes = channelSet.SerializeToString() s = base64.urlsafe_b64encode(bytes).decode('ascii') - return f"https://www.meshtastic.org/c/#{s}" + return f"https://www.meshtastic.org/d/#{s}" - def setURL(self, url, write=True): + def setURL(self, url): """Set mesh network URL""" if self.radioConfig == None: raise Exception("No RadioConfig has been read") - # URLs are of the form https://www.meshtastic.org/c/#{base64_channel_settings} + # URLs are of the form https://www.meshtastic.org/d/#{base64_channel_set} # Split on '/#' to find the base64 encoded channel settings splitURL = url.split("/#") decodedURL = base64.urlsafe_b64decode(splitURL[-1]) - self.radioConfig.channel_settings.ParseFromString(decodedURL) - if write: - self.writeConfig() + channelSet = apponly_pb2.ChannelSet() + channelSet.ParseFromString(decodedURL) + fixme("set self.channels, see https://developers.google.com/protocol-buffers/docs/reference/python-generated?csw=1#repeated-fields") + self._writeChannels() def _waitConnected(self): """Block until the initial node db download is complete, or timeout and raise an exception""" - if not self.isConnected.wait(5.0): # timeout after 5 seconds + if not self.isConnected.wait(5.0): # timeout after 5 seconds raise Exception("Timed out waiting for connection completion") + # If we failed while connecting, raise the connection to the client + if self.failure: + raise self.failure + def _generatePacketId(self): """Get a new unique packet ID""" if self.currentPacketId is None: @@ -1275,13 +1570,15 @@ noProto – If True, don't try to run our protocol on the link - just be a d def _disconnected(self): """Called by subclasses to tell clients this interface has disconnected""" self.isConnected.clear() - pub.sendMessage("meshtastic.connection.lost", interface=self) + catchAndIgnore("disconnection publish", lambda: pub.sendMessage( + "meshtastic.connection.lost", interface=self)) def _connected(self): """Called by this class to tell clients we are now fully connected to a node """ self.isConnected.set() - pub.sendMessage("meshtastic.connection.established", interface=self) + catchAndIgnore("connection publish", lambda: pub.sendMessage( + "meshtastic.connection.established", interface=self)) def _startConfig(self): """Start device packets flowing""" @@ -1289,6 +1586,8 @@ noProto – If True, don't try to run our protocol on the link - just be a d self.nodes = {} # nodes keyed by ID self.nodesByNum = {} # nodes keyed by nodenum self.radioConfig = None + self.channels = None + self.partialChannels = [] # We keep our channels in a temp array until finished startConfig = mesh_pb2.ToRadio() startConfig.want_config_id = MY_CONFIG_ID # we don't use this value @@ -1297,14 +1596,69 @@ noProto – If True, don't try to run our protocol on the link - just be a d def _sendToRadio(self, toRadio): """Send a ToRadio protobuf to the device""" if self.noProto: - logging.warn(f"Not sending packet because protocol use is disabled by noProto") + logging.warn( + f"Not sending packet because protocol use is disabled by noProto") else: + logging.debug(f"Sending toRadio: {toRadio}") self._sendToRadioImpl(toRadio) def _sendToRadioImpl(self, toRadio): """Send a ToRadio protobuf to the device""" logging.error(f"Subclass must provide toradio: {toRadio}") + def _handleConfigComplete(self): + """ + Done with initial config messages, now send regular MeshPackets to ask for settings and channels + """ + self._requestSettings() + self._requestChannel(0) + + def _requestSettings(self): + """ + Done with initial config messages, now send regular MeshPackets to ask for settings + """ + p = admin_pb2.AdminMessage() + p.get_radio_request = True + + def onResponse(p): + """A closure to handle the response packet""" + self.radioConfig = p["decoded"]["admin"]["raw"].get_radio_response + + return self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True, + wantResponse=True, + onResponse=onResponse) + + def _requestChannel(self, channelNum: int): + """ + Done with initial config messages, now send regular MeshPackets to ask for settings + """ + p = admin_pb2.AdminMessage() + p.get_channel_request = channelNum + 1 + logging.debug(f"Requesting channel {channelNum}") + + def onResponse(p): + """A closure to handle the response packet""" + c = p["decoded"]["admin"]["raw"].get_channel_response + self.partialChannels.append(c) + logging.debug(f"Received channel {c}") + # for stress testing, download all channels + # if channelNum >= self.myInfo.max_channels - 1: + if c.role == channel_pb2.Channel.Role.DISABLED or channelNum >= self.myInfo.max_channels - 1: + # Once we see a response that has NO settings, assume we are at the end of channels and stop fetching + self.channels = self.partialChannels + # FIXME, the following should only be called after we have settings and channels + self._connected() # Tell everone else we are ready to go + else: + self._requestChannel(channelNum + 1) + + return self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True, + wantResponse=True, + onResponse=onResponse) + def _handleFromRadio(self, fromRadioBytes): """ Handle a packet that arrived from the radio(update model and publish events) @@ -1316,12 +1670,21 @@ noProto – If True, don't try to run our protocol on the link - just be a d logging.debug(f"Received: {asDict}") if fromRadio.HasField("my_info"): self.myInfo = fromRadio.my_info + + failmsg = None + # Check for app too old if self.myInfo.min_app_version > OUR_APP_VERSION: - raise Exception( - "This device needs a newer python client, please \"pip install --upgrade meshtastic\"") - # start assigning our packet IDs from the opposite side of where our local device is assigning them - elif fromRadio.HasField("radio"): - self.radioConfig = fromRadio.radio + failmsg = "This device needs a newer python client, please \"pip install --upgrade meshtastic\". For more information see https://tinyurl.com/5bjsxu32" + + # check for firmware too old + if self.myInfo.max_channels == 0: + failmsg = "This version of meshtastic-python requires device firmware version 1.2 or later. For more information see https://tinyurl.com/5bjsxu32" + + if failmsg: + self.failure = Exception(failmsg) + self.isConnected.set() # let waitConnected return this exception + self.close() + elif fromRadio.HasField("node_info"): node = asDict["nodeInfo"] try: @@ -1331,10 +1694,11 @@ noProto – If True, don't try to run our protocol on the link - just be a d self.nodesByNum[node["num"]] = node if "user" in node: # Some nodes might not have user/ids assigned yet self.nodes[node["user"]["id"]] = node - pub.sendMessage("meshtastic.node.updated", node=node, interface=self) + pub.sendMessage("meshtastic.node.updated", + node=node, interface=self) elif fromRadio.config_complete_id == MY_CONFIG_ID: # we ignore the config_complete_id, it is unneeded for our stream API fromRadio.config_complete_id - self._connected() + self._handleConfigComplete() elif fromRadio.HasField("packet"): self._handlePacketFromRadio(fromRadio.packet) elif fromRadio.rebooted: @@ -1397,6 +1761,12 @@ noProto – If True, don't try to run our protocol on the link - just be a d """ asDict = google.protobuf.json_format.MessageToDict(meshPacket) + + # We normally decompose the payload into a dictionary so that the client + # doesn't need to understand protobufs. But advanced clients might + # want the raw protobuf, so we provide it in "raw" + asDict["raw"] = meshPacket + # /add fromId and toId fields based on the node ID asDict["fromId"] = self._nodeNumToId(asDict["from"]) asDict["toId"] = self._nodeNumToId(asDict["to"]) @@ -1405,68 +1775,59 @@ noProto – If True, don't try to run our protocol on the link - just be a d # asObj = DotMap(asDict) topic = "meshtastic.receive" # Generic unknown packet type - # Warn users if firmware doesn't use new portnum based data encodings - # But do not crash, because the lib will still basically work and ignore those packet types - if meshPacket.decoded.HasField("user") or meshPacket.decoded.HasField("position"): - logging.warn("Ignoring old position/user message. Recommend you update firmware to 1.1.20 or later") + decoded = asDict["decoded"] + # The default MessageToDict converts byte arrays into base64 strings. + # We don't want that - it messes up data payload. So slam in the correct + # byte array. + decoded["payload"] = meshPacket.decoded.payload - if meshPacket.decoded.HasField("data"): + # UNKNOWN_APP is the default protobuf portnum value, and therefore if not set it will not be populated at all + # to make API usage easier, set it to prevent confusion + if not "portnum" in decoded: + decoded["portnum"] = portnums_pb2.PortNum.Name( + portnums_pb2.PortNum.UNKNOWN_APP) - # The default MessageToDict converts byte arrays into base64 strings. - # We don't want that - it messes up data payload. So slam in the correct - # byte array. - asDict["decoded"]["data"]["payload"] = meshPacket.decoded.data.payload + portnum = decoded["portnum"] - # UNKNOWN_APP is the default protobuf portnum value, and therefore if not set it will not be populated at all - # to make API usage easier, set it to prevent confusion - if not "portnum" in asDict["decoded"]["data"]: - asDict["decoded"]["data"]["portnum"] = portnums_pb2.PortNum.Name(portnums_pb2.PortNum.UNKNOWN_APP) + topic = f"meshtastic.receive.data.{portnum}" - portnum = asDict["decoded"]["data"]["portnum"] + # decode position protobufs and update nodedb, provide decoded version as "position" in the published msg + # move the following into a 'decoders' API that clients could register? + portNumInt = meshPacket.decoded.portnum # we want portnum as an int + handler = protocols.get(portNumInt) + # The decoded protobuf as a dictionary (if we understand this message) + p = None + if handler is not None: + topic = f"meshtastic.receive.{handler.name}" - topic = f"meshtastic.receive.data.{portnum}" - - # For text messages, we go ahead and decode the text to ascii for our users - if portnum == portnums_pb2.PortNum.Name(portnums_pb2.PortNum.TEXT_MESSAGE_APP): - topic = "meshtastic.receive.text" - - # We don't throw if the utf8 is invalid in the text message. Instead we just don't populate - # the decoded.data.text and we log an error message. This at least allows some delivery to - # the app and the app can deal with the missing decoded representation. - # - # Usually btw this problem is caused by apps sending binary data but setting the payload type to - # text. - try: - asDict["decoded"]["data"]["text"] = meshPacket.decoded.data.payload.decode("utf-8") - except Exception as ex: - logging.error(f"Malformatted utf8 in text message: {ex}") - - # decode position protobufs and update nodedb, provide decoded version as "position" in the published msg - if portnum == portnums_pb2.PortNum.Name(portnums_pb2.PortNum.POSITION_APP): - topic = "meshtastic.receive.position" - pb = mesh_pb2.Position() - pb.ParseFromString(meshPacket.decoded.data.payload) + # Convert to protobuf if possible + if handler.protobufFactory is not None: + pb = handler.protobufFactory() + pb.ParseFromString(meshPacket.decoded.payload) p = google.protobuf.json_format.MessageToDict(pb) - self._fixupPosition(p) - asDict["decoded"]["data"]["position"] = p - # update node DB as needed - self._getOrCreateByNum(asDict["from"])["position"] = p + asDict["decoded"][handler.name] = p + # Also provide the protobuf raw + asDict["decoded"][handler.name]["raw"] = pb - # decode user protobufs and update nodedb, provide decoded version as "position" in the published msg - if portnum == portnums_pb2.PortNum.Name(portnums_pb2.PortNum.NODEINFO_APP): - topic = "meshtastic.receive.user" - pb = mesh_pb2.User() - pb.ParseFromString(meshPacket.decoded.data.payload) - u = google.protobuf.json_format.MessageToDict(pb) - asDict["decoded"]["data"]["user"] = u - # update node DB as needed - n = self._getOrCreateByNum(asDict["from"]) - n["user"] = u - # We now have a node ID, make sure it is uptodate in that table - self.nodes[u["id"]] = n + # Call specialized onReceive if necessary + if handler.onReceive is not None: + handler.onReceive(self, asDict) + + # Is this message in response to a request, if so, look for a handler + requestId = decoded.get("requestId") + if requestId is not None: + # We ignore ACK packets, but send NAKs and data responses to the handlers + routing = decoded.get("routing") + isAck = routing is not None and ("errorReason" not in routing) + if not isAck: + # we keep the responseHandler in dict until we get a non ack + handler = self.responseHandlers.pop(requestId, None) + if handler is not None: + handler.callback(asDict) logging.debug(f"Publishing topic {topic}") - pub.sendMessage(topic, packet=asDict, interface=self) + catchAndIgnore(f"publishing {topic}", lambda: pub.sendMessage( + topic, packet=asDict, interface=self))

    Subclasses

      @@ -1486,9 +1847,14 @@ noProto – If True, don't try to run our protocol on the link - just be a d def channelURL(self): """The sharable URL that describes the current channel """ - bytes = self.radioConfig.channel_settings.SerializeToString() + # Only keep the primary/secondary channels, assume primary is first + channelSet = apponly_pb2.ChannelSet() + for c in self.channels: + if c.role != channel_pb2.Channel.Role.DISABLED: + channelSet.settings.append(c.settings) + bytes = channelSet.SerializeToString() s = base64.urlsafe_b64encode(bytes).decode('ascii') - return f"https://www.meshtastic.org/c/#{s}" + return f"https://www.meshtastic.org/d/#{s}"
    @@ -1558,7 +1924,7 @@ def channelURL(self):
    -def sendData(self, data, destinationId='^all', portNum=256, wantAck=False, wantResponse=False) +def sendData(self, data, destinationId='^all', portNum=256, wantAck=False, wantResponse=False, onResponse=None)

    Send a data packet to some other node

    @@ -1566,13 +1932,18 @@ def channelURL(self): data – the data to send, either as an array of bytes or as a protobuf (which will be automatically serialized to bytes) destinationId {nodeId or nodeNum} – where to send this message (default: {BROADCAST_ADDR}) 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)

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

    Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.

    Expand source code -
    def sendData(self, data, destinationId=BROADCAST_ADDR, portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False, wantResponse=False):
    +
    def sendData(self, data, destinationId=BROADCAST_ADDR,
    +             portNum=portnums_pb2.PortNum.PRIVATE_APP, wantAck=False,
    +             wantResponse=False,
    +             onResponse=None):
         """Send a data packet to some other node
     
         Keyword Arguments:
    @@ -1580,6 +1951,8 @@ wantAck – True if you want the message sent in a reliable manner (with ret
             destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR})
             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)
     
         Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
         """
    @@ -1590,54 +1963,14 @@ wantAck – True if you want the message sent in a reliable manner (with ret
         if len(data) > mesh_pb2.Constants.DATA_PAYLOAD_LEN:
             raise Exception("Data payload too big")
         meshPacket = mesh_pb2.MeshPacket()
    -    meshPacket.decoded.data.payload = data
    -    meshPacket.decoded.data.portnum = portNum
    +    meshPacket.decoded.payload = data
    +    meshPacket.decoded.portnum = portNum
         meshPacket.decoded.want_response = wantResponse
    -    return self.sendPacket(meshPacket, destinationId, wantAck=wantAck)
    -
    -
    -
    -def sendPacket(self, meshPacket, destinationId='^all', wantAck=False) -
    -
    -

    Send a MeshPacket to the specified node (or if unspecified, broadcast). -You probably don't want this - use sendData instead.

    -

    Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.

    -
    - -Expand source code - -
    def sendPacket(self, meshPacket, destinationId=BROADCAST_ADDR, wantAck=False):
    -    """Send a MeshPacket to the specified node (or if unspecified, broadcast).
    -    You probably don't want this - use sendData instead.
     
    -    Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
    -    """
    -    self._waitConnected()
    -
    -    toRadio = mesh_pb2.ToRadio()
    -    # FIXME add support for non broadcast addresses
    -
    -    if destinationId is None:
    -        raise Exception("destinationId must not be None")
    -    elif isinstance(destinationId, int):
    -        nodeNum = destinationId
    -    elif destinationId == BROADCAST_ADDR:
    -        nodeNum = BROADCAST_NUM
    -    else:
    -        nodeNum = self.nodes[destinationId]['num']
    -
    -    meshPacket.to = nodeNum
    -    meshPacket.want_ack = wantAck
    -
    -    # if the user hasn't set an ID for this packet (likely and recommended), we should pick a new unique ID
    -    # so the message can be tracked.
    -    if meshPacket.id == 0:
    -        meshPacket.id = self._generatePacketId()
    -
    -    toRadio.packet.CopyFrom(meshPacket)
    -    self._sendToRadio(toRadio)
    -    return meshPacket
    + p = self._sendPacket(meshPacket, destinationId, wantAck=wantAck) + if onResponse is not None: + self._addResponseHandler(p.id, onResponse) + return p
    @@ -1678,11 +2011,14 @@ the local position.

    timeSec = time.time() # returns unix timestamp in seconds p.time = int(timeSec) - return self.sendData(p, destinationId, portNum=portnums_pb2.PortNum.POSITION_APP, wantAck=wantAck, wantResponse=wantResponse)
    + return self.sendData(p, destinationId, + portNum=portnums_pb2.PortNum.POSITION_APP, + wantAck=wantAck, + wantResponse=wantResponse)
    -def sendText(self, text, destinationId='^all', wantAck=False, wantResponse=False) +def sendText(self, text: ~AnyStr, destinationId='^all', wantAck=False, wantResponse=False, onResponse=None)

    Send a utf8 string to some other node, if the node has a display it will also be shown on the device.

    @@ -1691,13 +2027,18 @@ the local position.

    Keyword Arguments: destinationId {nodeId or nodeNum} – where to send this message (default: {BROADCAST_ADDR}) 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)

    +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

    Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.

    Expand source code -
    def sendText(self, text, destinationId=BROADCAST_ADDR, wantAck=False, wantResponse=False):
    +
    def sendText(self, text: AnyStr,
    +             destinationId=BROADCAST_ADDR,
    +             wantAck=False,
    +             wantResponse=False,
    +             onResponse=None):
         """Send a utf8 string to some other node, if the node has a display it will also be shown on the device.
     
         Arguments:
    @@ -1707,11 +2048,15 @@ wantAck – True if you want the message sent in a reliable manner (with ret
             destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR})
             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
     
         Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.
         """
         return self.sendData(text.encode("utf-8"), destinationId,
    -                         portNum=portnums_pb2.PortNum.TEXT_MESSAGE_APP, wantAck=wantAck, wantResponse=wantResponse)
    + portNum=portnums_pb2.PortNum.TEXT_MESSAGE_APP, + wantAck=wantAck, + wantResponse=wantResponse, + onResponse=onResponse)
    @@ -1740,19 +2085,24 @@ wantAck – True if you want the message sent in a reliable manner (with ret short_name = long_name[0] + long_name[1:].translate(trans) if len(short_name) < nChars: short_name = long_name[:nChars] - t = mesh_pb2.ToRadio() + + p = admin_pb2.AdminMessage() + if long_name is not None: - t.set_owner.long_name = long_name + p.set_owner.long_name = long_name if short_name is not None: short_name = short_name.strip() if len(short_name) > nChars: short_name = short_name[:nChars] - t.set_owner.short_name = short_name - self._sendToRadio(t) + p.set_owner.short_name = short_name + + return self.sendData(p, self.myInfo.my_node_num, + portNum=portnums_pb2.PortNum.ADMIN_APP, + wantAck=True)
    -def setURL(self, url, write=True) +def setURL(self, url)

    Set mesh network URL

    @@ -1760,22 +2110,23 @@ wantAck – True if you want the message sent in a reliable manner (with ret Expand source code -
    def setURL(self, url, write=True):
    +
    def setURL(self, url):
         """Set mesh network URL"""
         if self.radioConfig == None:
             raise Exception("No RadioConfig has been read")
     
    -    # URLs are of the form https://www.meshtastic.org/c/#{base64_channel_settings}
    +    # URLs are of the form https://www.meshtastic.org/d/#{base64_channel_set}
         # Split on '/#' to find the base64 encoded channel settings
         splitURL = url.split("/#")
         decodedURL = base64.urlsafe_b64decode(splitURL[-1])
    -    self.radioConfig.channel_settings.ParseFromString(decodedURL)
    -    if write:
    -        self.writeConfig()
    + channelSet = apponly_pb2.ChannelSet() + channelSet.ParseFromString(decodedURL) + fixme("set self.channels, see https://developers.google.com/protocol-buffers/docs/reference/python-generated?csw=1#repeated-fields") + self._writeChannels()
    -def waitForConfig(self, sleep=0.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig')) +def waitForConfig(self, sleep=0.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig', 'channels'))

    Block until radio config is received. Returns True if config has been received.

    @@ -1783,7 +2134,7 @@ wantAck – True if you want the message sent in a reliable manner (with ret Expand source code -
    def waitForConfig(self, sleep=.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig')):
    +
    def waitForConfig(self, sleep=.1, maxsecs=20, attrs=('myInfo', 'nodes', 'radioConfig', 'channels')):
         """Block until radio config is received. Returns True if config has been received."""
         for _ in range(int(maxsecs/sleep)):
             if all(map(lambda a: getattr(self, a, None), attrs)):
    @@ -1806,14 +2157,44 @@ wantAck – True if you want the message sent in a reliable manner (with ret
         if self.radioConfig == None:
             raise Exception("No RadioConfig has been read")
     
    -    t = mesh_pb2.ToRadio()
    -    t.set_radio.CopyFrom(self.radioConfig)
    -    self._sendToRadio(t)
    +    p = admin_pb2.AdminMessage()
    +    p.set_radio.CopyFrom(self.radioConfig)
    +
    +    self.sendData(p, self.myInfo.my_node_num,
    +                         portNum=portnums_pb2.PortNum.ADMIN_APP,
    +                         wantAck=True)
         logging.debug("Wrote config")
    +
    +class ResponseHandler +(callback: Callable) +
    +
    +

    A pending response callback, waiting for a response to one of our messages

    +
    + +Expand source code + +
    class ResponseHandler(NamedTuple):
    +    """A pending response callback, waiting for a response to one of our messages"""
    +    # requestId: int - used only as a key
    +    callback: Callable
    +
    +

    Ancestors

    +
      +
    • builtins.tuple
    • +
    +

    Instance variables

    +
    +
    var callback : Callable
    +
    +

    Alias for field number 0

    +
    +
    +
    class SerialInterface (devPath=None, debugOut=None, noProto=False, connectNow=True) @@ -1884,7 +2265,6 @@ debugOut {stream} – If a stream is provided, any debug serial output from
  • close
  • connect
  • sendData
  • -
  • sendPacket
  • sendPosition
  • sendText
  • setOwner
  • @@ -1958,7 +2338,7 @@ debugOut {stream} – If a stream is provided, any debug serial output from time.sleep(0.1) # wait 100ms to give device time to start running self._rxThread.start() - if not self.noProto: # Wait for the db download if using the protocol + if not self.noProto: # Wait for the db download if using the protocol self._waitConnected() def _disconnected(self): @@ -2044,13 +2424,16 @@ debugOut {stream} – If a stream is provided, any debug serial output from # logging.debug(f"timeout") pass except serial.SerialException as ex: - if not self._wantExit: # We might intentionally get an exception during shutdown - logging.warn(f"Meshtastic serial port disconnected, disconnecting... {ex}") + if not self._wantExit: # We might intentionally get an exception during shutdown + logging.warn( + f"Meshtastic serial port disconnected, disconnecting... {ex}") except OSError as ex: - if not self._wantExit: # We might intentionally get an exception during shutdown - logging.error(f"Unexpected OSError, terminating meshtastic reader... {ex}") + if not self._wantExit: # We might intentionally get an exception during shutdown + logging.error( + f"Unexpected OSError, terminating meshtastic reader... {ex}") except Exception as ex: - logging.error(f"Unexpected exception, terminating meshtastic reader... {ex}") + logging.error( + f"Unexpected exception, terminating meshtastic reader... {ex}") finally: logging.debug("reader is exiting") self._disconnected()
    @@ -2107,7 +2490,7 @@ start the reading thread later.

    time.sleep(0.1) # wait 100ms to give device time to start running self._rxThread.start() - if not self.noProto: # Wait for the db download if using the protocol + if not self.noProto: # Wait for the db download if using the protocol self._waitConnected()
    @@ -2118,7 +2501,6 @@ start the reading thread later.

    • channelURL
    • sendData
    • -
    • sendPacket
    • sendPosition
    • sendText
    • setOwner
    • @@ -2131,7 +2513,7 @@ start the reading thread later.

      class TCPInterface -(hostname, debugOut=None, noProto=False, connectNow=True, portNumber=4403) +(hostname: ~AnyStr, debugOut=None, noProto=False, connectNow=True, portNumber=4403)

      Interface class for meshtastic devices over a TCP link

      @@ -2145,7 +2527,7 @@ hostname {string} – Hostname/IP address of the device to connect to

      class TCPInterface(StreamInterface): """Interface class for meshtastic devices over a TCP link""" - def __init__(self, hostname, debugOut=None, noProto=False, connectNow=True, portNumber=4403): + def __init__(self, hostname: AnyStr, debugOut=None, noProto=False, connectNow=True, portNumber=4403): """Constructor, opens a connection to a specified IP address/hostname Keyword Arguments: @@ -2168,9 +2550,9 @@ hostname {string} – Hostname/IP address of the device to connect to

      close
    • connect
    • sendData
    • -
    • sendPacket
    • sendPosition
    • sendText
    • setOwner
    • @@ -2223,12 +2604,15 @@ hostname {string} – Hostname/IP address of the device to connect to

    • Sub-modules

        +
      • meshtastic.admin_pb2
      • meshtastic.apponly_pb2
      • meshtastic.ble
      • +
      • meshtastic.channel_pb2
      • meshtastic.deviceonly_pb2
      • meshtastic.environmental_measurement_pb2
      • meshtastic.mesh_pb2
      • meshtastic.portnums_pb2
      • +
      • meshtastic.radioconfig_pb2
      • meshtastic.remote_hardware
      • meshtastic.remote_hardware_pb2
      • meshtastic.test
      • @@ -2250,6 +2634,14 @@ hostname {string} – Hostname/IP address of the device to connect to

      • +

        KnownProtocol

        + +
      • +
      • MeshInterface

        • channelURL
        • @@ -2258,7 +2650,6 @@ hostname {string} – Hostname/IP address of the device to connect to

          getMyUser
        • getShortName
        • sendData
        • -
        • sendPacket
        • sendPosition
        • sendText
        • setOwner
        • @@ -2268,6 +2659,12 @@ hostname {string} – Hostname/IP address of the device to connect to

        • +

          ResponseHandler

          + +
        • +
        • SerialInterface

        • diff --git a/docs/meshtastic/mesh_pb2.html b/docs/meshtastic/mesh_pb2.html index 667721c..7e4b856 100644 --- a/docs/meshtastic/mesh_pb2.html +++ b/docs/meshtastic/mesh_pb2.html @@ -50,56 +50,10 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=b'\n\023com.geeksville.meshB\nMeshProtosH\003', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\nmesh.proto\x1a\x0eportnums.proto\"j\n\x08Position\x12\x12\n\nlatitude_i\x18\x07 \x01(\x11\x12\x13\n\x0blongitude_i\x18\x08 \x01(\x11\x12\x10\n\x08\x61ltitude\x18\x03 \x01(\x05\x12\x15\n\rbattery_level\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\t \x01(\x07\"2\n\x04\x44\x61ta\x12\x19\n\x07portnum\x18\x01 \x01(\x0e\x32\x08.PortNum\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\"J\n\x04User\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tlong_name\x18\x02 \x01(\t\x12\x12\n\nshort_name\x18\x03 \x01(\t\x12\x0f\n\x07macaddr\x18\x04 \x01(\x0c\"\x1f\n\x0eRouteDiscovery\x12\r\n\x05route\x18\x02 \x03(\x05\"\xeb\x02\n\tSubPacket\x12\x15\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x05.DataH\x00\x12(\n\rroute_request\x18\x06 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12&\n\x0broute_reply\x18\x07 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12$\n\x0c\x65rror_reason\x18\r \x01(\x0e\x32\x0c.ErrorReasonH\x00\x12!\n\x08position\x18\x01 \x01(\x0b\x32\t.PositionB\x02\x18\x01H\x00\x12\x19\n\x04user\x18\x04 \x01(\x0b\x32\x05.UserB\x02\x18\x01H\x00\x12\x15\n\rwant_response\x18\x05 \x01(\x08\x12\x14\n\nsuccess_id\x18\n \x01(\rH\x01\x12\x11\n\x07\x66\x61il_id\x18\x0b \x01(\rH\x01\x12\x0c\n\x04\x64\x65st\x18\t \x01(\r\x12\x0e\n\x06source\x18\x0c \x01(\r\x12\x13\n\x0boriginal_id\x18\x02 \x01(\rB\x10\n\x0epayloadVariantB\x0c\n\nackVariant\"\xda\x02\n\nMeshPacket\x12\x0c\n\x04\x66rom\x18\x01 \x01(\r\x12\n\n\x02to\x18\x02 \x01(\r\x12\x15\n\rchannel_index\x18\x04 \x01(\r\x12\x1d\n\x07\x64\x65\x63oded\x18\x03 \x01(\x0b\x32\n.SubPacketH\x00\x12\x13\n\tencrypted\x18\x08 \x01(\x0cH\x00\x12\n\n\x02id\x18\x06 \x01(\r\x12\x0f\n\x07rx_time\x18\t \x01(\x07\x12\x0e\n\x06rx_snr\x18\x07 \x01(\x02\x12\x11\n\thop_limit\x18\n \x01(\r\x12\x10\n\x08want_ack\x18\x0b \x01(\x08\x12&\n\x08priority\x18\x0c \x01(\x0e\x32\x14.MeshPacket.Priority\"[\n\x08Priority\x12\t\n\x05UNSET\x10\x00\x12\x07\n\x03MIN\x10\x01\x12\x0e\n\nBACKGROUND\x10\n\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10@\x12\x0c\n\x08RELIABLE\x10\x46\x12\x07\n\x03\x41\x43K\x10x\x12\x07\n\x03MAX\x10\x7f\x42\x10\n\x0epayloadVariant\"\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\"\xb9\r\n\x0bRadioConfig\x12\x31\n\x0bpreferences\x18\x01 \x01(\x0b\x32\x1c.RadioConfig.UserPreferences\x12.\n\x10\x63hannel_settings\x18\x02 \x01(\x0b\x32\x10.ChannelSettingsB\x02\x18\x01\x1a\xc6\x0c\n\x0fUserPreferences\x12\x1f\n\x17position_broadcast_secs\x18\x01 \x01(\r\x12\x1b\n\x13send_owner_interval\x18\x02 \x01(\r\x12\x1b\n\x13wait_bluetooth_secs\x18\x04 \x01(\r\x12\x16\n\x0escreen_on_secs\x18\x05 \x01(\r\x12\x1a\n\x12phone_timeout_secs\x18\x06 \x01(\r\x12\x1d\n\x15phone_sds_timeout_sec\x18\x07 \x01(\r\x12\x1d\n\x15mesh_sds_timeout_secs\x18\x08 \x01(\r\x12\x10\n\x08sds_secs\x18\t \x01(\r\x12\x0f\n\x07ls_secs\x18\n \x01(\r\x12\x15\n\rmin_wake_secs\x18\x0b \x01(\r\x12\x11\n\twifi_ssid\x18\x0c \x01(\t\x12\x15\n\rwifi_password\x18\r \x01(\t\x12\x14\n\x0cwifi_ap_mode\x18\x0e \x01(\x08\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\x12&\n\x0e\x63harge_current\x18\x10 \x01(\x0e\x32\x0e.ChargeCurrent\x12\x11\n\tis_router\x18% \x01(\x08\x12\x14\n\x0cis_low_power\x18& \x01(\x08\x12\x16\n\x0e\x66ixed_position\x18\' \x01(\x08\x12\x15\n\rfactory_reset\x18\x64 \x01(\x08\x12\x19\n\x11\x64\x65\x62ug_log_enabled\x18\x65 \x01(\x08\x12(\n\x0elocation_share\x18 \x01(\x0e\x32\x10.LocationSharing\x12$\n\rgps_operation\x18! \x01(\x0e\x32\r.GpsOperation\x12\x1b\n\x13gps_update_interval\x18\" \x01(\r\x12\x18\n\x10gps_attempt_time\x18$ \x01(\r\x12\x17\n\x0fignore_incoming\x18g \x03(\r\x12\x1c\n\x14serialplugin_enabled\x18x \x01(\x08\x12\x19\n\x11serialplugin_echo\x18y \x01(\x08\x12\x18\n\x10serialplugin_rxd\x18z \x01(\r\x12\x18\n\x10serialplugin_txd\x18{ \x01(\r\x12\x1c\n\x14serialplugin_timeout\x18| \x01(\r\x12\x19\n\x11serialplugin_mode\x18} \x01(\r\x12\'\n\x1f\x65xt_notification_plugin_enabled\x18~ \x01(\x08\x12)\n!ext_notification_plugin_output_ms\x18\x7f \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_output\x18\x80\x01 \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_active\x18\x81\x01 \x01(\x08\x12.\n%ext_notification_plugin_alert_message\x18\x82\x01 \x01(\x08\x12+\n\"ext_notification_plugin_alert_bell\x18\x83\x01 \x01(\x08\x12\"\n\x19range_test_plugin_enabled\x18\x84\x01 \x01(\x08\x12!\n\x18range_test_plugin_sender\x18\x85\x01 \x01(\r\x12\x1f\n\x16range_test_plugin_save\x18\x86\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_enabled\x18\x88\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_records\x18\x89\x01 \x01(\r\x12=\n4environmental_measurement_plugin_measurement_enabled\x18\x8c\x01 \x01(\x08\x12\x38\n/environmental_measurement_plugin_screen_enabled\x18\x8d\x01 \x01(\x08\x12\x44\n;environmental_measurement_plugin_read_error_count_threshold\x18\x8e\x01 \x01(\r\x12\x39\n0environmental_measurement_plugin_update_interval\x18\x8f\x01 \x01(\r\x12;\n2environmental_measurement_plugin_recovery_interval\x18\x90\x01 \x01(\r\"h\n\x08NodeInfo\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x13\n\x04user\x18\x02 \x01(\x0b\x32\x05.User\x12\x1b\n\x08position\x18\x03 \x01(\x0b\x32\t.Position\x12\x0b\n\x03snr\x18\x07 \x01(\x02\x12\x10\n\x08next_hop\x18\x05 \x01(\r\"\xe1\x02\n\nMyNodeInfo\x12\x13\n\x0bmy_node_num\x18\x01 \x01(\r\x12\x0f\n\x07has_gps\x18\x02 \x01(\x08\x12\x14\n\x0cnum_channels\x18\x03 \x01(\x05\x12\x12\n\x06region\x18\x04 \x01(\tB\x02\x18\x01\x12\x10\n\x08hw_model\x18\x05 \x01(\t\x12\x18\n\x10\x66irmware_version\x18\x06 \x01(\t\x12&\n\nerror_code\x18\x07 \x01(\x0e\x32\x12.CriticalErrorCode\x12\x15\n\rerror_address\x18\x08 \x01(\r\x12\x13\n\x0b\x65rror_count\x18\t \x01(\r\x12\x16\n\x0epacket_id_bits\x18\n \x01(\r\x12\x1d\n\x11\x63urrent_packet_id\x18\x0b \x01(\rB\x02\x18\x01\x12\x15\n\rnode_num_bits\x18\x0c \x01(\r\x12\x1c\n\x14message_timeout_msec\x18\r \x01(\r\x12\x17\n\x0fmin_app_version\x18\x0e \x01(\r\"\xb5\x01\n\tLogRecord\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x07\x12\x0e\n\x06source\x18\x03 \x01(\t\x12\x1f\n\x05level\x18\x04 \x01(\x0e\x32\x10.LogRecord.Level\"X\n\x05Level\x12\t\n\x05UNSET\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x32\x12\t\n\x05\x45RROR\x10(\x12\x0b\n\x07WARNING\x10\x1e\x12\x08\n\x04INFO\x10\x14\x12\t\n\x05\x44\x45\x42UG\x10\n\x12\t\n\x05TRACE\x10\x05\"\xa1\x02\n\tFromRadio\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x1d\n\x06packet\x18\x02 \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x1e\n\x07my_info\x18\x03 \x01(\x0b\x32\x0b.MyNodeInfoH\x00\x12\x1e\n\tnode_info\x18\x04 \x01(\x0b\x32\t.NodeInfoH\x00\x12\x1d\n\x05radio\x18\x06 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12 \n\nlog_record\x18\x07 \x01(\x0b\x32\n.LogRecordH\x00\x12\x1c\n\x12\x63onfig_complete_id\x18\x08 \x01(\rH\x00\x12\x12\n\x08rebooted\x18\t \x01(\x08H\x00\x12#\n\x07\x63hannel\x18\n \x01(\x0b\x32\x10.ChannelSettingsH\x00\x42\x10\n\x0epayloadVariant\"\xbc\x01\n\x07ToRadio\x12\x1d\n\x06packet\x18\x01 \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x18\n\x0ewant_config_id\x18\x64 \x01(\rH\x00\x12!\n\tset_radio\x18\x65 \x01(\x0b\x32\x0c.RadioConfigH\x00\x12\x1a\n\tset_owner\x18\x66 \x01(\x0b\x32\x05.UserH\x00\x12\'\n\x0bset_channel\x18g \x01(\x0b\x32\x10.ChannelSettingsH\x00\x42\x10\n\x0epayloadVariant*e\n\x0b\x45rrorReason\x12\x08\n\x04NONE\x10\x00\x12\x0c\n\x08NO_ROUTE\x10\x01\x12\x0b\n\x07GOT_NAK\x10\x02\x12\x0b\n\x07TIMEOUT\x10\x03\x12\x10\n\x0cNO_INTERFACE\x10\x04\x12\x12\n\x0eMAX_RETRANSMIT\x10\x05*.\n\tConstants\x12\n\n\x06Unused\x10\x00\x12\x15\n\x10\x44\x41TA_PAYLOAD_LEN\x10\xf0\x01*^\n\nRegionCode\x12\t\n\x05Unset\x10\x00\x12\x06\n\x02US\x10\x01\x12\t\n\x05\x45U433\x10\x02\x12\t\n\x05\x45U865\x10\x03\x12\x06\n\x02\x43N\x10\x04\x12\x06\n\x02JP\x10\x05\x12\x07\n\x03\x41NZ\x10\x06\x12\x06\n\x02KR\x10\x07\x12\x06\n\x02TW\x10\x08*\xd1\x01\n\rChargeCurrent\x12\x0b\n\x07MAUnset\x10\x00\x12\t\n\x05MA100\x10\x01\x12\t\n\x05MA190\x10\x02\x12\t\n\x05MA280\x10\x03\x12\t\n\x05MA360\x10\x04\x12\t\n\x05MA450\x10\x05\x12\t\n\x05MA550\x10\x06\x12\t\n\x05MA630\x10\x07\x12\t\n\x05MA700\x10\x08\x12\t\n\x05MA780\x10\t\x12\t\n\x05MA880\x10\n\x12\t\n\x05MA960\x10\x0b\x12\n\n\x06MA1000\x10\x0c\x12\n\n\x06MA1080\x10\r\x12\n\n\x06MA1160\x10\x0e\x12\n\n\x06MA1240\x10\x0f\x12\n\n\x06MA1320\x10\x10*j\n\x0cGpsOperation\x12\x0e\n\nGpsOpUnset\x10\x00\x12\x13\n\x0fGpsOpStationary\x10\x01\x12\x0f\n\x0bGpsOpMobile\x10\x02\x12\x11\n\rGpsOpTimeOnly\x10\x03\x12\x11\n\rGpsOpDisabled\x10\x04*@\n\x0fLocationSharing\x12\x0c\n\x08LocUnset\x10\x00\x12\x0e\n\nLocEnabled\x10\x01\x12\x0f\n\x0bLocDisabled\x10\x02*\xaf\x01\n\x11\x43riticalErrorCode\x12\x08\n\x04None\x10\x00\x12\x0e\n\nTxWatchdog\x10\x01\x12\x12\n\x0eSleepEnterWait\x10\x02\x12\x0b\n\x07NoRadio\x10\x03\x12\x0f\n\x0bUnspecified\x10\x04\x12\x13\n\x0fUBloxInitFailed\x10\x05\x12\x0c\n\x08NoAXP192\x10\x06\x12\x17\n\x13InvalidRadioSetting\x10\x07\x12\x12\n\x0eTransmitFailed\x10\x08\x42#\n\x13\x63om.geeksville.meshB\nMeshProtosH\x03\x62\x06proto3' + serialized_pb=b'\n\nmesh.proto\x1a\x0eportnums.proto\"v\n\x08Position\x12\x12\n\nlatitude_i\x18\x01 \x01(\x0f\x12\x13\n\x0blongitude_i\x18\x02 \x01(\x0f\x12\x10\n\x08\x61ltitude\x18\x03 \x01(\x05\x12\x15\n\rbattery_level\x18\x04 \x01(\x05\x12\x0c\n\x04time\x18\t \x01(\x07J\x04\x08\x07\x10\x08J\x04\x08\x08\x10\t\"J\n\x04User\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tlong_name\x18\x02 \x01(\t\x12\x12\n\nshort_name\x18\x03 \x01(\t\x12\x0f\n\x07macaddr\x18\x04 \x01(\x0c\"\x1f\n\x0eRouteDiscovery\x12\r\n\x05route\x18\x02 \x03(\x07\"\x8e\x02\n\x07Routing\x12(\n\rroute_request\x18\x01 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12&\n\x0broute_reply\x18\x02 \x01(\x0b\x32\x0f.RouteDiscoveryH\x00\x12&\n\x0c\x65rror_reason\x18\x03 \x01(\x0e\x32\x0e.Routing.ErrorH\x00\"~\n\x05\x45rror\x12\x08\n\x04NONE\x10\x00\x12\x0c\n\x08NO_ROUTE\x10\x01\x12\x0b\n\x07GOT_NAK\x10\x02\x12\x0b\n\x07TIMEOUT\x10\x03\x12\x10\n\x0cNO_INTERFACE\x10\x04\x12\x12\n\x0eMAX_RETRANSMIT\x10\x05\x12\x0e\n\nNO_CHANNEL\x10\x06\x12\r\n\tTOO_LARGE\x10\x07\x42\t\n\x07variant\"{\n\x04\x44\x61ta\x12\x19\n\x07portnum\x18\x01 \x01(\x0e\x32\x08.PortNum\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\x12\x15\n\rwant_response\x18\x03 \x01(\x08\x12\x0c\n\x04\x64\x65st\x18\x04 \x01(\x07\x12\x0e\n\x06source\x18\x05 \x01(\x07\x12\x12\n\nrequest_id\x18\x06 \x01(\x07\"\xcf\x02\n\nMeshPacket\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x07\x12\n\n\x02to\x18\x02 \x01(\x07\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\r\x12\x18\n\x07\x64\x65\x63oded\x18\x04 \x01(\x0b\x32\x05.DataH\x00\x12\x13\n\tencrypted\x18\x05 \x01(\x0cH\x00\x12\n\n\x02id\x18\x06 \x01(\x07\x12\x0f\n\x07rx_time\x18\x07 \x01(\x07\x12\x0e\n\x06rx_snr\x18\x08 \x01(\x02\x12\x11\n\thop_limit\x18\n \x01(\r\x12\x10\n\x08want_ack\x18\x0b \x01(\x08\x12&\n\x08priority\x18\x0c \x01(\x0e\x32\x14.MeshPacket.Priority\"[\n\x08Priority\x12\t\n\x05UNSET\x10\x00\x12\x07\n\x03MIN\x10\x01\x12\x0e\n\nBACKGROUND\x10\n\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10@\x12\x0c\n\x08RELIABLE\x10\x46\x12\x07\n\x03\x41\x43K\x10x\x12\x07\n\x03MAX\x10\x7f\x42\x10\n\x0epayloadVariant\"h\n\x08NodeInfo\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x13\n\x04user\x18\x02 \x01(\x0b\x32\x05.User\x12\x1b\n\x08position\x18\x03 \x01(\x0b\x32\t.Position\x12\x0b\n\x03snr\x18\x07 \x01(\x02\x12\x10\n\x08next_hop\x18\x05 \x01(\r\"\xa6\x02\n\nMyNodeInfo\x12\x13\n\x0bmy_node_num\x18\x01 \x01(\r\x12\x0f\n\x07has_gps\x18\x02 \x01(\x08\x12\x11\n\tnum_bands\x18\x03 \x01(\r\x12\x14\n\x0cmax_channels\x18\x0f \x01(\r\x12\x12\n\x06region\x18\x04 \x01(\tB\x02\x18\x01\x12\x10\n\x08hw_model\x18\x05 \x01(\t\x12\x18\n\x10\x66irmware_version\x18\x06 \x01(\t\x12&\n\nerror_code\x18\x07 \x01(\x0e\x32\x12.CriticalErrorCode\x12\x15\n\rerror_address\x18\x08 \x01(\r\x12\x13\n\x0b\x65rror_count\x18\t \x01(\r\x12\x1c\n\x14message_timeout_msec\x18\r \x01(\r\x12\x17\n\x0fmin_app_version\x18\x0e \x01(\r\"\xb5\x01\n\tLogRecord\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\x0c\n\x04time\x18\x02 \x01(\x07\x12\x0e\n\x06source\x18\x03 \x01(\t\x12\x1f\n\x05level\x18\x04 \x01(\x0e\x32\x10.LogRecord.Level\"X\n\x05Level\x12\t\n\x05UNSET\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x32\x12\t\n\x05\x45RROR\x10(\x12\x0b\n\x07WARNING\x10\x1e\x12\x08\n\x04INFO\x10\x14\x12\t\n\x05\x44\x45\x42UG\x10\n\x12\t\n\x05TRACE\x10\x05\"\xe9\x01\n\tFromRadio\x12\x0b\n\x03num\x18\x01 \x01(\r\x12\x1d\n\x06packet\x18\x0b \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x1e\n\x07my_info\x18\x03 \x01(\x0b\x32\x0b.MyNodeInfoH\x00\x12\x1e\n\tnode_info\x18\x04 \x01(\x0b\x32\t.NodeInfoH\x00\x12 \n\nlog_record\x18\x07 \x01(\x0b\x32\n.LogRecordH\x00\x12\x1c\n\x12\x63onfig_complete_id\x18\x08 \x01(\rH\x00\x12\x12\n\x08rebooted\x18\t \x01(\x08H\x00\x42\x10\n\x0epayloadVariantJ\x04\x08\x02\x10\x03J\x04\x08\x06\x10\x07\"l\n\x07ToRadio\x12\x1d\n\x06packet\x18\x02 \x01(\x0b\x32\x0b.MeshPacketH\x00\x12\x18\n\x0ewant_config_id\x18\x64 \x01(\rH\x00\x42\x10\n\x0epayloadVariantJ\x04\x08\x01\x10\x02J\x04\x08\x65\x10\x66J\x04\x08\x66\x10gJ\x04\x08g\x10h*.\n\tConstants\x12\n\n\x06Unused\x10\x00\x12\x15\n\x10\x44\x41TA_PAYLOAD_LEN\x10\xf0\x01*\xaf\x01\n\x11\x43riticalErrorCode\x12\x08\n\x04None\x10\x00\x12\x0e\n\nTxWatchdog\x10\x01\x12\x12\n\x0eSleepEnterWait\x10\x02\x12\x0b\n\x07NoRadio\x10\x03\x12\x0f\n\x0bUnspecified\x10\x04\x12\x13\n\x0fUBloxInitFailed\x10\x05\x12\x0c\n\x08NoAXP192\x10\x06\x12\x17\n\x13InvalidRadioSetting\x10\x07\x12\x12\n\x0eTransmitFailed\x10\x08\x42#\n\x13\x63om.geeksville.meshB\nMeshProtosH\x03\x62\x06proto3' , dependencies=[portnums__pb2.DESCRIPTOR,]) -_ERRORREASON = _descriptor.EnumDescriptor( - name='ErrorReason', - full_name='ErrorReason', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='NONE', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='NO_ROUTE', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GOT_NAK', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='TIMEOUT', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='NO_INTERFACE', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MAX_RETRANSMIT', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4228, - serialized_end=4329, -) -_sym_db.RegisterEnumDescriptor(_ERRORREASON) - -ErrorReason = enum_type_wrapper.EnumTypeWrapper(_ERRORREASON) _CONSTANTS = _descriptor.EnumDescriptor( name='Constants', full_name='Constants', @@ -120,246 +74,12 @@ _CONSTANTS = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4331, - serialized_end=4377, + serialized_start=1928, + serialized_end=1974, ) _sym_db.RegisterEnumDescriptor(_CONSTANTS) Constants = enum_type_wrapper.EnumTypeWrapper(_CONSTANTS) -_REGIONCODE = _descriptor.EnumDescriptor( - name='RegionCode', - full_name='RegionCode', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='Unset', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='US', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EU433', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='EU865', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='CN', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='JP', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='ANZ', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='KR', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='TW', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4379, - serialized_end=4473, -) -_sym_db.RegisterEnumDescriptor(_REGIONCODE) - -RegionCode = enum_type_wrapper.EnumTypeWrapper(_REGIONCODE) -_CHARGECURRENT = _descriptor.EnumDescriptor( - name='ChargeCurrent', - full_name='ChargeCurrent', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='MAUnset', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA100', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA190', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA280', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA360', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA450', index=5, number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA550', index=6, number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA630', index=7, number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA700', index=8, number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA780', index=9, number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA880', index=10, number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA960', index=11, number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA1000', index=12, number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA1080', index=13, number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA1160', index=14, number=14, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA1240', index=15, number=15, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='MA1320', index=16, number=16, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4476, - serialized_end=4685, -) -_sym_db.RegisterEnumDescriptor(_CHARGECURRENT) - -ChargeCurrent = enum_type_wrapper.EnumTypeWrapper(_CHARGECURRENT) -_GPSOPERATION = _descriptor.EnumDescriptor( - name='GpsOperation', - full_name='GpsOperation', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='GpsOpUnset', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GpsOpStationary', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GpsOpMobile', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GpsOpTimeOnly', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='GpsOpDisabled', index=4, number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4687, - serialized_end=4793, -) -_sym_db.RegisterEnumDescriptor(_GPSOPERATION) - -GpsOperation = enum_type_wrapper.EnumTypeWrapper(_GPSOPERATION) -_LOCATIONSHARING = _descriptor.EnumDescriptor( - name='LocationSharing', - full_name='LocationSharing', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='LocUnset', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LocEnabled', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='LocDisabled', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=4795, - serialized_end=4859, -) -_sym_db.RegisterEnumDescriptor(_LOCATIONSHARING) - -LocationSharing = enum_type_wrapper.EnumTypeWrapper(_LOCATIONSHARING) _CRITICALERRORCODE = _descriptor.EnumDescriptor( name='CriticalErrorCode', full_name='CriticalErrorCode', @@ -415,54 +135,14 @@ _CRITICALERRORCODE = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=4862, - serialized_end=5037, + serialized_start=1977, + serialized_end=2152, ) _sym_db.RegisterEnumDescriptor(_CRITICALERRORCODE) CriticalErrorCode = enum_type_wrapper.EnumTypeWrapper(_CRITICALERRORCODE) -NONE = 0 -NO_ROUTE = 1 -GOT_NAK = 2 -TIMEOUT = 3 -NO_INTERFACE = 4 -MAX_RETRANSMIT = 5 Unused = 0 DATA_PAYLOAD_LEN = 240 -Unset = 0 -US = 1 -EU433 = 2 -EU865 = 3 -CN = 4 -JP = 5 -ANZ = 6 -KR = 7 -TW = 8 -MAUnset = 0 -MA100 = 1 -MA190 = 2 -MA280 = 3 -MA360 = 4 -MA450 = 5 -MA550 = 6 -MA630 = 7 -MA700 = 8 -MA780 = 9 -MA880 = 10 -MA960 = 11 -MA1000 = 12 -MA1080 = 13 -MA1160 = 14 -MA1240 = 15 -MA1320 = 16 -GpsOpUnset = 0 -GpsOpStationary = 1 -GpsOpMobile = 2 -GpsOpTimeOnly = 3 -GpsOpDisabled = 4 -LocUnset = 0 -LocEnabled = 1 -LocDisabled = 2 globals()['None'] = 0 TxWatchdog = 1 SleepEnterWait = 2 @@ -474,6 +154,61 @@ InvalidRadioSetting = 7 TransmitFailed = 8 +_ROUTING_ERROR = _descriptor.EnumDescriptor( + name='Error', + full_name='Routing.Error', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='NONE', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='NO_ROUTE', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='GOT_NAK', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='TIMEOUT', index=3, number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='NO_INTERFACE', index=4, number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MAX_RETRANSMIT', index=5, number=5, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='NO_CHANNEL', index=6, number=6, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='TOO_LARGE', index=7, number=7, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=393, + serialized_end=519, +) +_sym_db.RegisterEnumDescriptor(_ROUTING_ERROR) + _MESHPACKET_PRIORITY = _descriptor.EnumDescriptor( name='Priority', full_name='MeshPacket.Priority', @@ -519,46 +254,11 @@ _MESHPACKET_PRIORITY = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=903, - serialized_end=994, + serialized_start=884, + serialized_end=975, ) _sym_db.RegisterEnumDescriptor(_MESHPACKET_PRIORITY) -_CHANNELSETTINGS_MODEMCONFIG = _descriptor.EnumDescriptor( - name='ModemConfig', - full_name='ChannelSettings.ModemConfig', - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name='Bw125Cr45Sf128', index=0, number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Bw500Cr45Sf128', index=1, number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Bw31_25Cr48Sf512', index=2, number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - _descriptor.EnumValueDescriptor( - name='Bw125Cr48Sf4096', index=3, number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key), - ], - containing_type=None, - serialized_options=None, - serialized_start=1277, - serialized_end=1373, -) -_sym_db.RegisterEnumDescriptor(_CHANNELSETTINGS_MODEMCONFIG) - _LOGRECORD_LEVEL = _descriptor.EnumDescriptor( name='Level', full_name='LogRecord.Level', @@ -604,8 +304,8 @@ _LOGRECORD_LEVEL = _descriptor.EnumDescriptor( ], containing_type=None, serialized_options=None, - serialized_start=3655, - serialized_end=3743, + serialized_start=1492, + serialized_end=1580, ) _sym_db.RegisterEnumDescriptor(_LOGRECORD_LEVEL) @@ -620,14 +320,14 @@ _POSITION = _descriptor.Descriptor( fields=[ _descriptor.FieldDescriptor( name='latitude_i', full_name='Position.latitude_i', index=0, - number=7, type=17, cpp_type=1, label=1, + number=1, type=15, cpp_type=1, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='longitude_i', full_name='Position.longitude_i', index=1, - number=8, type=17, cpp_type=1, label=1, + number=2, type=15, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -666,46 +366,7 @@ _POSITION = _descriptor.Descriptor( oneofs=[ ], serialized_start=30, - serialized_end=136, -) - - -_DATA = _descriptor.Descriptor( - name='Data', - full_name='Data', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='portnum', full_name='Data.portnum', 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='payload', full_name='Data.payload', index=1, - number=2, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=138, - serialized_end=188, + serialized_end=148, ) @@ -757,8 +418,8 @@ _USER = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=190, - serialized_end=264, + serialized_start=150, + serialized_end=224, ) @@ -772,7 +433,7 @@ _ROUTEDISCOVERY = _descriptor.Descriptor( fields=[ _descriptor.FieldDescriptor( name='route', full_name='RouteDiscovery.route', index=0, - number=2, type=5, cpp_type=1, label=3, + number=2, type=7, cpp_type=3, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -789,99 +450,109 @@ _ROUTEDISCOVERY = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=266, - serialized_end=297, + serialized_start=226, + serialized_end=257, ) -_SUBPACKET = _descriptor.Descriptor( - name='SubPacket', - full_name='SubPacket', +_ROUTING = _descriptor.Descriptor( + name='Routing', + full_name='Routing', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='data', full_name='SubPacket.data', index=0, - number=3, type=11, cpp_type=10, label=1, + name='route_request', full_name='Routing.route_request', index=0, + number=1, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='route_request', full_name='SubPacket.route_request', index=1, - number=6, type=11, cpp_type=10, label=1, + name='route_reply', full_name='Routing.route_reply', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='route_reply', full_name='SubPacket.route_reply', index=2, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='error_reason', full_name='Routing.error_reason', index=2, + number=3, 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, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _ROUTING_ERROR, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='variant', full_name='Routing.variant', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=260, + serialized_end=530, +) + + +_DATA = _descriptor.Descriptor( + name='Data', + full_name='Data', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ _descriptor.FieldDescriptor( - name='error_reason', full_name='SubPacket.error_reason', index=3, - number=13, type=14, cpp_type=8, label=1, + name='portnum', full_name='Data.portnum', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='position', full_name='SubPacket.position', index=4, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + name='payload', full_name='Data.payload', index=1, + number=2, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='user', full_name='SubPacket.user', index=5, - number=4, 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=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='want_response', full_name='SubPacket.want_response', index=6, - number=5, type=8, cpp_type=7, label=1, + name='want_response', full_name='Data.want_response', index=2, + number=3, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='success_id', full_name='SubPacket.success_id', index=7, - number=10, type=13, cpp_type=3, label=1, + name='dest', full_name='Data.dest', index=3, + number=4, type=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='fail_id', full_name='SubPacket.fail_id', index=8, - number=11, type=13, cpp_type=3, label=1, + name='source', full_name='Data.source', index=4, + number=5, type=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='dest', full_name='SubPacket.dest', index=9, - 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, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='source', full_name='SubPacket.source', index=10, - number=12, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='original_id', full_name='SubPacket.original_id', index=11, - number=2, type=13, cpp_type=3, label=1, + name='request_id', full_name='Data.request_id', index=5, + number=6, type=7, 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, @@ -897,19 +568,9 @@ _SUBPACKET = _descriptor.Descriptor( syntax='proto3', extension_ranges=[], oneofs=[ - _descriptor.OneofDescriptor( - name='payloadVariant', full_name='SubPacket.payloadVariant', - index=0, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), - _descriptor.OneofDescriptor( - name='ackVariant', full_name='SubPacket.ackVariant', - index=1, containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[]), ], - serialized_start=300, - serialized_end=663, + serialized_start=532, + serialized_end=655, ) @@ -923,56 +584,56 @@ _MESHPACKET = _descriptor.Descriptor( fields=[ _descriptor.FieldDescriptor( name='from', full_name='MeshPacket.from', index=0, - number=1, type=13, cpp_type=3, label=1, + number=1, type=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='to', full_name='MeshPacket.to', index=1, - number=2, type=13, cpp_type=3, label=1, + number=2, type=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='channel_index', full_name='MeshPacket.channel_index', index=2, - number=4, type=13, cpp_type=3, label=1, + name='channel', full_name='MeshPacket.channel', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='decoded', full_name='MeshPacket.decoded', index=3, - number=3, type=11, cpp_type=10, label=1, + number=4, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='encrypted', full_name='MeshPacket.encrypted', index=4, - number=8, type=12, cpp_type=9, label=1, + number=5, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='id', full_name='MeshPacket.id', index=5, - number=6, type=13, cpp_type=3, label=1, + number=6, type=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='rx_time', full_name='MeshPacket.rx_time', index=6, - number=9, type=7, cpp_type=3, label=1, + number=7, type=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='rx_snr', full_name='MeshPacket.rx_snr', index=7, - number=7, type=2, cpp_type=6, label=1, + number=8, type=2, cpp_type=6, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -1016,503 +677,8 @@ _MESHPACKET = _descriptor.Descriptor( create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=666, - serialized_end=1012, -) - - -_CHANNELSETTINGS = _descriptor.Descriptor( - name='ChannelSettings', - full_name='ChannelSettings', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='tx_power', full_name='ChannelSettings.tx_power', index=0, - number=1, type=5, cpp_type=1, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='modem_config', full_name='ChannelSettings.modem_config', index=1, - number=3, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='bandwidth', full_name='ChannelSettings.bandwidth', index=2, - 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='spread_factor', full_name='ChannelSettings.spread_factor', index=3, - number=7, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='coding_rate', full_name='ChannelSettings.coding_rate', index=4, - 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='channel_num', full_name='ChannelSettings.channel_num', index=5, - 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, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='psk', full_name='ChannelSettings.psk', index=6, - number=4, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='name', full_name='ChannelSettings.name', index=7, - number=5, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='id', full_name='ChannelSettings.id', index=8, - number=10, type=7, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='uplink_enabled', full_name='ChannelSettings.uplink_enabled', index=9, - number=16, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='downlink_enabled', full_name='ChannelSettings.downlink_enabled', index=10, - number=17, 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, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - _CHANNELSETTINGS_MODEMCONFIG, - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1015, - serialized_end=1373, -) - - -_RADIOCONFIG_USERPREFERENCES = _descriptor.Descriptor( - name='UserPreferences', - full_name='RadioConfig.UserPreferences', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='position_broadcast_secs', full_name='RadioConfig.UserPreferences.position_broadcast_secs', 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='send_owner_interval', full_name='RadioConfig.UserPreferences.send_owner_interval', 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='wait_bluetooth_secs', full_name='RadioConfig.UserPreferences.wait_bluetooth_secs', index=2, - 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='screen_on_secs', full_name='RadioConfig.UserPreferences.screen_on_secs', index=3, - 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='phone_timeout_secs', full_name='RadioConfig.UserPreferences.phone_timeout_secs', index=4, - 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='phone_sds_timeout_sec', full_name='RadioConfig.UserPreferences.phone_sds_timeout_sec', index=5, - number=7, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='mesh_sds_timeout_secs', full_name='RadioConfig.UserPreferences.mesh_sds_timeout_secs', index=6, - 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sds_secs', full_name='RadioConfig.UserPreferences.sds_secs', index=7, - 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, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ls_secs', full_name='RadioConfig.UserPreferences.ls_secs', index=8, - number=10, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='min_wake_secs', full_name='RadioConfig.UserPreferences.min_wake_secs', index=9, - number=11, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='wifi_ssid', full_name='RadioConfig.UserPreferences.wifi_ssid', index=10, - number=12, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='wifi_password', full_name='RadioConfig.UserPreferences.wifi_password', index=11, - number=13, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='wifi_ap_mode', full_name='RadioConfig.UserPreferences.wifi_ap_mode', index=12, - number=14, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='region', full_name='RadioConfig.UserPreferences.region', index=13, - number=15, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='charge_current', full_name='RadioConfig.UserPreferences.charge_current', index=14, - number=16, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is_router', full_name='RadioConfig.UserPreferences.is_router', index=15, - number=37, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='is_low_power', full_name='RadioConfig.UserPreferences.is_low_power', index=16, - number=38, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='fixed_position', full_name='RadioConfig.UserPreferences.fixed_position', index=17, - number=39, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='factory_reset', full_name='RadioConfig.UserPreferences.factory_reset', index=18, - number=100, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='debug_log_enabled', full_name='RadioConfig.UserPreferences.debug_log_enabled', index=19, - number=101, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='location_share', full_name='RadioConfig.UserPreferences.location_share', index=20, - number=32, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='gps_operation', full_name='RadioConfig.UserPreferences.gps_operation', index=21, - number=33, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='gps_update_interval', full_name='RadioConfig.UserPreferences.gps_update_interval', index=22, - number=34, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='gps_attempt_time', full_name='RadioConfig.UserPreferences.gps_attempt_time', index=23, - number=36, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ignore_incoming', full_name='RadioConfig.UserPreferences.ignore_incoming', index=24, - number=103, type=13, cpp_type=3, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='serialplugin_enabled', full_name='RadioConfig.UserPreferences.serialplugin_enabled', index=25, - number=120, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='serialplugin_echo', full_name='RadioConfig.UserPreferences.serialplugin_echo', index=26, - number=121, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='serialplugin_rxd', full_name='RadioConfig.UserPreferences.serialplugin_rxd', index=27, - number=122, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='serialplugin_txd', full_name='RadioConfig.UserPreferences.serialplugin_txd', index=28, - number=123, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='serialplugin_timeout', full_name='RadioConfig.UserPreferences.serialplugin_timeout', index=29, - number=124, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='serialplugin_mode', full_name='RadioConfig.UserPreferences.serialplugin_mode', index=30, - number=125, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ext_notification_plugin_enabled', full_name='RadioConfig.UserPreferences.ext_notification_plugin_enabled', index=31, - number=126, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ext_notification_plugin_output_ms', full_name='RadioConfig.UserPreferences.ext_notification_plugin_output_ms', index=32, - number=127, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ext_notification_plugin_output', full_name='RadioConfig.UserPreferences.ext_notification_plugin_output', index=33, - number=128, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ext_notification_plugin_active', full_name='RadioConfig.UserPreferences.ext_notification_plugin_active', index=34, - number=129, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ext_notification_plugin_alert_message', full_name='RadioConfig.UserPreferences.ext_notification_plugin_alert_message', index=35, - number=130, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ext_notification_plugin_alert_bell', full_name='RadioConfig.UserPreferences.ext_notification_plugin_alert_bell', index=36, - number=131, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='range_test_plugin_enabled', full_name='RadioConfig.UserPreferences.range_test_plugin_enabled', index=37, - number=132, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='range_test_plugin_sender', full_name='RadioConfig.UserPreferences.range_test_plugin_sender', index=38, - number=133, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='range_test_plugin_save', full_name='RadioConfig.UserPreferences.range_test_plugin_save', index=39, - number=134, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='store_forward_plugin_enabled', full_name='RadioConfig.UserPreferences.store_forward_plugin_enabled', index=40, - number=136, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='store_forward_plugin_records', full_name='RadioConfig.UserPreferences.store_forward_plugin_records', index=41, - number=137, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='environmental_measurement_plugin_measurement_enabled', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_measurement_enabled', index=42, - number=140, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='environmental_measurement_plugin_screen_enabled', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_screen_enabled', index=43, - number=141, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='environmental_measurement_plugin_read_error_count_threshold', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_read_error_count_threshold', index=44, - number=142, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='environmental_measurement_plugin_update_interval', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_update_interval', index=45, - number=143, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='environmental_measurement_plugin_recovery_interval', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_recovery_interval', index=46, - number=144, 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, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1491, - serialized_end=3097, -) - -_RADIOCONFIG = _descriptor.Descriptor( - name='RadioConfig', - full_name='RadioConfig', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='preferences', full_name='RadioConfig.preferences', index=0, - number=1, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='channel_settings', full_name='RadioConfig.channel_settings', 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=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_RADIOCONFIG_USERPREFERENCES, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1376, - serialized_end=3097, + serialized_start=658, + serialized_end=993, ) @@ -1571,8 +737,8 @@ _NODEINFO = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3099, - serialized_end=3203, + serialized_start=995, + serialized_end=1099, ) @@ -1599,84 +765,70 @@ _MYNODEINFO = _descriptor.Descriptor( is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='num_channels', full_name='MyNodeInfo.num_channels', index=2, - number=3, type=5, cpp_type=1, label=1, + name='num_bands', full_name='MyNodeInfo.num_bands', 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='region', full_name='MyNodeInfo.region', index=3, + name='max_channels', full_name='MyNodeInfo.max_channels', index=3, + number=15, 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, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='region', full_name='MyNodeInfo.region', index=4, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='hw_model', full_name='MyNodeInfo.hw_model', index=4, + name='hw_model', full_name='MyNodeInfo.hw_model', index=5, number=5, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='firmware_version', full_name='MyNodeInfo.firmware_version', index=5, + name='firmware_version', full_name='MyNodeInfo.firmware_version', index=6, number=6, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='error_code', full_name='MyNodeInfo.error_code', index=6, + name='error_code', full_name='MyNodeInfo.error_code', index=7, number=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='error_address', full_name='MyNodeInfo.error_address', index=7, + name='error_address', full_name='MyNodeInfo.error_address', index=8, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='error_count', full_name='MyNodeInfo.error_count', index=8, + name='error_count', full_name='MyNodeInfo.error_count', index=9, 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, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='packet_id_bits', full_name='MyNodeInfo.packet_id_bits', index=9, - number=10, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='current_packet_id', full_name='MyNodeInfo.current_packet_id', index=10, - number=11, 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=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='node_num_bits', full_name='MyNodeInfo.node_num_bits', index=11, - number=12, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='message_timeout_msec', full_name='MyNodeInfo.message_timeout_msec', index=12, + name='message_timeout_msec', full_name='MyNodeInfo.message_timeout_msec', index=10, number=13, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='min_app_version', full_name='MyNodeInfo.min_app_version', index=13, + name='min_app_version', full_name='MyNodeInfo.min_app_version', index=11, number=14, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, @@ -1694,8 +846,8 @@ _MYNODEINFO = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3206, - serialized_end=3559, + serialized_start=1102, + serialized_end=1396, ) @@ -1748,8 +900,8 @@ _LOGRECORD = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], - serialized_start=3562, - serialized_end=3743, + serialized_start=1399, + serialized_end=1580, ) @@ -1770,7 +922,7 @@ _FROMRADIO = _descriptor.Descriptor( serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='packet', full_name='FromRadio.packet', index=1, - number=2, type=11, cpp_type=10, label=1, + number=11, 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, @@ -1790,40 +942,26 @@ _FROMRADIO = _descriptor.Descriptor( is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='radio', full_name='FromRadio.radio', index=4, - number=6, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='log_record', full_name='FromRadio.log_record', index=5, + name='log_record', full_name='FromRadio.log_record', index=4, number=7, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='config_complete_id', full_name='FromRadio.config_complete_id', index=6, + name='config_complete_id', full_name='FromRadio.config_complete_id', index=5, 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, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='rebooted', full_name='FromRadio.rebooted', index=7, + name='rebooted', full_name='FromRadio.rebooted', index=6, number=9, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='channel', full_name='FromRadio.channel', index=8, - number=10, 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, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1841,8 +979,8 @@ _FROMRADIO = _descriptor.Descriptor( create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=3746, - serialized_end=4035, + serialized_start=1583, + serialized_end=1816, ) @@ -1856,7 +994,7 @@ _TORADIO = _descriptor.Descriptor( fields=[ _descriptor.FieldDescriptor( name='packet', full_name='ToRadio.packet', index=0, - number=1, type=11, cpp_type=10, label=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, @@ -1868,27 +1006,6 @@ _TORADIO = _descriptor.Descriptor( message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='set_radio', full_name='ToRadio.set_radio', index=2, - number=101, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='set_owner', full_name='ToRadio.set_owner', index=3, - number=102, 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, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='set_channel', full_name='ToRadio.set_channel', index=4, - number=103, 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, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -1906,42 +1023,25 @@ _TORADIO = _descriptor.Descriptor( create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=4038, - serialized_end=4226, + serialized_start=1818, + serialized_end=1926, ) +_ROUTING.fields_by_name['route_request'].message_type = _ROUTEDISCOVERY +_ROUTING.fields_by_name['route_reply'].message_type = _ROUTEDISCOVERY +_ROUTING.fields_by_name['error_reason'].enum_type = _ROUTING_ERROR +_ROUTING_ERROR.containing_type = _ROUTING +_ROUTING.oneofs_by_name['variant'].fields.append( + _ROUTING.fields_by_name['route_request']) +_ROUTING.fields_by_name['route_request'].containing_oneof = _ROUTING.oneofs_by_name['variant'] +_ROUTING.oneofs_by_name['variant'].fields.append( + _ROUTING.fields_by_name['route_reply']) +_ROUTING.fields_by_name['route_reply'].containing_oneof = _ROUTING.oneofs_by_name['variant'] +_ROUTING.oneofs_by_name['variant'].fields.append( + _ROUTING.fields_by_name['error_reason']) +_ROUTING.fields_by_name['error_reason'].containing_oneof = _ROUTING.oneofs_by_name['variant'] _DATA.fields_by_name['portnum'].enum_type = portnums__pb2._PORTNUM -_SUBPACKET.fields_by_name['data'].message_type = _DATA -_SUBPACKET.fields_by_name['route_request'].message_type = _ROUTEDISCOVERY -_SUBPACKET.fields_by_name['route_reply'].message_type = _ROUTEDISCOVERY -_SUBPACKET.fields_by_name['error_reason'].enum_type = _ERRORREASON -_SUBPACKET.fields_by_name['position'].message_type = _POSITION -_SUBPACKET.fields_by_name['user'].message_type = _USER -_SUBPACKET.oneofs_by_name['payloadVariant'].fields.append( - _SUBPACKET.fields_by_name['data']) -_SUBPACKET.fields_by_name['data'].containing_oneof = _SUBPACKET.oneofs_by_name['payloadVariant'] -_SUBPACKET.oneofs_by_name['payloadVariant'].fields.append( - _SUBPACKET.fields_by_name['route_request']) -_SUBPACKET.fields_by_name['route_request'].containing_oneof = _SUBPACKET.oneofs_by_name['payloadVariant'] -_SUBPACKET.oneofs_by_name['payloadVariant'].fields.append( - _SUBPACKET.fields_by_name['route_reply']) -_SUBPACKET.fields_by_name['route_reply'].containing_oneof = _SUBPACKET.oneofs_by_name['payloadVariant'] -_SUBPACKET.oneofs_by_name['payloadVariant'].fields.append( - _SUBPACKET.fields_by_name['error_reason']) -_SUBPACKET.fields_by_name['error_reason'].containing_oneof = _SUBPACKET.oneofs_by_name['payloadVariant'] -_SUBPACKET.oneofs_by_name['payloadVariant'].fields.append( - _SUBPACKET.fields_by_name['position']) -_SUBPACKET.fields_by_name['position'].containing_oneof = _SUBPACKET.oneofs_by_name['payloadVariant'] -_SUBPACKET.oneofs_by_name['payloadVariant'].fields.append( - _SUBPACKET.fields_by_name['user']) -_SUBPACKET.fields_by_name['user'].containing_oneof = _SUBPACKET.oneofs_by_name['payloadVariant'] -_SUBPACKET.oneofs_by_name['ackVariant'].fields.append( - _SUBPACKET.fields_by_name['success_id']) -_SUBPACKET.fields_by_name['success_id'].containing_oneof = _SUBPACKET.oneofs_by_name['ackVariant'] -_SUBPACKET.oneofs_by_name['ackVariant'].fields.append( - _SUBPACKET.fields_by_name['fail_id']) -_SUBPACKET.fields_by_name['fail_id'].containing_oneof = _SUBPACKET.oneofs_by_name['ackVariant'] -_MESHPACKET.fields_by_name['decoded'].message_type = _SUBPACKET +_MESHPACKET.fields_by_name['decoded'].message_type = _DATA _MESHPACKET.fields_by_name['priority'].enum_type = _MESHPACKET_PRIORITY _MESHPACKET_PRIORITY.containing_type = _MESHPACKET _MESHPACKET.oneofs_by_name['payloadVariant'].fields.append( @@ -1950,15 +1050,6 @@ _MESHPACKET.fields_by_name['decoded'].containing_oneof = _MESHPACKET.one _MESHPACKET.oneofs_by_name['payloadVariant'].fields.append( _MESHPACKET.fields_by_name['encrypted']) _MESHPACKET.fields_by_name['encrypted'].containing_oneof = _MESHPACKET.oneofs_by_name['payloadVariant'] -_CHANNELSETTINGS.fields_by_name['modem_config'].enum_type = _CHANNELSETTINGS_MODEMCONFIG -_CHANNELSETTINGS_MODEMCONFIG.containing_type = _CHANNELSETTINGS -_RADIOCONFIG_USERPREFERENCES.fields_by_name['region'].enum_type = _REGIONCODE -_RADIOCONFIG_USERPREFERENCES.fields_by_name['charge_current'].enum_type = _CHARGECURRENT -_RADIOCONFIG_USERPREFERENCES.fields_by_name['location_share'].enum_type = _LOCATIONSHARING -_RADIOCONFIG_USERPREFERENCES.fields_by_name['gps_operation'].enum_type = _GPSOPERATION -_RADIOCONFIG_USERPREFERENCES.containing_type = _RADIOCONFIG -_RADIOCONFIG.fields_by_name['preferences'].message_type = _RADIOCONFIG_USERPREFERENCES -_RADIOCONFIG.fields_by_name['channel_settings'].message_type = _CHANNELSETTINGS _NODEINFO.fields_by_name['user'].message_type = _USER _NODEINFO.fields_by_name['position'].message_type = _POSITION _MYNODEINFO.fields_by_name['error_code'].enum_type = _CRITICALERRORCODE @@ -1967,9 +1058,7 @@ _LOGRECORD_LEVEL.containing_type = _LOGRECORD _FROMRADIO.fields_by_name['packet'].message_type = _MESHPACKET _FROMRADIO.fields_by_name['my_info'].message_type = _MYNODEINFO _FROMRADIO.fields_by_name['node_info'].message_type = _NODEINFO -_FROMRADIO.fields_by_name['radio'].message_type = _RADIOCONFIG _FROMRADIO.fields_by_name['log_record'].message_type = _LOGRECORD -_FROMRADIO.fields_by_name['channel'].message_type = _CHANNELSETTINGS _FROMRADIO.oneofs_by_name['payloadVariant'].fields.append( _FROMRADIO.fields_by_name['packet']) _FROMRADIO.fields_by_name['packet'].containing_oneof = _FROMRADIO.oneofs_by_name['payloadVariant'] @@ -1979,9 +1068,6 @@ _FROMRADIO.fields_by_name['my_info'].containing_oneof = _FROMRADIO.oneof _FROMRADIO.oneofs_by_name['payloadVariant'].fields.append( _FROMRADIO.fields_by_name['node_info']) _FROMRADIO.fields_by_name['node_info'].containing_oneof = _FROMRADIO.oneofs_by_name['payloadVariant'] -_FROMRADIO.oneofs_by_name['payloadVariant'].fields.append( - _FROMRADIO.fields_by_name['radio']) -_FROMRADIO.fields_by_name['radio'].containing_oneof = _FROMRADIO.oneofs_by_name['payloadVariant'] _FROMRADIO.oneofs_by_name['payloadVariant'].fields.append( _FROMRADIO.fields_by_name['log_record']) _FROMRADIO.fields_by_name['log_record'].containing_oneof = _FROMRADIO.oneofs_by_name['payloadVariant'] @@ -1991,47 +1077,25 @@ _FROMRADIO.fields_by_name['config_complete_id'].containing_oneof = _FROM _FROMRADIO.oneofs_by_name['payloadVariant'].fields.append( _FROMRADIO.fields_by_name['rebooted']) _FROMRADIO.fields_by_name['rebooted'].containing_oneof = _FROMRADIO.oneofs_by_name['payloadVariant'] -_FROMRADIO.oneofs_by_name['payloadVariant'].fields.append( - _FROMRADIO.fields_by_name['channel']) -_FROMRADIO.fields_by_name['channel'].containing_oneof = _FROMRADIO.oneofs_by_name['payloadVariant'] _TORADIO.fields_by_name['packet'].message_type = _MESHPACKET -_TORADIO.fields_by_name['set_radio'].message_type = _RADIOCONFIG -_TORADIO.fields_by_name['set_owner'].message_type = _USER -_TORADIO.fields_by_name['set_channel'].message_type = _CHANNELSETTINGS _TORADIO.oneofs_by_name['payloadVariant'].fields.append( _TORADIO.fields_by_name['packet']) _TORADIO.fields_by_name['packet'].containing_oneof = _TORADIO.oneofs_by_name['payloadVariant'] _TORADIO.oneofs_by_name['payloadVariant'].fields.append( _TORADIO.fields_by_name['want_config_id']) _TORADIO.fields_by_name['want_config_id'].containing_oneof = _TORADIO.oneofs_by_name['payloadVariant'] -_TORADIO.oneofs_by_name['payloadVariant'].fields.append( - _TORADIO.fields_by_name['set_radio']) -_TORADIO.fields_by_name['set_radio'].containing_oneof = _TORADIO.oneofs_by_name['payloadVariant'] -_TORADIO.oneofs_by_name['payloadVariant'].fields.append( - _TORADIO.fields_by_name['set_owner']) -_TORADIO.fields_by_name['set_owner'].containing_oneof = _TORADIO.oneofs_by_name['payloadVariant'] -_TORADIO.oneofs_by_name['payloadVariant'].fields.append( - _TORADIO.fields_by_name['set_channel']) -_TORADIO.fields_by_name['set_channel'].containing_oneof = _TORADIO.oneofs_by_name['payloadVariant'] DESCRIPTOR.message_types_by_name['Position'] = _POSITION -DESCRIPTOR.message_types_by_name['Data'] = _DATA DESCRIPTOR.message_types_by_name['User'] = _USER DESCRIPTOR.message_types_by_name['RouteDiscovery'] = _ROUTEDISCOVERY -DESCRIPTOR.message_types_by_name['SubPacket'] = _SUBPACKET +DESCRIPTOR.message_types_by_name['Routing'] = _ROUTING +DESCRIPTOR.message_types_by_name['Data'] = _DATA DESCRIPTOR.message_types_by_name['MeshPacket'] = _MESHPACKET -DESCRIPTOR.message_types_by_name['ChannelSettings'] = _CHANNELSETTINGS -DESCRIPTOR.message_types_by_name['RadioConfig'] = _RADIOCONFIG DESCRIPTOR.message_types_by_name['NodeInfo'] = _NODEINFO DESCRIPTOR.message_types_by_name['MyNodeInfo'] = _MYNODEINFO DESCRIPTOR.message_types_by_name['LogRecord'] = _LOGRECORD DESCRIPTOR.message_types_by_name['FromRadio'] = _FROMRADIO DESCRIPTOR.message_types_by_name['ToRadio'] = _TORADIO -DESCRIPTOR.enum_types_by_name['ErrorReason'] = _ERRORREASON DESCRIPTOR.enum_types_by_name['Constants'] = _CONSTANTS -DESCRIPTOR.enum_types_by_name['RegionCode'] = _REGIONCODE -DESCRIPTOR.enum_types_by_name['ChargeCurrent'] = _CHARGECURRENT -DESCRIPTOR.enum_types_by_name['GpsOperation'] = _GPSOPERATION -DESCRIPTOR.enum_types_by_name['LocationSharing'] = _LOCATIONSHARING DESCRIPTOR.enum_types_by_name['CriticalErrorCode'] = _CRITICALERRORCODE _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -2042,13 +1106,6 @@ Position = _reflection.GeneratedProtocolMessageType('Position', (_messag }) _sym_db.RegisterMessage(Position) -Data = _reflection.GeneratedProtocolMessageType('Data', (_message.Message,), { - 'DESCRIPTOR' : _DATA, - '__module__' : 'mesh_pb2' - # @@protoc_insertion_point(class_scope:Data) - }) -_sym_db.RegisterMessage(Data) - User = _reflection.GeneratedProtocolMessageType('User', (_message.Message,), { 'DESCRIPTOR' : _USER, '__module__' : 'mesh_pb2' @@ -2063,12 +1120,19 @@ RouteDiscovery = _reflection.GeneratedProtocolMessageType('RouteDiscovery }) _sym_db.RegisterMessage(RouteDiscovery) -SubPacket = _reflection.GeneratedProtocolMessageType('SubPacket', (_message.Message,), { - 'DESCRIPTOR' : _SUBPACKET, +Routing = _reflection.GeneratedProtocolMessageType('Routing', (_message.Message,), { + 'DESCRIPTOR' : _ROUTING, '__module__' : 'mesh_pb2' - # @@protoc_insertion_point(class_scope:SubPacket) + # @@protoc_insertion_point(class_scope:Routing) }) -_sym_db.RegisterMessage(SubPacket) +_sym_db.RegisterMessage(Routing) + +Data = _reflection.GeneratedProtocolMessageType('Data', (_message.Message,), { + 'DESCRIPTOR' : _DATA, + '__module__' : 'mesh_pb2' + # @@protoc_insertion_point(class_scope:Data) + }) +_sym_db.RegisterMessage(Data) MeshPacket = _reflection.GeneratedProtocolMessageType('MeshPacket', (_message.Message,), { 'DESCRIPTOR' : _MESHPACKET, @@ -2077,28 +1141,6 @@ MeshPacket = _reflection.GeneratedProtocolMessageType('MeshPacket', (_me }) _sym_db.RegisterMessage(MeshPacket) -ChannelSettings = _reflection.GeneratedProtocolMessageType('ChannelSettings', (_message.Message,), { - 'DESCRIPTOR' : _CHANNELSETTINGS, - '__module__' : 'mesh_pb2' - # @@protoc_insertion_point(class_scope:ChannelSettings) - }) -_sym_db.RegisterMessage(ChannelSettings) - -RadioConfig = _reflection.GeneratedProtocolMessageType('RadioConfig', (_message.Message,), { - - 'UserPreferences' : _reflection.GeneratedProtocolMessageType('UserPreferences', (_message.Message,), { - 'DESCRIPTOR' : _RADIOCONFIG_USERPREFERENCES, - '__module__' : 'mesh_pb2' - # @@protoc_insertion_point(class_scope:RadioConfig.UserPreferences) - }) - , - 'DESCRIPTOR' : _RADIOCONFIG, - '__module__' : 'mesh_pb2' - # @@protoc_insertion_point(class_scope:RadioConfig) - }) -_sym_db.RegisterMessage(RadioConfig) -_sym_db.RegisterMessage(RadioConfig.UserPreferences) - NodeInfo = _reflection.GeneratedProtocolMessageType('NodeInfo', (_message.Message,), { 'DESCRIPTOR' : _NODEINFO, '__module__' : 'mesh_pb2' @@ -2136,11 +1178,7 @@ _sym_db.RegisterMessage(ToRadio) DESCRIPTOR._options = None -_SUBPACKET.fields_by_name['position']._options = None -_SUBPACKET.fields_by_name['user']._options = None -_RADIOCONFIG.fields_by_name['channel_settings']._options = None _MYNODEINFO.fields_by_name['region']._options = None -_MYNODEINFO.fields_by_name['current_packet_id']._options = None # @@protoc_insertion_point(module_scope)
    @@ -2153,92 +1191,6 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Classes

    -
    -class ChannelSettings -(*args, **kwargs) -
    -
    -

    A ProtocolMessage

    -

    Ancestors

    -
      -
    • google.protobuf.pyext._message.CMessage
    • -
    • google.protobuf.message.Message
    • -
    -

    Class variables

    -
    -
    var Bw125Cr45Sf128
    -
    -
    -
    -
    var Bw125Cr48Sf4096
    -
    -
    -
    -
    var Bw31_25Cr48Sf512
    -
    -
    -
    -
    var Bw500Cr45Sf128
    -
    -
    -
    -
    var DESCRIPTOR
    -
    -
    -
    -
    var ModemConfig
    -
    -
    -
    -
    -

    Instance variables

    -
    -
    var bandwidth
    -
    -

    Field ChannelSettings.bandwidth

    -
    -
    var channel_num
    -
    -

    Field ChannelSettings.channel_num

    -
    -
    var coding_rate
    -
    -

    Field ChannelSettings.coding_rate

    -
    - -
    -

    Field ChannelSettings.downlink_enabled

    -
    -
    var id
    -
    -

    Field ChannelSettings.id

    -
    -
    var modem_config
    -
    -

    Field ChannelSettings.modem_config

    -
    -
    var name
    -
    -

    Field ChannelSettings.name

    -
    -
    var psk
    -
    -

    Field ChannelSettings.psk

    -
    -
    var spread_factor
    -
    -

    Field ChannelSettings.spread_factor

    -
    -
    var tx_power
    -
    -

    Field ChannelSettings.tx_power

    -
    - -
    -

    Field ChannelSettings.uplink_enabled

    -
    -
    -
    class Data (*args, **kwargs) @@ -2259,6 +1211,10 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Instance variables

    +
    var dest
    +
    +

    Field Data.dest

    +
    var payload

    Field Data.payload

    @@ -2267,6 +1223,18 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Field Data.portnum

    +
    var request_id
    +
    +

    Field Data.request_id

    +
    +
    var source
    +
    +

    Field Data.source

    +
    +
    var want_response
    +
    +

    Field Data.want_response

    +
    @@ -2289,10 +1257,6 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Instance variables

    -
    var channel
    -
    -

    Field FromRadio.channel

    -
    var config_complete_id

    Field FromRadio.config_complete_id

    @@ -2317,10 +1281,6 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Field FromRadio.packet

    -
    var radio
    -
    -

    Field FromRadio.radio

    -
    var rebooted

    Field FromRadio.rebooted

    @@ -2449,9 +1409,9 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Instance variables

    -
    var channel_index
    +
    var channel
    -

    Field MeshPacket.channel_index

    +

    Field MeshPacket.channel

    var decoded
    @@ -2515,10 +1475,6 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Instance variables

    -
    var current_packet_id
    -
    -

    Field MyNodeInfo.current_packet_id

    -
    var error_address

    Field MyNodeInfo.error_address

    @@ -2543,6 +1499,10 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Field MyNodeInfo.hw_model

    +
    var max_channels
    +
    +

    Field MyNodeInfo.max_channels

    +
    var message_timeout_msec

    Field MyNodeInfo.message_timeout_msec

    @@ -2555,17 +1515,9 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Field MyNodeInfo.my_node_num

    -
    var node_num_bits
    +
    var num_bands
    -

    Field MyNodeInfo.node_num_bits

    -
    -
    var num_channels
    -
    -

    Field MyNodeInfo.num_channels

    -
    -
    var packet_id_bits
    -
    -

    Field MyNodeInfo.packet_id_bits

    +

    Field MyNodeInfo.num_bands

    var region
    @@ -2657,40 +1609,6 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None
    -
    -class RadioConfig -(*args, **kwargs) -
    -
    -

    A ProtocolMessage

    -

    Ancestors

    -
      -
    • google.protobuf.pyext._message.CMessage
    • -
    • google.protobuf.message.Message
    • -
    -

    Class variables

    -
    -
    var DESCRIPTOR
    -
    -
    -
    -
    var UserPreferences
    -
    -

    A ProtocolMessage

    -
    -
    -

    Instance variables

    -
    -
    var channel_settings
    -
    -

    Field RadioConfig.channel_settings

    -
    -
    var preferences
    -
    -

    Field RadioConfig.preferences

    -
    -
    -
    class RouteDiscovery (*args, **kwargs) @@ -2717,8 +1635,8 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None -
    -class SubPacket +
    +class Routing (*args, **kwargs)
    @@ -2730,60 +1648,60 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Class variables

    -
    var DESCRIPTOR
    +
    var DESCRIPTOR
    +
    +
    +
    +
    var Error
    +
    +
    +
    +
    var GOT_NAK
    +
    +
    +
    +
    var MAX_RETRANSMIT
    +
    +
    +
    +
    var NONE
    +
    +
    +
    +
    var NO_CHANNEL
    +
    +
    +
    +
    var NO_INTERFACE
    +
    +
    +
    +
    var NO_ROUTE
    +
    +
    +
    +
    var TIMEOUT
    +
    +
    +
    +
    var TOO_LARGE

    Instance variables

    -
    var data
    +
    var error_reason
    -

    Field SubPacket.data

    +

    Field Routing.error_reason

    -
    var dest
    +
    var route_reply
    -

    Field SubPacket.dest

    +

    Field Routing.route_reply

    -
    var error_reason
    +
    var route_request
    -

    Field SubPacket.error_reason

    -
    -
    var fail_id
    -
    -

    Field SubPacket.fail_id

    -
    -
    var original_id
    -
    -

    Field SubPacket.original_id

    -
    -
    var position
    -
    -

    Field SubPacket.position

    -
    -
    var route_reply
    -
    -

    Field SubPacket.route_reply

    -
    -
    var route_request
    -
    -

    Field SubPacket.route_request

    -
    -
    var source
    -
    -

    Field SubPacket.source

    -
    -
    var success_id
    -
    -

    Field SubPacket.success_id

    -
    -
    var user
    -
    -

    Field SubPacket.user

    -
    -
    var want_response
    -
    -

    Field SubPacket.want_response

    +

    Field Routing.route_request

    @@ -2811,18 +1729,6 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None

    Field ToRadio.packet

    -
    var set_channel
    -
    -

    Field ToRadio.set_channel

    -
    -
    var set_owner
    -
    -

    Field ToRadio.set_owner

    -
    -
    var set_radio
    -
    -

    Field ToRadio.set_radio

    -
    var want_config_id

    Field ToRadio.want_config_id

    @@ -2884,47 +1790,27 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None
  • Classes

    • -

      ChannelSettings

      - -
    • -
    • Data

      -
    • -

      RadioConfig

      - -
    • -
    • RouteDiscovery

      • DESCRIPTOR
      • @@ -3030,31 +1905,28 @@ _MYNODEINFO.fields_by_name['current_packet_id']._options = None
    • -

      SubPacket

      +

      Routing

    • ToRadio

      -
        + diff --git a/docs/meshtastic/portnums_pb2.html b/docs/meshtastic/portnums_pb2.html index baaee4d..9b5b0e9 100644 --- a/docs/meshtastic/portnums_pb2.html +++ b/docs/meshtastic/portnums_pb2.html @@ -49,7 +49,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( syntax='proto3', serialized_options=b'\n\023com.geeksville.meshB\010PortnumsH\003', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0eportnums.proto*\x94\x02\n\x07PortNum\x12\x0f\n\x0bUNKNOWN_APP\x10\x00\x12\x14\n\x10TEXT_MESSAGE_APP\x10\x01\x12\x17\n\x13REMOTE_HARDWARE_APP\x10\x02\x12\x10\n\x0cPOSITION_APP\x10\x03\x12\x10\n\x0cNODEINFO_APP\x10\x04\x12\r\n\tREPLY_APP\x10 \x12\x11\n\rIP_TUNNEL_APP\x10!\x12!\n\x1d\x45NVIRONMENTAL_MEASUREMENT_APP\x10\"\x12\x0e\n\nSERIAL_APP\x10@\x12\x15\n\x11STORE_FORWARD_APP\x10\x41\x12\x12\n\x0eRANGE_TEST_APP\x10\x42\x12\x10\n\x0bPRIVATE_APP\x10\x80\x02\x12\x13\n\x0e\x41TAK_FORWARDER\x10\x81\x02\x42!\n\x13\x63om.geeksville.meshB\x08PortnumsH\x03\x62\x06proto3' + serialized_pb=b'\n\x0eportnums.proto*\xbe\x02\n\x07PortNum\x12\x0f\n\x0bUNKNOWN_APP\x10\x00\x12\x14\n\x10TEXT_MESSAGE_APP\x10\x01\x12\x17\n\x13REMOTE_HARDWARE_APP\x10\x02\x12\x10\n\x0cPOSITION_APP\x10\x03\x12\x10\n\x0cNODEINFO_APP\x10\x04\x12\x0f\n\x0bROUTING_APP\x10\x05\x12\r\n\tADMIN_APP\x10\x06\x12\r\n\tREPLY_APP\x10 \x12\x11\n\rIP_TUNNEL_APP\x10!\x12!\n\x1d\x45NVIRONMENTAL_MEASUREMENT_APP\x10\"\x12\x0e\n\nSERIAL_APP\x10@\x12\x15\n\x11STORE_FORWARD_APP\x10\x41\x12\x12\n\x0eRANGE_TEST_APP\x10\x42\x12\x10\n\x0bPRIVATE_APP\x10\x80\x02\x12\x13\n\x0e\x41TAK_FORWARDER\x10\x81\x02\x12\x08\n\x03MAX\x10\xff\x03\x42!\n\x13\x63om.geeksville.meshB\x08PortnumsH\x03\x62\x06proto3' ) _PORTNUM = _descriptor.EnumDescriptor( @@ -85,42 +85,57 @@ _PORTNUM = _descriptor.EnumDescriptor( type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='REPLY_APP', index=5, number=32, + name='ROUTING_APP', index=5, number=5, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='IP_TUNNEL_APP', index=6, number=33, + name='ADMIN_APP', index=6, number=6, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='ENVIRONMENTAL_MEASUREMENT_APP', index=7, number=34, + name='REPLY_APP', index=7, number=32, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='SERIAL_APP', index=8, number=64, + name='IP_TUNNEL_APP', index=8, number=33, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='STORE_FORWARD_APP', index=9, number=65, + name='ENVIRONMENTAL_MEASUREMENT_APP', index=9, number=34, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='RANGE_TEST_APP', index=10, number=66, + name='SERIAL_APP', index=10, number=64, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='PRIVATE_APP', index=11, number=256, + name='STORE_FORWARD_APP', index=11, number=65, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( - name='ATAK_FORWARDER', index=12, number=257, + name='RANGE_TEST_APP', index=12, number=66, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='PRIVATE_APP', index=13, number=256, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ATAK_FORWARDER', index=14, number=257, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='MAX', index=15, number=511, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), @@ -128,7 +143,7 @@ _PORTNUM = _descriptor.EnumDescriptor( containing_type=None, serialized_options=None, serialized_start=19, - serialized_end=295, + serialized_end=337, ) _sym_db.RegisterEnumDescriptor(_PORTNUM) @@ -138,6 +153,8 @@ TEXT_MESSAGE_APP = 1 REMOTE_HARDWARE_APP = 2 POSITION_APP = 3 NODEINFO_APP = 4 +ROUTING_APP = 5 +ADMIN_APP = 6 REPLY_APP = 32 IP_TUNNEL_APP = 33 ENVIRONMENTAL_MEASUREMENT_APP = 34 @@ -146,6 +163,7 @@ STORE_FORWARD_APP = 65 RANGE_TEST_APP = 66 PRIVATE_APP = 256 ATAK_FORWARDER = 257 +MAX = 511 DESCRIPTOR.enum_types_by_name['PortNum'] = _PORTNUM diff --git a/docs/meshtastic/radioconfig_pb2.html b/docs/meshtastic/radioconfig_pb2.html new file mode 100644 index 0000000..f914689 --- /dev/null +++ b/docs/meshtastic/radioconfig_pb2.html @@ -0,0 +1,815 @@ + + + + + + +meshtastic.radioconfig_pb2 API documentation + + + + + + + + + + + +
        +
        +
        +

        Module meshtastic.radioconfig_pb2

        +
        +
        +

        Generated protocol buffer code.

        +
        + +Expand source code + +
        # -*- coding: utf-8 -*-
        +# Generated by the protocol buffer compiler.  DO NOT EDIT!
        +# source: radioconfig.proto
        +"""Generated protocol buffer code."""
        +from google.protobuf.internal import enum_type_wrapper
        +from google.protobuf import descriptor as _descriptor
        +from google.protobuf import message as _message
        +from google.protobuf import reflection as _reflection
        +from google.protobuf import symbol_database as _symbol_database
        +# @@protoc_insertion_point(imports)
        +
        +_sym_db = _symbol_database.Default()
        +
        +
        +
        +
        +DESCRIPTOR = _descriptor.FileDescriptor(
        +  name='radioconfig.proto',
        +  package='',
        +  syntax='proto3',
        +  serialized_options=b'\n\023com.geeksville.meshB\021RadioConfigProtosH\003',
        +  create_key=_descriptor._internal_create_key,
        +  serialized_pb=b'\n\x11radioconfig.proto\"\x89\r\n\x0bRadioConfig\x12\x31\n\x0bpreferences\x18\x01 \x01(\x0b\x32\x1c.RadioConfig.UserPreferences\x1a\xc6\x0c\n\x0fUserPreferences\x12\x1f\n\x17position_broadcast_secs\x18\x01 \x01(\r\x12\x1b\n\x13send_owner_interval\x18\x02 \x01(\r\x12\x1b\n\x13wait_bluetooth_secs\x18\x04 \x01(\r\x12\x16\n\x0escreen_on_secs\x18\x05 \x01(\r\x12\x1a\n\x12phone_timeout_secs\x18\x06 \x01(\r\x12\x1d\n\x15phone_sds_timeout_sec\x18\x07 \x01(\r\x12\x1d\n\x15mesh_sds_timeout_secs\x18\x08 \x01(\r\x12\x10\n\x08sds_secs\x18\t \x01(\r\x12\x0f\n\x07ls_secs\x18\n \x01(\r\x12\x15\n\rmin_wake_secs\x18\x0b \x01(\r\x12\x11\n\twifi_ssid\x18\x0c \x01(\t\x12\x15\n\rwifi_password\x18\r \x01(\t\x12\x14\n\x0cwifi_ap_mode\x18\x0e \x01(\x08\x12\x1b\n\x06region\x18\x0f \x01(\x0e\x32\x0b.RegionCode\x12&\n\x0e\x63harge_current\x18\x10 \x01(\x0e\x32\x0e.ChargeCurrent\x12\x11\n\tis_router\x18% \x01(\x08\x12\x14\n\x0cis_low_power\x18& \x01(\x08\x12\x16\n\x0e\x66ixed_position\x18\' \x01(\x08\x12\x15\n\rfactory_reset\x18\x64 \x01(\x08\x12\x19\n\x11\x64\x65\x62ug_log_enabled\x18\x65 \x01(\x08\x12(\n\x0elocation_share\x18  \x01(\x0e\x32\x10.LocationSharing\x12$\n\rgps_operation\x18! \x01(\x0e\x32\r.GpsOperation\x12\x1b\n\x13gps_update_interval\x18\" \x01(\r\x12\x18\n\x10gps_attempt_time\x18$ \x01(\r\x12\x17\n\x0fignore_incoming\x18g \x03(\r\x12\x1c\n\x14serialplugin_enabled\x18x \x01(\x08\x12\x19\n\x11serialplugin_echo\x18y \x01(\x08\x12\x18\n\x10serialplugin_rxd\x18z \x01(\r\x12\x18\n\x10serialplugin_txd\x18{ \x01(\r\x12\x1c\n\x14serialplugin_timeout\x18| \x01(\r\x12\x19\n\x11serialplugin_mode\x18} \x01(\r\x12\'\n\x1f\x65xt_notification_plugin_enabled\x18~ \x01(\x08\x12)\n!ext_notification_plugin_output_ms\x18\x7f \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_output\x18\x80\x01 \x01(\r\x12\'\n\x1e\x65xt_notification_plugin_active\x18\x81\x01 \x01(\x08\x12.\n%ext_notification_plugin_alert_message\x18\x82\x01 \x01(\x08\x12+\n\"ext_notification_plugin_alert_bell\x18\x83\x01 \x01(\x08\x12\"\n\x19range_test_plugin_enabled\x18\x84\x01 \x01(\x08\x12!\n\x18range_test_plugin_sender\x18\x85\x01 \x01(\r\x12\x1f\n\x16range_test_plugin_save\x18\x86\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_enabled\x18\x88\x01 \x01(\x08\x12%\n\x1cstore_forward_plugin_records\x18\x89\x01 \x01(\r\x12=\n4environmental_measurement_plugin_measurement_enabled\x18\x8c\x01 \x01(\x08\x12\x38\n/environmental_measurement_plugin_screen_enabled\x18\x8d\x01 \x01(\x08\x12\x44\n;environmental_measurement_plugin_read_error_count_threshold\x18\x8e\x01 \x01(\r\x12\x39\n0environmental_measurement_plugin_update_interval\x18\x8f\x01 \x01(\r\x12;\n2environmental_measurement_plugin_recovery_interval\x18\x90\x01 \x01(\r*^\n\nRegionCode\x12\t\n\x05Unset\x10\x00\x12\x06\n\x02US\x10\x01\x12\t\n\x05\x45U433\x10\x02\x12\t\n\x05\x45U865\x10\x03\x12\x06\n\x02\x43N\x10\x04\x12\x06\n\x02JP\x10\x05\x12\x07\n\x03\x41NZ\x10\x06\x12\x06\n\x02KR\x10\x07\x12\x06\n\x02TW\x10\x08*\xd1\x01\n\rChargeCurrent\x12\x0b\n\x07MAUnset\x10\x00\x12\t\n\x05MA100\x10\x01\x12\t\n\x05MA190\x10\x02\x12\t\n\x05MA280\x10\x03\x12\t\n\x05MA360\x10\x04\x12\t\n\x05MA450\x10\x05\x12\t\n\x05MA550\x10\x06\x12\t\n\x05MA630\x10\x07\x12\t\n\x05MA700\x10\x08\x12\t\n\x05MA780\x10\t\x12\t\n\x05MA880\x10\n\x12\t\n\x05MA960\x10\x0b\x12\n\n\x06MA1000\x10\x0c\x12\n\n\x06MA1080\x10\r\x12\n\n\x06MA1160\x10\x0e\x12\n\n\x06MA1240\x10\x0f\x12\n\n\x06MA1320\x10\x10*j\n\x0cGpsOperation\x12\x0e\n\nGpsOpUnset\x10\x00\x12\x13\n\x0fGpsOpStationary\x10\x01\x12\x0f\n\x0bGpsOpMobile\x10\x02\x12\x11\n\rGpsOpTimeOnly\x10\x03\x12\x11\n\rGpsOpDisabled\x10\x04*@\n\x0fLocationSharing\x12\x0c\n\x08LocUnset\x10\x00\x12\x0e\n\nLocEnabled\x10\x01\x12\x0f\n\x0bLocDisabled\x10\x02\x42*\n\x13\x63om.geeksville.meshB\x11RadioConfigProtosH\x03\x62\x06proto3'
        +)
        +
        +_REGIONCODE = _descriptor.EnumDescriptor(
        +  name='RegionCode',
        +  full_name='RegionCode',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  create_key=_descriptor._internal_create_key,
        +  values=[
        +    _descriptor.EnumValueDescriptor(
        +      name='Unset', index=0, number=0,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='US', index=1, number=1,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='EU433', index=2, number=2,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='EU865', index=3, number=3,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='CN', index=4, number=4,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='JP', index=5, number=5,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='ANZ', index=6, number=6,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='KR', index=7, number=7,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='TW', index=8, number=8,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +  ],
        +  containing_type=None,
        +  serialized_options=None,
        +  serialized_start=1697,
        +  serialized_end=1791,
        +)
        +_sym_db.RegisterEnumDescriptor(_REGIONCODE)
        +
        +RegionCode = enum_type_wrapper.EnumTypeWrapper(_REGIONCODE)
        +_CHARGECURRENT = _descriptor.EnumDescriptor(
        +  name='ChargeCurrent',
        +  full_name='ChargeCurrent',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  create_key=_descriptor._internal_create_key,
        +  values=[
        +    _descriptor.EnumValueDescriptor(
        +      name='MAUnset', index=0, number=0,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA100', index=1, number=1,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA190', index=2, number=2,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA280', index=3, number=3,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA360', index=4, number=4,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA450', index=5, number=5,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA550', index=6, number=6,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA630', index=7, number=7,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA700', index=8, number=8,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA780', index=9, number=9,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA880', index=10, number=10,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA960', index=11, number=11,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA1000', index=12, number=12,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA1080', index=13, number=13,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA1160', index=14, number=14,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA1240', index=15, number=15,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='MA1320', index=16, number=16,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +  ],
        +  containing_type=None,
        +  serialized_options=None,
        +  serialized_start=1794,
        +  serialized_end=2003,
        +)
        +_sym_db.RegisterEnumDescriptor(_CHARGECURRENT)
        +
        +ChargeCurrent = enum_type_wrapper.EnumTypeWrapper(_CHARGECURRENT)
        +_GPSOPERATION = _descriptor.EnumDescriptor(
        +  name='GpsOperation',
        +  full_name='GpsOperation',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  create_key=_descriptor._internal_create_key,
        +  values=[
        +    _descriptor.EnumValueDescriptor(
        +      name='GpsOpUnset', index=0, number=0,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='GpsOpStationary', index=1, number=1,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='GpsOpMobile', index=2, number=2,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='GpsOpTimeOnly', index=3, number=3,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='GpsOpDisabled', index=4, number=4,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +  ],
        +  containing_type=None,
        +  serialized_options=None,
        +  serialized_start=2005,
        +  serialized_end=2111,
        +)
        +_sym_db.RegisterEnumDescriptor(_GPSOPERATION)
        +
        +GpsOperation = enum_type_wrapper.EnumTypeWrapper(_GPSOPERATION)
        +_LOCATIONSHARING = _descriptor.EnumDescriptor(
        +  name='LocationSharing',
        +  full_name='LocationSharing',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  create_key=_descriptor._internal_create_key,
        +  values=[
        +    _descriptor.EnumValueDescriptor(
        +      name='LocUnset', index=0, number=0,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='LocEnabled', index=1, number=1,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +    _descriptor.EnumValueDescriptor(
        +      name='LocDisabled', index=2, number=2,
        +      serialized_options=None,
        +      type=None,
        +      create_key=_descriptor._internal_create_key),
        +  ],
        +  containing_type=None,
        +  serialized_options=None,
        +  serialized_start=2113,
        +  serialized_end=2177,
        +)
        +_sym_db.RegisterEnumDescriptor(_LOCATIONSHARING)
        +
        +LocationSharing = enum_type_wrapper.EnumTypeWrapper(_LOCATIONSHARING)
        +Unset = 0
        +US = 1
        +EU433 = 2
        +EU865 = 3
        +CN = 4
        +JP = 5
        +ANZ = 6
        +KR = 7
        +TW = 8
        +MAUnset = 0
        +MA100 = 1
        +MA190 = 2
        +MA280 = 3
        +MA360 = 4
        +MA450 = 5
        +MA550 = 6
        +MA630 = 7
        +MA700 = 8
        +MA780 = 9
        +MA880 = 10
        +MA960 = 11
        +MA1000 = 12
        +MA1080 = 13
        +MA1160 = 14
        +MA1240 = 15
        +MA1320 = 16
        +GpsOpUnset = 0
        +GpsOpStationary = 1
        +GpsOpMobile = 2
        +GpsOpTimeOnly = 3
        +GpsOpDisabled = 4
        +LocUnset = 0
        +LocEnabled = 1
        +LocDisabled = 2
        +
        +
        +
        +_RADIOCONFIG_USERPREFERENCES = _descriptor.Descriptor(
        +  name='UserPreferences',
        +  full_name='RadioConfig.UserPreferences',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  containing_type=None,
        +  create_key=_descriptor._internal_create_key,
        +  fields=[
        +    _descriptor.FieldDescriptor(
        +      name='position_broadcast_secs', full_name='RadioConfig.UserPreferences.position_broadcast_secs', 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='send_owner_interval', full_name='RadioConfig.UserPreferences.send_owner_interval', 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='wait_bluetooth_secs', full_name='RadioConfig.UserPreferences.wait_bluetooth_secs', index=2,
        +      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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='screen_on_secs', full_name='RadioConfig.UserPreferences.screen_on_secs', index=3,
        +      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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='phone_timeout_secs', full_name='RadioConfig.UserPreferences.phone_timeout_secs', index=4,
        +      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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='phone_sds_timeout_sec', full_name='RadioConfig.UserPreferences.phone_sds_timeout_sec', index=5,
        +      number=7, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='mesh_sds_timeout_secs', full_name='RadioConfig.UserPreferences.mesh_sds_timeout_secs', index=6,
        +      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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='sds_secs', full_name='RadioConfig.UserPreferences.sds_secs', index=7,
        +      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,
        +      is_extension=False, extension_scope=None,
        +      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ls_secs', full_name='RadioConfig.UserPreferences.ls_secs', index=8,
        +      number=10, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='min_wake_secs', full_name='RadioConfig.UserPreferences.min_wake_secs', index=9,
        +      number=11, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='wifi_ssid', full_name='RadioConfig.UserPreferences.wifi_ssid', index=10,
        +      number=12, type=9, cpp_type=9, label=1,
        +      has_default_value=False, default_value=b"".decode('utf-8'),
        +      message_type=None, enum_type=None, containing_type=None,
        +      is_extension=False, extension_scope=None,
        +      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='wifi_password', full_name='RadioConfig.UserPreferences.wifi_password', index=11,
        +      number=13, type=9, cpp_type=9, label=1,
        +      has_default_value=False, default_value=b"".decode('utf-8'),
        +      message_type=None, enum_type=None, containing_type=None,
        +      is_extension=False, extension_scope=None,
        +      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='wifi_ap_mode', full_name='RadioConfig.UserPreferences.wifi_ap_mode', index=12,
        +      number=14, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='region', full_name='RadioConfig.UserPreferences.region', index=13,
        +      number=15, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='charge_current', full_name='RadioConfig.UserPreferences.charge_current', index=14,
        +      number=16, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='is_router', full_name='RadioConfig.UserPreferences.is_router', index=15,
        +      number=37, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='is_low_power', full_name='RadioConfig.UserPreferences.is_low_power', index=16,
        +      number=38, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='fixed_position', full_name='RadioConfig.UserPreferences.fixed_position', index=17,
        +      number=39, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='factory_reset', full_name='RadioConfig.UserPreferences.factory_reset', index=18,
        +      number=100, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='debug_log_enabled', full_name='RadioConfig.UserPreferences.debug_log_enabled', index=19,
        +      number=101, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='location_share', full_name='RadioConfig.UserPreferences.location_share', index=20,
        +      number=32, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='gps_operation', full_name='RadioConfig.UserPreferences.gps_operation', index=21,
        +      number=33, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='gps_update_interval', full_name='RadioConfig.UserPreferences.gps_update_interval', index=22,
        +      number=34, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='gps_attempt_time', full_name='RadioConfig.UserPreferences.gps_attempt_time', index=23,
        +      number=36, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ignore_incoming', full_name='RadioConfig.UserPreferences.ignore_incoming', index=24,
        +      number=103, type=13, cpp_type=3, label=3,
        +      has_default_value=False, default_value=[],
        +      message_type=None, enum_type=None, containing_type=None,
        +      is_extension=False, extension_scope=None,
        +      serialized_options=None, file=DESCRIPTOR,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='serialplugin_enabled', full_name='RadioConfig.UserPreferences.serialplugin_enabled', index=25,
        +      number=120, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='serialplugin_echo', full_name='RadioConfig.UserPreferences.serialplugin_echo', index=26,
        +      number=121, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='serialplugin_rxd', full_name='RadioConfig.UserPreferences.serialplugin_rxd', index=27,
        +      number=122, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='serialplugin_txd', full_name='RadioConfig.UserPreferences.serialplugin_txd', index=28,
        +      number=123, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='serialplugin_timeout', full_name='RadioConfig.UserPreferences.serialplugin_timeout', index=29,
        +      number=124, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='serialplugin_mode', full_name='RadioConfig.UserPreferences.serialplugin_mode', index=30,
        +      number=125, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ext_notification_plugin_enabled', full_name='RadioConfig.UserPreferences.ext_notification_plugin_enabled', index=31,
        +      number=126, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ext_notification_plugin_output_ms', full_name='RadioConfig.UserPreferences.ext_notification_plugin_output_ms', index=32,
        +      number=127, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ext_notification_plugin_output', full_name='RadioConfig.UserPreferences.ext_notification_plugin_output', index=33,
        +      number=128, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ext_notification_plugin_active', full_name='RadioConfig.UserPreferences.ext_notification_plugin_active', index=34,
        +      number=129, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ext_notification_plugin_alert_message', full_name='RadioConfig.UserPreferences.ext_notification_plugin_alert_message', index=35,
        +      number=130, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='ext_notification_plugin_alert_bell', full_name='RadioConfig.UserPreferences.ext_notification_plugin_alert_bell', index=36,
        +      number=131, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='range_test_plugin_enabled', full_name='RadioConfig.UserPreferences.range_test_plugin_enabled', index=37,
        +      number=132, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='range_test_plugin_sender', full_name='RadioConfig.UserPreferences.range_test_plugin_sender', index=38,
        +      number=133, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='range_test_plugin_save', full_name='RadioConfig.UserPreferences.range_test_plugin_save', index=39,
        +      number=134, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='store_forward_plugin_enabled', full_name='RadioConfig.UserPreferences.store_forward_plugin_enabled', index=40,
        +      number=136, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='store_forward_plugin_records', full_name='RadioConfig.UserPreferences.store_forward_plugin_records', index=41,
        +      number=137, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='environmental_measurement_plugin_measurement_enabled', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_measurement_enabled', index=42,
        +      number=140, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='environmental_measurement_plugin_screen_enabled', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_screen_enabled', index=43,
        +      number=141, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='environmental_measurement_plugin_read_error_count_threshold', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_read_error_count_threshold', index=44,
        +      number=142, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='environmental_measurement_plugin_update_interval', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_update_interval', index=45,
        +      number=143, 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,  create_key=_descriptor._internal_create_key),
        +    _descriptor.FieldDescriptor(
        +      name='environmental_measurement_plugin_recovery_interval', full_name='RadioConfig.UserPreferences.environmental_measurement_plugin_recovery_interval', index=46,
        +      number=144, 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,  create_key=_descriptor._internal_create_key),
        +  ],
        +  extensions=[
        +  ],
        +  nested_types=[],
        +  enum_types=[
        +  ],
        +  serialized_options=None,
        +  is_extendable=False,
        +  syntax='proto3',
        +  extension_ranges=[],
        +  oneofs=[
        +  ],
        +  serialized_start=89,
        +  serialized_end=1695,
        +)
        +
        +_RADIOCONFIG = _descriptor.Descriptor(
        +  name='RadioConfig',
        +  full_name='RadioConfig',
        +  filename=None,
        +  file=DESCRIPTOR,
        +  containing_type=None,
        +  create_key=_descriptor._internal_create_key,
        +  fields=[
        +    _descriptor.FieldDescriptor(
        +      name='preferences', full_name='RadioConfig.preferences', index=0,
        +      number=1, 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,  create_key=_descriptor._internal_create_key),
        +  ],
        +  extensions=[
        +  ],
        +  nested_types=[_RADIOCONFIG_USERPREFERENCES, ],
        +  enum_types=[
        +  ],
        +  serialized_options=None,
        +  is_extendable=False,
        +  syntax='proto3',
        +  extension_ranges=[],
        +  oneofs=[
        +  ],
        +  serialized_start=22,
        +  serialized_end=1695,
        +)
        +
        +_RADIOCONFIG_USERPREFERENCES.fields_by_name['region'].enum_type = _REGIONCODE
        +_RADIOCONFIG_USERPREFERENCES.fields_by_name['charge_current'].enum_type = _CHARGECURRENT
        +_RADIOCONFIG_USERPREFERENCES.fields_by_name['location_share'].enum_type = _LOCATIONSHARING
        +_RADIOCONFIG_USERPREFERENCES.fields_by_name['gps_operation'].enum_type = _GPSOPERATION
        +_RADIOCONFIG_USERPREFERENCES.containing_type = _RADIOCONFIG
        +_RADIOCONFIG.fields_by_name['preferences'].message_type = _RADIOCONFIG_USERPREFERENCES
        +DESCRIPTOR.message_types_by_name['RadioConfig'] = _RADIOCONFIG
        +DESCRIPTOR.enum_types_by_name['RegionCode'] = _REGIONCODE
        +DESCRIPTOR.enum_types_by_name['ChargeCurrent'] = _CHARGECURRENT
        +DESCRIPTOR.enum_types_by_name['GpsOperation'] = _GPSOPERATION
        +DESCRIPTOR.enum_types_by_name['LocationSharing'] = _LOCATIONSHARING
        +_sym_db.RegisterFileDescriptor(DESCRIPTOR)
        +
        +RadioConfig = _reflection.GeneratedProtocolMessageType('RadioConfig', (_message.Message,), {
        +
        +  'UserPreferences' : _reflection.GeneratedProtocolMessageType('UserPreferences', (_message.Message,), {
        +    'DESCRIPTOR' : _RADIOCONFIG_USERPREFERENCES,
        +    '__module__' : 'radioconfig_pb2'
        +    # @@protoc_insertion_point(class_scope:RadioConfig.UserPreferences)
        +    })
        +  ,
        +  'DESCRIPTOR' : _RADIOCONFIG,
        +  '__module__' : 'radioconfig_pb2'
        +  # @@protoc_insertion_point(class_scope:RadioConfig)
        +  })
        +_sym_db.RegisterMessage(RadioConfig)
        +_sym_db.RegisterMessage(RadioConfig.UserPreferences)
        +
        +
        +DESCRIPTOR._options = None
        +# @@protoc_insertion_point(module_scope)
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +

        Classes

        +
        +
        +class RadioConfig +(*args, **kwargs) +
        +
        +

        A ProtocolMessage

        +

        Ancestors

        +
          +
        • google.protobuf.pyext._message.CMessage
        • +
        • google.protobuf.message.Message
        • +
        +

        Class variables

        +
        +
        var DESCRIPTOR
        +
        +
        +
        +
        var UserPreferences
        +
        +

        A ProtocolMessage

        +
        +
        +

        Instance variables

        +
        +
        var preferences
        +
        +

        Field RadioConfig.preferences

        +
        +
        +
        +
        +
        +
        + +
        + + + \ No newline at end of file diff --git a/docs/meshtastic/test.html b/docs/meshtastic/test.html index ccd2028..12327be 100644 --- a/docs/meshtastic/test.html +++ b/docs/meshtastic/test.html @@ -47,6 +47,7 @@ testNumber = 0 sendingInterface = None + def onReceive(packet, interface): """Callback invoked when a packet arrives""" if sendingInterface == interface: @@ -55,10 +56,11 @@ def onReceive(packet, interface): print(f"From {interface.stream.port}: {packet}") p = DotMap(packet) - if p.decoded.data.portnum == "TEXT_MESSAGE_APP": + if p.decoded.portnum == "TEXT_MESSAGE_APP": # We only care a about clear text packets receivedPackets.append(p) + def onNode(node): """Callback invoked when the node DB changes""" print(f"Node changed: {node}") @@ -91,7 +93,7 @@ def testSend(fromInterface, toInterface, isBroadcast=False, asBinary=False): toNode = toInterface.myInfo.my_node_num logging.info(f"Sending test packet from {fromNode} to {toNode}") - wantAck = False # Don't want any sort of reliaible sending + wantAck = False # Don't want any sort of reliaible sending global sendingInterface sendingInterface = fromInterface if not asBinary: @@ -99,11 +101,11 @@ def testSend(fromInterface, toInterface, isBroadcast=False, asBinary=False): else: fromInterface.sendData((f"Binary {testNumber}").encode( "utf-8"), toNode, wantAck=wantAck) - for sec in range(45): # max of 45 secs before we timeout + for sec in range(45): # max of 45 secs before we timeout time.sleep(1) if (len(receivedPackets) >= 1): return True - return False # Failed to send + return False # Failed to send def testThread(numTests=50): @@ -116,14 +118,15 @@ def testThread(numTests=50): isBroadcast = True # asBinary=(i % 2 == 0) success = testSend( - interfaces[0], interfaces[1], isBroadcast, asBinary = False) + interfaces[0], interfaces[1], isBroadcast, asBinary=False) if not success: numFail = numFail + 1 logging.error( f"Test failed, expected packet not received ({numFail} failures so far)") else: numSuccess = numSuccess + 1 - logging.info(f"Test succeeded ({numSuccess} successes ({numFail} failures) so far)") + logging.info( + f"Test succeeded ({numSuccess} successes ({numFail} failures) so far)") if numFail >= 3: for i in interfaces: @@ -137,11 +140,13 @@ def onConnection(topic=pub.AUTO_TOPIC): """Callback invoked when we connect/disconnect from a radio""" print(f"Connection changed: {topic.getName()}") + def openDebugLog(portName): debugname = "log" + portName.replace("/", "_") logging.info(f"Writing serial debugging to {debugname}") return open(debugname, 'w+', buffering=1) + def testAll(): """ Run a series of tests using devices we can find. @@ -163,8 +168,7 @@ def testAll(): testThread() for i in interfaces: - i.close() -
        + i.close()
  • @@ -226,7 +230,7 @@ def testAll(): print(f"From {interface.stream.port}: {packet}") p = DotMap(packet) - if p.decoded.data.portnum == "TEXT_MESSAGE_APP": + if p.decoded.portnum == "TEXT_MESSAGE_APP": # We only care a about clear text packets receivedPackets.append(p) @@ -334,7 +338,7 @@ toInterface {[type]} – [description]

    toNode = toInterface.myInfo.my_node_num logging.info(f"Sending test packet from {fromNode} to {toNode}") - wantAck = False # Don't want any sort of reliaible sending + wantAck = False # Don't want any sort of reliaible sending global sendingInterface sendingInterface = fromInterface if not asBinary: @@ -342,11 +346,11 @@ toInterface {[type]} – [description]

    else: fromInterface.sendData((f"Binary {testNumber}").encode( "utf-8"), toNode, wantAck=wantAck) - for sec in range(45): # max of 45 secs before we timeout + for sec in range(45): # max of 45 secs before we timeout time.sleep(1) if (len(receivedPackets) >= 1): return True - return False # Failed to send + return False # Failed to send
    @@ -368,14 +372,15 @@ toInterface {[type]} – [description]

    isBroadcast = True # asBinary=(i % 2 == 0) success = testSend( - interfaces[0], interfaces[1], isBroadcast, asBinary = False) + interfaces[0], interfaces[1], isBroadcast, asBinary=False) if not success: numFail = numFail + 1 logging.error( f"Test failed, expected packet not received ({numFail} failures so far)") else: numSuccess = numSuccess + 1 - logging.info(f"Test succeeded ({numSuccess} successes ({numFail} failures) so far)") + logging.info( + f"Test succeeded ({numSuccess} successes ({numFail} failures) so far)") if numFail >= 3: for i in interfaces: diff --git a/docs/meshtastic/tunnel.html b/docs/meshtastic/tunnel.html index 1952857..015a5e7 100644 --- a/docs/meshtastic/tunnel.html +++ b/docs/meshtastic/tunnel.html @@ -34,7 +34,7 @@ # sudo bin/run.sh --port /dev/ttyUSB0 --setch-shortfast # sudo bin/run.sh --port /dev/ttyUSB0 --tunnel --debug # ssh -Y root@192.168.10.151 (or dietpi), default password p -# ncat -e /bin/cat -k -u -l 1235 +# ncat -e /bin/cat -k -u -l 1235 # ncat -u 10.115.64.152 1235 # ping -c 1 -W 20 10.115.64.152 # ping -i 30 -W 30 10.115.64.152 @@ -43,7 +43,8 @@ from . import portnums_pb2 from pubsub import pub -import logging, threading +import logging +import threading # A new non standard log level that is lower level than DEBUG LOG_TRACE = 5 @@ -54,8 +55,8 @@ tunnelInstance = None """A list of chatty UDP services we should never accidentally forward to our slow network""" udpBlacklist = { - 1900, # SSDP - 5353, # multicast DNS + 1900, # SSDP + 5353, # multicast DNS } """A list of TCP services to block""" @@ -63,31 +64,36 @@ tcpBlacklist = {} """A list of protocols we ignore""" protocolBlacklist = { - 0x02, # IGMP - 0x80, # Service-Specific Connection-Oriented Protocol in a Multilink and Connectionless Environment + 0x02, # IGMP + 0x80, # Service-Specific Connection-Oriented Protocol in a Multilink and Connectionless Environment } + def hexstr(barray): """Print a string of hex digits""" return ":".join('{:02x}'.format(x) for x in barray) + def ipstr(barray): """Print a string of ip digits""" return ".".join('{}'.format(x) for x in barray) + def readnet_u16(p, offset): """Read big endian u16 (network byte order)""" return p[offset] * 256 + p[offset + 1] + def onTunnelReceive(packet, interface): """Callback for received tunneled messages from mesh - + FIXME figure out how to do closures with methods in python""" tunnelInstance.onReceive(packet) + class Tunnel: """A TUN based IP tunnel over meshtastic""" - + def __init__(self, iface, subnet=None, netmask="255.255.0.0"): """ Constructor @@ -105,7 +111,8 @@ class Tunnel: global tunnelInstance tunnelInstance = self - logging.info("Starting IP to mesh tunnel (you must be root for this *pre-alpha* feature to work). Mesh members:") + logging.info( + "Starting IP to mesh tunnel (you must be root for this *pre-alpha* feature to work). Mesh members:") pub.subscribe(onTunnelReceive, "meshtastic.receive.data.IP_TUNNEL_APP") myAddr = self._nodeNumToIp(self.iface.myInfo.my_node_num) @@ -113,24 +120,26 @@ class Tunnel: for node in self.iface.nodes.values(): nodeId = node["user"]["id"] ip = self._nodeNumToIp(node["num"]) - logging.info(f"Node { nodeId } has IP address { ip }") + logging.info(f"Node { nodeId } has IP address { ip }") logging.debug("creating TUN device with MTU=200") # FIXME - figure out real max MTU, it should be 240 - the overhead bytes for SubPacket and Data from pytap2 import TapDevice self.tun = TapDevice(name="mesh") self.tun.up() - self.tun.ifconfig(address=myAddr,netmask=netmask,mtu=200) + self.tun.ifconfig(address=myAddr, netmask=netmask, mtu=200) logging.debug(f"starting TUN reader, our IP address is {myAddr}") - self._rxThread = threading.Thread(target=self.__tunReader, args=(), daemon=True) + self._rxThread = threading.Thread( + target=self.__tunReader, args=(), daemon=True) self._rxThread.start() def onReceive(self, packet): - p = packet["decoded"]["data"]["payload"] + p = packet["decoded"]["payload"] if packet["from"] == self.iface.myInfo.my_node_num: logging.debug("Ignoring message we sent") else: - logging.debug(f"Received mesh tunnel message type={type(p)} len={len(p)}") + logging.debug( + f"Received mesh tunnel message type={type(p)} len={len(p)}") # we don't really need to check for filtering here (sender should have checked), but this provides # useful debug printing on types of packets received if not self._shouldFilterPacket(p): @@ -142,36 +151,43 @@ class Tunnel: srcaddr = p[12:16] destAddr = p[16:20] subheader = 20 - ignore = False # Assume we will be forwarding the packet + ignore = False # Assume we will be forwarding the packet if protocol in protocolBlacklist: ignore = True - logging.log(LOG_TRACE, f"Ignoring blacklisted protocol 0x{protocol:02x}") - elif protocol == 0x01: # ICMP + logging.log( + LOG_TRACE, f"Ignoring blacklisted protocol 0x{protocol:02x}") + elif protocol == 0x01: # ICMP icmpType = p[20] icmpCode = p[21] checksum = p[22:24] - logging.debug(f"forwarding ICMP message src={ipstr(srcaddr)}, dest={ipstr(destAddr)}, type={icmpType}, code={icmpCode}, checksum={checksum}") + logging.debug( + f"forwarding ICMP message src={ipstr(srcaddr)}, dest={ipstr(destAddr)}, type={icmpType}, code={icmpCode}, checksum={checksum}") # reply to pings (swap src and dest but keep rest of packet unchanged) #pingback = p[:12]+p[16:20]+p[12:16]+p[20:] - #tap.write(pingback) - elif protocol == 0x11: # UDP + # tap.write(pingback) + elif protocol == 0x11: # UDP srcport = readnet_u16(p, subheader) destport = readnet_u16(p, subheader + 2) if destport in udpBlacklist: ignore = True - logging.log(LOG_TRACE, f"ignoring blacklisted UDP port {destport}") + logging.log( + LOG_TRACE, f"ignoring blacklisted UDP port {destport}") else: - logging.debug(f"forwarding udp srcport={srcport}, destport={destport}") - elif protocol == 0x06: # TCP + logging.debug( + f"forwarding udp srcport={srcport}, destport={destport}") + elif protocol == 0x06: # TCP srcport = readnet_u16(p, subheader) destport = readnet_u16(p, subheader + 2) if destport in tcpBlacklist: ignore = True - logging.log(LOG_TRACE, f"ignoring blacklisted TCP port {destport}") + logging.log( + LOG_TRACE, f"ignoring blacklisted TCP port {destport}") else: - logging.debug(f"forwarding tcp srcport={srcport}, destport={destport}") + logging.debug( + f"forwarding tcp srcport={srcport}, destport={destport}") else: - logging.warning(f"forwarding unexpected protocol 0x{protocol:02x}, src={ipstr(srcaddr)}, dest={ipstr(destAddr)}") + logging.warning( + f"forwarding unexpected protocol 0x{protocol:02x}, src={ipstr(srcaddr)}, dest={ipstr(destAddr)}") return ignore @@ -207,10 +223,13 @@ class Tunnel: """Forward the provided IP packet into the mesh""" nodeId = self._ipToNodeId(destAddr) if nodeId is not None: - logging.debug(f"Forwarding packet bytelen={len(p)} dest={ipstr(destAddr)}, destNode={nodeId}") - self.iface.sendData(p, nodeId, portnums_pb2.IP_TUNNEL_APP, wantAck = False) + logging.debug( + f"Forwarding packet bytelen={len(p)} dest={ipstr(destAddr)}, destNode={nodeId}") + self.iface.sendData( + p, nodeId, portnums_pb2.IP_TUNNEL_APP, wantAck=False) else: - logging.warning(f"Dropping packet because no node found for destIP={ipstr(destAddr)}") + logging.warning( + f"Dropping packet because no node found for destIP={ipstr(destAddr)}") def close(self): self.tun.close()
    @@ -279,7 +298,7 @@ forward to our slow network

    def onTunnelReceive(packet, interface):
         """Callback for received tunneled messages from mesh
    -    
    +
         FIXME figure out how to do closures with methods in python"""
         tunnelInstance.onReceive(packet)
    @@ -318,7 +337,7 @@ subnet is used to construct our network number (normally 10.115.x.x)

    class Tunnel:
         """A TUN based IP tunnel over meshtastic"""
    -    
    +
         def __init__(self, iface, subnet=None, netmask="255.255.0.0"):
             """
             Constructor
    @@ -336,7 +355,8 @@ subnet is used to construct our network number (normally 10.115.x.x)

    global tunnelInstance tunnelInstance = self - logging.info("Starting IP to mesh tunnel (you must be root for this *pre-alpha* feature to work). Mesh members:") + logging.info( + "Starting IP to mesh tunnel (you must be root for this *pre-alpha* feature to work). Mesh members:") pub.subscribe(onTunnelReceive, "meshtastic.receive.data.IP_TUNNEL_APP") myAddr = self._nodeNumToIp(self.iface.myInfo.my_node_num) @@ -344,24 +364,26 @@ subnet is used to construct our network number (normally 10.115.x.x)

    for node in self.iface.nodes.values(): nodeId = node["user"]["id"] ip = self._nodeNumToIp(node["num"]) - logging.info(f"Node { nodeId } has IP address { ip }") + logging.info(f"Node { nodeId } has IP address { ip }") logging.debug("creating TUN device with MTU=200") # FIXME - figure out real max MTU, it should be 240 - the overhead bytes for SubPacket and Data from pytap2 import TapDevice self.tun = TapDevice(name="mesh") self.tun.up() - self.tun.ifconfig(address=myAddr,netmask=netmask,mtu=200) + self.tun.ifconfig(address=myAddr, netmask=netmask, mtu=200) logging.debug(f"starting TUN reader, our IP address is {myAddr}") - self._rxThread = threading.Thread(target=self.__tunReader, args=(), daemon=True) + self._rxThread = threading.Thread( + target=self.__tunReader, args=(), daemon=True) self._rxThread.start() def onReceive(self, packet): - p = packet["decoded"]["data"]["payload"] + p = packet["decoded"]["payload"] if packet["from"] == self.iface.myInfo.my_node_num: logging.debug("Ignoring message we sent") else: - logging.debug(f"Received mesh tunnel message type={type(p)} len={len(p)}") + logging.debug( + f"Received mesh tunnel message type={type(p)} len={len(p)}") # we don't really need to check for filtering here (sender should have checked), but this provides # useful debug printing on types of packets received if not self._shouldFilterPacket(p): @@ -373,36 +395,43 @@ subnet is used to construct our network number (normally 10.115.x.x)

    srcaddr = p[12:16] destAddr = p[16:20] subheader = 20 - ignore = False # Assume we will be forwarding the packet + ignore = False # Assume we will be forwarding the packet if protocol in protocolBlacklist: ignore = True - logging.log(LOG_TRACE, f"Ignoring blacklisted protocol 0x{protocol:02x}") - elif protocol == 0x01: # ICMP + logging.log( + LOG_TRACE, f"Ignoring blacklisted protocol 0x{protocol:02x}") + elif protocol == 0x01: # ICMP icmpType = p[20] icmpCode = p[21] checksum = p[22:24] - logging.debug(f"forwarding ICMP message src={ipstr(srcaddr)}, dest={ipstr(destAddr)}, type={icmpType}, code={icmpCode}, checksum={checksum}") + logging.debug( + f"forwarding ICMP message src={ipstr(srcaddr)}, dest={ipstr(destAddr)}, type={icmpType}, code={icmpCode}, checksum={checksum}") # reply to pings (swap src and dest but keep rest of packet unchanged) #pingback = p[:12]+p[16:20]+p[12:16]+p[20:] - #tap.write(pingback) - elif protocol == 0x11: # UDP + # tap.write(pingback) + elif protocol == 0x11: # UDP srcport = readnet_u16(p, subheader) destport = readnet_u16(p, subheader + 2) if destport in udpBlacklist: ignore = True - logging.log(LOG_TRACE, f"ignoring blacklisted UDP port {destport}") + logging.log( + LOG_TRACE, f"ignoring blacklisted UDP port {destport}") else: - logging.debug(f"forwarding udp srcport={srcport}, destport={destport}") - elif protocol == 0x06: # TCP + logging.debug( + f"forwarding udp srcport={srcport}, destport={destport}") + elif protocol == 0x06: # TCP srcport = readnet_u16(p, subheader) destport = readnet_u16(p, subheader + 2) if destport in tcpBlacklist: ignore = True - logging.log(LOG_TRACE, f"ignoring blacklisted TCP port {destport}") + logging.log( + LOG_TRACE, f"ignoring blacklisted TCP port {destport}") else: - logging.debug(f"forwarding tcp srcport={srcport}, destport={destport}") + logging.debug( + f"forwarding tcp srcport={srcport}, destport={destport}") else: - logging.warning(f"forwarding unexpected protocol 0x{protocol:02x}, src={ipstr(srcaddr)}, dest={ipstr(destAddr)}") + logging.warning( + f"forwarding unexpected protocol 0x{protocol:02x}, src={ipstr(srcaddr)}, dest={ipstr(destAddr)}") return ignore @@ -438,10 +467,13 @@ subnet is used to construct our network number (normally 10.115.x.x)

    """Forward the provided IP packet into the mesh""" nodeId = self._ipToNodeId(destAddr) if nodeId is not None: - logging.debug(f"Forwarding packet bytelen={len(p)} dest={ipstr(destAddr)}, destNode={nodeId}") - self.iface.sendData(p, nodeId, portnums_pb2.IP_TUNNEL_APP, wantAck = False) + logging.debug( + f"Forwarding packet bytelen={len(p)} dest={ipstr(destAddr)}, destNode={nodeId}") + self.iface.sendData( + p, nodeId, portnums_pb2.IP_TUNNEL_APP, wantAck=False) else: - logging.warning(f"Dropping packet because no node found for destIP={ipstr(destAddr)}") + logging.warning( + f"Dropping packet because no node found for destIP={ipstr(destAddr)}") def close(self): self.tun.close()
    @@ -471,11 +503,12 @@ subnet is used to construct our network number (normally 10.115.x.x)

    Expand source code
    def onReceive(self, packet):
    -    p = packet["decoded"]["data"]["payload"]
    +    p = packet["decoded"]["payload"]
         if packet["from"] == self.iface.myInfo.my_node_num:
             logging.debug("Ignoring message we sent")
         else:
    -        logging.debug(f"Received mesh tunnel message type={type(p)} len={len(p)}")
    +        logging.debug(
    +            f"Received mesh tunnel message type={type(p)} len={len(p)}")
             # we don't really need to check for filtering here (sender should have checked), but this provides
             # useful debug printing on types of packets received
             if not self._shouldFilterPacket(p):
    @@ -495,10 +528,13 @@ subnet is used to construct our network number (normally 10.115.x.x)

    """Forward the provided IP packet into the mesh""" nodeId = self._ipToNodeId(destAddr) if nodeId is not None: - logging.debug(f"Forwarding packet bytelen={len(p)} dest={ipstr(destAddr)}, destNode={nodeId}") - self.iface.sendData(p, nodeId, portnums_pb2.IP_TUNNEL_APP, wantAck = False) + logging.debug( + f"Forwarding packet bytelen={len(p)} dest={ipstr(destAddr)}, destNode={nodeId}") + self.iface.sendData( + p, nodeId, portnums_pb2.IP_TUNNEL_APP, wantAck=False) else: - logging.warning(f"Dropping packet because no node found for destIP={ipstr(destAddr)}")
    + logging.warning( + f"Dropping packet because no node found for destIP={ipstr(destAddr)}") diff --git a/docs/meshtastic/util.html b/docs/meshtastic/util.html index efc4a67..973bd30 100644 --- a/docs/meshtastic/util.html +++ b/docs/meshtastic/util.html @@ -34,6 +34,18 @@ import serial.tools.list_ports blacklistVids = dict.fromkeys([0x1366]) +def fixme(message): + raise Exception(f"FIXME: {message}") + + +def catchAndIgnore(reason, closure): + """Call a closure but if it throws an excpetion print it and continue""" + try: + closure() + except BaseException as ex: + logging.error(f"Exception thrown in {reason}: {ex}") + + def findPorts(): """Find all ports that might have meshtastic devices @@ -61,6 +73,23 @@ class dotdict(dict):

    Functions

    +
    +def catchAndIgnore(reason, closure) +
    +
    +

    Call a closure but if it throws an excpetion print it and continue

    +
    + +Expand source code + +
    def catchAndIgnore(reason, closure):
    +    """Call a closure but if it throws an excpetion print it and continue"""
    +    try:
    +        closure()
    +    except BaseException as ex:
    +        logging.error(f"Exception thrown in {reason}: {ex}")
    +
    +
    def findPorts()
    @@ -85,6 +114,19 @@ class dotdict(dict): return l +
    +def fixme(message) +
    +
    +
    +
    + +Expand source code + +
    def fixme(message):
    +    raise Exception(f"FIXME: {message}")
    +
    +
    @@ -127,7 +169,9 @@ class dotdict(dict):
  • Functions

  • Classes