|
| 1 | +""" |
| 2 | +@generated by mypy-protobuf. Do not edit manually! |
| 3 | +isort:skip_file |
| 4 | +""" |
| 5 | + |
| 6 | +import builtins |
| 7 | +import google.protobuf.descriptor |
| 8 | +import google.protobuf.internal.enum_type_wrapper |
| 9 | +import google.protobuf.message |
| 10 | +import sys |
| 11 | +import typing |
| 12 | + |
| 13 | +if sys.version_info >= (3, 10): |
| 14 | + import typing as typing_extensions |
| 15 | +else: |
| 16 | + import typing_extensions |
| 17 | + |
| 18 | +DESCRIPTOR: google.protobuf.descriptor.FileDescriptor |
| 19 | + |
| 20 | +@typing.final |
| 21 | +class PowerMon(google.protobuf.message.Message): |
| 22 | + """Note: There are no 'PowerMon' messages normally in use (PowerMons are sent only as structured logs - slogs). |
| 23 | + But we wrap our State enum in this message to effectively nest a namespace (without our linter yelling at us) |
| 24 | + """ |
| 25 | + |
| 26 | + DESCRIPTOR: google.protobuf.descriptor.Descriptor |
| 27 | + |
| 28 | + class _State: |
| 29 | + ValueType = typing.NewType("ValueType", builtins.int) |
| 30 | + V: typing_extensions.TypeAlias = ValueType |
| 31 | + |
| 32 | + class _StateEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[PowerMon._State.ValueType], builtins.type): |
| 33 | + DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor |
| 34 | + CPU_DeepSleep: PowerMon._State.ValueType # 1 |
| 35 | + CPU_LightSleep: PowerMon._State.ValueType # 2 |
| 36 | + Vext1_On: PowerMon._State.ValueType # 4 |
| 37 | + """ |
| 38 | + The external Vext1 power is on. Many boards have auxillary power rails that the CPU turns on only |
| 39 | + occasionally. In cases where that rail has multiple devices on it we usually want to have logging on |
| 40 | + the state of that rail as an independent record. |
| 41 | + For instance on the Heltec Tracker 1.1 board, this rail is the power source for the GPS and screen. |
| 42 | +
|
| 43 | + The log messages will be short and complete (see PowerMon.Event in the protobufs for details). |
| 44 | + something like "S:PM:C,0x00001234,REASON" where the hex number is the bitmask of all current states. |
| 45 | + (We use a bitmask for states so that if a log message gets lost it won't be fatal) |
| 46 | + """ |
| 47 | + Lora_RXOn: PowerMon._State.ValueType # 8 |
| 48 | + Lora_TXOn: PowerMon._State.ValueType # 16 |
| 49 | + Lora_RXActive: PowerMon._State.ValueType # 32 |
| 50 | + BT_On: PowerMon._State.ValueType # 64 |
| 51 | + LED_On: PowerMon._State.ValueType # 128 |
| 52 | + Screen_On: PowerMon._State.ValueType # 256 |
| 53 | + Screen_Drawing: PowerMon._State.ValueType # 512 |
| 54 | + Wifi_On: PowerMon._State.ValueType # 1024 |
| 55 | + GPS_Active: PowerMon._State.ValueType # 2048 |
| 56 | + """ |
| 57 | + GPS is actively trying to find our location |
| 58 | + See GPSPowerState for more details |
| 59 | + """ |
| 60 | + |
| 61 | + class State(_State, metaclass=_StateEnumTypeWrapper): |
| 62 | + """Any significant power changing event in meshtastic should be tagged with a powermon state transition. |
| 63 | + If you are making new meshtastic features feel free to add new entries at the end of this definition. |
| 64 | + """ |
| 65 | + |
| 66 | + CPU_DeepSleep: PowerMon.State.ValueType # 1 |
| 67 | + CPU_LightSleep: PowerMon.State.ValueType # 2 |
| 68 | + Vext1_On: PowerMon.State.ValueType # 4 |
| 69 | + """ |
| 70 | + The external Vext1 power is on. Many boards have auxillary power rails that the CPU turns on only |
| 71 | + occasionally. In cases where that rail has multiple devices on it we usually want to have logging on |
| 72 | + the state of that rail as an independent record. |
| 73 | + For instance on the Heltec Tracker 1.1 board, this rail is the power source for the GPS and screen. |
| 74 | +
|
| 75 | + The log messages will be short and complete (see PowerMon.Event in the protobufs for details). |
| 76 | + something like "S:PM:C,0x00001234,REASON" where the hex number is the bitmask of all current states. |
| 77 | + (We use a bitmask for states so that if a log message gets lost it won't be fatal) |
| 78 | + """ |
| 79 | + Lora_RXOn: PowerMon.State.ValueType # 8 |
| 80 | + Lora_TXOn: PowerMon.State.ValueType # 16 |
| 81 | + Lora_RXActive: PowerMon.State.ValueType # 32 |
| 82 | + BT_On: PowerMon.State.ValueType # 64 |
| 83 | + LED_On: PowerMon.State.ValueType # 128 |
| 84 | + Screen_On: PowerMon.State.ValueType # 256 |
| 85 | + Screen_Drawing: PowerMon.State.ValueType # 512 |
| 86 | + Wifi_On: PowerMon.State.ValueType # 1024 |
| 87 | + GPS_Active: PowerMon.State.ValueType # 2048 |
| 88 | + """ |
| 89 | + GPS is actively trying to find our location |
| 90 | + See GPSPowerState for more details |
| 91 | + """ |
| 92 | + |
| 93 | + def __init__( |
| 94 | + self, |
| 95 | + ) -> None: ... |
| 96 | + |
| 97 | +global___PowerMon = PowerMon |
0 commit comments