Files
ham/protocol/meshtastic/pb/channel.pb.go
maze e2b69d92fd
Some checks failed
Run tests / test (1.25) (push) Failing after 1m1s
Run tests / test (stable) (push) Failing after 1m0s
meshtastic: support
2026-03-06 09:24:56 +01:00

436 lines
16 KiB
Go

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v6.33.4
// source: meshtastic/channel.proto
// trunk-ignore(buf-lint/PACKAGE_DIRECTORY_MATCH)
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// How this channel is being used (or not).
// Note: this field is an enum to give us options for the future.
// In particular, someday we might make a 'SCANNING' option.
// SCANNING channels could have different frequencies and the radio would
// occasionally check that freq to see if anything is being transmitted.
// For devices that have multiple physical radios attached, we could keep multiple PRIMARY/SCANNING channels active at once to allow
// cross band routing as needed.
// If a device has only a single radio (the common case) only one channel can be PRIMARY at a time
// (but any number of SECONDARY channels can't be sent received on that common frequency)
type Channel_Role int32
const (
// This channel is not in use right now
Channel_DISABLED Channel_Role = 0
// This channel is used to set the frequency for the radio - all other enabled channels must be SECONDARY
Channel_PRIMARY Channel_Role = 1
// Secondary channels are only used for encryption/decryption/authentication purposes.
// Their radio settings (freq etc) are ignored, only psk is used.
Channel_SECONDARY Channel_Role = 2
)
// Enum value maps for Channel_Role.
var (
Channel_Role_name = map[int32]string{
0: "DISABLED",
1: "PRIMARY",
2: "SECONDARY",
}
Channel_Role_value = map[string]int32{
"DISABLED": 0,
"PRIMARY": 1,
"SECONDARY": 2,
}
)
func (x Channel_Role) Enum() *Channel_Role {
p := new(Channel_Role)
*p = x
return p
}
func (x Channel_Role) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Channel_Role) Descriptor() protoreflect.EnumDescriptor {
return file_meshtastic_channel_proto_enumTypes[0].Descriptor()
}
func (Channel_Role) Type() protoreflect.EnumType {
return &file_meshtastic_channel_proto_enumTypes[0]
}
func (x Channel_Role) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Channel_Role.Descriptor instead.
func (Channel_Role) EnumDescriptor() ([]byte, []int) {
return file_meshtastic_channel_proto_rawDescGZIP(), []int{2, 0}
}
// 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
type ChannelSettings struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Deprecated in favor of LoraConfig.channel_num
//
// Deprecated: Marked as deprecated in meshtastic/channel.proto.
ChannelNum uint32 `protobuf:"varint,1,opt,name=channel_num,json=channelNum,proto3" json:"channelNum,omitempty"`
// 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 crypto
// `1` = 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 10
Psk []byte `protobuf:"bytes,2,opt,name=psk,proto3" json:"psk,omitempty"`
// 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
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
// 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)
Id uint32 `protobuf:"fixed32,4,opt,name=id,proto3" json:"id,omitempty"`
// If true, messages on the mesh will be sent to the *public* internet by any gateway ndoe
UplinkEnabled bool `protobuf:"varint,5,opt,name=uplink_enabled,json=uplinkEnabled,proto3" json:"uplinkEnabled,omitempty"`
// If true, messages seen on the internet will be forwarded to the local mesh.
DownlinkEnabled bool `protobuf:"varint,6,opt,name=downlink_enabled,json=downlinkEnabled,proto3" json:"downlinkEnabled,omitempty"`
// Per-channel module settings.
ModuleSettings *ModuleSettings `protobuf:"bytes,7,opt,name=module_settings,json=moduleSettings,proto3" json:"moduleSettings,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ChannelSettings) Reset() {
*x = ChannelSettings{}
mi := &file_meshtastic_channel_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ChannelSettings) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChannelSettings) ProtoMessage() {}
func (x *ChannelSettings) ProtoReflect() protoreflect.Message {
mi := &file_meshtastic_channel_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ChannelSettings.ProtoReflect.Descriptor instead.
func (*ChannelSettings) Descriptor() ([]byte, []int) {
return file_meshtastic_channel_proto_rawDescGZIP(), []int{0}
}
// Deprecated: Marked as deprecated in meshtastic/channel.proto.
func (x *ChannelSettings) GetChannelNum() uint32 {
if x != nil {
return x.ChannelNum
}
return 0
}
func (x *ChannelSettings) GetPsk() []byte {
if x != nil {
return x.Psk
}
return nil
}
func (x *ChannelSettings) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ChannelSettings) GetId() uint32 {
if x != nil {
return x.Id
}
return 0
}
func (x *ChannelSettings) GetUplinkEnabled() bool {
if x != nil {
return x.UplinkEnabled
}
return false
}
func (x *ChannelSettings) GetDownlinkEnabled() bool {
if x != nil {
return x.DownlinkEnabled
}
return false
}
func (x *ChannelSettings) GetModuleSettings() *ModuleSettings {
if x != nil {
return x.ModuleSettings
}
return nil
}
// This message is specifically for modules to store per-channel configuration data.
type ModuleSettings struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Bits of precision for the location sent in position packets.
PositionPrecision uint32 `protobuf:"varint,1,opt,name=position_precision,json=positionPrecision,proto3" json:"positionPrecision,omitempty"`
// Controls whether or not the client / device should mute the current channel
// Useful for noisy public channels you don't necessarily want to disable
IsMuted bool `protobuf:"varint,2,opt,name=is_muted,json=isMuted,proto3" json:"isMuted,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ModuleSettings) Reset() {
*x = ModuleSettings{}
mi := &file_meshtastic_channel_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ModuleSettings) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ModuleSettings) ProtoMessage() {}
func (x *ModuleSettings) ProtoReflect() protoreflect.Message {
mi := &file_meshtastic_channel_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ModuleSettings.ProtoReflect.Descriptor instead.
func (*ModuleSettings) Descriptor() ([]byte, []int) {
return file_meshtastic_channel_proto_rawDescGZIP(), []int{1}
}
func (x *ModuleSettings) GetPositionPrecision() uint32 {
if x != nil {
return x.PositionPrecision
}
return 0
}
func (x *ModuleSettings) GetIsMuted() bool {
if x != nil {
return x.IsMuted
}
return false
}
// A pair of a channel number, mode and the (sharable) settings for that channel
type Channel struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The index of this channel in the channel table (from 0 to MAX_NUM_CHANNELS-1)
// (Someday - not currently implemented) An index of -1 could be used to mean "set by name",
// in which case the target node will find and set the channel by settings.name.
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
// The new settings, or NULL to disable that channel
Settings *ChannelSettings `protobuf:"bytes,2,opt,name=settings,proto3" json:"settings,omitempty"`
// TODO: REPLACE
Role Channel_Role `protobuf:"varint,3,opt,name=role,proto3,enum=meshtastic.Channel_Role" json:"role,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Channel) Reset() {
*x = Channel{}
mi := &file_meshtastic_channel_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Channel) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Channel) ProtoMessage() {}
func (x *Channel) ProtoReflect() protoreflect.Message {
mi := &file_meshtastic_channel_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Channel.ProtoReflect.Descriptor instead.
func (*Channel) Descriptor() ([]byte, []int) {
return file_meshtastic_channel_proto_rawDescGZIP(), []int{2}
}
func (x *Channel) GetIndex() int32 {
if x != nil {
return x.Index
}
return 0
}
func (x *Channel) GetSettings() *ChannelSettings {
if x != nil {
return x.Settings
}
return nil
}
func (x *Channel) GetRole() Channel_Role {
if x != nil {
return x.Role
}
return Channel_DISABLED
}
var File_meshtastic_channel_proto protoreflect.FileDescriptor
const file_meshtastic_channel_proto_rawDesc = "" +
"\n" +
"\x18meshtastic/channel.proto\x12\n" +
"meshtastic\"\x83\x02\n" +
"\x0fChannelSettings\x12#\n" +
"\vchannel_num\x18\x01 \x01(\rB\x02\x18\x01R\n" +
"channelNum\x12\x10\n" +
"\x03psk\x18\x02 \x01(\fR\x03psk\x12\x12\n" +
"\x04name\x18\x03 \x01(\tR\x04name\x12\x0e\n" +
"\x02id\x18\x04 \x01(\aR\x02id\x12%\n" +
"\x0euplink_enabled\x18\x05 \x01(\bR\ruplinkEnabled\x12)\n" +
"\x10downlink_enabled\x18\x06 \x01(\bR\x0fdownlinkEnabled\x12C\n" +
"\x0fmodule_settings\x18\a \x01(\v2\x1a.meshtastic.ModuleSettingsR\x0emoduleSettings\"Z\n" +
"\x0eModuleSettings\x12-\n" +
"\x12position_precision\x18\x01 \x01(\rR\x11positionPrecision\x12\x19\n" +
"\bis_muted\x18\x02 \x01(\bR\aisMuted\"\xb8\x01\n" +
"\aChannel\x12\x14\n" +
"\x05index\x18\x01 \x01(\x05R\x05index\x127\n" +
"\bsettings\x18\x02 \x01(\v2\x1b.meshtastic.ChannelSettingsR\bsettings\x12,\n" +
"\x04role\x18\x03 \x01(\x0e2\x18.meshtastic.Channel.RoleR\x04role\"0\n" +
"\x04Role\x12\f\n" +
"\bDISABLED\x10\x00\x12\v\n" +
"\aPRIMARY\x10\x01\x12\r\n" +
"\tSECONDARY\x10\x02Bc\n" +
"\x14org.meshtastic.protoB\rChannelProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00b\x06proto3"
var (
file_meshtastic_channel_proto_rawDescOnce sync.Once
file_meshtastic_channel_proto_rawDescData []byte
)
func file_meshtastic_channel_proto_rawDescGZIP() []byte {
file_meshtastic_channel_proto_rawDescOnce.Do(func() {
file_meshtastic_channel_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_meshtastic_channel_proto_rawDesc), len(file_meshtastic_channel_proto_rawDesc)))
})
return file_meshtastic_channel_proto_rawDescData
}
var file_meshtastic_channel_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_meshtastic_channel_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_meshtastic_channel_proto_goTypes = []any{
(Channel_Role)(0), // 0: meshtastic.Channel.Role
(*ChannelSettings)(nil), // 1: meshtastic.ChannelSettings
(*ModuleSettings)(nil), // 2: meshtastic.ModuleSettings
(*Channel)(nil), // 3: meshtastic.Channel
}
var file_meshtastic_channel_proto_depIdxs = []int32{
2, // 0: meshtastic.ChannelSettings.module_settings:type_name -> meshtastic.ModuleSettings
1, // 1: meshtastic.Channel.settings:type_name -> meshtastic.ChannelSettings
0, // 2: meshtastic.Channel.role:type_name -> meshtastic.Channel.Role
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_meshtastic_channel_proto_init() }
func file_meshtastic_channel_proto_init() {
if File_meshtastic_channel_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_meshtastic_channel_proto_rawDesc), len(file_meshtastic_channel_proto_rawDesc)),
NumEnums: 1,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_meshtastic_channel_proto_goTypes,
DependencyIndexes: file_meshtastic_channel_proto_depIdxs,
EnumInfos: file_meshtastic_channel_proto_enumTypes,
MessageInfos: file_meshtastic_channel_proto_msgTypes,
}.Build()
File_meshtastic_channel_proto = out.File
file_meshtastic_channel_proto_goTypes = nil
file_meshtastic_channel_proto_depIdxs = nil
}