meshtastic: support
Some checks failed
Run tests / test (1.25) (push) Failing after 1m1s
Run tests / test (stable) (push) Failing after 1m0s

This commit is contained in:
2026-03-06 09:24:56 +01:00
parent e6bda98b92
commit e2b69d92fd
39 changed files with 26113 additions and 1 deletions

View File

@@ -0,0 +1,418 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc v6.33.4
// source: meshtastic/powermon.proto
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)
)
// Any significant power changing event in meshtastic should be tagged with a powermon state transition.
// If you are making new meshtastic features feel free to add new entries at the end of this definition.
type PowerMon_State int32
const (
PowerMon_None PowerMon_State = 0
PowerMon_CPU_DeepSleep PowerMon_State = 1
PowerMon_CPU_LightSleep PowerMon_State = 2
// The external Vext1 power is on. Many boards have auxillary power rails that the CPU turns on only
// occasionally. In cases where that rail has multiple devices on it we usually want to have logging on
// the state of that rail as an independent record.
// For instance on the Heltec Tracker 1.1 board, this rail is the power source for the GPS and screen.
//
// The log messages will be short and complete (see PowerMon.Event in the protobufs for details).
// something like "S:PM:C,0x00001234,REASON" where the hex number is the bitmask of all current states.
// (We use a bitmask for states so that if a log message gets lost it won't be fatal)
PowerMon_Vext1_On PowerMon_State = 4
PowerMon_Lora_RXOn PowerMon_State = 8
PowerMon_Lora_TXOn PowerMon_State = 16
PowerMon_Lora_RXActive PowerMon_State = 32
PowerMon_BT_On PowerMon_State = 64
PowerMon_LED_On PowerMon_State = 128
PowerMon_Screen_On PowerMon_State = 256
PowerMon_Screen_Drawing PowerMon_State = 512
PowerMon_Wifi_On PowerMon_State = 1024
// GPS is actively trying to find our location
// See GPSPowerState for more details
PowerMon_GPS_Active PowerMon_State = 2048
)
// Enum value maps for PowerMon_State.
var (
PowerMon_State_name = map[int32]string{
0: "None",
1: "CPU_DeepSleep",
2: "CPU_LightSleep",
4: "Vext1_On",
8: "Lora_RXOn",
16: "Lora_TXOn",
32: "Lora_RXActive",
64: "BT_On",
128: "LED_On",
256: "Screen_On",
512: "Screen_Drawing",
1024: "Wifi_On",
2048: "GPS_Active",
}
PowerMon_State_value = map[string]int32{
"None": 0,
"CPU_DeepSleep": 1,
"CPU_LightSleep": 2,
"Vext1_On": 4,
"Lora_RXOn": 8,
"Lora_TXOn": 16,
"Lora_RXActive": 32,
"BT_On": 64,
"LED_On": 128,
"Screen_On": 256,
"Screen_Drawing": 512,
"Wifi_On": 1024,
"GPS_Active": 2048,
}
)
func (x PowerMon_State) Enum() *PowerMon_State {
p := new(PowerMon_State)
*p = x
return p
}
func (x PowerMon_State) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PowerMon_State) Descriptor() protoreflect.EnumDescriptor {
return file_meshtastic_powermon_proto_enumTypes[0].Descriptor()
}
func (PowerMon_State) Type() protoreflect.EnumType {
return &file_meshtastic_powermon_proto_enumTypes[0]
}
func (x PowerMon_State) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PowerMon_State.Descriptor instead.
func (PowerMon_State) EnumDescriptor() ([]byte, []int) {
return file_meshtastic_powermon_proto_rawDescGZIP(), []int{0, 0}
}
// What operation would we like the UUT to perform.
// note: senders should probably set want_response in their request packets, so that they can know when the state
// machine has started processing their request
type PowerStressMessage_Opcode int32
const (
// Unset/unused
PowerStressMessage_UNSET PowerStressMessage_Opcode = 0
PowerStressMessage_PRINT_INFO PowerStressMessage_Opcode = 1 // Print board version slog and send an ack that we are alive and ready to process commands
PowerStressMessage_FORCE_QUIET PowerStressMessage_Opcode = 2 // Try to turn off all automatic processing of packets, screen, sleeping, etc (to make it easier to measure in isolation)
PowerStressMessage_END_QUIET PowerStressMessage_Opcode = 3 // Stop powerstress processing - probably by just rebooting the board
PowerStressMessage_SCREEN_ON PowerStressMessage_Opcode = 16 // Turn the screen on
PowerStressMessage_SCREEN_OFF PowerStressMessage_Opcode = 17 // Turn the screen off
PowerStressMessage_CPU_IDLE PowerStressMessage_Opcode = 32 // Let the CPU run but we assume mostly idling for num_seconds
PowerStressMessage_CPU_DEEPSLEEP PowerStressMessage_Opcode = 33 // Force deep sleep for FIXME seconds
PowerStressMessage_CPU_FULLON PowerStressMessage_Opcode = 34 // Spin the CPU as fast as possible for num_seconds
PowerStressMessage_LED_ON PowerStressMessage_Opcode = 48 // Turn the LED on for num_seconds (and leave it on - for baseline power measurement purposes)
PowerStressMessage_LED_OFF PowerStressMessage_Opcode = 49 // Force the LED off for num_seconds
PowerStressMessage_LORA_OFF PowerStressMessage_Opcode = 64 // Completely turn off the LORA radio for num_seconds
PowerStressMessage_LORA_TX PowerStressMessage_Opcode = 65 // Send Lora packets for num_seconds
PowerStressMessage_LORA_RX PowerStressMessage_Opcode = 66 // Receive Lora packets for num_seconds (node will be mostly just listening, unless an external agent is helping stress this by sending packets on the current channel)
PowerStressMessage_BT_OFF PowerStressMessage_Opcode = 80 // Turn off the BT radio for num_seconds
PowerStressMessage_BT_ON PowerStressMessage_Opcode = 81 // Turn on the BT radio for num_seconds
PowerStressMessage_WIFI_OFF PowerStressMessage_Opcode = 96 // Turn off the WIFI radio for num_seconds
PowerStressMessage_WIFI_ON PowerStressMessage_Opcode = 97 // Turn on the WIFI radio for num_seconds
PowerStressMessage_GPS_OFF PowerStressMessage_Opcode = 112 // Turn off the GPS radio for num_seconds
PowerStressMessage_GPS_ON PowerStressMessage_Opcode = 113 // Turn on the GPS radio for num_seconds
)
// Enum value maps for PowerStressMessage_Opcode.
var (
PowerStressMessage_Opcode_name = map[int32]string{
0: "UNSET",
1: "PRINT_INFO",
2: "FORCE_QUIET",
3: "END_QUIET",
16: "SCREEN_ON",
17: "SCREEN_OFF",
32: "CPU_IDLE",
33: "CPU_DEEPSLEEP",
34: "CPU_FULLON",
48: "LED_ON",
49: "LED_OFF",
64: "LORA_OFF",
65: "LORA_TX",
66: "LORA_RX",
80: "BT_OFF",
81: "BT_ON",
96: "WIFI_OFF",
97: "WIFI_ON",
112: "GPS_OFF",
113: "GPS_ON",
}
PowerStressMessage_Opcode_value = map[string]int32{
"UNSET": 0,
"PRINT_INFO": 1,
"FORCE_QUIET": 2,
"END_QUIET": 3,
"SCREEN_ON": 16,
"SCREEN_OFF": 17,
"CPU_IDLE": 32,
"CPU_DEEPSLEEP": 33,
"CPU_FULLON": 34,
"LED_ON": 48,
"LED_OFF": 49,
"LORA_OFF": 64,
"LORA_TX": 65,
"LORA_RX": 66,
"BT_OFF": 80,
"BT_ON": 81,
"WIFI_OFF": 96,
"WIFI_ON": 97,
"GPS_OFF": 112,
"GPS_ON": 113,
}
)
func (x PowerStressMessage_Opcode) Enum() *PowerStressMessage_Opcode {
p := new(PowerStressMessage_Opcode)
*p = x
return p
}
func (x PowerStressMessage_Opcode) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PowerStressMessage_Opcode) Descriptor() protoreflect.EnumDescriptor {
return file_meshtastic_powermon_proto_enumTypes[1].Descriptor()
}
func (PowerStressMessage_Opcode) Type() protoreflect.EnumType {
return &file_meshtastic_powermon_proto_enumTypes[1]
}
func (x PowerStressMessage_Opcode) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PowerStressMessage_Opcode.Descriptor instead.
func (PowerStressMessage_Opcode) EnumDescriptor() ([]byte, []int) {
return file_meshtastic_powermon_proto_rawDescGZIP(), []int{1, 0}
}
// Note: There are no 'PowerMon' messages normally in use (PowerMons are sent only as structured logs - slogs).
// But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us)
type PowerMon struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PowerMon) Reset() {
*x = PowerMon{}
mi := &file_meshtastic_powermon_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PowerMon) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PowerMon) ProtoMessage() {}
func (x *PowerMon) ProtoReflect() protoreflect.Message {
mi := &file_meshtastic_powermon_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 PowerMon.ProtoReflect.Descriptor instead.
func (*PowerMon) Descriptor() ([]byte, []int) {
return file_meshtastic_powermon_proto_rawDescGZIP(), []int{0}
}
// PowerStress testing support via the C++ PowerStress module
type PowerStressMessage struct {
state protoimpl.MessageState `protogen:"open.v1"`
// What type of HardwareMessage is this?
Cmd PowerStressMessage_Opcode `protobuf:"varint,1,opt,name=cmd,proto3,enum=meshtastic.PowerStressMessage_Opcode" json:"cmd,omitempty"`
NumSeconds float32 `protobuf:"fixed32,2,opt,name=num_seconds,json=numSeconds,proto3" json:"numSeconds,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PowerStressMessage) Reset() {
*x = PowerStressMessage{}
mi := &file_meshtastic_powermon_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PowerStressMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PowerStressMessage) ProtoMessage() {}
func (x *PowerStressMessage) ProtoReflect() protoreflect.Message {
mi := &file_meshtastic_powermon_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 PowerStressMessage.ProtoReflect.Descriptor instead.
func (*PowerStressMessage) Descriptor() ([]byte, []int) {
return file_meshtastic_powermon_proto_rawDescGZIP(), []int{1}
}
func (x *PowerStressMessage) GetCmd() PowerStressMessage_Opcode {
if x != nil {
return x.Cmd
}
return PowerStressMessage_UNSET
}
func (x *PowerStressMessage) GetNumSeconds() float32 {
if x != nil {
return x.NumSeconds
}
return 0
}
var File_meshtastic_powermon_proto protoreflect.FileDescriptor
const file_meshtastic_powermon_proto_rawDesc = "" +
"\n" +
"\x19meshtastic/powermon.proto\x12\n" +
"meshtastic\"\xe0\x01\n" +
"\bPowerMon\"\xd3\x01\n" +
"\x05State\x12\b\n" +
"\x04None\x10\x00\x12\x11\n" +
"\rCPU_DeepSleep\x10\x01\x12\x12\n" +
"\x0eCPU_LightSleep\x10\x02\x12\f\n" +
"\bVext1_On\x10\x04\x12\r\n" +
"\tLora_RXOn\x10\b\x12\r\n" +
"\tLora_TXOn\x10\x10\x12\x11\n" +
"\rLora_RXActive\x10 \x12\t\n" +
"\x05BT_On\x10@\x12\v\n" +
"\x06LED_On\x10\x80\x01\x12\x0e\n" +
"\tScreen_On\x10\x80\x02\x12\x13\n" +
"\x0eScreen_Drawing\x10\x80\x04\x12\f\n" +
"\aWifi_On\x10\x80\b\x12\x0f\n" +
"\n" +
"GPS_Active\x10\x80\x10\"\x90\x03\n" +
"\x12PowerStressMessage\x127\n" +
"\x03cmd\x18\x01 \x01(\x0e2%.meshtastic.PowerStressMessage.OpcodeR\x03cmd\x12\x1f\n" +
"\vnum_seconds\x18\x02 \x01(\x02R\n" +
"numSeconds\"\x9f\x02\n" +
"\x06Opcode\x12\t\n" +
"\x05UNSET\x10\x00\x12\x0e\n" +
"\n" +
"PRINT_INFO\x10\x01\x12\x0f\n" +
"\vFORCE_QUIET\x10\x02\x12\r\n" +
"\tEND_QUIET\x10\x03\x12\r\n" +
"\tSCREEN_ON\x10\x10\x12\x0e\n" +
"\n" +
"SCREEN_OFF\x10\x11\x12\f\n" +
"\bCPU_IDLE\x10 \x12\x11\n" +
"\rCPU_DEEPSLEEP\x10!\x12\x0e\n" +
"\n" +
"CPU_FULLON\x10\"\x12\n" +
"\n" +
"\x06LED_ON\x100\x12\v\n" +
"\aLED_OFF\x101\x12\f\n" +
"\bLORA_OFF\x10@\x12\v\n" +
"\aLORA_TX\x10A\x12\v\n" +
"\aLORA_RX\x10B\x12\n" +
"\n" +
"\x06BT_OFF\x10P\x12\t\n" +
"\x05BT_ON\x10Q\x12\f\n" +
"\bWIFI_OFF\x10`\x12\v\n" +
"\aWIFI_ON\x10a\x12\v\n" +
"\aGPS_OFF\x10p\x12\n" +
"\n" +
"\x06GPS_ON\x10qBd\n" +
"\x14org.meshtastic.protoB\x0ePowerMonProtosZ\"github.com/meshtastic/go/generated\xaa\x02\x14Meshtastic.Protobufs\xba\x02\x00b\x06proto3"
var (
file_meshtastic_powermon_proto_rawDescOnce sync.Once
file_meshtastic_powermon_proto_rawDescData []byte
)
func file_meshtastic_powermon_proto_rawDescGZIP() []byte {
file_meshtastic_powermon_proto_rawDescOnce.Do(func() {
file_meshtastic_powermon_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_meshtastic_powermon_proto_rawDesc), len(file_meshtastic_powermon_proto_rawDesc)))
})
return file_meshtastic_powermon_proto_rawDescData
}
var file_meshtastic_powermon_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_meshtastic_powermon_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_meshtastic_powermon_proto_goTypes = []any{
(PowerMon_State)(0), // 0: meshtastic.PowerMon.State
(PowerStressMessage_Opcode)(0), // 1: meshtastic.PowerStressMessage.Opcode
(*PowerMon)(nil), // 2: meshtastic.PowerMon
(*PowerStressMessage)(nil), // 3: meshtastic.PowerStressMessage
}
var file_meshtastic_powermon_proto_depIdxs = []int32{
1, // 0: meshtastic.PowerStressMessage.cmd:type_name -> meshtastic.PowerStressMessage.Opcode
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_meshtastic_powermon_proto_init() }
func file_meshtastic_powermon_proto_init() {
if File_meshtastic_powermon_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_meshtastic_powermon_proto_rawDesc), len(file_meshtastic_powermon_proto_rawDesc)),
NumEnums: 2,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_meshtastic_powermon_proto_goTypes,
DependencyIndexes: file_meshtastic_powermon_proto_depIdxs,
EnumInfos: file_meshtastic_powermon_proto_enumTypes,
MessageInfos: file_meshtastic_powermon_proto_msgTypes,
}.Build()
File_meshtastic_powermon_proto = out.File
file_meshtastic_powermon_proto_goTypes = nil
file_meshtastic_powermon_proto_depIdxs = nil
}