From ecf68d5544f77b2868c37738a9cb0877beaabc19 Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Tue, 28 Dec 2021 21:08:28 -0800 Subject: [PATCH] fix some comments for doc --- docs/meshtastic/admin_pb2.html | 745 +- docs/meshtastic/apponly_pb2.html | 545 +- docs/meshtastic/channel_pb2.html | 1276 +-- docs/meshtastic/deviceonly_pb2.html | 1821 +--- .../environmental_measurement_pb2.html | 567 +- docs/meshtastic/index.html | 43 +- docs/meshtastic/mesh_interface.html | 221 +- docs/meshtastic/mesh_pb2.html | 7329 +---------------- docs/meshtastic/mqtt_pb2.html | 577 +- docs/meshtastic/node.html | 401 +- docs/meshtastic/radioconfig_pb2.html | 551 +- docs/meshtastic/remote_hardware.html | 73 +- docs/meshtastic/remote_hardware_pb2.html | 569 +- docs/meshtastic/storeforward_pb2.html | 601 +- docs/meshtastic/stream_interface.html | 51 +- docs/meshtastic/tcp_interface.html | 76 +- docs/meshtastic/tests/conftest.html | 101 +- docs/meshtastic/tests/index.html | 12 + docs/meshtastic/tests/test_examples.html | 132 + docs/meshtastic/tests/test_main.html | 1551 ++-- .../meshtastic/tests/test_mesh_interface.html | 1181 ++- docs/meshtastic/tests/test_node.html | 2731 ++++-- .../tests/test_remote_hardware.html | 304 + docs/meshtastic/tests/test_smoke1.html | 26 +- .../tests/test_stream_interface.html | 160 +- docs/meshtastic/tests/test_util.html | 74 +- docs/meshtastic/util.html | 34 +- meshtastic/__init__.py | 13 +- meshtastic/__main__.py | 2 +- 29 files changed, 5838 insertions(+), 15929 deletions(-) create mode 100644 docs/meshtastic/tests/test_examples.html create mode 100644 docs/meshtastic/tests/test_remote_hardware.html diff --git a/docs/meshtastic/admin_pb2.html b/docs/meshtastic/admin_pb2.html index 20b1262..159619e 100644 --- a/docs/meshtastic/admin_pb2.html +++ b/docs/meshtastic/admin_pb2.html @@ -223,756 +223,67 @@ DESCRIPTOR._options = None
class AdminMessage -(**kwargs) +(*args, **kwargs)
-

Abstract base class for protocol messages.

-

Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

+

A ProtocolMessage

Ancestors

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

Class variables

-
var CONFIRM_SET_CHANNEL_FIELD_NUMBER
-
-
-
-
var CONFIRM_SET_RADIO_FIELD_NUMBER
-
-
-
var DESCRIPTOR
-
var EXIT_SIMULATOR_FIELD_NUMBER
-
-
-
-
var GET_CHANNEL_REQUEST_FIELD_NUMBER
-
-
-
-
var GET_CHANNEL_RESPONSE_FIELD_NUMBER
-
-
-
-
var GET_RADIO_REQUEST_FIELD_NUMBER
-
-
-
-
var GET_RADIO_RESPONSE_FIELD_NUMBER
-
-
-
-
var REBOOT_SECONDS_FIELD_NUMBER
-
-
-
-
var SET_CHANNEL_FIELD_NUMBER
-
-
-
-
var SET_OWNER_FIELD_NUMBER
-
-
-
-
var SET_RADIO_FIELD_NUMBER
-
-
-
-
-

Static methods

-
-
-def FromString(s) -
-
-
-
- -Expand source code - -
def FromString(s):
-  message = cls()
-  message.MergeFromString(s)
-  return message
-
-
-
-def RegisterExtension(extension_handle) -
-
-
-
- -Expand source code - -
def RegisterExtension(extension_handle):
-  extension_handle.containing_type = cls.DESCRIPTOR
-  # TODO(amauryfa): Use cls.MESSAGE_FACTORY.pool when available.
-  # pylint: disable=protected-access
-  cls.DESCRIPTOR.file.pool._AddExtensionDescriptor(extension_handle)
-  _AttachFieldHelpers(cls, extension_handle)
-
-

Instance variables

var confirm_set_channel
-

Getter for confirm_set_channel.

-
- -Expand source code - -
def getter(self):
-  # TODO(protobuf-team): This may be broken since there may not be
-  # default_value.  Combine with has_default_value somehow.
-  return self._fields.get(field, default_value)
-
+

Field AdminMessage.confirm_set_channel

var confirm_set_radio
-

Getter for confirm_set_radio.

-
- -Expand source code - -
def getter(self):
-  # TODO(protobuf-team): This may be broken since there may not be
-  # default_value.  Combine with has_default_value somehow.
-  return self._fields.get(field, default_value)
-
+

Field AdminMessage.confirm_set_radio

var exit_simulator
-

Getter for exit_simulator.

-
- -Expand source code - -
def getter(self):
-  # TODO(protobuf-team): This may be broken since there may not be
-  # default_value.  Combine with has_default_value somehow.
-  return self._fields.get(field, default_value)
-
+

Field AdminMessage.exit_simulator

var get_channel_request
-

Getter for get_channel_request.

-
- -Expand source code - -
def getter(self):
-  # TODO(protobuf-team): This may be broken since there may not be
-  # default_value.  Combine with has_default_value somehow.
-  return self._fields.get(field, default_value)
-
+

Field AdminMessage.get_channel_request

var get_channel_response
-

Getter for get_channel_response.

-
- -Expand source code - -
def getter(self):
-  field_value = self._fields.get(field)
-  if field_value is None:
-    # Construct a new object to represent this field.
-    field_value = field._default_constructor(self)
-
-    # Atomically check if another thread has preempted us and, if not, swap
-    # in the new object we just created.  If someone has preempted us, we
-    # take that object and discard ours.
-    # WARNING:  We are relying on setdefault() being atomic.  This is true
-    #   in CPython but we haven't investigated others.  This warning appears
-    #   in several other locations in this file.
-    field_value = self._fields.setdefault(field, field_value)
-  return field_value
-
+

Field AdminMessage.get_channel_response

var get_radio_request
-

Getter for get_radio_request.

-
- -Expand source code - -
def getter(self):
-  # TODO(protobuf-team): This may be broken since there may not be
-  # default_value.  Combine with has_default_value somehow.
-  return self._fields.get(field, default_value)
-
+

Field AdminMessage.get_radio_request

var get_radio_response
-

Getter for get_radio_response.

-
- -Expand source code - -
def getter(self):
-  field_value = self._fields.get(field)
-  if field_value is None:
-    # Construct a new object to represent this field.
-    field_value = field._default_constructor(self)
-
-    # Atomically check if another thread has preempted us and, if not, swap
-    # in the new object we just created.  If someone has preempted us, we
-    # take that object and discard ours.
-    # WARNING:  We are relying on setdefault() being atomic.  This is true
-    #   in CPython but we haven't investigated others.  This warning appears
-    #   in several other locations in this file.
-    field_value = self._fields.setdefault(field, field_value)
-  return field_value
-
+

Field AdminMessage.get_radio_response

var reboot_seconds
-

Getter for reboot_seconds.

-
- -Expand source code - -
def getter(self):
-  # TODO(protobuf-team): This may be broken since there may not be
-  # default_value.  Combine with has_default_value somehow.
-  return self._fields.get(field, default_value)
-
+

Field AdminMessage.reboot_seconds

var set_channel
-

Getter for set_channel.

-
- -Expand source code - -
def getter(self):
-  field_value = self._fields.get(field)
-  if field_value is None:
-    # Construct a new object to represent this field.
-    field_value = field._default_constructor(self)
-
-    # Atomically check if another thread has preempted us and, if not, swap
-    # in the new object we just created.  If someone has preempted us, we
-    # take that object and discard ours.
-    # WARNING:  We are relying on setdefault() being atomic.  This is true
-    #   in CPython but we haven't investigated others.  This warning appears
-    #   in several other locations in this file.
-    field_value = self._fields.setdefault(field, field_value)
-  return field_value
-
+

Field AdminMessage.set_channel

var set_owner
-

Getter for set_owner.

-
- -Expand source code - -
def getter(self):
-  field_value = self._fields.get(field)
-  if field_value is None:
-    # Construct a new object to represent this field.
-    field_value = field._default_constructor(self)
-
-    # Atomically check if another thread has preempted us and, if not, swap
-    # in the new object we just created.  If someone has preempted us, we
-    # take that object and discard ours.
-    # WARNING:  We are relying on setdefault() being atomic.  This is true
-    #   in CPython but we haven't investigated others.  This warning appears
-    #   in several other locations in this file.
-    field_value = self._fields.setdefault(field, field_value)
-  return field_value
-
+

Field AdminMessage.set_owner

var set_radio
-

Getter for set_radio.

-
- -Expand source code - -
def getter(self):
-  field_value = self._fields.get(field)
-  if field_value is None:
-    # Construct a new object to represent this field.
-    field_value = field._default_constructor(self)
-
-    # Atomically check if another thread has preempted us and, if not, swap
-    # in the new object we just created.  If someone has preempted us, we
-    # take that object and discard ours.
-    # WARNING:  We are relying on setdefault() being atomic.  This is true
-    #   in CPython but we haven't investigated others.  This warning appears
-    #   in several other locations in this file.
-    field_value = self._fields.setdefault(field, field_value)
-  return field_value
-
-
-
-

Methods

-
-
-def ByteSize(self) -
-
-
-
- -Expand source code - -
def ByteSize(self):
-  if not self._cached_byte_size_dirty:
-    return self._cached_byte_size
-
-  size = 0
-  descriptor = self.DESCRIPTOR
-  if descriptor.GetOptions().map_entry:
-    # Fields of map entry should always be serialized.
-    size = descriptor.fields_by_name['key']._sizer(self.key)
-    size += descriptor.fields_by_name['value']._sizer(self.value)
-  else:
-    for field_descriptor, field_value in self.ListFields():
-      size += field_descriptor._sizer(field_value)
-    for tag_bytes, value_bytes in self._unknown_fields:
-      size += len(tag_bytes) + len(value_bytes)
-
-  self._cached_byte_size = size
-  self._cached_byte_size_dirty = False
-  self._listener_for_children.dirty = False
-  return size
-
-
-
-def Clear(self) -
-
-
-
- -Expand source code - -
def _Clear(self):
-  # Clear fields.
-  self._fields = {}
-  self._unknown_fields = ()
-  # pylint: disable=protected-access
-  if self._unknown_field_set is not None:
-    self._unknown_field_set._clear()
-    self._unknown_field_set = None
-
-  self._oneofs = {}
-  self._Modified()
-
-
-
-def ClearField(self, field_name) -
-
-
-
- -Expand source code - -
def ClearField(self, field_name):
-  try:
-    field = message_descriptor.fields_by_name[field_name]
-  except KeyError:
-    try:
-      field = message_descriptor.oneofs_by_name[field_name]
-      if field in self._oneofs:
-        field = self._oneofs[field]
-      else:
-        return
-    except KeyError:
-      raise ValueError('Protocol message %s has no "%s" field.' %
-                       (message_descriptor.name, field_name))
-
-  if field in self._fields:
-    # To match the C++ implementation, we need to invalidate iterators
-    # for map fields when ClearField() happens.
-    if hasattr(self._fields[field], 'InvalidateIterators'):
-      self._fields[field].InvalidateIterators()
-
-    # Note:  If the field is a sub-message, its listener will still point
-    #   at us.  That's fine, because the worst than can happen is that it
-    #   will call _Modified() and invalidate our byte size.  Big deal.
-    del self._fields[field]
-
-    if self._oneofs.get(field.containing_oneof, None) is field:
-      del self._oneofs[field.containing_oneof]
-
-  # Always call _Modified() -- even if nothing was changed, this is
-  # a mutating method, and thus calling it should cause the field to become
-  # present in the parent message.
-  self._Modified()
-
-
-
-def DiscardUnknownFields(self) -
-
-
-
- -Expand source code - -
def _DiscardUnknownFields(self):
-  self._unknown_fields = []
-  self._unknown_field_set = None      # pylint: disable=protected-access
-  for field, value in self.ListFields():
-    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
-      if _IsMapField(field):
-        if _IsMessageMapField(field):
-          for key in value:
-            value[key].DiscardUnknownFields()
-      elif field.label == _FieldDescriptor.LABEL_REPEATED:
-        for sub_message in value:
-          sub_message.DiscardUnknownFields()
-      else:
-        value.DiscardUnknownFields()
-
-
-
-def FindInitializationErrors(self) -
-
-

Finds required fields which are not initialized.

-

Returns

-

A list of strings. -Each string is a path to an uninitialized field from -the top-level message, e.g. "foo.bar[5].baz".

-
- -Expand source code - -
def FindInitializationErrors(self):
-  """Finds required fields which are not initialized.
-
-  Returns:
-    A list of strings.  Each string is a path to an uninitialized field from
-    the top-level message, e.g. "foo.bar[5].baz".
-  """
-
-  errors = []  # simplify things
-
-  for field in required_fields:
-    if not self.HasField(field.name):
-      errors.append(field.name)
-
-  for field, value in self.ListFields():
-    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
-      if field.is_extension:
-        name = '(%s)' % field.full_name
-      else:
-        name = field.name
-
-      if _IsMapField(field):
-        if _IsMessageMapField(field):
-          for key in value:
-            element = value[key]
-            prefix = '%s[%s].' % (name, key)
-            sub_errors = element.FindInitializationErrors()
-            errors += [prefix + error for error in sub_errors]
-        else:
-          # ScalarMaps can't have any initialization errors.
-          pass
-      elif field.label == _FieldDescriptor.LABEL_REPEATED:
-        for i in range(len(value)):
-          element = value[i]
-          prefix = '%s[%d].' % (name, i)
-          sub_errors = element.FindInitializationErrors()
-          errors += [prefix + error for error in sub_errors]
-      else:
-        prefix = name + '.'
-        sub_errors = value.FindInitializationErrors()
-        errors += [prefix + error for error in sub_errors]
-
-  return errors
-
-
-
-def HasField(self, field_name) -
-
-
-
- -Expand source code - -
def HasField(self, field_name):
-  try:
-    field = hassable_fields[field_name]
-  except KeyError:
-    raise ValueError(error_msg % (message_descriptor.full_name, field_name))
-
-  if isinstance(field, descriptor_mod.OneofDescriptor):
-    try:
-      return HasField(self, self._oneofs[field].name)
-    except KeyError:
-      return False
-  else:
-    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
-      value = self._fields.get(field)
-      return value is not None and value._is_present_in_parent
-    else:
-      return field in self._fields
-
-
-
-def IsInitialized(self, errors=None) -
-
-

Checks if all required fields of a message are set.

-

Args

-
-
errors
-
A list which, if provided, will be populated with the field -paths of all missing required fields.
-
-

Returns

-

True iff the specified message has all required fields set.

