ChannelSettings class
This information can be encoded as a QRcode/url so that other users can configure
their radio to join the same channel.
A note about how channel names are shown to users: channelname-X
poundsymbol is a prefix used to indicate this is a channel name (idea from @professr).
Where X is a letter from A-Z (base 26) representing a hash of the PSK for this
channel - so that if the user changes anything about the channel (which does
force a new PSK) this letter will also change. Thus preventing user confusion if
two friends try to type in a channel name of "BobsChan" and then can't talk
because their PSKs will be different.
The PSK is hashed into this letter by "0x41 + xor all bytes of the psk
modulo 26"
This also allows the option of someday if people have the PSK off (zero), the
users COULD type in a channel name and be able to talk.
FIXME: Add description of multi-channel support and how primary vs secondary channels are used.
FIXME: explain how apps use channels for security.
explain how remote settings and remote gpio are managed as an example
- Available extensions
Constructors
-
ChannelSettings.new({@Deprecated('This field is deprecated.') int? channelNum, List<
int> ? psk, String? name, int? id, bool? uplinkEnabled, bool? downlinkEnabled, ModuleSettings? moduleSettings}) -
factory
-
ChannelSettings.fromBuffer(List<
int> data, [ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) -
factory
- ChannelSettings.fromJson(String json, [ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY])
-
factory
Properties
- channelNum ↔ int
-
Deprecated in favor of LoraConfig.channel_num
getter/setter pair
- downlinkEnabled ↔ bool
-
If true, messages seen on the internet will be forwarded to the local mesh.
getter/setter pair
- hashCode → int
-
Calculates a hash code based on the contents of the protobuf.
no setterinherited
- id ↔ int
-
Used to construct a globally unique channel ID.
The full globally unique ID will be: "name.id" where ID is shown as base36.
Assuming that the number of meshtastic users is below 20K (true for a long time)
the chance of this 64 bit random number colliding with anyone else is super low.
And the penalty for collision is low as well, it just means that anyone trying to decrypt channel messages might need to
try multiple candidate channels.
Any time a non wire compatible change is made to a channel, this field should be regenerated.
There are a small number of 'special' globally known (and fairly) insecure standard channels.
Those channels do not have a numeric id included in the settings, but instead it is pulled from
a table of well known IDs.
(see Well Known Channels FIXME)
getter/setter pair
- info_ → BuilderInfo
-
no setter
- isFrozen → bool
-
Returns
true
if this message is marked read-only. Otherwisefalse
.no setterinherited - moduleSettings ↔ ModuleSettings
-
Per-channel module settings.
getter/setter pair
- name ↔ String
-
A SHORT name that will be packed into the URL.
Less than 12 bytes.
Something for end users to call the channel
If this is the empty string it is assumed that this channel
is the special (minimally secure) "Default"channel.
In user interfaces it should be rendered as a local language translation of "X".
For channel_num hashing empty string will be treated as "X".
Where "X" is selected based on the English words listed above for ModemPreset
getter/setter pair
-
psk
↔ List<
int> -
A simple pre-shared key for now for crypto.
Must be either 0 bytes (no crypto), 16 bytes (AES128), or 32 bytes (AES256).
A special shorthand is used for 1 byte long psks.
These psks should be treated as only minimally secure,
because they are listed in this source code.
Those bytes are mapped using the following scheme:
0
= No crypto1
= The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0x01}2
through 10 = The default channel key, except with 1 through 9 added to the last byte. Shown to user as simple1 through 10getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unknownFields → UnknownFieldSet
-
no setterinherited
- uplinkEnabled ↔ bool
-
If true, messages on the mesh will be sent to the public internet by any gateway ndoe
getter/setter pair
Methods
-
addExtension(
Extension extension, Object? value) → void -
Adds an extension field value to a repeated field.
inherited
-
check(
) → void -
Throws a StateError if the message has required fields without a value.
inherited
-
clear(
) → void -
Clears all data that was set in this message.
inherited
-
clearChannelNum(
) → void -
clearDownlinkEnabled(
) → void -
clearExtension(
Extension extension) → void -
Clears an extension field and also removes the extension.
inherited
-
clearField(
int tagNumber) → void -
Clears the contents of a given field.
inherited
-
clearId(
) → void -
clearModuleSettings(
) → void -
clearName(
) → void -
clearPsk(
) → void -
clearUplinkEnabled(
) → void -
clone(
) → ChannelSettings - Creates a deep copy of the fields in this message. (The generated code uses mergeFromMessage.)
-
copyWith(
void updates(ChannelSettings)) → ChannelSettings -
Apply
updates
to a copy of this message. -
createEmptyInstance(
) → ChannelSettings - Creates an empty instance of the same message type as this.
-
deepCopy(
) → T -
Available on T, provided by the GeneratedMessageGenericExtensions extension
Returns a writable deep copy of this message. -
ensureModuleSettings(
) → ModuleSettings -
extensionsAreInitialized(
) → bool -
inherited
-
freeze(
) → GeneratedMessage -
Make this message read-only.
inherited
-
getDefaultForField(
int tagNumber) → dynamic -
Returns the default value for the given field.
inherited
-
getExtension(
Extension extension) → dynamic -
Returns the value of
extension
.inherited -
getField(
int tagNumber) → dynamic -
Returns the value of the field associated with
tagNumber
, or the default value if it is not set.inherited -
getFieldOrNull(
int tagNumber) → dynamic -
Returns the value of a field, ignoring any defaults.
inherited
-
getTagNumber(
String fieldName) → int? -
inherited
-
hasChannelNum(
) → bool -
hasDownlinkEnabled(
) → bool -
hasExtension(
Extension extension) → bool -
Returns
true
if a value ofextension
is present.inherited -
hasField(
int tagNumber) → bool -
Whether this message has a field associated with
tagNumber
.inherited -
hasId(
) → bool -
hasModuleSettings(
) → bool -
hasName(
) → bool -
hasPsk(
) → bool -
hasRequiredFields(
) → bool -
Whether the message has required fields.
inherited
-
hasUplinkEnabled(
) → bool -
isInitialized(
) → bool -
Whether all required fields in the message and embedded messages are set.
inherited
-
mergeFromBuffer(
List< int> input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges serialized protocol buffer data into this message.
inherited
-
mergeFromCodedBufferReader(
CodedBufferReader input, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Same as
mergeFromBuffer
, but takes aCodedBufferReader
input.inherited -
mergeFromJson(
String data, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges field values from
data
, a JSON object, encoded as described byGeneratedMessage.writeToJson
.inherited -
mergeFromJsonMap(
Map< String, dynamic> json, [ExtensionRegistry extensionRegistry = ExtensionRegistry.EMPTY]) → void -
Merges field values from a JSON object represented as a Dart map.
inherited
-
mergeFromMessage(
GeneratedMessage other) → void -
Merges the contents of the
other
into this message.inherited -
mergeFromProto3Json(
Object? json, {TypeRegistry typeRegistry = const TypeRegistry.empty(), bool ignoreUnknownFields = false, bool supportNamesWithUnderscores = true, bool permissiveEnums = false}) → void -
Merges field values from
json
, a JSON object using proto3 encoding.inherited -
mergeUnknownFields(
UnknownFieldSet unknownFieldSet) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rebuild(
void updates(T)) → T -
Available on T, provided by the GeneratedMessageGenericExtensions extension
Applyupdates
to a copy of this message. -
setExtension(
Extension extension, Object value) → void -
Sets the value of a non-repeated extension field to
value
.inherited -
setField(
int tagNumber, Object value) → void -
Sets the value of a field by its
tagNumber
.inherited -
toBuilder(
) → GeneratedMessage -
Creates a writable, shallow copy of this message.
inherited
-
toDebugString(
) → String -
Returns a String representation of this message.
inherited
-
toProto3Json(
{TypeRegistry typeRegistry = const TypeRegistry.empty()}) → Object? -
Returns an Object representing Proto3 JSON serialization of
this
.inherited -
toString(
) → String -
Returns a String representation of this message.
inherited
-
writeToBuffer(
) → Uint8List -
Serialize the message as the protobuf binary format.
inherited
-
writeToCodedBufferWriter(
CodedBufferWriter output) → void -
Same as
writeToBuffer
, but serializes to the givenCodedBufferWriter
.inherited -
writeToJson(
) → String -
Returns a JSON string that encodes this message.
inherited
-
writeToJsonMap(
) → Map< String, dynamic> -
Returns the JSON encoding of this message as a Dart Map.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
) → ChannelSettings -
createRepeated(
) → PbList< ChannelSettings> -
getDefault(
) → ChannelSettings