-
- -Expand source code - -
def IsInitialized(self, errors=None):
-  """Checks if all required fields of a message are set.
-
-  Args:
-    errors:  A list which, if provided, will be populated with the field
-             paths of all missing required fields.
-
-  Returns:
-    True iff the specified message has all required fields set.
-  """
-
-  # Performance is critical so we avoid HasField() and ListFields().
-
-  for field in required_fields:
-    if (field not in self._fields or
-        (field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE and
-         not self._fields[field]._is_present_in_parent)):
-      if errors is not None:
-        errors.extend(self.FindInitializationErrors())
-      return False
-
-  for field, value in list(self._fields.items()):  # dict can change size!
-    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
-      if field.label == _FieldDescriptor.LABEL_REPEATED:
-        if (field.message_type.has_options and
-            field.message_type.GetOptions().map_entry):
-          continue
-        for element in value:
-          if not element.IsInitialized():
-            if errors is not None:
-              errors.extend(self.FindInitializationErrors())
-            return False
-      elif value._is_present_in_parent and not value.IsInitialized():
-        if errors is not None:
-          errors.extend(self.FindInitializationErrors())
-        return False
-
-  return True
-
-
-
-def ListFields(self) -
-
-
-
- -Expand source code - -
def ListFields(self):
-  all_fields = [item for item in self._fields.items() if _IsPresent(item)]
-  all_fields.sort(key = lambda item: item[0].number)
-  return all_fields
-
-
-
-def MergeFrom(self, msg) -
-
-
-
- -Expand source code - -
def MergeFrom(self, msg):
-  if not isinstance(msg, cls):
-    raise TypeError(
-        'Parameter to MergeFrom() must be instance of same class: '
-        'expected %s got %s.' % (_FullyQualifiedClassName(cls),
-                                 _FullyQualifiedClassName(msg.__class__)))
-
-  assert msg is not self
-  self._Modified()
-
-  fields = self._fields
-
-  for field, value in msg._fields.items():
-    if field.label == LABEL_REPEATED:
-      field_value = fields.get(field)
-      if field_value is None:
-        # Construct a new object to represent this field.
-        field_value = field._default_constructor(self)
-        fields[field] = field_value
-      field_value.MergeFrom(value)
-    elif field.cpp_type == CPPTYPE_MESSAGE:
-      if value._is_present_in_parent:
-        field_value = fields.get(field)
-        if field_value is None:
-          # Construct a new object to represent this field.
-          field_value = field._default_constructor(self)
-          fields[field] = field_value
-        field_value.MergeFrom(value)
-    else:
-      self._fields[field] = value
-      if field.containing_oneof:
-        self._UpdateOneofState(field)
-
-  if msg._unknown_fields:
-    if not self._unknown_fields:
-      self._unknown_fields = []
-    self._unknown_fields.extend(msg._unknown_fields)
-    # pylint: disable=protected-access
-    if self._unknown_field_set is None:
-      self._unknown_field_set = containers.UnknownFieldSet()
-    self._unknown_field_set._extend(msg._unknown_field_set)
-
-
-
-def MergeFromString(self, serialized) -
-
-
-
- -Expand source code - -
def MergeFromString(self, serialized):
-  serialized = memoryview(serialized)
-  length = len(serialized)
-  try:
-    if self._InternalParse(serialized, 0, length) != length:
-      # The only reason _InternalParse would return early is if it
-      # encountered an end-group tag.
-      raise message_mod.DecodeError('Unexpected end-group tag.')
-  except (IndexError, TypeError):
-    # Now ord(buf[p:p+1]) == ord('') gets TypeError.
-    raise message_mod.DecodeError('Truncated message.')
-  except struct.error as e:
-    raise message_mod.DecodeError(e)
-  return length   # Return this for legacy reasons.
-
-
-
-def SerializePartialToString(self, **kwargs) -
-
-
-
- -Expand source code - -
def SerializePartialToString(self, **kwargs):
-  out = BytesIO()
-  self._InternalSerialize(out.write, **kwargs)
-  return out.getvalue()
-
-
-
-def SerializeToString(self, **kwargs) -
-
-
-
- -Expand source code - -
def SerializeToString(self, **kwargs):
-  # Check if the message has all of its required fields set.
-  if not self.IsInitialized():
-    raise message_mod.EncodeError(
-        'Message %s is missing required fields: %s' % (
-        self.DESCRIPTOR.full_name, ','.join(self.FindInitializationErrors())))
-  return self.SerializePartialToString(**kwargs)
-
-
-
-def SetInParent(self) -
-
-

Sets the _cached_byte_size_dirty bit to true, -and propagates this to our listener iff this was a state change.

-
- -Expand source code - -
def Modified(self):
-  """Sets the _cached_byte_size_dirty bit to true,
-  and propagates this to our listener iff this was a state change.
-  """
-
-  # Note:  Some callers check _cached_byte_size_dirty before calling
-  #   _Modified() as an extra optimization.  So, if this method is ever
-  #   changed such that it does stuff even when _cached_byte_size_dirty is
-  #   already true, the callers need to be updated.
-  if not self._cached_byte_size_dirty:
-    self._cached_byte_size_dirty = True
-    self._listener_for_children.dirty = True
-    self._is_present_in_parent = True
-    self._listener.Modified()
-
-
-
-def UnknownFields(self) -
-
-
-
- -Expand source code - -
def _UnknownFields(self):
-  if self._unknown_field_set is None:  # pylint: disable=protected-access
-    # pylint: disable=protected-access
-    self._unknown_field_set = containers.UnknownFieldSet()
-  return self._unknown_field_set    # pylint: disable=protected-access
-
-
-
-def WhichOneof(self, oneof_name) -
-
-

Returns the name of the currently set field inside a oneof, or None.

-
- -Expand source code - -
def WhichOneof(self, oneof_name):
-  """Returns the name of the currently set field inside a oneof, or None."""
-  try:
-    field = message_descriptor.oneofs_by_name[oneof_name]
-  except KeyError:
-    raise ValueError(
-        'Protocol message has no oneof "%s" field.' % oneof_name)
-
-  nested_field = self._oneofs.get(field, None)
-  if nested_field is not None and self.HasField(nested_field.name):
-    return nested_field.name
-  else:
-    return None
-
+

Field AdminMessage.set_radio

@@ -995,35 +306,7 @@ and propagates this to our listener iff this was a state change.

  • AdminMessage

      -
    • ByteSize
    • -
    • CONFIRM_SET_CHANNEL_FIELD_NUMBER
    • -
    • CONFIRM_SET_RADIO_FIELD_NUMBER
    • -
    • Clear
    • -
    • ClearField
    • DESCRIPTOR
    • -
    • DiscardUnknownFields
    • -
    • EXIT_SIMULATOR_FIELD_NUMBER
    • -
    • FindInitializationErrors
    • -
    • FromString
    • -
    • GET_CHANNEL_REQUEST_FIELD_NUMBER
    • -
    • GET_CHANNEL_RESPONSE_FIELD_NUMBER
    • -
    • GET_RADIO_REQUEST_FIELD_NUMBER
    • -
    • GET_RADIO_RESPONSE_FIELD_NUMBER
    • -
    • HasField
    • -
    • IsInitialized
    • -
    • ListFields
    • -
    • MergeFrom
    • -
    • MergeFromString
    • -
    • REBOOT_SECONDS_FIELD_NUMBER
    • -
    • RegisterExtension
    • -
    • SET_CHANNEL_FIELD_NUMBER
    • -
    • SET_OWNER_FIELD_NUMBER
    • -
    • SET_RADIO_FIELD_NUMBER
    • -
    • SerializePartialToString
    • -
    • SerializeToString
    • -
    • SetInParent
    • -
    • UnknownFields
    • -
    • WhichOneof
    • confirm_set_channel
    • confirm_set_radio
    • exit_simulator
    • diff --git a/docs/meshtastic/apponly_pb2.html b/docs/meshtastic/apponly_pb2.html index 1180130..62061b9 100644 --- a/docs/meshtastic/apponly_pb2.html +++ b/docs/meshtastic/apponly_pb2.html @@ -111,16 +111,13 @@ DESCRIPTOR._options = None
      class ChannelSet -(**kwargs) +(*args, **kwargs)
      -

      Abstract base class for protocol messages.

      -

      Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

      +

      A ProtocolMessage

      Ancestors

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

      Class variables

      @@ -129,528 +126,12 @@ shown below.

      -
      var SETTINGS_FIELD_NUMBER
      -
      -
      -
      -
      -

      Static methods

      -
      -
      -def FromString(s) -
      -
      -
      -
      - -Expand source code - -
      def FromString(s):
      -  message = cls()
      -  message.MergeFromString(s)
      -  return message
      -
      -
      -
      -def RegisterExtension(extension_handle) -
      -
      -
      -
      - -Expand source code - -
      def RegisterExtension(extension_handle):
      -  extension_handle.containing_type = cls.DESCRIPTOR
      -  # TODO(amauryfa): Use cls.MESSAGE_FACTORY.pool when available.
      -  # pylint: disable=protected-access
      -  cls.DESCRIPTOR.file.pool._AddExtensionDescriptor(extension_handle)
      -  _AttachFieldHelpers(cls, extension_handle)
      -
      -

      Instance variables

      var settings
      -

      Getter for settings.

      -
      - -Expand source code - -
      def getter(self):
      -  field_value = self._fields.get(field)
      -  if field_value is None:
      -    # Construct a new object to represent this field.
      -    field_value = field._default_constructor(self)
      -
      -    # Atomically check if another thread has preempted us and, if not, swap
      -    # in the new object we just created.  If someone has preempted us, we
      -    # take that object and discard ours.
      -    # WARNING:  We are relying on setdefault() being atomic.  This is true
      -    #   in CPython but we haven't investigated others.  This warning appears
      -    #   in several other locations in this file.
      -    field_value = self._fields.setdefault(field, field_value)
      -  return field_value
      -
      -
      -
      -

      Methods

      -
      -
      -def ByteSize(self) -
      -
      -
      -
      - -Expand source code - -
      def ByteSize(self):
      -  if not self._cached_byte_size_dirty:
      -    return self._cached_byte_size
      -
      -  size = 0
      -  descriptor = self.DESCRIPTOR
      -  if descriptor.GetOptions().map_entry:
      -    # Fields of map entry should always be serialized.
      -    size = descriptor.fields_by_name['key']._sizer(self.key)
      -    size += descriptor.fields_by_name['value']._sizer(self.value)
      -  else:
      -    for field_descriptor, field_value in self.ListFields():
      -      size += field_descriptor._sizer(field_value)
      -    for tag_bytes, value_bytes in self._unknown_fields:
      -      size += len(tag_bytes) + len(value_bytes)
      -
      -  self._cached_byte_size = size
      -  self._cached_byte_size_dirty = False
      -  self._listener_for_children.dirty = False
      -  return size
      -
      -
      -
      -def Clear(self) -
      -
      -
      -
      - -Expand source code - -
      def _Clear(self):
      -  # Clear fields.
      -  self._fields = {}
      -  self._unknown_fields = ()
      -  # pylint: disable=protected-access
      -  if self._unknown_field_set is not None:
      -    self._unknown_field_set._clear()
      -    self._unknown_field_set = None
      -
      -  self._oneofs = {}
      -  self._Modified()
      -
      -
      -
      -def ClearField(self, field_name) -
      -
      -
      -
      - -Expand source code - -
      def ClearField(self, field_name):
      -  try:
      -    field = message_descriptor.fields_by_name[field_name]
      -  except KeyError:
      -    try:
      -      field = message_descriptor.oneofs_by_name[field_name]
      -      if field in self._oneofs:
      -        field = self._oneofs[field]
      -      else:
      -        return
      -    except KeyError:
      -      raise ValueError('Protocol message %s has no "%s" field.' %
      -                       (message_descriptor.name, field_name))
      -
      -  if field in self._fields:
      -    # To match the C++ implementation, we need to invalidate iterators
      -    # for map fields when ClearField() happens.
      -    if hasattr(self._fields[field], 'InvalidateIterators'):
      -      self._fields[field].InvalidateIterators()
      -
      -    # Note:  If the field is a sub-message, its listener will still point
      -    #   at us.  That's fine, because the worst than can happen is that it
      -    #   will call _Modified() and invalidate our byte size.  Big deal.
      -    del self._fields[field]
      -
      -    if self._oneofs.get(field.containing_oneof, None) is field:
      -      del self._oneofs[field.containing_oneof]
      -
      -  # Always call _Modified() -- even if nothing was changed, this is
      -  # a mutating method, and thus calling it should cause the field to become
      -  # present in the parent message.
      -  self._Modified()
      -
      -
      -
      -def DiscardUnknownFields(self) -
      -
      -
      -
      - -Expand source code - -
      def _DiscardUnknownFields(self):
      -  self._unknown_fields = []
      -  self._unknown_field_set = None      # pylint: disable=protected-access
      -  for field, value in self.ListFields():
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if _IsMapField(field):
      -        if _IsMessageMapField(field):
      -          for key in value:
      -            value[key].DiscardUnknownFields()
      -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
      -        for sub_message in value:
      -          sub_message.DiscardUnknownFields()
      -      else:
      -        value.DiscardUnknownFields()
      -
      -
      -
      -def FindInitializationErrors(self) -
      -
      -

      Finds required fields which are not initialized.

      -

      Returns

      -

      A list of strings. -Each string is a path to an uninitialized field from -the top-level message, e.g. "foo.bar[5].baz".

      -
      - -Expand source code - -
      def FindInitializationErrors(self):
      -  """Finds required fields which are not initialized.
      -
      -  Returns:
      -    A list of strings.  Each string is a path to an uninitialized field from
      -    the top-level message, e.g. "foo.bar[5].baz".
      -  """
      -
      -  errors = []  # simplify things
      -
      -  for field in required_fields:
      -    if not self.HasField(field.name):
      -      errors.append(field.name)
      -
      -  for field, value in self.ListFields():
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if field.is_extension:
      -        name = '(%s)' % field.full_name
      -      else:
      -        name = field.name
      -
      -      if _IsMapField(field):
      -        if _IsMessageMapField(field):
      -          for key in value:
      -            element = value[key]
      -            prefix = '%s[%s].' % (name, key)
      -            sub_errors = element.FindInitializationErrors()
      -            errors += [prefix + error for error in sub_errors]
      -        else:
      -          # ScalarMaps can't have any initialization errors.
      -          pass
      -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
      -        for i in range(len(value)):
      -          element = value[i]
      -          prefix = '%s[%d].' % (name, i)
      -          sub_errors = element.FindInitializationErrors()
      -          errors += [prefix + error for error in sub_errors]
      -      else:
      -        prefix = name + '.'
      -        sub_errors = value.FindInitializationErrors()
      -        errors += [prefix + error for error in sub_errors]
      -
      -  return errors
      -
      -
      -
      -def HasField(self, field_name) -
      -
      -
      -
      - -Expand source code - -
      def HasField(self, field_name):
      -  try:
      -    field = hassable_fields[field_name]
      -  except KeyError:
      -    raise ValueError(error_msg % (message_descriptor.full_name, field_name))
      -
      -  if isinstance(field, descriptor_mod.OneofDescriptor):
      -    try:
      -      return HasField(self, self._oneofs[field].name)
      -    except KeyError:
      -      return False
      -  else:
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      value = self._fields.get(field)
      -      return value is not None and value._is_present_in_parent
      -    else:
      -      return field in self._fields
      -
      -
      -
      -def IsInitialized(self, errors=None) -
      -
      -

      Checks if all required fields of a message are set.

      -

      Args

      -
      -
      errors
      -
      A list which, if provided, will be populated with the field -paths of all missing required fields.
      -
      -

      Returns

      -

      True iff the specified message has all required fields set.

      -
      - -Expand source code - -
      def IsInitialized(self, errors=None):
      -  """Checks if all required fields of a message are set.
      -
      -  Args:
      -    errors:  A list which, if provided, will be populated with the field
      -             paths of all missing required fields.
      -
      -  Returns:
      -    True iff the specified message has all required fields set.
      -  """
      -
      -  # Performance is critical so we avoid HasField() and ListFields().
      -
      -  for field in required_fields:
      -    if (field not in self._fields or
      -        (field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE and
      -         not self._fields[field]._is_present_in_parent)):
      -      if errors is not None:
      -        errors.extend(self.FindInitializationErrors())
      -      return False
      -
      -  for field, value in list(self._fields.items()):  # dict can change size!
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if field.label == _FieldDescriptor.LABEL_REPEATED:
      -        if (field.message_type.has_options and
      -            field.message_type.GetOptions().map_entry):
      -          continue
      -        for element in value:
      -          if not element.IsInitialized():
      -            if errors is not None:
      -              errors.extend(self.FindInitializationErrors())
      -            return False
      -      elif value._is_present_in_parent and not value.IsInitialized():
      -        if errors is not None:
      -          errors.extend(self.FindInitializationErrors())
      -        return False
      -
      -  return True
      -
      -
      -
      -def ListFields(self) -
      -
      -
      -
      - -Expand source code - -
      def ListFields(self):
      -  all_fields = [item for item in self._fields.items() if _IsPresent(item)]
      -  all_fields.sort(key = lambda item: item[0].number)
      -  return all_fields
      -
      -
      -
      -def MergeFrom(self, msg) -
      -
      -
      -
      - -Expand source code - -
      def MergeFrom(self, msg):
      -  if not isinstance(msg, cls):
      -    raise TypeError(
      -        'Parameter to MergeFrom() must be instance of same class: '
      -        'expected %s got %s.' % (_FullyQualifiedClassName(cls),
      -                                 _FullyQualifiedClassName(msg.__class__)))
      -
      -  assert msg is not self
      -  self._Modified()
      -
      -  fields = self._fields
      -
      -  for field, value in msg._fields.items():
      -    if field.label == LABEL_REPEATED:
      -      field_value = fields.get(field)
      -      if field_value is None:
      -        # Construct a new object to represent this field.
      -        field_value = field._default_constructor(self)
      -        fields[field] = field_value
      -      field_value.MergeFrom(value)
      -    elif field.cpp_type == CPPTYPE_MESSAGE:
      -      if value._is_present_in_parent:
      -        field_value = fields.get(field)
      -        if field_value is None:
      -          # Construct a new object to represent this field.
      -          field_value = field._default_constructor(self)
      -          fields[field] = field_value
      -        field_value.MergeFrom(value)
      -    else:
      -      self._fields[field] = value
      -      if field.containing_oneof:
      -        self._UpdateOneofState(field)
      -
      -  if msg._unknown_fields:
      -    if not self._unknown_fields:
      -      self._unknown_fields = []
      -    self._unknown_fields.extend(msg._unknown_fields)
      -    # pylint: disable=protected-access
      -    if self._unknown_field_set is None:
      -      self._unknown_field_set = containers.UnknownFieldSet()
      -    self._unknown_field_set._extend(msg._unknown_field_set)
      -
      -
      -
      -def MergeFromString(self, serialized) -
      -
      -
      -
      - -Expand source code - -
      def MergeFromString(self, serialized):
      -  serialized = memoryview(serialized)
      -  length = len(serialized)
      -  try:
      -    if self._InternalParse(serialized, 0, length) != length:
      -      # The only reason _InternalParse would return early is if it
      -      # encountered an end-group tag.
      -      raise message_mod.DecodeError('Unexpected end-group tag.')
      -  except (IndexError, TypeError):
      -    # Now ord(buf[p:p+1]) == ord('') gets TypeError.
      -    raise message_mod.DecodeError('Truncated message.')
      -  except struct.error as e:
      -    raise message_mod.DecodeError(e)
      -  return length   # Return this for legacy reasons.
      -
      -
      -
      -def SerializePartialToString(self, **kwargs) -
      -
      -
      -
      - -Expand source code - -
      def SerializePartialToString(self, **kwargs):
      -  out = BytesIO()
      -  self._InternalSerialize(out.write, **kwargs)
      -  return out.getvalue()
      -
      -
      -
      -def SerializeToString(self, **kwargs) -
      -
      -
      -
      - -Expand source code - -
      def SerializeToString(self, **kwargs):
      -  # Check if the message has all of its required fields set.
      -  if not self.IsInitialized():
      -    raise message_mod.EncodeError(
      -        'Message %s is missing required fields: %s' % (
      -        self.DESCRIPTOR.full_name, ','.join(self.FindInitializationErrors())))
      -  return self.SerializePartialToString(**kwargs)
      -
      -
      -
      -def SetInParent(self) -
      -
      -

      Sets the _cached_byte_size_dirty bit to true, -and propagates this to our listener iff this was a state change.

      -
      - -Expand source code - -
      def Modified(self):
      -  """Sets the _cached_byte_size_dirty bit to true,
      -  and propagates this to our listener iff this was a state change.
      -  """
      -
      -  # Note:  Some callers check _cached_byte_size_dirty before calling
      -  #   _Modified() as an extra optimization.  So, if this method is ever
      -  #   changed such that it does stuff even when _cached_byte_size_dirty is
      -  #   already true, the callers need to be updated.
      -  if not self._cached_byte_size_dirty:
      -    self._cached_byte_size_dirty = True
      -    self._listener_for_children.dirty = True
      -    self._is_present_in_parent = True
      -    self._listener.Modified()
      -
      -
      -
      -def UnknownFields(self) -
      -
      -
      -
      - -Expand source code - -
      def _UnknownFields(self):
      -  if self._unknown_field_set is None:  # pylint: disable=protected-access
      -    # pylint: disable=protected-access
      -    self._unknown_field_set = containers.UnknownFieldSet()
      -  return self._unknown_field_set    # pylint: disable=protected-access
      -
      -
      -
      -def WhichOneof(self, oneof_name) -
      -
      -

      Returns the name of the currently set field inside a oneof, or None.

      -
      - -Expand source code - -
      def WhichOneof(self, oneof_name):
      -  """Returns the name of the currently set field inside a oneof, or None."""
      -  try:
      -    field = message_descriptor.oneofs_by_name[oneof_name]
      -  except KeyError:
      -    raise ValueError(
      -        'Protocol message has no oneof "%s" field.' % oneof_name)
      -
      -  nested_field = self._oneofs.get(field, None)
      -  if nested_field is not None and self.HasField(nested_field.name):
      -    return nested_field.name
      -  else:
      -    return None
      -
      +

      Field ChannelSet.settings

      @@ -673,25 +154,7 @@ and propagates this to our listener iff this was a state change.

    • ChannelSet

    • diff --git a/docs/meshtastic/channel_pb2.html b/docs/meshtastic/channel_pb2.html index f717c6d..47946ff 100644 --- a/docs/meshtastic/channel_pb2.html +++ b/docs/meshtastic/channel_pb2.html @@ -302,16 +302,13 @@ DESCRIPTOR._options = None
      class Channel -(**kwargs) +(*args, **kwargs)
      -

      Abstract base class for protocol messages.

      -

      Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

      +

      A ProtocolMessage

      Ancestors

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

      Class variables

      @@ -324,18 +321,10 @@ shown below.

      -
      var INDEX_FIELD_NUMBER
      -
      -
      -
      var PRIMARY
      -
      var ROLE_FIELD_NUMBER
      -
      -
      -
      var Role
      @@ -344,577 +333,36 @@ shown below.

      -
      var SETTINGS_FIELD_NUMBER
      -
      -
      -
      -
      -

      Static methods

      -
      -
      -def FromString(s) -
      -
      -
      -
      - -Expand source code - -
      def FromString(s):
      -  message = cls()
      -  message.MergeFromString(s)
      -  return message
      -
      -
      -
      -def RegisterExtension(extension_handle) -
      -
      -
      -
      - -Expand source code - -
      def RegisterExtension(extension_handle):
      -  extension_handle.containing_type = cls.DESCRIPTOR
      -  # TODO(amauryfa): Use cls.MESSAGE_FACTORY.pool when available.
      -  # pylint: disable=protected-access
      -  cls.DESCRIPTOR.file.pool._AddExtensionDescriptor(extension_handle)
      -  _AttachFieldHelpers(cls, extension_handle)
      -
      -

      Instance variables

      var index
      -

      Getter for index.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field Channel.index

      var role
      -

      Getter for role.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field Channel.role

      var settings
      -

      Getter for settings.

      -
      - -Expand source code - -
      def getter(self):
      -  field_value = self._fields.get(field)
      -  if field_value is None:
      -    # Construct a new object to represent this field.
      -    field_value = field._default_constructor(self)
      -
      -    # Atomically check if another thread has preempted us and, if not, swap
      -    # in the new object we just created.  If someone has preempted us, we
      -    # take that object and discard ours.
      -    # WARNING:  We are relying on setdefault() being atomic.  This is true
      -    #   in CPython but we haven't investigated others.  This warning appears
      -    #   in several other locations in this file.
      -    field_value = self._fields.setdefault(field, field_value)
      -  return field_value
      -
      -
      -
      -

      Methods

      -
      -
      -def ByteSize(self) -
      -
      -
      -
      - -Expand source code - -
      def ByteSize(self):
      -  if not self._cached_byte_size_dirty:
      -    return self._cached_byte_size
      -
      -  size = 0
      -  descriptor = self.DESCRIPTOR
      -  if descriptor.GetOptions().map_entry:
      -    # Fields of map entry should always be serialized.
      -    size = descriptor.fields_by_name['key']._sizer(self.key)
      -    size += descriptor.fields_by_name['value']._sizer(self.value)
      -  else:
      -    for field_descriptor, field_value in self.ListFields():
      -      size += field_descriptor._sizer(field_value)
      -    for tag_bytes, value_bytes in self._unknown_fields:
      -      size += len(tag_bytes) + len(value_bytes)
      -
      -  self._cached_byte_size = size
      -  self._cached_byte_size_dirty = False
      -  self._listener_for_children.dirty = False
      -  return size
      -
      -
      -
      -def Clear(self) -
      -
      -
      -
      - -Expand source code - -
      def _Clear(self):
      -  # Clear fields.
      -  self._fields = {}
      -  self._unknown_fields = ()
      -  # pylint: disable=protected-access
      -  if self._unknown_field_set is not None:
      -    self._unknown_field_set._clear()
      -    self._unknown_field_set = None
      -
      -  self._oneofs = {}
      -  self._Modified()
      -
      -
      -
      -def ClearField(self, field_name) -
      -
      -
      -
      - -Expand source code - -
      def ClearField(self, field_name):
      -  try:
      -    field = message_descriptor.fields_by_name[field_name]
      -  except KeyError:
      -    try:
      -      field = message_descriptor.oneofs_by_name[field_name]
      -      if field in self._oneofs:
      -        field = self._oneofs[field]
      -      else:
      -        return
      -    except KeyError:
      -      raise ValueError('Protocol message %s has no "%s" field.' %
      -                       (message_descriptor.name, field_name))
      -
      -  if field in self._fields:
      -    # To match the C++ implementation, we need to invalidate iterators
      -    # for map fields when ClearField() happens.
      -    if hasattr(self._fields[field], 'InvalidateIterators'):
      -      self._fields[field].InvalidateIterators()
      -
      -    # Note:  If the field is a sub-message, its listener will still point
      -    #   at us.  That's fine, because the worst than can happen is that it
      -    #   will call _Modified() and invalidate our byte size.  Big deal.
      -    del self._fields[field]
      -
      -    if self._oneofs.get(field.containing_oneof, None) is field:
      -      del self._oneofs[field.containing_oneof]
      -
      -  # Always call _Modified() -- even if nothing was changed, this is
      -  # a mutating method, and thus calling it should cause the field to become
      -  # present in the parent message.
      -  self._Modified()
      -
      -
      -
      -def DiscardUnknownFields(self) -
      -
      -
      -
      - -Expand source code - -
      def _DiscardUnknownFields(self):
      -  self._unknown_fields = []
      -  self._unknown_field_set = None      # pylint: disable=protected-access
      -  for field, value in self.ListFields():
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if _IsMapField(field):
      -        if _IsMessageMapField(field):
      -          for key in value:
      -            value[key].DiscardUnknownFields()
      -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
      -        for sub_message in value:
      -          sub_message.DiscardUnknownFields()
      -      else:
      -        value.DiscardUnknownFields()
      -
      -
      -
      -def FindInitializationErrors(self) -
      -
      -

      Finds required fields which are not initialized.

      -

      Returns

      -

      A list of strings. -Each string is a path to an uninitialized field from -the top-level message, e.g. "foo.bar[5].baz".

      -
      - -Expand source code - -
      def FindInitializationErrors(self):
      -  """Finds required fields which are not initialized.
      -
      -  Returns:
      -    A list of strings.  Each string is a path to an uninitialized field from
      -    the top-level message, e.g. "foo.bar[5].baz".
      -  """
      -
      -  errors = []  # simplify things
      -
      -  for field in required_fields:
      -    if not self.HasField(field.name):
      -      errors.append(field.name)
      -
      -  for field, value in self.ListFields():
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if field.is_extension:
      -        name = '(%s)' % field.full_name
      -      else:
      -        name = field.name
      -
      -      if _IsMapField(field):
      -        if _IsMessageMapField(field):
      -          for key in value:
      -            element = value[key]
      -            prefix = '%s[%s].' % (name, key)
      -            sub_errors = element.FindInitializationErrors()
      -            errors += [prefix + error for error in sub_errors]
      -        else:
      -          # ScalarMaps can't have any initialization errors.
      -          pass
      -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
      -        for i in range(len(value)):
      -          element = value[i]
      -          prefix = '%s[%d].' % (name, i)
      -          sub_errors = element.FindInitializationErrors()
      -          errors += [prefix + error for error in sub_errors]
      -      else:
      -        prefix = name + '.'
      -        sub_errors = value.FindInitializationErrors()
      -        errors += [prefix + error for error in sub_errors]
      -
      -  return errors
      -
      -
      -
      -def HasField(self, field_name) -
      -
      -
      -
      - -Expand source code - -
      def HasField(self, field_name):
      -  try:
      -    field = hassable_fields[field_name]
      -  except KeyError:
      -    raise ValueError(error_msg % (message_descriptor.full_name, field_name))
      -
      -  if isinstance(field, descriptor_mod.OneofDescriptor):
      -    try:
      -      return HasField(self, self._oneofs[field].name)
      -    except KeyError:
      -      return False
      -  else:
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      value = self._fields.get(field)
      -      return value is not None and value._is_present_in_parent
      -    else:
      -      return field in self._fields
      -
      -
      -
      -def IsInitialized(self, errors=None) -
      -
      -

      Checks if all required fields of a message are set.

      -

      Args

      -
      -
      errors
      -
      A list which, if provided, will be populated with the field -paths of all missing required fields.
      -
      -

      Returns

      -

      True iff the specified message has all required fields set.

      -
      - -Expand source code - -
      def IsInitialized(self, errors=None):
      -  """Checks if all required fields of a message are set.
      -
      -  Args:
      -    errors:  A list which, if provided, will be populated with the field
      -             paths of all missing required fields.
      -
      -  Returns:
      -    True iff the specified message has all required fields set.
      -  """
      -
      -  # Performance is critical so we avoid HasField() and ListFields().
      -
      -  for field in required_fields:
      -    if (field not in self._fields or
      -        (field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE and
      -         not self._fields[field]._is_present_in_parent)):
      -      if errors is not None:
      -        errors.extend(self.FindInitializationErrors())
      -      return False
      -
      -  for field, value in list(self._fields.items()):  # dict can change size!
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if field.label == _FieldDescriptor.LABEL_REPEATED:
      -        if (field.message_type.has_options and
      -            field.message_type.GetOptions().map_entry):
      -          continue
      -        for element in value:
      -          if not element.IsInitialized():
      -            if errors is not None:
      -              errors.extend(self.FindInitializationErrors())
      -            return False
      -      elif value._is_present_in_parent and not value.IsInitialized():
      -        if errors is not None:
      -          errors.extend(self.FindInitializationErrors())
      -        return False
      -
      -  return True
      -
      -
      -
      -def ListFields(self) -
      -
      -
      -
      - -Expand source code - -
      def ListFields(self):
      -  all_fields = [item for item in self._fields.items() if _IsPresent(item)]
      -  all_fields.sort(key = lambda item: item[0].number)
      -  return all_fields
      -
      -
      -
      -def MergeFrom(self, msg) -
      -
      -
      -
      - -Expand source code - -
      def MergeFrom(self, msg):
      -  if not isinstance(msg, cls):
      -    raise TypeError(
      -        'Parameter to MergeFrom() must be instance of same class: '
      -        'expected %s got %s.' % (_FullyQualifiedClassName(cls),
      -                                 _FullyQualifiedClassName(msg.__class__)))
      -
      -  assert msg is not self
      -  self._Modified()
      -
      -  fields = self._fields
      -
      -  for field, value in msg._fields.items():
      -    if field.label == LABEL_REPEATED:
      -      field_value = fields.get(field)
      -      if field_value is None:
      -        # Construct a new object to represent this field.
      -        field_value = field._default_constructor(self)
      -        fields[field] = field_value
      -      field_value.MergeFrom(value)
      -    elif field.cpp_type == CPPTYPE_MESSAGE:
      -      if value._is_present_in_parent:
      -        field_value = fields.get(field)
      -        if field_value is None:
      -          # Construct a new object to represent this field.
      -          field_value = field._default_constructor(self)
      -          fields[field] = field_value
      -        field_value.MergeFrom(value)
      -    else:
      -      self._fields[field] = value
      -      if field.containing_oneof:
      -        self._UpdateOneofState(field)
      -
      -  if msg._unknown_fields:
      -    if not self._unknown_fields:
      -      self._unknown_fields = []
      -    self._unknown_fields.extend(msg._unknown_fields)
      -    # pylint: disable=protected-access
      -    if self._unknown_field_set is None:
      -      self._unknown_field_set = containers.UnknownFieldSet()
      -    self._unknown_field_set._extend(msg._unknown_field_set)
      -
      -
      -
      -def MergeFromString(self, serialized) -
      -
      -
      -
      - -Expand source code - -
      def MergeFromString(self, serialized):
      -  serialized = memoryview(serialized)
      -  length = len(serialized)
      -  try:
      -    if self._InternalParse(serialized, 0, length) != length:
      -      # The only reason _InternalParse would return early is if it
      -      # encountered an end-group tag.
      -      raise message_mod.DecodeError('Unexpected end-group tag.')
      -  except (IndexError, TypeError):
      -    # Now ord(buf[p:p+1]) == ord('') gets TypeError.
      -    raise message_mod.DecodeError('Truncated message.')
      -  except struct.error as e:
      -    raise message_mod.DecodeError(e)
      -  return length   # Return this for legacy reasons.
      -
      -
      -
      -def SerializePartialToString(self, **kwargs) -
      -
      -
      -
      - -Expand source code - -
      def SerializePartialToString(self, **kwargs):
      -  out = BytesIO()
      -  self._InternalSerialize(out.write, **kwargs)
      -  return out.getvalue()
      -
      -
      -
      -def SerializeToString(self, **kwargs) -
      -
      -
      -
      - -Expand source code - -
      def SerializeToString(self, **kwargs):
      -  # Check if the message has all of its required fields set.
      -  if not self.IsInitialized():
      -    raise message_mod.EncodeError(
      -        'Message %s is missing required fields: %s' % (
      -        self.DESCRIPTOR.full_name, ','.join(self.FindInitializationErrors())))
      -  return self.SerializePartialToString(**kwargs)
      -
      -
      -
      -def SetInParent(self) -
      -
      -

      Sets the _cached_byte_size_dirty bit to true, -and propagates this to our listener iff this was a state change.

      -
      - -Expand source code - -
      def Modified(self):
      -  """Sets the _cached_byte_size_dirty bit to true,
      -  and propagates this to our listener iff this was a state change.
      -  """
      -
      -  # Note:  Some callers check _cached_byte_size_dirty before calling
      -  #   _Modified() as an extra optimization.  So, if this method is ever
      -  #   changed such that it does stuff even when _cached_byte_size_dirty is
      -  #   already true, the callers need to be updated.
      -  if not self._cached_byte_size_dirty:
      -    self._cached_byte_size_dirty = True
      -    self._listener_for_children.dirty = True
      -    self._is_present_in_parent = True
      -    self._listener.Modified()
      -
      -
      -
      -def UnknownFields(self) -
      -
      -
      -
      - -Expand source code - -
      def _UnknownFields(self):
      -  if self._unknown_field_set is None:  # pylint: disable=protected-access
      -    # pylint: disable=protected-access
      -    self._unknown_field_set = containers.UnknownFieldSet()
      -  return self._unknown_field_set    # pylint: disable=protected-access
      -
      -
      -
      -def WhichOneof(self, oneof_name) -
      -
      -

      Returns the name of the currently set field inside a oneof, or None.

      -
      - -Expand source code - -
      def WhichOneof(self, oneof_name):
      -  """Returns the name of the currently set field inside a oneof, or None."""
      -  try:
      -    field = message_descriptor.oneofs_by_name[oneof_name]
      -  except KeyError:
      -    raise ValueError(
      -        'Protocol message has no oneof "%s" field.' % oneof_name)
      -
      -  nested_field = self._oneofs.get(field, None)
      -  if nested_field is not None and self.HasField(nested_field.name):
      -    return nested_field.name
      -  else:
      -    return None
      -
      +

      Field Channel.settings

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

      Abstract base class for protocol messages.

      -

      Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

      +

      A ProtocolMessage

      Ancestors

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

      Class variables

      -
      var BANDWIDTH_FIELD_NUMBER
      -
      -
      -
      var Bw125Cr45Sf128
      @@ -939,692 +387,60 @@ shown below.

      -
      var CHANNEL_NUM_FIELD_NUMBER
      -
      -
      -
      -
      var CODING_RATE_FIELD_NUMBER
      -
      -
      -
      var DESCRIPTOR
      - -
      -
      -
      -
      var ID_FIELD_NUMBER
      -
      -
      -
      -
      var MODEM_CONFIG_FIELD_NUMBER
      -
      -
      -
      var ModemConfig
      -
      var NAME_FIELD_NUMBER
      -
      -
      -
      -
      var PSK_FIELD_NUMBER
      -
      -
      -
      -
      var SPREAD_FACTOR_FIELD_NUMBER
      -
      -
      -
      -
      var TX_POWER_FIELD_NUMBER
      -
      -
      -
      - -
      -
      -
      -
      -

      Static methods

      -
      -
      -def FromString(s) -
      -
      -
      -
      - -Expand source code - -
      def FromString(s):
      -  message = cls()
      -  message.MergeFromString(s)
      -  return message
      -
      -
      -
      -def RegisterExtension(extension_handle) -
      -
      -
      -
      - -Expand source code - -
      def RegisterExtension(extension_handle):
      -  extension_handle.containing_type = cls.DESCRIPTOR
      -  # TODO(amauryfa): Use cls.MESSAGE_FACTORY.pool when available.
      -  # pylint: disable=protected-access
      -  cls.DESCRIPTOR.file.pool._AddExtensionDescriptor(extension_handle)
      -  _AttachFieldHelpers(cls, extension_handle)
      -
      -

      Instance variables

      var bandwidth
      -

      Getter for bandwidth.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.bandwidth

      var channel_num
      -

      Getter for channel_num.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.channel_num

      var coding_rate
      -

      Getter for coding_rate.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.coding_rate

      -

      Getter for downlink_enabled.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.downlink_enabled

      var id
      -

      Getter for id.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.id

      var modem_config
      -

      Getter for modem_config.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.modem_config

      var name
      -

      Getter for name.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.name

      var psk
      -

      Getter for psk.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.psk

      var spread_factor
      -

      Getter for spread_factor.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.spread_factor

      var tx_power
      -

      Getter for tx_power.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      +

      Field ChannelSettings.tx_power

      -

      Getter for uplink_enabled.

      -
      - -Expand source code - -
      def getter(self):
      -  # TODO(protobuf-team): This may be broken since there may not be
      -  # default_value.  Combine with has_default_value somehow.
      -  return self._fields.get(field, default_value)
      -
      -
      -
      -

      Methods

      -
      -
      -def ByteSize(self) -
      -
      -
      -
      - -Expand source code - -
      def ByteSize(self):
      -  if not self._cached_byte_size_dirty:
      -    return self._cached_byte_size
      -
      -  size = 0
      -  descriptor = self.DESCRIPTOR
      -  if descriptor.GetOptions().map_entry:
      -    # Fields of map entry should always be serialized.
      -    size = descriptor.fields_by_name['key']._sizer(self.key)
      -    size += descriptor.fields_by_name['value']._sizer(self.value)
      -  else:
      -    for field_descriptor, field_value in self.ListFields():
      -      size += field_descriptor._sizer(field_value)
      -    for tag_bytes, value_bytes in self._unknown_fields:
      -      size += len(tag_bytes) + len(value_bytes)
      -
      -  self._cached_byte_size = size
      -  self._cached_byte_size_dirty = False
      -  self._listener_for_children.dirty = False
      -  return size
      -
      -
      -
      -def Clear(self) -
      -
      -
      -
      - -Expand source code - -
      def _Clear(self):
      -  # Clear fields.
      -  self._fields = {}
      -  self._unknown_fields = ()
      -  # pylint: disable=protected-access
      -  if self._unknown_field_set is not None:
      -    self._unknown_field_set._clear()
      -    self._unknown_field_set = None
      -
      -  self._oneofs = {}
      -  self._Modified()
      -
      -
      -
      -def ClearField(self, field_name) -
      -
      -
      -
      - -Expand source code - -
      def ClearField(self, field_name):
      -  try:
      -    field = message_descriptor.fields_by_name[field_name]
      -  except KeyError:
      -    try:
      -      field = message_descriptor.oneofs_by_name[field_name]
      -      if field in self._oneofs:
      -        field = self._oneofs[field]
      -      else:
      -        return
      -    except KeyError:
      -      raise ValueError('Protocol message %s has no "%s" field.' %
      -                       (message_descriptor.name, field_name))
      -
      -  if field in self._fields:
      -    # To match the C++ implementation, we need to invalidate iterators
      -    # for map fields when ClearField() happens.
      -    if hasattr(self._fields[field], 'InvalidateIterators'):
      -      self._fields[field].InvalidateIterators()
      -
      -    # Note:  If the field is a sub-message, its listener will still point
      -    #   at us.  That's fine, because the worst than can happen is that it
      -    #   will call _Modified() and invalidate our byte size.  Big deal.
      -    del self._fields[field]
      -
      -    if self._oneofs.get(field.containing_oneof, None) is field:
      -      del self._oneofs[field.containing_oneof]
      -
      -  # Always call _Modified() -- even if nothing was changed, this is
      -  # a mutating method, and thus calling it should cause the field to become
      -  # present in the parent message.
      -  self._Modified()
      -
      -
      -
      -def DiscardUnknownFields(self) -
      -
      -
      -
      - -Expand source code - -
      def _DiscardUnknownFields(self):
      -  self._unknown_fields = []
      -  self._unknown_field_set = None      # pylint: disable=protected-access
      -  for field, value in self.ListFields():
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if _IsMapField(field):
      -        if _IsMessageMapField(field):
      -          for key in value:
      -            value[key].DiscardUnknownFields()
      -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
      -        for sub_message in value:
      -          sub_message.DiscardUnknownFields()
      -      else:
      -        value.DiscardUnknownFields()
      -
      -
      -
      -def FindInitializationErrors(self) -
      -
      -

      Finds required fields which are not initialized.

      -

      Returns

      -

      A list of strings. -Each string is a path to an uninitialized field from -the top-level message, e.g. "foo.bar[5].baz".

      -
      - -Expand source code - -
      def FindInitializationErrors(self):
      -  """Finds required fields which are not initialized.
      -
      -  Returns:
      -    A list of strings.  Each string is a path to an uninitialized field from
      -    the top-level message, e.g. "foo.bar[5].baz".
      -  """
      -
      -  errors = []  # simplify things
      -
      -  for field in required_fields:
      -    if not self.HasField(field.name):
      -      errors.append(field.name)
      -
      -  for field, value in self.ListFields():
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if field.is_extension:
      -        name = '(%s)' % field.full_name
      -      else:
      -        name = field.name
      -
      -      if _IsMapField(field):
      -        if _IsMessageMapField(field):
      -          for key in value:
      -            element = value[key]
      -            prefix = '%s[%s].' % (name, key)
      -            sub_errors = element.FindInitializationErrors()
      -            errors += [prefix + error for error in sub_errors]
      -        else:
      -          # ScalarMaps can't have any initialization errors.
      -          pass
      -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
      -        for i in range(len(value)):
      -          element = value[i]
      -          prefix = '%s[%d].' % (name, i)
      -          sub_errors = element.FindInitializationErrors()
      -          errors += [prefix + error for error in sub_errors]
      -      else:
      -        prefix = name + '.'
      -        sub_errors = value.FindInitializationErrors()
      -        errors += [prefix + error for error in sub_errors]
      -
      -  return errors
      -
      -
      -
      -def HasField(self, field_name) -
      -
      -
      -
      - -Expand source code - -
      def HasField(self, field_name):
      -  try:
      -    field = hassable_fields[field_name]
      -  except KeyError:
      -    raise ValueError(error_msg % (message_descriptor.full_name, field_name))
      -
      -  if isinstance(field, descriptor_mod.OneofDescriptor):
      -    try:
      -      return HasField(self, self._oneofs[field].name)
      -    except KeyError:
      -      return False
      -  else:
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      value = self._fields.get(field)
      -      return value is not None and value._is_present_in_parent
      -    else:
      -      return field in self._fields
      -
      -
      -
      -def IsInitialized(self, errors=None) -
      -
      -

      Checks if all required fields of a message are set.

      -

      Args

      -
      -
      errors
      -
      A list which, if provided, will be populated with the field -paths of all missing required fields.
      -
      -

      Returns

      -

      True iff the specified message has all required fields set.

      -
      - -Expand source code - -
      def IsInitialized(self, errors=None):
      -  """Checks if all required fields of a message are set.
      -
      -  Args:
      -    errors:  A list which, if provided, will be populated with the field
      -             paths of all missing required fields.
      -
      -  Returns:
      -    True iff the specified message has all required fields set.
      -  """
      -
      -  # Performance is critical so we avoid HasField() and ListFields().
      -
      -  for field in required_fields:
      -    if (field not in self._fields or
      -        (field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE and
      -         not self._fields[field]._is_present_in_parent)):
      -      if errors is not None:
      -        errors.extend(self.FindInitializationErrors())
      -      return False
      -
      -  for field, value in list(self._fields.items()):  # dict can change size!
      -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
      -      if field.label == _FieldDescriptor.LABEL_REPEATED:
      -        if (field.message_type.has_options and
      -            field.message_type.GetOptions().map_entry):
      -          continue
      -        for element in value:
      -          if not element.IsInitialized():
      -            if errors is not None:
      -              errors.extend(self.FindInitializationErrors())
      -            return False
      -      elif value._is_present_in_parent and not value.IsInitialized():
      -        if errors is not None:
      -          errors.extend(self.FindInitializationErrors())
      -        return False
      -
      -  return True
      -
      -
      -
      -def ListFields(self) -
      -
      -
      -
      - -Expand source code - -
      def ListFields(self):
      -  all_fields = [item for item in self._fields.items() if _IsPresent(item)]
      -  all_fields.sort(key = lambda item: item[0].number)
      -  return all_fields
      -
      -
      -
      -def MergeFrom(self, msg) -
      -
      -
      -
      - -Expand source code - -
      def MergeFrom(self, msg):
      -  if not isinstance(msg, cls):
      -    raise TypeError(
      -        'Parameter to MergeFrom() must be instance of same class: '
      -        'expected %s got %s.' % (_FullyQualifiedClassName(cls),
      -                                 _FullyQualifiedClassName(msg.__class__)))
      -
      -  assert msg is not self
      -  self._Modified()
      -
      -  fields = self._fields
      -
      -  for field, value in msg._fields.items():
      -    if field.label == LABEL_REPEATED:
      -      field_value = fields.get(field)
      -      if field_value is None:
      -        # Construct a new object to represent this field.
      -        field_value = field._default_constructor(self)
      -        fields[field] = field_value
      -      field_value.MergeFrom(value)
      -    elif field.cpp_type == CPPTYPE_MESSAGE:
      -      if value._is_present_in_parent:
      -        field_value = fields.get(field)
      -        if field_value is None:
      -          # Construct a new object to represent this field.
      -          field_value = field._default_constructor(self)
      -          fields[field] = field_value
      -        field_value.MergeFrom(value)
      -    else:
      -      self._fields[field] = value
      -      if field.containing_oneof:
      -        self._UpdateOneofState(field)
      -
      -  if msg._unknown_fields:
      -    if not self._unknown_fields:
      -      self._unknown_fields = []
      -    self._unknown_fields.extend(msg._unknown_fields)
      -    # pylint: disable=protected-access
      -    if self._unknown_field_set is None:
      -      self._unknown_field_set = containers.UnknownFieldSet()
      -    self._unknown_field_set._extend(msg._unknown_field_set)
      -
      -
      -
      -def MergeFromString(self, serialized) -
      -
      -
      -
      - -Expand source code - -
      def MergeFromString(self, serialized):
      -  serialized = memoryview(serialized)
      -  length = len(serialized)
      -  try:
      -    if self._InternalParse(serialized, 0, length) != length:
      -      # The only reason _InternalParse would return early is if it
      -      # encountered an end-group tag.
      -      raise message_mod.DecodeError('Unexpected end-group tag.')
      -  except (IndexError, TypeError):
      -    # Now ord(buf[p:p+1]) == ord('') gets TypeError.
      -    raise message_mod.DecodeError('Truncated message.')
      -  except struct.error as e:
      -    raise message_mod.DecodeError(e)
      -  return length   # Return this for legacy reasons.
      -
      -
      -
      -def SerializePartialToString(self, **kwargs) -
      -
      -
      -
      - -Expand source code - -
      def SerializePartialToString(self, **kwargs):
      -  out = BytesIO()
      -  self._InternalSerialize(out.write, **kwargs)
      -  return out.getvalue()
      -
      -
      -
      -def SerializeToString(self, **kwargs) -
      -
      -
      -
      - -Expand source code - -
      def SerializeToString(self, **kwargs):
      -  # Check if the message has all of its required fields set.
      -  if not self.IsInitialized():
      -    raise message_mod.EncodeError(
      -        'Message %s is missing required fields: %s' % (
      -        self.DESCRIPTOR.full_name, ','.join(self.FindInitializationErrors())))
      -  return self.SerializePartialToString(**kwargs)
      -
      -
      -
      -def SetInParent(self) -
      -
      -

      Sets the _cached_byte_size_dirty bit to true, -and propagates this to our listener iff this was a state change.

      -
      - -Expand source code - -
      def Modified(self):
      -  """Sets the _cached_byte_size_dirty bit to true,
      -  and propagates this to our listener iff this was a state change.
      -  """
      -
      -  # Note:  Some callers check _cached_byte_size_dirty before calling
      -  #   _Modified() as an extra optimization.  So, if this method is ever
      -  #   changed such that it does stuff even when _cached_byte_size_dirty is
      -  #   already true, the callers need to be updated.
      -  if not self._cached_byte_size_dirty:
      -    self._cached_byte_size_dirty = True
      -    self._listener_for_children.dirty = True
      -    self._is_present_in_parent = True
      -    self._listener.Modified()
      -
      -
      -
      -def UnknownFields(self) -
      -
      -
      -
      - -Expand source code - -
      def _UnknownFields(self):
      -  if self._unknown_field_set is None:  # pylint: disable=protected-access
      -    # pylint: disable=protected-access
      -    self._unknown_field_set = containers.UnknownFieldSet()
      -  return self._unknown_field_set    # pylint: disable=protected-access
      -
      -
      -
      -def WhichOneof(self, oneof_name) -
      -
      -

      Returns the name of the currently set field inside a oneof, or None.

      -
      - -Expand source code - -
      def WhichOneof(self, oneof_name):
      -  """Returns the name of the currently set field inside a oneof, or None."""
      -  try:
      -    field = message_descriptor.oneofs_by_name[oneof_name]
      -  except KeyError:
      -    raise ValueError(
      -        'Protocol message has no oneof "%s" field.' % oneof_name)
      -
      -  nested_field = self._oneofs.get(field, None)
      -  if nested_field is not None and self.HasField(nested_field.name):
      -    return nested_field.name
      -  else:
      -    return None
      -
      +

      Field ChannelSettings.uplink_enabled

      @@ -1646,32 +462,12 @@ and propagates this to our listener iff this was a state change.

      • Channel

        -
          -
        • ByteSize
        • -
        • Clear
        • -
        • ClearField
        • +
          • DESCRIPTOR
          • DISABLED
          • -
          • DiscardUnknownFields
          • -
          • FindInitializationErrors
          • -
          • FromString
          • -
          • HasField
          • -
          • INDEX_FIELD_NUMBER
          • -
          • IsInitialized
          • -
          • ListFields
          • -
          • MergeFrom
          • -
          • MergeFromString
          • PRIMARY
          • -
          • ROLE_FIELD_NUMBER
          • -
          • RegisterExtension
          • Role
          • SECONDARY
          • -
          • SETTINGS_FIELD_NUMBER
          • -
          • SerializePartialToString
          • -
          • SerializeToString
          • -
          • SetInParent
          • -
          • UnknownFields
          • -
          • WhichOneof
          • index
          • role
          • settings
          • @@ -1679,43 +475,15 @@ and propagates this to our listener iff this was a state change.

          • ChannelSettings

            -
              -
            • BANDWIDTH_FIELD_NUMBER
            • +
              • Bw125Cr45Sf128
              • Bw125Cr48Sf4096
              • Bw250Cr46Sf2048
              • Bw250Cr47Sf1024
              • Bw31_25Cr48Sf512
              • Bw500Cr45Sf128
              • -
              • ByteSize
              • -
              • CHANNEL_NUM_FIELD_NUMBER
              • -
              • CODING_RATE_FIELD_NUMBER
              • -
              • Clear
              • -
              • ClearField
              • DESCRIPTOR
              • -
              • DOWNLINK_ENABLED_FIELD_NUMBER
              • -
              • DiscardUnknownFields
              • -
              • FindInitializationErrors
              • -
              • FromString
              • -
              • HasField
              • -
              • ID_FIELD_NUMBER
              • -
              • IsInitialized
              • -
              • ListFields
              • -
              • MODEM_CONFIG_FIELD_NUMBER
              • -
              • MergeFrom
              • -
              • MergeFromString
              • ModemConfig
              • -
              • NAME_FIELD_NUMBER
              • -
              • PSK_FIELD_NUMBER
              • -
              • RegisterExtension
              • -
              • SPREAD_FACTOR_FIELD_NUMBER
              • -
              • SerializePartialToString
              • -
              • SerializeToString
              • -
              • SetInParent
              • -
              • TX_POWER_FIELD_NUMBER
              • -
              • UPLINK_ENABLED_FIELD_NUMBER
              • -
              • UnknownFields
              • -
              • WhichOneof
              • bandwidth
              • channel_num
              • coding_rate
              • diff --git a/docs/meshtastic/deviceonly_pb2.html b/docs/meshtastic/deviceonly_pb2.html index 6b4df19..7968217 100644 --- a/docs/meshtastic/deviceonly_pb2.html +++ b/docs/meshtastic/deviceonly_pb2.html @@ -294,561 +294,39 @@ DESCRIPTOR._options = None
                class ChannelFile -(**kwargs) +(*args, **kwargs)
                -

                Abstract base class for protocol messages.

                -

                Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

                +

                A ProtocolMessage

                Ancestors

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

                Class variables

                -
                var CHANNELS_FIELD_NUMBER
                -
                -
                -
                var DESCRIPTOR
                -

                Static methods

                -
                -
                -def FromString(s) -
                -
                -
                -
                - -Expand source code - -
                def FromString(s):
                -  message = cls()
                -  message.MergeFromString(s)
                -  return message
                -
                -
                -
                -def RegisterExtension(extension_handle) -
                -
                -
                -
                - -Expand source code - -
                def RegisterExtension(extension_handle):
                -  extension_handle.containing_type = cls.DESCRIPTOR
                -  # TODO(amauryfa): Use cls.MESSAGE_FACTORY.pool when available.
                -  # pylint: disable=protected-access
                -  cls.DESCRIPTOR.file.pool._AddExtensionDescriptor(extension_handle)
                -  _AttachFieldHelpers(cls, extension_handle)
                -
                -
                -

                Instance variables

                var channels
                -

                Getter for channels.

                -
                - -Expand source code - -
                def getter(self):
                -  field_value = self._fields.get(field)
                -  if field_value is None:
                -    # Construct a new object to represent this field.
                -    field_value = field._default_constructor(self)
                -
                -    # Atomically check if another thread has preempted us and, if not, swap
                -    # in the new object we just created.  If someone has preempted us, we
                -    # take that object and discard ours.
                -    # WARNING:  We are relying on setdefault() being atomic.  This is true
                -    #   in CPython but we haven't investigated others.  This warning appears
                -    #   in several other locations in this file.
                -    field_value = self._fields.setdefault(field, field_value)
                -  return field_value
                -
                -
                -
                -

                Methods

                -
                -
                -def ByteSize(self) -
                -
                -
                -
                - -Expand source code - -
                def ByteSize(self):
                -  if not self._cached_byte_size_dirty:
                -    return self._cached_byte_size
                -
                -  size = 0
                -  descriptor = self.DESCRIPTOR
                -  if descriptor.GetOptions().map_entry:
                -    # Fields of map entry should always be serialized.
                -    size = descriptor.fields_by_name['key']._sizer(self.key)
                -    size += descriptor.fields_by_name['value']._sizer(self.value)
                -  else:
                -    for field_descriptor, field_value in self.ListFields():
                -      size += field_descriptor._sizer(field_value)
                -    for tag_bytes, value_bytes in self._unknown_fields:
                -      size += len(tag_bytes) + len(value_bytes)
                -
                -  self._cached_byte_size = size
                -  self._cached_byte_size_dirty = False
                -  self._listener_for_children.dirty = False
                -  return size
                -
                -
                -
                -def Clear(self) -
                -
                -
                -
                - -Expand source code - -
                def _Clear(self):
                -  # Clear fields.
                -  self._fields = {}
                -  self._unknown_fields = ()
                -  # pylint: disable=protected-access
                -  if self._unknown_field_set is not None:
                -    self._unknown_field_set._clear()
                -    self._unknown_field_set = None
                -
                -  self._oneofs = {}
                -  self._Modified()
                -
                -
                -
                -def ClearField(self, field_name) -
                -
                -
                -
                - -Expand source code - -
                def ClearField(self, field_name):
                -  try:
                -    field = message_descriptor.fields_by_name[field_name]
                -  except KeyError:
                -    try:
                -      field = message_descriptor.oneofs_by_name[field_name]
                -      if field in self._oneofs:
                -        field = self._oneofs[field]
                -      else:
                -        return
                -    except KeyError:
                -      raise ValueError('Protocol message %s has no "%s" field.' %
                -                       (message_descriptor.name, field_name))
                -
                -  if field in self._fields:
                -    # To match the C++ implementation, we need to invalidate iterators
                -    # for map fields when ClearField() happens.
                -    if hasattr(self._fields[field], 'InvalidateIterators'):
                -      self._fields[field].InvalidateIterators()
                -
                -    # Note:  If the field is a sub-message, its listener will still point
                -    #   at us.  That's fine, because the worst than can happen is that it
                -    #   will call _Modified() and invalidate our byte size.  Big deal.
                -    del self._fields[field]
                -
                -    if self._oneofs.get(field.containing_oneof, None) is field:
                -      del self._oneofs[field.containing_oneof]
                -
                -  # Always call _Modified() -- even if nothing was changed, this is
                -  # a mutating method, and thus calling it should cause the field to become
                -  # present in the parent message.
                -  self._Modified()
                -
                -
                -
                -def DiscardUnknownFields(self) -
                -
                -
                -
                - -Expand source code - -
                def _DiscardUnknownFields(self):
                -  self._unknown_fields = []
                -  self._unknown_field_set = None      # pylint: disable=protected-access
                -  for field, value in self.ListFields():
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      if _IsMapField(field):
                -        if _IsMessageMapField(field):
                -          for key in value:
                -            value[key].DiscardUnknownFields()
                -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
                -        for sub_message in value:
                -          sub_message.DiscardUnknownFields()
                -      else:
                -        value.DiscardUnknownFields()
                -
                -
                -
                -def FindInitializationErrors(self) -
                -
                -

                Finds required fields which are not initialized.

                -

                Returns

                -

                A list of strings. -Each string is a path to an uninitialized field from -the top-level message, e.g. "foo.bar[5].baz".

                -
                - -Expand source code - -
                def FindInitializationErrors(self):
                -  """Finds required fields which are not initialized.
                -
                -  Returns:
                -    A list of strings.  Each string is a path to an uninitialized field from
                -    the top-level message, e.g. "foo.bar[5].baz".
                -  """
                -
                -  errors = []  # simplify things
                -
                -  for field in required_fields:
                -    if not self.HasField(field.name):
                -      errors.append(field.name)
                -
                -  for field, value in self.ListFields():
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      if field.is_extension:
                -        name = '(%s)' % field.full_name
                -      else:
                -        name = field.name
                -
                -      if _IsMapField(field):
                -        if _IsMessageMapField(field):
                -          for key in value:
                -            element = value[key]
                -            prefix = '%s[%s].' % (name, key)
                -            sub_errors = element.FindInitializationErrors()
                -            errors += [prefix + error for error in sub_errors]
                -        else:
                -          # ScalarMaps can't have any initialization errors.
                -          pass
                -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
                -        for i in range(len(value)):
                -          element = value[i]
                -          prefix = '%s[%d].' % (name, i)
                -          sub_errors = element.FindInitializationErrors()
                -          errors += [prefix + error for error in sub_errors]
                -      else:
                -        prefix = name + '.'
                -        sub_errors = value.FindInitializationErrors()
                -        errors += [prefix + error for error in sub_errors]
                -
                -  return errors
                -
                -
                -
                -def HasField(self, field_name) -
                -
                -
                -
                - -Expand source code - -
                def HasField(self, field_name):
                -  try:
                -    field = hassable_fields[field_name]
                -  except KeyError:
                -    raise ValueError(error_msg % (message_descriptor.full_name, field_name))
                -
                -  if isinstance(field, descriptor_mod.OneofDescriptor):
                -    try:
                -      return HasField(self, self._oneofs[field].name)
                -    except KeyError:
                -      return False
                -  else:
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      value = self._fields.get(field)
                -      return value is not None and value._is_present_in_parent
                -    else:
                -      return field in self._fields
                -
                -
                -
                -def IsInitialized(self, errors=None) -
                -
                -

                Checks if all required fields of a message are set.

                -

                Args

                -
                -
                errors
                -
                A list which, if provided, will be populated with the field -paths of all missing required fields.
                -
                -

                Returns

                -

                True iff the specified message has all required fields set.

                -
                - -Expand source code - -
                def IsInitialized(self, errors=None):
                -  """Checks if all required fields of a message are set.
                -
                -  Args:
                -    errors:  A list which, if provided, will be populated with the field
                -             paths of all missing required fields.
                -
                -  Returns:
                -    True iff the specified message has all required fields set.
                -  """
                -
                -  # Performance is critical so we avoid HasField() and ListFields().
                -
                -  for field in required_fields:
                -    if (field not in self._fields or
                -        (field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE and
                -         not self._fields[field]._is_present_in_parent)):
                -      if errors is not None:
                -        errors.extend(self.FindInitializationErrors())
                -      return False
                -
                -  for field, value in list(self._fields.items()):  # dict can change size!
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      if field.label == _FieldDescriptor.LABEL_REPEATED:
                -        if (field.message_type.has_options and
                -            field.message_type.GetOptions().map_entry):
                -          continue
                -        for element in value:
                -          if not element.IsInitialized():
                -            if errors is not None:
                -              errors.extend(self.FindInitializationErrors())
                -            return False
                -      elif value._is_present_in_parent and not value.IsInitialized():
                -        if errors is not None:
                -          errors.extend(self.FindInitializationErrors())
                -        return False
                -
                -  return True
                -
                -
                -
                -def ListFields(self) -
                -
                -
                -
                - -Expand source code - -
                def ListFields(self):
                -  all_fields = [item for item in self._fields.items() if _IsPresent(item)]
                -  all_fields.sort(key = lambda item: item[0].number)
                -  return all_fields
                -
                -
                -
                -def MergeFrom(self, msg) -
                -
                -
                -
                - -Expand source code - -
                def MergeFrom(self, msg):
                -  if not isinstance(msg, cls):
                -    raise TypeError(
                -        'Parameter to MergeFrom() must be instance of same class: '
                -        'expected %s got %s.' % (_FullyQualifiedClassName(cls),
                -                                 _FullyQualifiedClassName(msg.__class__)))
                -
                -  assert msg is not self
                -  self._Modified()
                -
                -  fields = self._fields
                -
                -  for field, value in msg._fields.items():
                -    if field.label == LABEL_REPEATED:
                -      field_value = fields.get(field)
                -      if field_value is None:
                -        # Construct a new object to represent this field.
                -        field_value = field._default_constructor(self)
                -        fields[field] = field_value
                -      field_value.MergeFrom(value)
                -    elif field.cpp_type == CPPTYPE_MESSAGE:
                -      if value._is_present_in_parent:
                -        field_value = fields.get(field)
                -        if field_value is None:
                -          # Construct a new object to represent this field.
                -          field_value = field._default_constructor(self)
                -          fields[field] = field_value
                -        field_value.MergeFrom(value)
                -    else:
                -      self._fields[field] = value
                -      if field.containing_oneof:
                -        self._UpdateOneofState(field)
                -
                -  if msg._unknown_fields:
                -    if not self._unknown_fields:
                -      self._unknown_fields = []
                -    self._unknown_fields.extend(msg._unknown_fields)
                -    # pylint: disable=protected-access
                -    if self._unknown_field_set is None:
                -      self._unknown_field_set = containers.UnknownFieldSet()
                -    self._unknown_field_set._extend(msg._unknown_field_set)
                -
                -
                -
                -def MergeFromString(self, serialized) -
                -
                -
                -
                - -Expand source code - -
                def MergeFromString(self, serialized):
                -  serialized = memoryview(serialized)
                -  length = len(serialized)
                -  try:
                -    if self._InternalParse(serialized, 0, length) != length:
                -      # The only reason _InternalParse would return early is if it
                -      # encountered an end-group tag.
                -      raise message_mod.DecodeError('Unexpected end-group tag.')
                -  except (IndexError, TypeError):
                -    # Now ord(buf[p:p+1]) == ord('') gets TypeError.
                -    raise message_mod.DecodeError('Truncated message.')
                -  except struct.error as e:
                -    raise message_mod.DecodeError(e)
                -  return length   # Return this for legacy reasons.
                -
                -
                -
                -def SerializePartialToString(self, **kwargs) -
                -
                -
                -
                - -Expand source code - -
                def SerializePartialToString(self, **kwargs):
                -  out = BytesIO()
                -  self._InternalSerialize(out.write, **kwargs)
                -  return out.getvalue()
                -
                -
                -
                -def SerializeToString(self, **kwargs) -
                -
                -
                -
                - -Expand source code - -
                def SerializeToString(self, **kwargs):
                -  # Check if the message has all of its required fields set.
                -  if not self.IsInitialized():
                -    raise message_mod.EncodeError(
                -        'Message %s is missing required fields: %s' % (
                -        self.DESCRIPTOR.full_name, ','.join(self.FindInitializationErrors())))
                -  return self.SerializePartialToString(**kwargs)
                -
                -
                -
                -def SetInParent(self) -
                -
                -

                Sets the _cached_byte_size_dirty bit to true, -and propagates this to our listener iff this was a state change.

                -
                - -Expand source code - -
                def Modified(self):
                -  """Sets the _cached_byte_size_dirty bit to true,
                -  and propagates this to our listener iff this was a state change.
                -  """
                -
                -  # Note:  Some callers check _cached_byte_size_dirty before calling
                -  #   _Modified() as an extra optimization.  So, if this method is ever
                -  #   changed such that it does stuff even when _cached_byte_size_dirty is
                -  #   already true, the callers need to be updated.
                -  if not self._cached_byte_size_dirty:
                -    self._cached_byte_size_dirty = True
                -    self._listener_for_children.dirty = True
                -    self._is_present_in_parent = True
                -    self._listener.Modified()
                -
                -
                -
                -def UnknownFields(self) -
                -
                -
                -
                - -Expand source code - -
                def _UnknownFields(self):
                -  if self._unknown_field_set is None:  # pylint: disable=protected-access
                -    # pylint: disable=protected-access
                -    self._unknown_field_set = containers.UnknownFieldSet()
                -  return self._unknown_field_set    # pylint: disable=protected-access
                -
                -
                -
                -def WhichOneof(self, oneof_name) -
                -
                -

                Returns the name of the currently set field inside a oneof, or None.

                -
                - -Expand source code - -
                def WhichOneof(self, oneof_name):
                -  """Returns the name of the currently set field inside a oneof, or None."""
                -  try:
                -    field = message_descriptor.oneofs_by_name[oneof_name]
                -  except KeyError:
                -    raise ValueError(
                -        'Protocol message has no oneof "%s" field.' % oneof_name)
                -
                -  nested_field = self._oneofs.get(field, None)
                -  if nested_field is not None and self.HasField(nested_field.name):
                -    return nested_field.name
                -  else:
                -    return None
                -
                +

                Field ChannelFile.channels

                class DeviceState -(**kwargs) +(*args, **kwargs)
                -

                Abstract base class for protocol messages.

                -

                Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

                +

                A ProtocolMessage

                Ancestors

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

                Class variables

                @@ -857,729 +335,56 @@ shown below.

                -
                var DID_GPS_RESET_FIELD_NUMBER
                -
                -
                -
                -
                var LEGACYRADIO_FIELD_NUMBER
                -
                -
                -
                -
                var MY_NODE_FIELD_NUMBER
                -
                -
                -
                -
                var NODE_DB_FIELD_NUMBER
                -
                -
                -
                -
                var NO_SAVE_FIELD_NUMBER
                -
                -
                -
                -
                var OWNER_FIELD_NUMBER
                -
                -
                -
                -
                var RECEIVE_QUEUE_FIELD_NUMBER
                -
                -
                -
                -
                var RX_TEXT_MESSAGE_FIELD_NUMBER
                -
                -
                -
                -
                var VERSION_FIELD_NUMBER
                -
                -
                -
                -
                -

                Static methods

                -
                -
                -def FromString(s) -
                -
                -
                -
                - -Expand source code - -
                def FromString(s):
                -  message = cls()
                -  message.MergeFromString(s)
                -  return message
                -
                -
                -
                -def RegisterExtension(extension_handle) -
                -
                -
                -
                - -Expand source code - -
                def RegisterExtension(extension_handle):
                -  extension_handle.containing_type = cls.DESCRIPTOR
                -  # TODO(amauryfa): Use cls.MESSAGE_FACTORY.pool when available.
                -  # pylint: disable=protected-access
                -  cls.DESCRIPTOR.file.pool._AddExtensionDescriptor(extension_handle)
                -  _AttachFieldHelpers(cls, extension_handle)
                -
                -

                Instance variables

                var did_gps_reset
                -

                Getter for did_gps_reset.

                -
                - -Expand source code - -
                def getter(self):
                -  # TODO(protobuf-team): This may be broken since there may not be
                -  # default_value.  Combine with has_default_value somehow.
                -  return self._fields.get(field, default_value)
                -
                +

                Field DeviceState.did_gps_reset

                var legacyRadio
                -

                Getter for legacyRadio.

                -
                - -Expand source code - -
                def getter(self):
                -  field_value = self._fields.get(field)
                -  if field_value is None:
                -    # Construct a new object to represent this field.
                -    field_value = field._default_constructor(self)
                -
                -    # Atomically check if another thread has preempted us and, if not, swap
                -    # in the new object we just created.  If someone has preempted us, we
                -    # take that object and discard ours.
                -    # WARNING:  We are relying on setdefault() being atomic.  This is true
                -    #   in CPython but we haven't investigated others.  This warning appears
                -    #   in several other locations in this file.
                -    field_value = self._fields.setdefault(field, field_value)
                -  return field_value
                -
                +

                Field DeviceState.legacyRadio

                var my_node
                -

                Getter for my_node.

                -
                - -Expand source code - -
                def getter(self):
                -  field_value = self._fields.get(field)
                -  if field_value is None:
                -    # Construct a new object to represent this field.
                -    field_value = field._default_constructor(self)
                -
                -    # Atomically check if another thread has preempted us and, if not, swap
                -    # in the new object we just created.  If someone has preempted us, we
                -    # take that object and discard ours.
                -    # WARNING:  We are relying on setdefault() being atomic.  This is true
                -    #   in CPython but we haven't investigated others.  This warning appears
                -    #   in several other locations in this file.
                -    field_value = self._fields.setdefault(field, field_value)
                -  return field_value
                -
                +

                Field DeviceState.my_node

                var no_save
                -

                Getter for no_save.

                -
                - -Expand source code - -
                def getter(self):
                -  # TODO(protobuf-team): This may be broken since there may not be
                -  # default_value.  Combine with has_default_value somehow.
                -  return self._fields.get(field, default_value)
                -
                +

                Field DeviceState.no_save

                var node_db
                -

                Getter for node_db.

                -
                - -Expand source code - -
                def getter(self):
                -  field_value = self._fields.get(field)
                -  if field_value is None:
                -    # Construct a new object to represent this field.
                -    field_value = field._default_constructor(self)
                -
                -    # Atomically check if another thread has preempted us and, if not, swap
                -    # in the new object we just created.  If someone has preempted us, we
                -    # take that object and discard ours.
                -    # WARNING:  We are relying on setdefault() being atomic.  This is true
                -    #   in CPython but we haven't investigated others.  This warning appears
                -    #   in several other locations in this file.
                -    field_value = self._fields.setdefault(field, field_value)
                -  return field_value
                -
                +

                Field DeviceState.node_db

                var owner
                -

                Getter for owner.

                -
                - -Expand source code - -
                def getter(self):
                -  field_value = self._fields.get(field)
                -  if field_value is None:
                -    # Construct a new object to represent this field.
                -    field_value = field._default_constructor(self)
                -
                -    # Atomically check if another thread has preempted us and, if not, swap
                -    # in the new object we just created.  If someone has preempted us, we
                -    # take that object and discard ours.
                -    # WARNING:  We are relying on setdefault() being atomic.  This is true
                -    #   in CPython but we haven't investigated others.  This warning appears
                -    #   in several other locations in this file.
                -    field_value = self._fields.setdefault(field, field_value)
                -  return field_value
                -
                +

                Field DeviceState.owner

                var receive_queue
                -

                Getter for receive_queue.

                -
                - -Expand source code - -
                def getter(self):
                -  field_value = self._fields.get(field)
                -  if field_value is None:
                -    # Construct a new object to represent this field.
                -    field_value = field._default_constructor(self)
                -
                -    # Atomically check if another thread has preempted us and, if not, swap
                -    # in the new object we just created.  If someone has preempted us, we
                -    # take that object and discard ours.
                -    # WARNING:  We are relying on setdefault() being atomic.  This is true
                -    #   in CPython but we haven't investigated others.  This warning appears
                -    #   in several other locations in this file.
                -    field_value = self._fields.setdefault(field, field_value)
                -  return field_value
                -
                +

                Field DeviceState.receive_queue

                var rx_text_message
                -

                Getter for rx_text_message.

                -
                - -Expand source code - -
                def getter(self):
                -  field_value = self._fields.get(field)
                -  if field_value is None:
                -    # Construct a new object to represent this field.
                -    field_value = field._default_constructor(self)
                -
                -    # Atomically check if another thread has preempted us and, if not, swap
                -    # in the new object we just created.  If someone has preempted us, we
                -    # take that object and discard ours.
                -    # WARNING:  We are relying on setdefault() being atomic.  This is true
                -    #   in CPython but we haven't investigated others.  This warning appears
                -    #   in several other locations in this file.
                -    field_value = self._fields.setdefault(field, field_value)
                -  return field_value
                -
                +

                Field DeviceState.rx_text_message

                var version
                -

                Getter for version.

                -
                - -Expand source code - -
                def getter(self):
                -  # TODO(protobuf-team): This may be broken since there may not be
                -  # default_value.  Combine with has_default_value somehow.
                -  return self._fields.get(field, default_value)
                -
                -
                -
                -

                Methods

                -
                -
                -def ByteSize(self) -
                -
                -
                -
                - -Expand source code - -
                def ByteSize(self):
                -  if not self._cached_byte_size_dirty:
                -    return self._cached_byte_size
                -
                -  size = 0
                -  descriptor = self.DESCRIPTOR
                -  if descriptor.GetOptions().map_entry:
                -    # Fields of map entry should always be serialized.
                -    size = descriptor.fields_by_name['key']._sizer(self.key)
                -    size += descriptor.fields_by_name['value']._sizer(self.value)
                -  else:
                -    for field_descriptor, field_value in self.ListFields():
                -      size += field_descriptor._sizer(field_value)
                -    for tag_bytes, value_bytes in self._unknown_fields:
                -      size += len(tag_bytes) + len(value_bytes)
                -
                -  self._cached_byte_size = size
                -  self._cached_byte_size_dirty = False
                -  self._listener_for_children.dirty = False
                -  return size
                -
                -
                -
                -def Clear(self) -
                -
                -
                -
                - -Expand source code - -
                def _Clear(self):
                -  # Clear fields.
                -  self._fields = {}
                -  self._unknown_fields = ()
                -  # pylint: disable=protected-access
                -  if self._unknown_field_set is not None:
                -    self._unknown_field_set._clear()
                -    self._unknown_field_set = None
                -
                -  self._oneofs = {}
                -  self._Modified()
                -
                -
                -
                -def ClearField(self, field_name) -
                -
                -
                -
                - -Expand source code - -
                def ClearField(self, field_name):
                -  try:
                -    field = message_descriptor.fields_by_name[field_name]
                -  except KeyError:
                -    try:
                -      field = message_descriptor.oneofs_by_name[field_name]
                -      if field in self._oneofs:
                -        field = self._oneofs[field]
                -      else:
                -        return
                -    except KeyError:
                -      raise ValueError('Protocol message %s has no "%s" field.' %
                -                       (message_descriptor.name, field_name))
                -
                -  if field in self._fields:
                -    # To match the C++ implementation, we need to invalidate iterators
                -    # for map fields when ClearField() happens.
                -    if hasattr(self._fields[field], 'InvalidateIterators'):
                -      self._fields[field].InvalidateIterators()
                -
                -    # Note:  If the field is a sub-message, its listener will still point
                -    #   at us.  That's fine, because the worst than can happen is that it
                -    #   will call _Modified() and invalidate our byte size.  Big deal.
                -    del self._fields[field]
                -
                -    if self._oneofs.get(field.containing_oneof, None) is field:
                -      del self._oneofs[field.containing_oneof]
                -
                -  # Always call _Modified() -- even if nothing was changed, this is
                -  # a mutating method, and thus calling it should cause the field to become
                -  # present in the parent message.
                -  self._Modified()
                -
                -
                -
                -def DiscardUnknownFields(self) -
                -
                -
                -
                - -Expand source code - -
                def _DiscardUnknownFields(self):
                -  self._unknown_fields = []
                -  self._unknown_field_set = None      # pylint: disable=protected-access
                -  for field, value in self.ListFields():
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      if _IsMapField(field):
                -        if _IsMessageMapField(field):
                -          for key in value:
                -            value[key].DiscardUnknownFields()
                -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
                -        for sub_message in value:
                -          sub_message.DiscardUnknownFields()
                -      else:
                -        value.DiscardUnknownFields()
                -
                -
                -
                -def FindInitializationErrors(self) -
                -
                -

                Finds required fields which are not initialized.

                -

                Returns

                -

                A list of strings. -Each string is a path to an uninitialized field from -the top-level message, e.g. "foo.bar[5].baz".

                -
                - -Expand source code - -
                def FindInitializationErrors(self):
                -  """Finds required fields which are not initialized.
                -
                -  Returns:
                -    A list of strings.  Each string is a path to an uninitialized field from
                -    the top-level message, e.g. "foo.bar[5].baz".
                -  """
                -
                -  errors = []  # simplify things
                -
                -  for field in required_fields:
                -    if not self.HasField(field.name):
                -      errors.append(field.name)
                -
                -  for field, value in self.ListFields():
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      if field.is_extension:
                -        name = '(%s)' % field.full_name
                -      else:
                -        name = field.name
                -
                -      if _IsMapField(field):
                -        if _IsMessageMapField(field):
                -          for key in value:
                -            element = value[key]
                -            prefix = '%s[%s].' % (name, key)
                -            sub_errors = element.FindInitializationErrors()
                -            errors += [prefix + error for error in sub_errors]
                -        else:
                -          # ScalarMaps can't have any initialization errors.
                -          pass
                -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
                -        for i in range(len(value)):
                -          element = value[i]
                -          prefix = '%s[%d].' % (name, i)
                -          sub_errors = element.FindInitializationErrors()
                -          errors += [prefix + error for error in sub_errors]
                -      else:
                -        prefix = name + '.'
                -        sub_errors = value.FindInitializationErrors()
                -        errors += [prefix + error for error in sub_errors]
                -
                -  return errors
                -
                -
                -
                -def HasField(self, field_name) -
                -
                -
                -
                - -Expand source code - -
                def HasField(self, field_name):
                -  try:
                -    field = hassable_fields[field_name]
                -  except KeyError:
                -    raise ValueError(error_msg % (message_descriptor.full_name, field_name))
                -
                -  if isinstance(field, descriptor_mod.OneofDescriptor):
                -    try:
                -      return HasField(self, self._oneofs[field].name)
                -    except KeyError:
                -      return False
                -  else:
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      value = self._fields.get(field)
                -      return value is not None and value._is_present_in_parent
                -    else:
                -      return field in self._fields
                -
                -
                -
                -def IsInitialized(self, errors=None) -
                -
                -

                Checks if all required fields of a message are set.

                -

                Args

                -
                -
                errors
                -
                A list which, if provided, will be populated with the field -paths of all missing required fields.
                -
                -

                Returns

                -

                True iff the specified message has all required fields set.

                -
                - -Expand source code - -
                def IsInitialized(self, errors=None):
                -  """Checks if all required fields of a message are set.
                -
                -  Args:
                -    errors:  A list which, if provided, will be populated with the field
                -             paths of all missing required fields.
                -
                -  Returns:
                -    True iff the specified message has all required fields set.
                -  """
                -
                -  # Performance is critical so we avoid HasField() and ListFields().
                -
                -  for field in required_fields:
                -    if (field not in self._fields or
                -        (field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE and
                -         not self._fields[field]._is_present_in_parent)):
                -      if errors is not None:
                -        errors.extend(self.FindInitializationErrors())
                -      return False
                -
                -  for field, value in list(self._fields.items()):  # dict can change size!
                -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
                -      if field.label == _FieldDescriptor.LABEL_REPEATED:
                -        if (field.message_type.has_options and
                -            field.message_type.GetOptions().map_entry):
                -          continue
                -        for element in value:
                -          if not element.IsInitialized():
                -            if errors is not None:
                -              errors.extend(self.FindInitializationErrors())
                -            return False
                -      elif value._is_present_in_parent and not value.IsInitialized():
                -        if errors is not None:
                -          errors.extend(self.FindInitializationErrors())
                -        return False
                -
                -  return True
                -
                -
                -
                -def ListFields(self) -
                -
                -
                -
                - -Expand source code - -
                def ListFields(self):
                -  all_fields = [item for item in self._fields.items() if _IsPresent(item)]
                -  all_fields.sort(key = lambda item: item[0].number)
                -  return all_fields
                -
                -
                -
                -def MergeFrom(self, msg) -
                -
                -
                -
                - -Expand source code - -
                def MergeFrom(self, msg):
                -  if not isinstance(msg, cls):
                -    raise TypeError(
                -        'Parameter to MergeFrom() must be instance of same class: '
                -        'expected %s got %s.' % (_FullyQualifiedClassName(cls),
                -                                 _FullyQualifiedClassName(msg.__class__)))
                -
                -  assert msg is not self
                -  self._Modified()
                -
                -  fields = self._fields
                -
                -  for field, value in msg._fields.items():
                -    if field.label == LABEL_REPEATED:
                -      field_value = fields.get(field)
                -      if field_value is None:
                -        # Construct a new object to represent this field.
                -        field_value = field._default_constructor(self)
                -        fields[field] = field_value
                -      field_value.MergeFrom(value)
                -    elif field.cpp_type == CPPTYPE_MESSAGE:
                -      if value._is_present_in_parent:
                -        field_value = fields.get(field)
                -        if field_value is None:
                -          # Construct a new object to represent this field.
                -          field_value = field._default_constructor(self)
                -          fields[field] = field_value
                -        field_value.MergeFrom(value)
                -    else:
                -      self._fields[field] = value
                -      if field.containing_oneof:
                -        self._UpdateOneofState(field)
                -
                -  if msg._unknown_fields:
                -    if not self._unknown_fields:
                -      self._unknown_fields = []
                -    self._unknown_fields.extend(msg._unknown_fields)
                -    # pylint: disable=protected-access
                -    if self._unknown_field_set is None:
                -      self._unknown_field_set = containers.UnknownFieldSet()
                -    self._unknown_field_set._extend(msg._unknown_field_set)
                -
                -
                -
                -def MergeFromString(self, serialized) -
                -
                -
                -
                - -Expand source code - -
                def MergeFromString(self, serialized):
                -  serialized = memoryview(serialized)
                -  length = len(serialized)
                -  try:
                -    if self._InternalParse(serialized, 0, length) != length:
                -      # The only reason _InternalParse would return early is if it
                -      # encountered an end-group tag.
                -      raise message_mod.DecodeError('Unexpected end-group tag.')
                -  except (IndexError, TypeError):
                -    # Now ord(buf[p:p+1]) == ord('') gets TypeError.
                -    raise message_mod.DecodeError('Truncated message.')
                -  except struct.error as e:
                -    raise message_mod.DecodeError(e)
                -  return length   # Return this for legacy reasons.
                -
                -
                -
                -def SerializePartialToString(self, **kwargs) -
                -
                -
                -
                - -Expand source code - -
                def SerializePartialToString(self, **kwargs):
                -  out = BytesIO()
                -  self._InternalSerialize(out.write, **kwargs)
                -  return out.getvalue()
                -
                -
                -
                -def SerializeToString(self, **kwargs) -
                -
                -
                -
                - -Expand source code - -
                def SerializeToString(self, **kwargs):
                -  # Check if the message has all of its required fields set.
                -  if not self.IsInitialized():
                -    raise message_mod.EncodeError(
                -        'Message %s is missing required fields: %s' % (
                -        self.DESCRIPTOR.full_name, ','.join(self.FindInitializationErrors())))
                -  return self.SerializePartialToString(**kwargs)
                -
                -
                -
                -def SetInParent(self) -
                -
                -

                Sets the _cached_byte_size_dirty bit to true, -and propagates this to our listener iff this was a state change.

                -
                - -Expand source code - -
                def Modified(self):
                -  """Sets the _cached_byte_size_dirty bit to true,
                -  and propagates this to our listener iff this was a state change.
                -  """
                -
                -  # Note:  Some callers check _cached_byte_size_dirty before calling
                -  #   _Modified() as an extra optimization.  So, if this method is ever
                -  #   changed such that it does stuff even when _cached_byte_size_dirty is
                -  #   already true, the callers need to be updated.
                -  if not self._cached_byte_size_dirty:
                -    self._cached_byte_size_dirty = True
                -    self._listener_for_children.dirty = True
                -    self._is_present_in_parent = True
                -    self._listener.Modified()
                -
                -
                -
                -def UnknownFields(self) -
                -
                -
                -
                - -Expand source code - -
                def _UnknownFields(self):
                -  if self._unknown_field_set is None:  # pylint: disable=protected-access
                -    # pylint: disable=protected-access
                -    self._unknown_field_set = containers.UnknownFieldSet()
                -  return self._unknown_field_set    # pylint: disable=protected-access
                -
                -
                -
                -def WhichOneof(self, oneof_name) -
                -
                -

                Returns the name of the currently set field inside a oneof, or None.

                -
                - -Expand source code - -
                def WhichOneof(self, oneof_name):
                -  """Returns the name of the currently set field inside a oneof, or None."""
                -  try:
                -    field = message_descriptor.oneofs_by_name[oneof_name]
                -  except KeyError:
                -    raise ValueError(
                -        'Protocol message has no oneof "%s" field.' % oneof_name)
                -
                -  nested_field = self._oneofs.get(field, None)
                -  if nested_field is not None and self.HasField(nested_field.name):
                -    return nested_field.name
                -  else:
                -    return None
                -
                +

                Field DeviceState.version

                class LegacyRadioConfig -(**kwargs) +(*args, **kwargs)
                -

                Abstract base class for protocol messages.

                -

                Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

                +

                A ProtocolMessage

                Ancestors

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

                Class variables

                @@ -1590,534 +395,14 @@ shown below.

                var LegacyPreferences
                -

                Abstract base class for protocol messages.

                -

                Protocol message classes are almost always generated by the protocol -compiler. -These generated types subclass Message and implement the methods -shown below.

                -
                -
                var PREFERENCES_FIELD_NUMBER
                -
                -
                -
                -
  • -

    Static methods

    -
    -
    -def FromString(s) -
    -
    -
    -
    - -Expand source code - -
    def FromString(s):
    -  message = cls()
    -  message.MergeFromString(s)
    -  return message
    -
    -
    -
    -def RegisterExtension(extension_handle) -
    -
    -
    -
    - -Expand source code - -
    def RegisterExtension(extension_handle):
    -  extension_handle.containing_type = cls.DESCRIPTOR
    -  # TODO(amauryfa): Use cls.MESSAGE_FACTORY.pool when available.
    -  # pylint: disable=protected-access
    -  cls.DESCRIPTOR.file.pool._AddExtensionDescriptor(extension_handle)
    -  _AttachFieldHelpers(cls, extension_handle)
    -
    +

    A ProtocolMessage

    Instance variables

    var preferences
    -

    Getter for preferences.

    -
    - -Expand source code - -
    def getter(self):
    -  field_value = self._fields.get(field)
    -  if field_value is None:
    -    # Construct a new object to represent this field.
    -    field_value = field._default_constructor(self)
    -
    -    # Atomically check if another thread has preempted us and, if not, swap
    -    # in the new object we just created.  If someone has preempted us, we
    -    # take that object and discard ours.
    -    # WARNING:  We are relying on setdefault() being atomic.  This is true
    -    #   in CPython but we haven't investigated others.  This warning appears
    -    #   in several other locations in this file.
    -    field_value = self._fields.setdefault(field, field_value)
    -  return field_value
    -
    -
    -
    -

    Methods

    -
    -
    -def ByteSize(self) -
    -
    -
    -
    - -Expand source code - -
    def ByteSize(self):
    -  if not self._cached_byte_size_dirty:
    -    return self._cached_byte_size
    -
    -  size = 0
    -  descriptor = self.DESCRIPTOR
    -  if descriptor.GetOptions().map_entry:
    -    # Fields of map entry should always be serialized.
    -    size = descriptor.fields_by_name['key']._sizer(self.key)
    -    size += descriptor.fields_by_name['value']._sizer(self.value)
    -  else:
    -    for field_descriptor, field_value in self.ListFields():
    -      size += field_descriptor._sizer(field_value)
    -    for tag_bytes, value_bytes in self._unknown_fields:
    -      size += len(tag_bytes) + len(value_bytes)
    -
    -  self._cached_byte_size = size
    -  self._cached_byte_size_dirty = False
    -  self._listener_for_children.dirty = False
    -  return size
    -
    -
    -
    -def Clear(self) -
    -
    -
    -
    - -Expand source code - -
    def _Clear(self):
    -  # Clear fields.
    -  self._fields = {}
    -  self._unknown_fields = ()
    -  # pylint: disable=protected-access
    -  if self._unknown_field_set is not None:
    -    self._unknown_field_set._clear()
    -    self._unknown_field_set = None
    -
    -  self._oneofs = {}
    -  self._Modified()
    -
    -
    -
    -def ClearField(self, field_name) -
    -
    -
    -
    - -Expand source code - -
    def ClearField(self, field_name):
    -  try:
    -    field = message_descriptor.fields_by_name[field_name]
    -  except KeyError:
    -    try:
    -      field = message_descriptor.oneofs_by_name[field_name]
    -      if field in self._oneofs:
    -        field = self._oneofs[field]
    -      else:
    -        return
    -    except KeyError:
    -      raise ValueError('Protocol message %s has no "%s" field.' %
    -                       (message_descriptor.name, field_name))
    -
    -  if field in self._fields:
    -    # To match the C++ implementation, we need to invalidate iterators
    -    # for map fields when ClearField() happens.
    -    if hasattr(self._fields[field], 'InvalidateIterators'):
    -      self._fields[field].InvalidateIterators()
    -
    -    # Note:  If the field is a sub-message, its listener will still point
    -    #   at us.  That's fine, because the worst than can happen is that it
    -    #   will call _Modified() and invalidate our byte size.  Big deal.
    -    del self._fields[field]
    -
    -    if self._oneofs.get(field.containing_oneof, None) is field:
    -      del self._oneofs[field.containing_oneof]
    -
    -  # Always call _Modified() -- even if nothing was changed, this is
    -  # a mutating method, and thus calling it should cause the field to become
    -  # present in the parent message.
    -  self._Modified()
    -
    -
    -
    -def DiscardUnknownFields(self) -
    -
    -
    -
    - -Expand source code - -
    def _DiscardUnknownFields(self):
    -  self._unknown_fields = []
    -  self._unknown_field_set = None      # pylint: disable=protected-access
    -  for field, value in self.ListFields():
    -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
    -      if _IsMapField(field):
    -        if _IsMessageMapField(field):
    -          for key in value:
    -            value[key].DiscardUnknownFields()
    -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
    -        for sub_message in value:
    -          sub_message.DiscardUnknownFields()
    -      else:
    -        value.DiscardUnknownFields()
    -
    -
    -
    -def FindInitializationErrors(self) -
    -
    -

    Finds required fields which are not initialized.

    -

    Returns

    -

    A list of strings. -Each string is a path to an uninitialized field from -the top-level message, e.g. "foo.bar[5].baz".

    -
    - -Expand source code - -
    def FindInitializationErrors(self):
    -  """Finds required fields which are not initialized.
    -
    -  Returns:
    -    A list of strings.  Each string is a path to an uninitialized field from
    -    the top-level message, e.g. "foo.bar[5].baz".
    -  """
    -
    -  errors = []  # simplify things
    -
    -  for field in required_fields:
    -    if not self.HasField(field.name):
    -      errors.append(field.name)
    -
    -  for field, value in self.ListFields():
    -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
    -      if field.is_extension:
    -        name = '(%s)' % field.full_name
    -      else:
    -        name = field.name
    -
    -      if _IsMapField(field):
    -        if _IsMessageMapField(field):
    -          for key in value:
    -            element = value[key]
    -            prefix = '%s[%s].' % (name, key)
    -            sub_errors = element.FindInitializationErrors()
    -            errors += [prefix + error for error in sub_errors]
    -        else:
    -          # ScalarMaps can't have any initialization errors.
    -          pass
    -      elif field.label == _FieldDescriptor.LABEL_REPEATED:
    -        for i in range(len(value)):
    -          element = value[i]
    -          prefix = '%s[%d].' % (name, i)
    -          sub_errors = element.FindInitializationErrors()
    -          errors += [prefix + error for error in sub_errors]
    -      else:
    -        prefix = name + '.'
    -        sub_errors = value.FindInitializationErrors()
    -        errors += [prefix + error for error in sub_errors]
    -
    -  return errors
    -
    -
    -
    -def HasField(self, field_name) -
    -
    -
    -
    - -Expand source code - -
    def HasField(self, field_name):
    -  try:
    -    field = hassable_fields[field_name]
    -  except KeyError:
    -    raise ValueError(error_msg % (message_descriptor.full_name, field_name))
    -
    -  if isinstance(field, descriptor_mod.OneofDescriptor):
    -    try:
    -      return HasField(self, self._oneofs[field].name)
    -    except KeyError:
    -      return False
    -  else:
    -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
    -      value = self._fields.get(field)
    -      return value is not None and value._is_present_in_parent
    -    else:
    -      return field in self._fields
    -
    -
    -
    -def IsInitialized(self, errors=None) -
    -
    -

    Checks if all required fields of a message are set.

    -

    Args

    -
    -
    errors
    -
    A list which, if provided, will be populated with the field -paths of all missing required fields.
    -
    -

    Returns

    -

    True iff the specified message has all required fields set.

    -
    - -Expand source code - -
    def IsInitialized(self, errors=None):
    -  """Checks if all required fields of a message are set.
    -
    -  Args:
    -    errors:  A list which, if provided, will be populated with the field
    -             paths of all missing required fields.
    -
    -  Returns:
    -    True iff the specified message has all required fields set.
    -  """
    -
    -  # Performance is critical so we avoid HasField() and ListFields().
    -
    -  for field in required_fields:
    -    if (field not in self._fields or
    -        (field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE and
    -         not self._fields[field]._is_present_in_parent)):
    -      if errors is not None:
    -        errors.extend(self.FindInitializationErrors())
    -      return False
    -
    -  for field, value in list(self._fields.items()):  # dict can change size!
    -    if field.cpp_type == _FieldDescriptor.CPPTYPE_MESSAGE:
    -      if field.label == _FieldDescriptor.LABEL_REPEATED:
    -        if (field.message_type.has_options and
    -            field.message_type.GetOptions().map_entry):
    -          continue
    -        for element in value:
    -          if not element.IsInitialized():
    -            if errors is not None:
    -              errors.extend(self.FindInitializationErrors())
    -            return False
    -      elif value._is_present_in_parent and not value.IsInitialized():
    -        if errors is not None:
    -          errors.extend(self.FindInitializationErrors())
    -        return False
    -
    -  return True
    -
    -
    -
    -def ListFields(self) -
    -
    -
    -
    - -Expand source code - -
    def ListFields(self):
    -  all_fields = [item for item in self._fields.items() if _IsPresent(item)]
    -  all_fields.sort(key = lambda item: item[0].number)
    -  return all_fields
    -
    -
    -
    -def MergeFrom(self, msg) -
    -
    -
    -
    - -Expand source code - -
    def MergeFrom(self, msg):
    -  if not isinstance(msg, cls):
    -    raise TypeError(
    -        'Parameter to MergeFrom() must be instance of same class: '
    -        'expected %s got %s.' % (_FullyQualifiedClassName(cls),
    -                                 _FullyQualifiedClassName(msg.__class__)))
    -
    -  assert msg is not self
    -  self._Modified()
    -
    -  fields = self._fields
    -
    -  for field, value in msg._fields.items():
    -    if field.label == LABEL_REPEATED:
    -      field_value = fields.get(field)
    -      if field_value is None:
    -        # Construct a new object to represent this field.
    -        field_value = field._default_constructor(self)
    -        fields[field] = field_value
    -      field_value.MergeFrom(value)
    -    elif field.cpp_type == CPPTYPE_MESSAGE:
    -      if value._is_present_in_parent:
    -        field_value = fields.get(field)
    -        if field_value is None:
    -          # Construct a new object to represent this field.
    -          field_value = field._default_constructor(self)
    -          fields[field] = field_value
    -        field_value.MergeFrom(value)
    -    else:
    -      self._fields[field] = value
    -      if field.containing_oneof:
    -        self._UpdateOneofState(field)
    -
    -  if msg._unknown_fields:
    -    if not self._unknown_fields:
    -      self._unknown_fields = []
    -    self._unknown_fields.extend(msg._unknown_fields)
    -    # pylint: disable=protected-access
    -    if self._unknown_field_set is None:
    -      self._unknown_field_set = containers.UnknownFieldSet()
    -    self._unknown_field_set._extend(msg._unknown_field_set)
    -
    -
    -
    -def MergeFromString(self, serialized) -
    -
    -
    -
    - -Expand source code - -
    def MergeFromString(self, serialized):
    -  serialized = memoryview(serialized)
    -  length = len(serialized)
    -  try:
    -    if self._InternalParse(serialized, 0, length) != length:
    -      # The only reason _InternalParse would return early is if it
    -      # encountered an end-group tag.
    -      raise message_mod.DecodeError('Unexpected end-group tag.')
    -  except (IndexError, TypeError):
    -    # Now ord(buf[p:p+1]) == ord('') gets TypeError.
    -    raise message_mod.DecodeError('Truncated message.')
    -  except struct.error as e:
    -    raise message_mod.DecodeError(e)
    -  return length   # Return this for legacy reasons.
    -
    -
    -
    -def SerializePartialToString(self, **kwargs) -
    -
    -
    -
    - -Expand source code - -
    def SerializePartialToString(self, **kwargs):
    -  out = BytesIO()
    -  self._InternalSerialize(out.write, **kwargs)
    -  return out.getvalue()
    -
    -
    -
    -def SerializeToString(self, **kwargs) -
    -
    -
    -
    - -Expand source code - -
    def SerializeToString(self, **kwargs):
    -  # Check if the message has all of its required fields set.
    -  if not self.IsInitialized():
    -    raise message_mod.EncodeError(
    -        'Message %s is missing required fields: %s' % (
    -        self.DESCRIPTOR.full_name, ','.join(self.FindInitializationErrors())))
    -  return self.SerializePartialToString(**kwargs)
    -
    -
    -
    -def SetInParent(self) -
    -
    -

    Sets the _cached_byte_size_dirty bit to true, -and propagates this to our listener iff this was a state change.

    -
    - -Expand source code - -
    def Modified(self):
    -  """Sets the _cached_byte_size_dirty bit to true,
    -  and propagates this to our listener iff this was a state change.
    -  """
    -
    -  # Note:  Some callers check _cached_byte_size_dirty before calling
    -  #   _Modified() as an extra optimization.  So, if this method is ever
    -  #   changed such that it does stuff even when _cached_byte_size_dirty is
    -  #   already true, the callers need to be updated.
    -  if not self._cached_byte_size_dirty:
    -    self._cached_byte_size_dirty = True
    -    self._listener_for_children.dirty = True
    -    self._is_present_in_parent = True
    -    self._listener.Modified()
    -
    -
    -
    -def UnknownFields(self) -
    -
    -
    -
    - -Expand source code - -
    def _UnknownFields(self):
    -  if self._unknown_field_set is None:  # pylint: disable=protected-access
    -    # pylint: disable=protected-access
    -    self._unknown_field_set = containers.UnknownFieldSet()
    -  return self._unknown_field_set    # pylint: disable=protected-access
    -
    -
    -
    -def WhichOneof(self, oneof_name) -
    -
    -

    Returns the name of the currently set field inside a oneof, or None.

    -
    - -Expand source code - -
    def WhichOneof(self, oneof_name):
    -  """Returns the name of the currently set field inside a oneof, or None."""
    -  try:
    -    field = message_descriptor.oneofs_by_name[oneof_name]
    -  except KeyError:
    -    raise ValueError(
    -        'Protocol message has no oneof "%s" field.' % oneof_name)
    -
    -  nested_field = self._oneofs.get(field, None)
    -  if nested_field is not None and self.HasField(nested_field.name):
    -    return nested_field.name
    -  else:
    -    return None
    -
    +

    Field LegacyRadioConfig.preferences

    @@ -2140,58 +425,14 @@ and propagates this to our listener iff this was a state change.

  • ChannelFile

  • DeviceState

    -