Merge pull request #1682 from meshtastic/create-pull-request/patch

Changes by create-pull-request action
This commit is contained in:
Thomas Göttgens 2022-09-09 11:20:51 +02:00 committed by GitHub
commit a7138b7213
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 516 additions and 529 deletions

@ -1 +1 @@
Subproject commit a72983993ccd9c2dabb1ef9e17b2fe79bd94d671
Subproject commit e72af95951ba4664f34374de492469a024dc64c5

View File

@ -6,7 +6,7 @@
#error Regenerate this file with the current version of nanopb generator.
#endif
PB_BIND(AdminMessage, AdminMessage, AUTO)
PB_BIND(AdminMessage, AdminMessage, 2)

View File

@ -40,16 +40,8 @@ typedef enum _AdminMessage_ModuleConfigType {
This message is used to do settings operations to both remote AND local nodes.
(Prior to 1.2 these operations were done via special ToRadio operations) */
typedef struct _AdminMessage {
pb_size_t which_variant;
pb_size_t which_payload_variant;
union {
/* Set the owner for this node */
User set_owner;
/* Set channels (using the new API).
A special channel is the "primary channel".
The other records are secondary channels.
Note: only one channel can be marked as primary.
If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically. */
Channel set_channel;
/* Send the specified channel in the response to this message
NOTE: This field is sent with the channel index + 1 (to ensure we never try to send 'zero' - which protobufs treats as not present) */
uint32_t get_channel_request;
@ -63,20 +55,38 @@ typedef struct _AdminMessage {
AdminMessage_ConfigType get_config_request;
/* Send the current Config in the response to this message. */
Config get_config_response;
/* Set the current Config */
Config set_config;
/* Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins */
bool confirm_set_config;
/* Ask for the following config data to be sent */
AdminMessage_ModuleConfigType get_module_config_request;
/* Send the current Config in the response to this message. */
ModuleConfig get_module_config_response;
/* Set the current Config */
ModuleConfig set_module_config;
/* Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins */
bool confirm_set_module_config;
/* Send all channels in the response to this message */
bool get_all_channel_request;
/* Get the Canned Message Module messages in the response to this message. */
bool get_canned_message_module_messages_request;
/* Get the Canned Message Module messages in the response to this message. */
char get_canned_message_module_messages_response[201];
/* Request the node to send device metadata (firmware, protobuf version, etc) */
uint32_t get_device_metadata_request;
/* Device metadata response */
DeviceMetadata get_device_metadata_response;
/* Set the owner for this node */
User set_owner;
/* Set channels (using the new API).
A special channel is the "primary channel".
The other records are secondary channels.
Note: only one channel can be marked as primary.
If the client sets a particular channel to be primary, the previous channel will be set to SECONDARY automatically. */
Channel set_channel;
/* Set the current Config */
Config set_config;
/* Set the current Config */
ModuleConfig set_module_config;
/* Set the Canned Message Module messages text. */
char set_canned_message_module_messages[201];
/* Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins */
bool confirm_set_config;
/* Sent immediatly after a config change has been sent to ensure comms, if this is not recieved, the config will be reverted after 10 mins */
bool confirm_set_module_config;
/* Setting channels/radio config remotely carries the risk that you might send an invalid config and the radio never talks to your mesh again.
Therefore if setting either of these properties remotely, you must send a confirm_xxx message within 10 minutes.
If you fail to do so, the radio will assume loss of comms and revert your changes.
@ -89,18 +99,10 @@ typedef struct _AdminMessage {
bool exit_simulator;
/* Tell the node to reboot in this many seconds (or <0 to cancel reboot) */
int32_t reboot_seconds;
/* Get the Canned Message Module messages in the response to this message. */
bool get_canned_message_module_messages_request;
/* Get the Canned Message Module messages in the response to this message. */
char get_canned_message_module_messages_response[201];
/* Set the Canned Message Module messages text. */
char set_canned_message_module_messages[201];
/* Tell the node to shutdown in this many seconds (or <0 to cancel shutdown) */
int32_t shutdown_seconds;
/* Request the node to send device metadata (firmware, protobuf version, etc) */
uint32_t get_device_metadata_request;
/* Device metadata response */
DeviceMetadata get_device_metadata_response;
/* Tell the node to factory reset, all device settings will be returned to factory defaults. */
int32_t factory_reset;
};
} AdminMessage;
@ -120,74 +122,76 @@ extern "C" {
#endif
/* Initializer values for message structs */
#define AdminMessage_init_default {0, {User_init_default}}
#define AdminMessage_init_zero {0, {User_init_zero}}
#define AdminMessage_init_default {0, {0}}
#define AdminMessage_init_zero {0, {0}}
/* Field tags (for use in manual encoding/decoding) */
#define AdminMessage_set_owner_tag 2
#define AdminMessage_set_channel_tag 3
#define AdminMessage_get_channel_request_tag 6
#define AdminMessage_get_channel_response_tag 7
#define AdminMessage_get_owner_request_tag 8
#define AdminMessage_get_owner_response_tag 9
#define AdminMessage_get_config_request_tag 10
#define AdminMessage_get_config_response_tag 11
#define AdminMessage_set_config_tag 12
#define AdminMessage_confirm_set_config_tag 13
#define AdminMessage_get_module_config_request_tag 14
#define AdminMessage_get_module_config_response_tag 15
#define AdminMessage_set_module_config_tag 16
#define AdminMessage_confirm_set_module_config_tag 17
#define AdminMessage_get_all_channel_request_tag 18
#define AdminMessage_confirm_set_channel_tag 32
#define AdminMessage_confirm_set_radio_tag 33
#define AdminMessage_exit_simulator_tag 34
#define AdminMessage_reboot_seconds_tag 35
#define AdminMessage_get_canned_message_module_messages_request_tag 36
#define AdminMessage_get_canned_message_module_messages_response_tag 37
#define AdminMessage_set_canned_message_module_messages_tag 44
#define AdminMessage_shutdown_seconds_tag 51
#define AdminMessage_get_device_metadata_request_tag 52
#define AdminMessage_get_device_metadata_response_tag 53
#define AdminMessage_get_channel_request_tag 1
#define AdminMessage_get_channel_response_tag 2
#define AdminMessage_get_owner_request_tag 3
#define AdminMessage_get_owner_response_tag 4
#define AdminMessage_get_config_request_tag 5
#define AdminMessage_get_config_response_tag 6
#define AdminMessage_get_module_config_request_tag 7
#define AdminMessage_get_module_config_response_tag 8
#define AdminMessage_get_all_channel_request_tag 9
#define AdminMessage_get_canned_message_module_messages_request_tag 10
#define AdminMessage_get_canned_message_module_messages_response_tag 11
#define AdminMessage_get_device_metadata_request_tag 12
#define AdminMessage_get_device_metadata_response_tag 13
#define AdminMessage_set_owner_tag 32
#define AdminMessage_set_channel_tag 33
#define AdminMessage_set_config_tag 34
#define AdminMessage_set_module_config_tag 35
#define AdminMessage_set_canned_message_module_messages_tag 36
#define AdminMessage_confirm_set_config_tag 64
#define AdminMessage_confirm_set_module_config_tag 65
#define AdminMessage_confirm_set_channel_tag 66
#define AdminMessage_confirm_set_radio_tag 67
#define AdminMessage_exit_simulator_tag 96
#define AdminMessage_reboot_seconds_tag 97
#define AdminMessage_shutdown_seconds_tag 98
#define AdminMessage_factory_reset_tag 99
/* Struct field encoding specification for nanopb */
#define AdminMessage_FIELDLIST(X, a) \
X(a, STATIC, ONEOF, MESSAGE, (variant,set_owner,set_owner), 2) \
X(a, STATIC, ONEOF, MESSAGE, (variant,set_channel,set_channel), 3) \
X(a, STATIC, ONEOF, UINT32, (variant,get_channel_request,get_channel_request), 6) \
X(a, STATIC, ONEOF, MESSAGE, (variant,get_channel_response,get_channel_response), 7) \
X(a, STATIC, ONEOF, BOOL, (variant,get_owner_request,get_owner_request), 8) \
X(a, STATIC, ONEOF, MESSAGE, (variant,get_owner_response,get_owner_response), 9) \
X(a, STATIC, ONEOF, UENUM, (variant,get_config_request,get_config_request), 10) \
X(a, STATIC, ONEOF, MESSAGE, (variant,get_config_response,get_config_response), 11) \
X(a, STATIC, ONEOF, MESSAGE, (variant,set_config,set_config), 12) \
X(a, STATIC, ONEOF, BOOL, (variant,confirm_set_config,confirm_set_config), 13) \
X(a, STATIC, ONEOF, UENUM, (variant,get_module_config_request,get_module_config_request), 14) \
X(a, STATIC, ONEOF, MESSAGE, (variant,get_module_config_response,get_module_config_response), 15) \
X(a, STATIC, ONEOF, MESSAGE, (variant,set_module_config,set_module_config), 16) \
X(a, STATIC, ONEOF, BOOL, (variant,confirm_set_module_config,confirm_set_module_config), 17) \
X(a, STATIC, ONEOF, BOOL, (variant,get_all_channel_request,get_all_channel_request), 18) \
X(a, STATIC, ONEOF, BOOL, (variant,confirm_set_channel,confirm_set_channel), 32) \
X(a, STATIC, ONEOF, BOOL, (variant,confirm_set_radio,confirm_set_radio), 33) \
X(a, STATIC, ONEOF, BOOL, (variant,exit_simulator,exit_simulator), 34) \
X(a, STATIC, ONEOF, INT32, (variant,reboot_seconds,reboot_seconds), 35) \
X(a, STATIC, ONEOF, BOOL, (variant,get_canned_message_module_messages_request,get_canned_message_module_messages_request), 36) \
X(a, STATIC, ONEOF, STRING, (variant,get_canned_message_module_messages_response,get_canned_message_module_messages_response), 37) \
X(a, STATIC, ONEOF, STRING, (variant,set_canned_message_module_messages,set_canned_message_module_messages), 44) \
X(a, STATIC, ONEOF, INT32, (variant,shutdown_seconds,shutdown_seconds), 51) \
X(a, STATIC, ONEOF, UINT32, (variant,get_device_metadata_request,get_device_metadata_request), 52) \
X(a, STATIC, ONEOF, MESSAGE, (variant,get_device_metadata_response,get_device_metadata_response), 53)
X(a, STATIC, ONEOF, UINT32, (payload_variant,get_channel_request,get_channel_request), 1) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_channel_response,get_channel_response), 2) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,get_owner_request,get_owner_request), 3) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_owner_response,get_owner_response), 4) \
X(a, STATIC, ONEOF, UENUM, (payload_variant,get_config_request,get_config_request), 5) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_config_response,get_config_response), 6) \
X(a, STATIC, ONEOF, UENUM, (payload_variant,get_module_config_request,get_module_config_request), 7) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_module_config_response,get_module_config_response), 8) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,get_all_channel_request,get_all_channel_request), 9) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,get_canned_message_module_messages_request,get_canned_message_module_messages_request), 10) \
X(a, STATIC, ONEOF, STRING, (payload_variant,get_canned_message_module_messages_response,get_canned_message_module_messages_response), 11) \
X(a, STATIC, ONEOF, UINT32, (payload_variant,get_device_metadata_request,get_device_metadata_request), 12) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,get_device_metadata_response,get_device_metadata_response), 13) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_owner,set_owner), 32) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_channel,set_channel), 33) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_config,set_config), 34) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,set_module_config,set_module_config), 35) \
X(a, STATIC, ONEOF, STRING, (payload_variant,set_canned_message_module_messages,set_canned_message_module_messages), 36) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_config,confirm_set_config), 64) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_module_config,confirm_set_module_config), 65) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_channel,confirm_set_channel), 66) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,confirm_set_radio,confirm_set_radio), 67) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,exit_simulator,exit_simulator), 96) \
X(a, STATIC, ONEOF, INT32, (payload_variant,reboot_seconds,reboot_seconds), 97) \
X(a, STATIC, ONEOF, INT32, (payload_variant,shutdown_seconds,shutdown_seconds), 98) \
X(a, STATIC, ONEOF, INT32, (payload_variant,factory_reset,factory_reset), 99)
#define AdminMessage_CALLBACK NULL
#define AdminMessage_DEFAULT NULL
#define AdminMessage_variant_set_owner_MSGTYPE User
#define AdminMessage_variant_set_channel_MSGTYPE Channel
#define AdminMessage_variant_get_channel_response_MSGTYPE Channel
#define AdminMessage_variant_get_owner_response_MSGTYPE User
#define AdminMessage_variant_get_config_response_MSGTYPE Config
#define AdminMessage_variant_set_config_MSGTYPE Config
#define AdminMessage_variant_get_module_config_response_MSGTYPE ModuleConfig
#define AdminMessage_variant_set_module_config_MSGTYPE ModuleConfig
#define AdminMessage_variant_get_device_metadata_response_MSGTYPE DeviceMetadata
#define AdminMessage_payload_variant_get_channel_response_MSGTYPE Channel
#define AdminMessage_payload_variant_get_owner_response_MSGTYPE User
#define AdminMessage_payload_variant_get_config_response_MSGTYPE Config
#define AdminMessage_payload_variant_get_module_config_response_MSGTYPE ModuleConfig
#define AdminMessage_payload_variant_get_device_metadata_response_MSGTYPE DeviceMetadata
#define AdminMessage_payload_variant_set_owner_MSGTYPE User
#define AdminMessage_payload_variant_set_channel_MSGTYPE Channel
#define AdminMessage_payload_variant_set_config_MSGTYPE Config
#define AdminMessage_payload_variant_set_module_config_MSGTYPE ModuleConfig
extern const pb_msgdesc_t AdminMessage_msg;
@ -195,7 +199,12 @@ extern const pb_msgdesc_t AdminMessage_msg;
#define AdminMessage_fields &AdminMessage_msg
/* Maximum encoded size of messages (where known) */
#define AdminMessage_size 204
#if defined(Config_size) && defined(Config_size)
union AdminMessage_payload_variant_size_union {char f6[(6 + Config_size)]; char f34[(7 + Config_size)]; char f0[204];};
#endif
#if defined(Config_size) && defined(Config_size)
#define AdminMessage_size (0 + sizeof(union AdminMessage_payload_variant_size_union))
#endif
#ifdef __cplusplus
} /* extern "C" */

View File

@ -54,7 +54,7 @@ extern const pb_msgdesc_t ChannelSet_msg;
#define ChannelSet_fields &ChannelSet_msg
/* Maximum encoded size of messages (where known) */
#define ChannelSet_size 573
#define ChannelSet_size 557
#ifdef __cplusplus
} /* extern "C" */

View File

@ -38,6 +38,25 @@ typedef PB_BYTES_ARRAY_T(32) ChannelSettings_psk_t;
FIXME: explain how apps use channels for security.
explain how remote settings and remote gpio are managed as an example */
typedef struct _ChannelSettings {
/* NOTE: this field is _independent_ and unrelated to the concepts in channel.proto.
this is controlling the actual hardware frequency the radio is transmitting on.
In a perfect world we would have called it something else (band?) but I forgot to make this change during the big 1.2 renaming.
Most users should never need to be exposed to this field/concept.
A channel number between 1 and 13 (or whatever the max is in the current
region). If ZERO then the rule is "use the old channel name hash based
algorithm to derive the channel number")
If using the hash algorithm the channel number will be: hash(channel_name) %
NUM_CHANNELS (Where num channels depends on the regulatory region).
NUM_CHANNELS_US is 13, for other values see MeshRadio.h in the device code.
hash a string into an integer - djb2 by Dan Bernstein. -
http://www.cse.yorku.ca/~oz/hash.html
unsigned long hash(char *str) {
unsigned long hash = 5381; int c;
while ((c = *str++) != 0)
hash = ((hash << 5) + hash) + (unsigned char) c;
return hash;
} */
uint8_t channel_num;
/* 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.
@ -58,25 +77,6 @@ typedef struct _ChannelSettings {
For channel_num hashing empty string will be treated as "X".
Where "X" is selected based on the English words listed above for ModemPreset */
char name[12];
/* NOTE: this field is _independent_ and unrelated to the concepts in channel.proto.
this is controlling the actual hardware frequency the radio is transmitting on.
In a perfect world we would have called it something else (band?) but I forgot to make this change during the big 1.2 renaming.
Most users should never need to be exposed to this field/concept.
A channel number between 1 and 13 (or whatever the max is in the current
region). If ZERO then the rule is "use the old channel name hash based
algorithm to derive the channel number")
If using the hash algorithm the channel number will be: hash(channel_name) %
NUM_CHANNELS (Where num channels depends on the regulatory region).
NUM_CHANNELS_US is 13, for other values see MeshRadio.h in the device code.
hash a string into an integer - djb2 by Dan Bernstein. -
http://www.cse.yorku.ca/~oz/hash.html
unsigned long hash(char *str) {
unsigned long hash = 5381; int c;
while ((c = *str++) != 0)
hash = ((hash << 5) + hash) + (unsigned char) c;
return hash;
} */
uint8_t channel_num;
/* 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)
@ -120,30 +120,30 @@ extern "C" {
#endif
/* Initializer values for message structs */
#define ChannelSettings_init_default {{0, {0}}, "", 0, 0, 0, 0}
#define ChannelSettings_init_default {0, {0, {0}}, "", 0, 0, 0}
#define Channel_init_default {0, false, ChannelSettings_init_default, _Channel_Role_MIN}
#define ChannelSettings_init_zero {{0, {0}}, "", 0, 0, 0, 0}
#define ChannelSettings_init_zero {0, {0, {0}}, "", 0, 0, 0}
#define Channel_init_zero {0, false, ChannelSettings_init_zero, _Channel_Role_MIN}
/* Field tags (for use in manual encoding/decoding) */
#define ChannelSettings_psk_tag 4
#define ChannelSettings_name_tag 5
#define ChannelSettings_channel_num_tag 9
#define ChannelSettings_id_tag 10
#define ChannelSettings_uplink_enabled_tag 16
#define ChannelSettings_downlink_enabled_tag 17
#define ChannelSettings_channel_num_tag 1
#define ChannelSettings_psk_tag 2
#define ChannelSettings_name_tag 3
#define ChannelSettings_id_tag 4
#define ChannelSettings_uplink_enabled_tag 5
#define ChannelSettings_downlink_enabled_tag 6
#define Channel_index_tag 1
#define Channel_settings_tag 2
#define Channel_role_tag 3
/* Struct field encoding specification for nanopb */
#define ChannelSettings_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, BYTES, psk, 4) \
X(a, STATIC, SINGULAR, STRING, name, 5) \
X(a, STATIC, SINGULAR, UINT32, channel_num, 9) \
X(a, STATIC, SINGULAR, FIXED32, id, 10) \
X(a, STATIC, SINGULAR, BOOL, uplink_enabled, 16) \
X(a, STATIC, SINGULAR, BOOL, downlink_enabled, 17)
X(a, STATIC, SINGULAR, UINT32, channel_num, 1) \
X(a, STATIC, SINGULAR, BYTES, psk, 2) \
X(a, STATIC, SINGULAR, STRING, name, 3) \
X(a, STATIC, SINGULAR, FIXED32, id, 4) \
X(a, STATIC, SINGULAR, BOOL, uplink_enabled, 5) \
X(a, STATIC, SINGULAR, BOOL, downlink_enabled, 6)
#define ChannelSettings_CALLBACK NULL
#define ChannelSettings_DEFAULT NULL
@ -163,8 +163,8 @@ extern const pb_msgdesc_t Channel_msg;
#define Channel_fields &Channel_msg
/* Maximum encoded size of messages (where known) */
#define ChannelSettings_size 61
#define Channel_size 76
#define ChannelSettings_size 59
#define Channel_size 74
#ifdef __cplusplus
} /* extern "C" */

View File

@ -18,7 +18,7 @@ PB_BIND(Config_PositionConfig, Config_PositionConfig, AUTO)
PB_BIND(Config_PowerConfig, Config_PowerConfig, AUTO)
PB_BIND(Config_WiFiConfig, Config_WiFiConfig, AUTO)
PB_BIND(Config_NetworkConfig, Config_NetworkConfig, AUTO)
PB_BIND(Config_DisplayConfig, Config_DisplayConfig, AUTO)
@ -38,4 +38,3 @@ PB_BIND(Config_BluetoothConfig, Config_BluetoothConfig, AUTO)

View File

@ -11,66 +11,46 @@
/* Enum definitions */
typedef enum _Config_DeviceConfig_Role {
Config_DeviceConfig_Role_Client = 0,
Config_DeviceConfig_Role_ClientMute = 1,
Config_DeviceConfig_Role_Router = 2,
Config_DeviceConfig_Role_RouterClient = 3
Config_DeviceConfig_Role_CLIENT = 0,
Config_DeviceConfig_Role_CLIENT_MUTE = 1,
Config_DeviceConfig_Role_ROUTER = 2,
Config_DeviceConfig_Role_ROUTER_CLIENT = 3
} Config_DeviceConfig_Role;
typedef enum _Config_PositionConfig_PositionFlags {
Config_PositionConfig_PositionFlags_POS_UNDEFINED = 0,
Config_PositionConfig_PositionFlags_POS_ALTITUDE = 1,
Config_PositionConfig_PositionFlags_POS_ALT_MSL = 2,
Config_PositionConfig_PositionFlags_POS_GEO_SEP = 4,
Config_PositionConfig_PositionFlags_POS_DOP = 8,
Config_PositionConfig_PositionFlags_POS_HVDOP = 16,
Config_PositionConfig_PositionFlags_POS_SATINVIEW = 32,
Config_PositionConfig_PositionFlags_POS_SEQ_NOS = 64,
Config_PositionConfig_PositionFlags_POS_TIMESTAMP = 128,
Config_PositionConfig_PositionFlags_POS_HEADING = 256,
Config_PositionConfig_PositionFlags_POS_SPEED = 512
Config_PositionConfig_PositionFlags_UNSET = 0,
Config_PositionConfig_PositionFlags_ALTITUDE = 1,
Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2,
Config_PositionConfig_PositionFlags_GEOIDAL_SEPERATION = 4,
Config_PositionConfig_PositionFlags_DOP = 8,
Config_PositionConfig_PositionFlags_HVDOP = 16,
Config_PositionConfig_PositionFlags_SATINVIEW = 32,
Config_PositionConfig_PositionFlags_SEQ_NO = 64,
Config_PositionConfig_PositionFlags_TIMESTAMP = 128,
Config_PositionConfig_PositionFlags_HEADING = 256,
Config_PositionConfig_PositionFlags_SPEED = 512
} Config_PositionConfig_PositionFlags;
typedef enum _Config_PowerConfig_ChargeCurrent {
Config_PowerConfig_ChargeCurrent_MAUnset = 0,
Config_PowerConfig_ChargeCurrent_MA100 = 1,
Config_PowerConfig_ChargeCurrent_MA190 = 2,
Config_PowerConfig_ChargeCurrent_MA280 = 3,
Config_PowerConfig_ChargeCurrent_MA360 = 4,
Config_PowerConfig_ChargeCurrent_MA450 = 5,
Config_PowerConfig_ChargeCurrent_MA550 = 6,
Config_PowerConfig_ChargeCurrent_MA630 = 7,
Config_PowerConfig_ChargeCurrent_MA700 = 8,
Config_PowerConfig_ChargeCurrent_MA780 = 9,
Config_PowerConfig_ChargeCurrent_MA880 = 10,
Config_PowerConfig_ChargeCurrent_MA960 = 11,
Config_PowerConfig_ChargeCurrent_MA1000 = 12,
Config_PowerConfig_ChargeCurrent_MA1080 = 13,
Config_PowerConfig_ChargeCurrent_MA1160 = 14,
Config_PowerConfig_ChargeCurrent_MA1240 = 15,
Config_PowerConfig_ChargeCurrent_MA1320 = 16
} Config_PowerConfig_ChargeCurrent;
typedef enum _Config_WiFiConfig_WiFiMode {
Config_WiFiConfig_WiFiMode_Client = 0,
Config_WiFiConfig_WiFiMode_AccessPoint = 1,
Config_WiFiConfig_WiFiMode_AccessPointHidden = 2
} Config_WiFiConfig_WiFiMode;
typedef enum _Config_NetworkConfig_WiFiMode {
Config_NetworkConfig_WiFiMode_CLIENT = 0,
Config_NetworkConfig_WiFiMode_ACCESS_POINT = 1,
Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN = 2
} Config_NetworkConfig_WiFiMode;
typedef enum _Config_DisplayConfig_GpsCoordinateFormat {
Config_DisplayConfig_GpsCoordinateFormat_GpsFormatDec = 0,
Config_DisplayConfig_GpsCoordinateFormat_GpsFormatDMS = 1,
Config_DisplayConfig_GpsCoordinateFormat_GpsFormatUTM = 2,
Config_DisplayConfig_GpsCoordinateFormat_GpsFormatMGRS = 3,
Config_DisplayConfig_GpsCoordinateFormat_GpsFormatOLC = 4,
Config_DisplayConfig_GpsCoordinateFormat_GpsFormatOSGR = 5
Config_DisplayConfig_GpsCoordinateFormat_DEC = 0,
Config_DisplayConfig_GpsCoordinateFormat_DMS = 1,
Config_DisplayConfig_GpsCoordinateFormat_UTM = 2,
Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3,
Config_DisplayConfig_GpsCoordinateFormat_OLC = 4,
Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5
} Config_DisplayConfig_GpsCoordinateFormat;
typedef enum _Config_LoRaConfig_RegionCode {
Config_LoRaConfig_RegionCode_Unset = 0,
Config_LoRaConfig_RegionCode_UNSET = 0,
Config_LoRaConfig_RegionCode_US = 1,
Config_LoRaConfig_RegionCode_EU433 = 2,
Config_LoRaConfig_RegionCode_EU868 = 3,
Config_LoRaConfig_RegionCode_EU_433 = 2,
Config_LoRaConfig_RegionCode_EU_868 = 3,
Config_LoRaConfig_RegionCode_CN = 4,
Config_LoRaConfig_RegionCode_JP = 5,
Config_LoRaConfig_RegionCode_ANZ = 6,
@ -78,24 +58,24 @@ typedef enum _Config_LoRaConfig_RegionCode {
Config_LoRaConfig_RegionCode_TW = 8,
Config_LoRaConfig_RegionCode_RU = 9,
Config_LoRaConfig_RegionCode_IN = 10,
Config_LoRaConfig_RegionCode_NZ865 = 11,
Config_LoRaConfig_RegionCode_NZ_865 = 11,
Config_LoRaConfig_RegionCode_TH = 12
} Config_LoRaConfig_RegionCode;
typedef enum _Config_LoRaConfig_ModemPreset {
Config_LoRaConfig_ModemPreset_LongFast = 0,
Config_LoRaConfig_ModemPreset_LongSlow = 1,
Config_LoRaConfig_ModemPreset_VLongSlow = 2,
Config_LoRaConfig_ModemPreset_MedSlow = 3,
Config_LoRaConfig_ModemPreset_MedFast = 4,
Config_LoRaConfig_ModemPreset_ShortSlow = 5,
Config_LoRaConfig_ModemPreset_ShortFast = 6
Config_LoRaConfig_ModemPreset_LONG_FAST = 0,
Config_LoRaConfig_ModemPreset_LONG_SLOW = 1,
Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2,
Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3,
Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4,
Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5,
Config_LoRaConfig_ModemPreset_SHORT_FAST = 6
} Config_LoRaConfig_ModemPreset;
typedef enum _Config_BluetoothConfig_PairingMode {
Config_BluetoothConfig_PairingMode_RandomPin = 0,
Config_BluetoothConfig_PairingMode_FixedPin = 1,
Config_BluetoothConfig_PairingMode_NoPin = 2
Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0,
Config_BluetoothConfig_PairingMode_FIXED_PIN = 1,
Config_BluetoothConfig_PairingMode_NO_PIN = 2
} Config_BluetoothConfig_PairingMode;
/* Struct definitions */
@ -108,9 +88,7 @@ typedef struct _Config_BluetoothConfig {
typedef struct _Config_DeviceConfig {
Config_DeviceConfig_Role role;
bool serial_disabled;
bool factory_reset;
bool debug_log_enabled;
char ntp_server[33];
} Config_DeviceConfig;
typedef struct _Config_DisplayConfig {
@ -134,6 +112,14 @@ typedef struct _Config_LoRaConfig {
uint32_t ignore_incoming[3];
} Config_LoRaConfig;
typedef struct _Config_NetworkConfig {
bool wifi_enabled;
Config_NetworkConfig_WiFiMode wifi_mode;
pb_callback_t wifi_ssid;
pb_callback_t wifi_psk;
pb_callback_t ntp_server;
} Config_NetworkConfig;
typedef struct _Config_PositionConfig {
uint32_t position_broadcast_secs;
bool position_broadcast_smart_disabled;
@ -145,7 +131,6 @@ typedef struct _Config_PositionConfig {
} Config_PositionConfig;
typedef struct _Config_PowerConfig {
Config_PowerConfig_ChargeCurrent charge_current;
bool is_power_saving;
uint32_t on_battery_shutdown_after_secs;
float adc_multiplier_override;
@ -156,59 +141,48 @@ typedef struct _Config_PowerConfig {
uint32_t min_wake_secs;
} Config_PowerConfig;
typedef struct _Config_WiFiConfig {
bool enabled;
Config_WiFiConfig_WiFiMode mode;
char ssid[33];
char psk[64];
} Config_WiFiConfig;
typedef struct _Config {
pb_size_t which_payloadVariant;
pb_size_t which_payload_variant;
union {
Config_DeviceConfig device;
Config_PositionConfig position;
Config_PowerConfig power;
Config_WiFiConfig wifi;
Config_NetworkConfig network;
Config_DisplayConfig display;
Config_LoRaConfig lora;
Config_BluetoothConfig bluetooth;
} payloadVariant;
} payload_variant;
} Config;
/* Helper constants for enums */
#define _Config_DeviceConfig_Role_MIN Config_DeviceConfig_Role_Client
#define _Config_DeviceConfig_Role_MAX Config_DeviceConfig_Role_RouterClient
#define _Config_DeviceConfig_Role_ARRAYSIZE ((Config_DeviceConfig_Role)(Config_DeviceConfig_Role_RouterClient+1))
#define _Config_DeviceConfig_Role_MIN Config_DeviceConfig_Role_CLIENT
#define _Config_DeviceConfig_Role_MAX Config_DeviceConfig_Role_ROUTER_CLIENT
#define _Config_DeviceConfig_Role_ARRAYSIZE ((Config_DeviceConfig_Role)(Config_DeviceConfig_Role_ROUTER_CLIENT+1))
#define _Config_PositionConfig_PositionFlags_MIN Config_PositionConfig_PositionFlags_POS_UNDEFINED
#define _Config_PositionConfig_PositionFlags_MAX Config_PositionConfig_PositionFlags_POS_SPEED
#define _Config_PositionConfig_PositionFlags_ARRAYSIZE ((Config_PositionConfig_PositionFlags)(Config_PositionConfig_PositionFlags_POS_SPEED+1))
#define _Config_PositionConfig_PositionFlags_MIN Config_PositionConfig_PositionFlags_UNSET
#define _Config_PositionConfig_PositionFlags_MAX Config_PositionConfig_PositionFlags_SPEED
#define _Config_PositionConfig_PositionFlags_ARRAYSIZE ((Config_PositionConfig_PositionFlags)(Config_PositionConfig_PositionFlags_SPEED+1))
#define _Config_PowerConfig_ChargeCurrent_MIN Config_PowerConfig_ChargeCurrent_MAUnset
#define _Config_PowerConfig_ChargeCurrent_MAX Config_PowerConfig_ChargeCurrent_MA1320
#define _Config_PowerConfig_ChargeCurrent_ARRAYSIZE ((Config_PowerConfig_ChargeCurrent)(Config_PowerConfig_ChargeCurrent_MA1320+1))
#define _Config_NetworkConfig_WiFiMode_MIN Config_NetworkConfig_WiFiMode_CLIENT
#define _Config_NetworkConfig_WiFiMode_MAX Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN
#define _Config_NetworkConfig_WiFiMode_ARRAYSIZE ((Config_NetworkConfig_WiFiMode)(Config_NetworkConfig_WiFiMode_ACCESS_POINT_HIDDEN+1))
#define _Config_WiFiConfig_WiFiMode_MIN Config_WiFiConfig_WiFiMode_Client
#define _Config_WiFiConfig_WiFiMode_MAX Config_WiFiConfig_WiFiMode_AccessPointHidden
#define _Config_WiFiConfig_WiFiMode_ARRAYSIZE ((Config_WiFiConfig_WiFiMode)(Config_WiFiConfig_WiFiMode_AccessPointHidden+1))
#define _Config_DisplayConfig_GpsCoordinateFormat_MIN Config_DisplayConfig_GpsCoordinateFormat_DEC
#define _Config_DisplayConfig_GpsCoordinateFormat_MAX Config_DisplayConfig_GpsCoordinateFormat_OSGR
#define _Config_DisplayConfig_GpsCoordinateFormat_ARRAYSIZE ((Config_DisplayConfig_GpsCoordinateFormat)(Config_DisplayConfig_GpsCoordinateFormat_OSGR+1))
#define _Config_DisplayConfig_GpsCoordinateFormat_MIN Config_DisplayConfig_GpsCoordinateFormat_GpsFormatDec
#define _Config_DisplayConfig_GpsCoordinateFormat_MAX Config_DisplayConfig_GpsCoordinateFormat_GpsFormatOSGR
#define _Config_DisplayConfig_GpsCoordinateFormat_ARRAYSIZE ((Config_DisplayConfig_GpsCoordinateFormat)(Config_DisplayConfig_GpsCoordinateFormat_GpsFormatOSGR+1))
#define _Config_LoRaConfig_RegionCode_MIN Config_LoRaConfig_RegionCode_Unset
#define _Config_LoRaConfig_RegionCode_MIN Config_LoRaConfig_RegionCode_UNSET
#define _Config_LoRaConfig_RegionCode_MAX Config_LoRaConfig_RegionCode_TH
#define _Config_LoRaConfig_RegionCode_ARRAYSIZE ((Config_LoRaConfig_RegionCode)(Config_LoRaConfig_RegionCode_TH+1))
#define _Config_LoRaConfig_ModemPreset_MIN Config_LoRaConfig_ModemPreset_LongFast
#define _Config_LoRaConfig_ModemPreset_MAX Config_LoRaConfig_ModemPreset_ShortFast
#define _Config_LoRaConfig_ModemPreset_ARRAYSIZE ((Config_LoRaConfig_ModemPreset)(Config_LoRaConfig_ModemPreset_ShortFast+1))
#define _Config_LoRaConfig_ModemPreset_MIN Config_LoRaConfig_ModemPreset_LONG_FAST
#define _Config_LoRaConfig_ModemPreset_MAX Config_LoRaConfig_ModemPreset_SHORT_FAST
#define _Config_LoRaConfig_ModemPreset_ARRAYSIZE ((Config_LoRaConfig_ModemPreset)(Config_LoRaConfig_ModemPreset_SHORT_FAST+1))
#define _Config_BluetoothConfig_PairingMode_MIN Config_BluetoothConfig_PairingMode_RandomPin
#define _Config_BluetoothConfig_PairingMode_MAX Config_BluetoothConfig_PairingMode_NoPin
#define _Config_BluetoothConfig_PairingMode_ARRAYSIZE ((Config_BluetoothConfig_PairingMode)(Config_BluetoothConfig_PairingMode_NoPin+1))
#define _Config_BluetoothConfig_PairingMode_MIN Config_BluetoothConfig_PairingMode_RANDOM_PIN
#define _Config_BluetoothConfig_PairingMode_MAX Config_BluetoothConfig_PairingMode_NO_PIN
#define _Config_BluetoothConfig_PairingMode_ARRAYSIZE ((Config_BluetoothConfig_PairingMode)(Config_BluetoothConfig_PairingMode_NO_PIN+1))
#ifdef __cplusplus
@ -217,18 +191,18 @@ extern "C" {
/* Initializer values for message structs */
#define Config_init_default {0, {Config_DeviceConfig_init_default}}
#define Config_DeviceConfig_init_default {_Config_DeviceConfig_Role_MIN, 0, 0, 0, ""}
#define Config_DeviceConfig_init_default {_Config_DeviceConfig_Role_MIN, 0, 0}
#define Config_PositionConfig_init_default {0, 0, 0, 0, 0, 0, 0}
#define Config_PowerConfig_init_default {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0}
#define Config_WiFiConfig_init_default {0, _Config_WiFiConfig_WiFiMode_MIN, "", ""}
#define Config_PowerConfig_init_default {0, 0, 0, 0, 0, 0, 0, 0}
#define Config_NetworkConfig_init_default {0, _Config_NetworkConfig_WiFiMode_MIN, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
#define Config_DisplayConfig_init_default {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0}
#define Config_LoRaConfig_init_default {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, {0, 0, 0}}
#define Config_BluetoothConfig_init_default {0, _Config_BluetoothConfig_PairingMode_MIN, 0}
#define Config_init_zero {0, {Config_DeviceConfig_init_zero}}
#define Config_DeviceConfig_init_zero {_Config_DeviceConfig_Role_MIN, 0, 0, 0, ""}
#define Config_DeviceConfig_init_zero {_Config_DeviceConfig_Role_MIN, 0, 0}
#define Config_PositionConfig_init_zero {0, 0, 0, 0, 0, 0, 0}
#define Config_PowerConfig_init_zero {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0}
#define Config_WiFiConfig_init_zero {0, _Config_WiFiConfig_WiFiMode_MIN, "", ""}
#define Config_PowerConfig_init_zero {0, 0, 0, 0, 0, 0, 0, 0}
#define Config_NetworkConfig_init_zero {0, _Config_NetworkConfig_WiFiMode_MIN, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}}
#define Config_DisplayConfig_init_zero {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 0, 0}
#define Config_LoRaConfig_init_zero {0, _Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, {0, 0, 0}}
#define Config_BluetoothConfig_init_zero {0, _Config_BluetoothConfig_PairingMode_MIN, 0}
@ -239,9 +213,7 @@ extern "C" {
#define Config_BluetoothConfig_fixed_pin_tag 3
#define Config_DeviceConfig_role_tag 1
#define Config_DeviceConfig_serial_disabled_tag 2
#define Config_DeviceConfig_factory_reset_tag 3
#define Config_DeviceConfig_debug_log_enabled_tag 4
#define Config_DeviceConfig_ntp_server_tag 5
#define Config_DeviceConfig_debug_log_enabled_tag 3
#define Config_DisplayConfig_screen_on_secs_tag 1
#define Config_DisplayConfig_gps_format_tag 2
#define Config_DisplayConfig_auto_screen_carousel_secs_tag 3
@ -256,59 +228,57 @@ extern "C" {
#define Config_LoRaConfig_hop_limit_tag 8
#define Config_LoRaConfig_tx_disabled_tag 9
#define Config_LoRaConfig_ignore_incoming_tag 103
#define Config_NetworkConfig_wifi_enabled_tag 1
#define Config_NetworkConfig_wifi_mode_tag 2
#define Config_NetworkConfig_wifi_ssid_tag 3
#define Config_NetworkConfig_wifi_psk_tag 4
#define Config_NetworkConfig_ntp_server_tag 5
#define Config_PositionConfig_position_broadcast_secs_tag 1
#define Config_PositionConfig_position_broadcast_smart_disabled_tag 2
#define Config_PositionConfig_fixed_position_tag 3
#define Config_PositionConfig_gps_disabled_tag 5
#define Config_PositionConfig_gps_update_interval_tag 6
#define Config_PositionConfig_gps_attempt_time_tag 7
#define Config_PositionConfig_position_flags_tag 10
#define Config_PowerConfig_charge_current_tag 1
#define Config_PowerConfig_is_power_saving_tag 2
#define Config_PowerConfig_on_battery_shutdown_after_secs_tag 4
#define Config_PowerConfig_adc_multiplier_override_tag 6
#define Config_PowerConfig_wait_bluetooth_secs_tag 7
#define Config_PowerConfig_mesh_sds_timeout_secs_tag 9
#define Config_PowerConfig_sds_secs_tag 10
#define Config_PowerConfig_ls_secs_tag 11
#define Config_PowerConfig_min_wake_secs_tag 12
#define Config_WiFiConfig_enabled_tag 1
#define Config_WiFiConfig_mode_tag 2
#define Config_WiFiConfig_ssid_tag 3
#define Config_WiFiConfig_psk_tag 4
#define Config_PositionConfig_gps_disabled_tag 4
#define Config_PositionConfig_gps_update_interval_tag 5
#define Config_PositionConfig_gps_attempt_time_tag 6
#define Config_PositionConfig_position_flags_tag 7
#define Config_PowerConfig_is_power_saving_tag 1
#define Config_PowerConfig_on_battery_shutdown_after_secs_tag 2
#define Config_PowerConfig_adc_multiplier_override_tag 3
#define Config_PowerConfig_wait_bluetooth_secs_tag 4
#define Config_PowerConfig_mesh_sds_timeout_secs_tag 5
#define Config_PowerConfig_sds_secs_tag 6
#define Config_PowerConfig_ls_secs_tag 7
#define Config_PowerConfig_min_wake_secs_tag 8
#define Config_device_tag 1
#define Config_position_tag 2
#define Config_power_tag 3
#define Config_wifi_tag 4
#define Config_network_tag 4
#define Config_display_tag 5
#define Config_lora_tag 6
#define Config_bluetooth_tag 7
/* Struct field encoding specification for nanopb */
#define Config_FIELDLIST(X, a) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,device,payloadVariant.device), 1) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,position,payloadVariant.position), 2) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,power,payloadVariant.power), 3) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,wifi,payloadVariant.wifi), 4) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,display,payloadVariant.display), 5) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,lora,payloadVariant.lora), 6) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,bluetooth,payloadVariant.bluetooth), 7)
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,device,payload_variant.device), 1) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,position,payload_variant.position), 2) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,power,payload_variant.power), 3) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,network,payload_variant.network), 4) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,display,payload_variant.display), 5) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,lora,payload_variant.lora), 6) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,bluetooth,payload_variant.bluetooth), 7)
#define Config_CALLBACK NULL
#define Config_DEFAULT NULL
#define Config_payloadVariant_device_MSGTYPE Config_DeviceConfig
#define Config_payloadVariant_position_MSGTYPE Config_PositionConfig
#define Config_payloadVariant_power_MSGTYPE Config_PowerConfig
#define Config_payloadVariant_wifi_MSGTYPE Config_WiFiConfig
#define Config_payloadVariant_display_MSGTYPE Config_DisplayConfig
#define Config_payloadVariant_lora_MSGTYPE Config_LoRaConfig
#define Config_payloadVariant_bluetooth_MSGTYPE Config_BluetoothConfig
#define Config_payload_variant_device_MSGTYPE Config_DeviceConfig
#define Config_payload_variant_position_MSGTYPE Config_PositionConfig
#define Config_payload_variant_power_MSGTYPE Config_PowerConfig
#define Config_payload_variant_network_MSGTYPE Config_NetworkConfig
#define Config_payload_variant_display_MSGTYPE Config_DisplayConfig
#define Config_payload_variant_lora_MSGTYPE Config_LoRaConfig
#define Config_payload_variant_bluetooth_MSGTYPE Config_BluetoothConfig
#define Config_DeviceConfig_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UENUM, role, 1) \
X(a, STATIC, SINGULAR, BOOL, serial_disabled, 2) \
X(a, STATIC, SINGULAR, BOOL, factory_reset, 3) \
X(a, STATIC, SINGULAR, BOOL, debug_log_enabled, 4) \
X(a, STATIC, SINGULAR, STRING, ntp_server, 5)
X(a, STATIC, SINGULAR, BOOL, debug_log_enabled, 3)
#define Config_DeviceConfig_CALLBACK NULL
#define Config_DeviceConfig_DEFAULT NULL
@ -316,33 +286,33 @@ X(a, STATIC, SINGULAR, STRING, ntp_server, 5)
X(a, STATIC, SINGULAR, UINT32, position_broadcast_secs, 1) \
X(a, STATIC, SINGULAR, BOOL, position_broadcast_smart_disabled, 2) \
X(a, STATIC, SINGULAR, BOOL, fixed_position, 3) \
X(a, STATIC, SINGULAR, BOOL, gps_disabled, 5) \
X(a, STATIC, SINGULAR, UINT32, gps_update_interval, 6) \
X(a, STATIC, SINGULAR, UINT32, gps_attempt_time, 7) \
X(a, STATIC, SINGULAR, UINT32, position_flags, 10)
X(a, STATIC, SINGULAR, BOOL, gps_disabled, 4) \
X(a, STATIC, SINGULAR, UINT32, gps_update_interval, 5) \
X(a, STATIC, SINGULAR, UINT32, gps_attempt_time, 6) \
X(a, STATIC, SINGULAR, UINT32, position_flags, 7)
#define Config_PositionConfig_CALLBACK NULL
#define Config_PositionConfig_DEFAULT NULL
#define Config_PowerConfig_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UENUM, charge_current, 1) \
X(a, STATIC, SINGULAR, BOOL, is_power_saving, 2) \
X(a, STATIC, SINGULAR, UINT32, on_battery_shutdown_after_secs, 4) \
X(a, STATIC, SINGULAR, FLOAT, adc_multiplier_override, 6) \
X(a, STATIC, SINGULAR, UINT32, wait_bluetooth_secs, 7) \
X(a, STATIC, SINGULAR, UINT32, mesh_sds_timeout_secs, 9) \
X(a, STATIC, SINGULAR, UINT32, sds_secs, 10) \
X(a, STATIC, SINGULAR, UINT32, ls_secs, 11) \
X(a, STATIC, SINGULAR, UINT32, min_wake_secs, 12)
X(a, STATIC, SINGULAR, BOOL, is_power_saving, 1) \
X(a, STATIC, SINGULAR, UINT32, on_battery_shutdown_after_secs, 2) \
X(a, STATIC, SINGULAR, FLOAT, adc_multiplier_override, 3) \
X(a, STATIC, SINGULAR, UINT32, wait_bluetooth_secs, 4) \
X(a, STATIC, SINGULAR, UINT32, mesh_sds_timeout_secs, 5) \
X(a, STATIC, SINGULAR, UINT32, sds_secs, 6) \
X(a, STATIC, SINGULAR, UINT32, ls_secs, 7) \
X(a, STATIC, SINGULAR, UINT32, min_wake_secs, 8)
#define Config_PowerConfig_CALLBACK NULL
#define Config_PowerConfig_DEFAULT NULL
#define Config_WiFiConfig_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, BOOL, enabled, 1) \
X(a, STATIC, SINGULAR, UENUM, mode, 2) \
X(a, STATIC, SINGULAR, STRING, ssid, 3) \
X(a, STATIC, SINGULAR, STRING, psk, 4)
#define Config_WiFiConfig_CALLBACK NULL
#define Config_WiFiConfig_DEFAULT NULL
#define Config_NetworkConfig_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, BOOL, wifi_enabled, 1) \
X(a, STATIC, SINGULAR, UENUM, wifi_mode, 2) \
X(a, CALLBACK, SINGULAR, STRING, wifi_ssid, 3) \
X(a, CALLBACK, SINGULAR, STRING, wifi_psk, 4) \
X(a, CALLBACK, SINGULAR, STRING, ntp_server, 5)
#define Config_NetworkConfig_CALLBACK pb_default_field_callback
#define Config_NetworkConfig_DEFAULT NULL
#define Config_DisplayConfig_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UINT32, screen_on_secs, 1) \
@ -377,7 +347,7 @@ extern const pb_msgdesc_t Config_msg;
extern const pb_msgdesc_t Config_DeviceConfig_msg;
extern const pb_msgdesc_t Config_PositionConfig_msg;
extern const pb_msgdesc_t Config_PowerConfig_msg;
extern const pb_msgdesc_t Config_WiFiConfig_msg;
extern const pb_msgdesc_t Config_NetworkConfig_msg;
extern const pb_msgdesc_t Config_DisplayConfig_msg;
extern const pb_msgdesc_t Config_LoRaConfig_msg;
extern const pb_msgdesc_t Config_BluetoothConfig_msg;
@ -387,20 +357,20 @@ extern const pb_msgdesc_t Config_BluetoothConfig_msg;
#define Config_DeviceConfig_fields &Config_DeviceConfig_msg
#define Config_PositionConfig_fields &Config_PositionConfig_msg
#define Config_PowerConfig_fields &Config_PowerConfig_msg
#define Config_WiFiConfig_fields &Config_WiFiConfig_msg
#define Config_NetworkConfig_fields &Config_NetworkConfig_msg
#define Config_DisplayConfig_fields &Config_DisplayConfig_msg
#define Config_LoRaConfig_fields &Config_LoRaConfig_msg
#define Config_BluetoothConfig_fields &Config_BluetoothConfig_msg
/* Maximum encoded size of messages (where known) */
/* Config_size depends on runtime parameters */
/* Config_NetworkConfig_size depends on runtime parameters */
#define Config_BluetoothConfig_size 10
#define Config_DeviceConfig_size 42
#define Config_DeviceConfig_size 6
#define Config_DisplayConfig_size 16
#define Config_LoRaConfig_size 67
#define Config_PositionConfig_size 30
#define Config_PowerConfig_size 45
#define Config_WiFiConfig_size 103
#define Config_size 105
#define Config_PowerConfig_size 43
#ifdef __cplusplus
} /* extern "C" */

View File

@ -164,8 +164,8 @@ extern const pb_msgdesc_t OEMStore_msg;
#define OEMStore_fields &OEMStore_msg
/* Maximum encoded size of messages (where known) */
#define ChannelFile_size 630
#define DeviceState_size 22218
#define ChannelFile_size 614
#define DeviceState_size 21800
#define OEMStore_size 2106
#ifdef __cplusplus

View File

@ -6,7 +6,7 @@
#error Regenerate this file with the current version of nanopb generator.
#endif
PB_BIND(LocalConfig, LocalConfig, 2)
PB_BIND(LocalConfig, LocalConfig, AUTO)
PB_BIND(LocalModuleConfig, LocalModuleConfig, 2)

View File

@ -23,8 +23,8 @@ typedef struct _LocalConfig {
bool has_power;
Config_PowerConfig power;
/* The part of the config that is specific to the Wifi Settings */
bool has_wifi;
Config_WiFiConfig wifi;
bool has_network;
Config_NetworkConfig network;
/* The part of the config that is specific to the Display */
bool has_display;
Config_DisplayConfig display;
@ -74,16 +74,16 @@ extern "C" {
#endif
/* Initializer values for message structs */
#define LocalConfig_init_default {false, Config_DeviceConfig_init_default, false, Config_PositionConfig_init_default, false, Config_PowerConfig_init_default, false, Config_WiFiConfig_init_default, false, Config_DisplayConfig_init_default, false, Config_LoRaConfig_init_default, false, Config_BluetoothConfig_init_default, 0}
#define LocalConfig_init_default {false, Config_DeviceConfig_init_default, false, Config_PositionConfig_init_default, false, Config_PowerConfig_init_default, false, Config_NetworkConfig_init_default, false, Config_DisplayConfig_init_default, false, Config_LoRaConfig_init_default, false, Config_BluetoothConfig_init_default, 0}
#define LocalModuleConfig_init_default {false, ModuleConfig_MQTTConfig_init_default, false, ModuleConfig_SerialConfig_init_default, false, ModuleConfig_ExternalNotificationConfig_init_default, false, ModuleConfig_StoreForwardConfig_init_default, false, ModuleConfig_RangeTestConfig_init_default, false, ModuleConfig_TelemetryConfig_init_default, false, ModuleConfig_CannedMessageConfig_init_default, 0}
#define LocalConfig_init_zero {false, Config_DeviceConfig_init_zero, false, Config_PositionConfig_init_zero, false, Config_PowerConfig_init_zero, false, Config_WiFiConfig_init_zero, false, Config_DisplayConfig_init_zero, false, Config_LoRaConfig_init_zero, false, Config_BluetoothConfig_init_zero, 0}
#define LocalConfig_init_zero {false, Config_DeviceConfig_init_zero, false, Config_PositionConfig_init_zero, false, Config_PowerConfig_init_zero, false, Config_NetworkConfig_init_zero, false, Config_DisplayConfig_init_zero, false, Config_LoRaConfig_init_zero, false, Config_BluetoothConfig_init_zero, 0}
#define LocalModuleConfig_init_zero {false, ModuleConfig_MQTTConfig_init_zero, false, ModuleConfig_SerialConfig_init_zero, false, ModuleConfig_ExternalNotificationConfig_init_zero, false, ModuleConfig_StoreForwardConfig_init_zero, false, ModuleConfig_RangeTestConfig_init_zero, false, ModuleConfig_TelemetryConfig_init_zero, false, ModuleConfig_CannedMessageConfig_init_zero, 0}
/* Field tags (for use in manual encoding/decoding) */
#define LocalConfig_device_tag 1
#define LocalConfig_position_tag 2
#define LocalConfig_power_tag 3
#define LocalConfig_wifi_tag 4
#define LocalConfig_network_tag 4
#define LocalConfig_display_tag 5
#define LocalConfig_lora_tag 6
#define LocalConfig_bluetooth_tag 7
@ -102,7 +102,7 @@ extern "C" {
X(a, STATIC, OPTIONAL, MESSAGE, device, 1) \
X(a, STATIC, OPTIONAL, MESSAGE, position, 2) \
X(a, STATIC, OPTIONAL, MESSAGE, power, 3) \
X(a, STATIC, OPTIONAL, MESSAGE, wifi, 4) \
X(a, STATIC, OPTIONAL, MESSAGE, network, 4) \
X(a, STATIC, OPTIONAL, MESSAGE, display, 5) \
X(a, STATIC, OPTIONAL, MESSAGE, lora, 6) \
X(a, STATIC, OPTIONAL, MESSAGE, bluetooth, 7) \
@ -112,7 +112,7 @@ X(a, STATIC, SINGULAR, UINT32, version, 8)
#define LocalConfig_device_MSGTYPE Config_DeviceConfig
#define LocalConfig_position_MSGTYPE Config_PositionConfig
#define LocalConfig_power_MSGTYPE Config_PowerConfig
#define LocalConfig_wifi_MSGTYPE Config_WiFiConfig
#define LocalConfig_network_MSGTYPE Config_NetworkConfig
#define LocalConfig_display_MSGTYPE Config_DisplayConfig
#define LocalConfig_lora_MSGTYPE Config_LoRaConfig
#define LocalConfig_bluetooth_MSGTYPE Config_BluetoothConfig
@ -144,7 +144,9 @@ extern const pb_msgdesc_t LocalModuleConfig_msg;
#define LocalModuleConfig_fields &LocalModuleConfig_msg
/* Maximum encoded size of messages (where known) */
#define LocalConfig_size 333
#if defined(Config_NetworkConfig_size)
#define LocalConfig_size (196 + Config_NetworkConfig_size)
#endif
#define LocalModuleConfig_size 270
#ifdef __cplusplus

View File

@ -26,18 +26,18 @@ typedef enum _HardwareModel {
/* TODO: REPLACE */
HardwareModel_TLORA_V1 = 2,
/* TODO: REPLACE */
HardwareModel_TLORA_V2_1_1p6 = 3,
HardwareModel_TLORA_V2_1_1P6 = 3,
/* TODO: REPLACE */
HardwareModel_TBEAM = 4,
/* The original heltec WiFi_Lora_32_V2, which had battery voltage sensing hooked to GPIO 13
(see HELTEC_V2 for the new version). */
HardwareModel_HELTEC_V2_0 = 5,
/* TODO: REPLACE */
HardwareModel_TBEAM0p7 = 6,
HardwareModel_TBEAM_V0P7 = 6,
/* TODO: REPLACE */
HardwareModel_T_ECHO = 7,
/* TODO: REPLACE */
HardwareModel_TLORA_V1_1p3 = 8,
HardwareModel_TLORA_V1_1P3 = 8,
/* TODO: REPLACE */
HardwareModel_RAK4631 = 9,
/* The new version of the heltec WiFi_Lora_32_V2 board that has battery sensing hooked to GPIO 37.
@ -45,6 +45,14 @@ typedef enum _HardwareModel {
HardwareModel_HELTEC_V2_1 = 10,
/* Ancient heltec WiFi_Lora_32 board */
HardwareModel_HELTEC_V1 = 11,
/* New T-BEAM with ESP32-S3 CPU */
HardwareModel_LILYGO_TBEAM_S3_CORE = 12,
/* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */
HardwareModel_RAK11200 = 13,
/* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */
HardwareModel_NANO_G1 = 14,
/* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */
HardwareModel_STATION_G1 = 25,
/* Less common/prototype boards listed here (needs one more byte over the air) */
HardwareModel_LORA_RELAY_V1 = 32,
/* TODO: REPLACE */
@ -61,18 +69,12 @@ typedef enum _HardwareModel {
HardwareModel_ANDROID_SIM = 38,
/* Custom DIY device based on @NanoVHF schematics: https://github.com/NanoVHF/Meshtastic-DIY/tree/main/Schematics */
HardwareModel_DIY_V1 = 39,
/* RAK WisBlock ESP32 core: https://docs.rakwireless.com/Product-Categories/WisBlock/RAK11200/Overview/ */
HardwareModel_RAK11200 = 40,
/* B&Q Consulting Nano Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:nano */
HardwareModel_NANO_G1 = 41,
/* nRF52840 Dongle : https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle/ */
HardwareModel_NRF52840_PCA10059 = 42,
HardwareModel_NRF52840_PCA10059 = 40,
/* Custom Disaster Radio esp32 v3 device https://github.com/sudomesh/disaster-radio/tree/master/hardware/board_esp32_v3 */
HardwareModel_DR_DEV = 43,
HardwareModel_DR_DEV = 41,
/* M5 esp32 based MCU modules with enclosure, TFT and LORA Shields. All Variants (Basic, Core, Fire, Core2, Paper) https://m5stack.com/ */
HardwareModel_M5STACK = 44,
/* B&Q Consulting Station Edition G1: https://uniteng.com/wiki/doku.php?id=meshtastic:station */
HardwareModel_STATION_G1 = 45,
HardwareModel_M5STACK = 42,
/* Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. */
HardwareModel_PRIVATE_HW = 255
} HardwareModel;
@ -81,7 +83,7 @@ typedef enum _HardwareModel {
typedef enum _Constants {
/* First enum must be zero, and we are just using this enum to
pass int constants between two very different environments */
Constants_Unused = 0,
Constants_ZERO = 0,
/* From mesh.options
note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
outside of this envelope */
@ -94,32 +96,32 @@ typedef enum _Constants {
and we'll try to help. */
typedef enum _CriticalErrorCode {
/* TODO: REPLACE */
CriticalErrorCode_None = 0,
CriticalErrorCode_NONE = 0,
/* A software bug was detected while trying to send lora */
CriticalErrorCode_TxWatchdog = 1,
CriticalErrorCode_TX_WATCHDOG = 1,
/* A software bug was detected on entry to sleep */
CriticalErrorCode_SleepEnterWait = 2,
CriticalErrorCode_SLEEP_ENTER_WAIT = 2,
/* No Lora radio hardware could be found */
CriticalErrorCode_NoRadio = 3,
CriticalErrorCode_NO_RADIO = 3,
/* Not normally used */
CriticalErrorCode_Unspecified = 4,
CriticalErrorCode_UNSPECIFIED = 4,
/* We failed while configuring a UBlox GPS */
CriticalErrorCode_UBloxInitFailed = 5,
CriticalErrorCode_UBLOX_UNIT_FAILED = 5,
/* This board was expected to have a power management chip and it is missing or broken */
CriticalErrorCode_NoAXP192 = 6,
CriticalErrorCode_NO_AXP192 = 6,
/* The channel tried to set a radio setting which is not supported by this chipset,
radio comms settings are now undefined. */
CriticalErrorCode_InvalidRadioSetting = 7,
CriticalErrorCode_INVALID_RADIO_SETTING = 7,
/* Radio transmit hardware failure. We sent data to the radio chip, but it didn't
reply with an interrupt. */
CriticalErrorCode_TransmitFailed = 8,
CriticalErrorCode_TRANSMIT_FAILED = 8,
/* We detected that the main CPU voltage dropped below the minumum acceptable value */
CriticalErrorCode_Brownout = 9,
CriticalErrorCode_BROWNOUT = 9,
/* Selftest of SX1262 radio chip failed */
CriticalErrorCode_SX1262Failure = 10,
CriticalErrorCode_SX1262_FAILURE = 10,
/* A (likely software but possibly hardware) failure was detected while trying to send packets.
If this occurs on your board, please post in the forum so that we can ask you to collect some information to allow fixing this bug */
CriticalErrorCode_RadioSpiBug = 11
CriticalErrorCode_RADIO_SPI_BUG = 11
} CriticalErrorCode;
/* Note: these enum names must EXACTLY match the string used in the device
@ -128,27 +130,27 @@ typedef enum _CriticalErrorCode {
To match the old style filenames, _ is converted to -, p is converted to . */
typedef enum _Position_LocSource {
/* TODO: REPLACE */
Position_LocSource_LOCSRC_UNSPECIFIED = 0,
Position_LocSource_LOC_UNSET = 0,
/* TODO: REPLACE */
Position_LocSource_LOCSRC_MANUAL_ENTRY = 1,
Position_LocSource_LOC_MANUAL = 1,
/* TODO: REPLACE */
Position_LocSource_LOCSRC_GPS_INTERNAL = 2,
Position_LocSource_LOC_INTERNAL = 2,
/* TODO: REPLACE */
Position_LocSource_LOCSRC_GPS_EXTERNAL = 3
Position_LocSource_LOC_EXTERNAL = 3
} Position_LocSource;
/* Shared constants between device and phone */
typedef enum _Position_AltSource {
/* First enum must be zero, and we are just using this enum to
pass int constants between two very different environments */
Position_AltSource_ALTSRC_UNSPECIFIED = 0,
Position_AltSource_ALT_UNSET = 0,
/* From mesh.options
note: this payload length is ONLY the bytes that are sent inside of the Data protobuf (excluding protobuf overhead). The 16 byte header is
outside of this envelope */
Position_AltSource_ALTSRC_MANUAL_ENTRY = 1,
Position_AltSource_ALTSRC_GPS_INTERNAL = 2,
Position_AltSource_ALTSRC_GPS_EXTERNAL = 3,
Position_AltSource_ALTSRC_BAROMETRIC = 4
Position_AltSource_ALT_MANUAL = 1,
Position_AltSource_ALT_INTERNAL = 2,
Position_AltSource_ALT_EXTERNAL = 3,
Position_AltSource_ALT_BAROMETRIC = 4
} Position_AltSource;
/* Note: these enum names must EXACTLY match the string used in the device
@ -304,6 +306,8 @@ typedef struct _MyNodeInfo {
/* Note: This flag merely means we detected a hardware GPS in our node.
Not the same as UserPreferences.location_sharing */
bool has_gps;
/* The maximum number of 'software' channels that can be set on this node. */
uint32_t max_channels;
/* 0.0.5 etc... */
char firmware_version[18];
/* An error message we'd like to report back to the mothership through analytics.
@ -331,8 +335,6 @@ typedef struct _MyNodeInfo {
/* The minimum app version that can talk to this device.
Phone/PC apps should compare this to their build number and if too low tell the user they must update their app */
uint32_t min_app_version;
/* The maximum number of 'software' channels that can be set on this node. */
uint32_t max_channels;
/* 24 time windows of 1hr each with the airtime transmitted out of the device per hour. */
pb_size_t air_period_tx_count;
uint32_t air_period_tx[8];
@ -367,13 +369,13 @@ typedef struct _Position {
/* TODO: REPLACE */
Position_AltSource altitude_source;
/* Positional timestamp (actual timestamp of GPS solution) in integer epoch seconds */
uint32_t pos_timestamp;
uint32_t timestamp;
/* Pos. timestamp milliseconds adjustment (rarely available or required) */
int32_t pos_time_millis;
int32_t timestamp_millis_adjust;
/* HAE altitude in meters - can be used instead of MSL altitude */
int32_t altitude_hae;
/* Geoidal separation in meters */
int32_t alt_geoid_sep;
int32_t altitude_geoidal_seperation;
/* Horizontal, Vertical and Position Dilution of Precision, in 1/100 units
- PDOP is sufficient for most cases
- for higher precision scenarios, HDOP and VDOP can be used instead,
@ -409,10 +411,10 @@ typedef struct _Position {
- if we update at fixed intervals of X seconds, use X
- if we update at dynamic intervals (based on relative movement etc),
but "AT LEAST every Y seconds", use Y */
uint32_t pos_next_update;
uint32_t next_update;
/* A sequence number, incremented with each Position message to help
detect lost updates if needed */
uint32_t pos_seq_number;
uint32_t seq_number;
} Position;
/* A message used in our Dynamic Source Routing protocol (RFC 4728 based) */
@ -496,7 +498,7 @@ typedef struct _Waypoint {
typedef PB_BYTES_ARRAY_T(256) MeshPacket_encrypted_t;
/* A packet envelope sent/received over the mesh
only payloadVariant is sent in the payload portion of the LORA packet.
only payload_variant is sent in the payload portion of the LORA packet.
The other fields are either not sent at all, or sent in the special 16 byte LORA header. */
typedef struct _MeshPacket {
/* The sending node number.
@ -513,9 +515,9 @@ typedef struct _MeshPacket {
Therefore channel_index is inherently a local concept and meaningless to send between nodes.
Very briefly, while sending and receiving deep inside the device Router code, this field instead
contains the 'channel hash' instead of the index.
This 'trick' is only used while the payloadVariant is an 'encrypted'. */
This 'trick' is only used while the payload_variant is an 'encrypted'. */
uint8_t channel;
pb_size_t which_payloadVariant;
pb_size_t which_payload_variant;
union {
/* TODO: REPLACE */
Data decoded;
@ -624,8 +626,10 @@ typedef struct _FromRadio {
/* The packet id, used to allow the phone to request missing read packets from the FIFO,
see our bluetooth docs */
uint32_t id;
pb_size_t which_payloadVariant;
pb_size_t which_payload_variant;
union {
/* Log levels, chosen to match python logging conventions. */
MeshPacket packet;
/* Tells the phone what our node number is, can be -1 if we've not yet joined a mesh.
NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */
MyNodeInfo my_info;
@ -648,15 +652,13 @@ typedef struct _FromRadio {
bool rebooted;
/* Include module config */
ModuleConfig moduleConfig;
/* Log levels, chosen to match python logging conventions. */
MeshPacket packet;
};
} FromRadio;
/* Packets/commands to the radio will be written (reliably) to the toRadio characteristic.
Once the write completes the phone can assume it is handled. */
typedef struct _ToRadio {
pb_size_t which_payloadVariant;
pb_size_t which_payload_variant;
union {
/* Send this packet on the mesh */
MeshPacket packet;
@ -685,21 +687,21 @@ typedef struct _ToRadio {
#define _HardwareModel_MAX HardwareModel_PRIVATE_HW
#define _HardwareModel_ARRAYSIZE ((HardwareModel)(HardwareModel_PRIVATE_HW+1))
#define _Constants_MIN Constants_Unused
#define _Constants_MIN Constants_ZERO
#define _Constants_MAX Constants_DATA_PAYLOAD_LEN
#define _Constants_ARRAYSIZE ((Constants)(Constants_DATA_PAYLOAD_LEN+1))
#define _CriticalErrorCode_MIN CriticalErrorCode_None
#define _CriticalErrorCode_MAX CriticalErrorCode_RadioSpiBug
#define _CriticalErrorCode_ARRAYSIZE ((CriticalErrorCode)(CriticalErrorCode_RadioSpiBug+1))
#define _CriticalErrorCode_MIN CriticalErrorCode_NONE
#define _CriticalErrorCode_MAX CriticalErrorCode_RADIO_SPI_BUG
#define _CriticalErrorCode_ARRAYSIZE ((CriticalErrorCode)(CriticalErrorCode_RADIO_SPI_BUG+1))
#define _Position_LocSource_MIN Position_LocSource_LOCSRC_UNSPECIFIED
#define _Position_LocSource_MAX Position_LocSource_LOCSRC_GPS_EXTERNAL
#define _Position_LocSource_ARRAYSIZE ((Position_LocSource)(Position_LocSource_LOCSRC_GPS_EXTERNAL+1))
#define _Position_LocSource_MIN Position_LocSource_LOC_UNSET
#define _Position_LocSource_MAX Position_LocSource_LOC_EXTERNAL
#define _Position_LocSource_ARRAYSIZE ((Position_LocSource)(Position_LocSource_LOC_EXTERNAL+1))
#define _Position_AltSource_MIN Position_AltSource_ALTSRC_UNSPECIFIED
#define _Position_AltSource_MAX Position_AltSource_ALTSRC_BAROMETRIC
#define _Position_AltSource_ARRAYSIZE ((Position_AltSource)(Position_AltSource_ALTSRC_BAROMETRIC+1))
#define _Position_AltSource_MIN Position_AltSource_ALT_UNSET
#define _Position_AltSource_MAX Position_AltSource_ALT_BAROMETRIC
#define _Position_AltSource_ARRAYSIZE ((Position_AltSource)(Position_AltSource_ALT_BAROMETRIC+1))
#define _Routing_Error_MIN Routing_Error_NONE
#define _Routing_Error_MAX Routing_Error_NOT_AUTHORIZED
@ -731,9 +733,9 @@ extern "C" {
#define Waypoint_init_default {0, 0, 0, 0, 0, "", ""}
#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, DeviceMetrics_init_default}
#define MyNodeInfo_init_default {0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0}
#define MyNodeInfo_init_default {0, 0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0}
#define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN}
#define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}}
#define FromRadio_init_default {0, 0, {MeshPacket_init_default}}
#define ToRadio_init_default {0, {MeshPacket_init_default}}
#define ToRadio_PeerInfo_init_default {0, 0}
#define Compressed_init_default {_PortNum_MIN, {0, {0}}}
@ -745,9 +747,9 @@ extern "C" {
#define Waypoint_init_zero {0, 0, 0, 0, 0, "", ""}
#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, DeviceMetrics_init_zero}
#define MyNodeInfo_init_zero {0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0}
#define MyNodeInfo_init_zero {0, 0, 0, "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, {0, 0, 0, 0, 0, 0, 0, 0}, 0, 0, 0}
#define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN}
#define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}}
#define FromRadio_init_zero {0, 0, {MeshPacket_init_zero}}
#define ToRadio_init_zero {0, {MeshPacket_init_zero}}
#define ToRadio_PeerInfo_init_zero {0, 0}
#define Compressed_init_zero {_PortNum_MIN, {0, {0}}}
@ -769,51 +771,51 @@ extern "C" {
#define LogRecord_level_tag 4
#define MyNodeInfo_my_node_num_tag 1
#define MyNodeInfo_has_gps_tag 2
#define MyNodeInfo_firmware_version_tag 6
#define MyNodeInfo_error_code_tag 7
#define MyNodeInfo_error_address_tag 8
#define MyNodeInfo_error_count_tag 9
#define MyNodeInfo_reboot_count_tag 10
#define MyNodeInfo_bitrate_tag 11
#define MyNodeInfo_message_timeout_msec_tag 13
#define MyNodeInfo_min_app_version_tag 14
#define MyNodeInfo_max_channels_tag 15
#define MyNodeInfo_air_period_tx_tag 16
#define MyNodeInfo_air_period_rx_tag 17
#define MyNodeInfo_has_wifi_tag 18
#define MyNodeInfo_channel_utilization_tag 19
#define MyNodeInfo_air_util_tx_tag 20
#define MyNodeInfo_max_channels_tag 3
#define MyNodeInfo_firmware_version_tag 4
#define MyNodeInfo_error_code_tag 5
#define MyNodeInfo_error_address_tag 6
#define MyNodeInfo_error_count_tag 7
#define MyNodeInfo_reboot_count_tag 8
#define MyNodeInfo_bitrate_tag 9
#define MyNodeInfo_message_timeout_msec_tag 10
#define MyNodeInfo_min_app_version_tag 11
#define MyNodeInfo_air_period_tx_tag 12
#define MyNodeInfo_air_period_rx_tag 13
#define MyNodeInfo_has_wifi_tag 14
#define MyNodeInfo_channel_utilization_tag 15
#define MyNodeInfo_air_util_tx_tag 16
#define Position_latitude_i_tag 1
#define Position_longitude_i_tag 2
#define Position_altitude_tag 3
#define Position_time_tag 9
#define Position_location_source_tag 10
#define Position_altitude_source_tag 11
#define Position_pos_timestamp_tag 12
#define Position_pos_time_millis_tag 13
#define Position_altitude_hae_tag 14
#define Position_alt_geoid_sep_tag 15
#define Position_PDOP_tag 16
#define Position_HDOP_tag 17
#define Position_VDOP_tag 18
#define Position_gps_accuracy_tag 19
#define Position_ground_speed_tag 20
#define Position_ground_track_tag 21
#define Position_fix_quality_tag 22
#define Position_fix_type_tag 23
#define Position_sats_in_view_tag 24
#define Position_sensor_id_tag 25
#define Position_pos_next_update_tag 40
#define Position_pos_seq_number_tag 41
#define RouteDiscovery_route_tag 2
#define Position_time_tag 4
#define Position_location_source_tag 5
#define Position_altitude_source_tag 6
#define Position_timestamp_tag 7
#define Position_timestamp_millis_adjust_tag 8
#define Position_altitude_hae_tag 9
#define Position_altitude_geoidal_seperation_tag 10
#define Position_PDOP_tag 11
#define Position_HDOP_tag 12
#define Position_VDOP_tag 13
#define Position_gps_accuracy_tag 14
#define Position_ground_speed_tag 15
#define Position_ground_track_tag 16
#define Position_fix_quality_tag 17
#define Position_fix_type_tag 18
#define Position_sats_in_view_tag 19
#define Position_sensor_id_tag 20
#define Position_next_update_tag 21
#define Position_seq_number_tag 22
#define RouteDiscovery_route_tag 1
#define ToRadio_PeerInfo_app_version_tag 1
#define ToRadio_PeerInfo_mqtt_gateway_tag 2
#define User_id_tag 1
#define User_long_name_tag 2
#define User_short_name_tag 3
#define User_macaddr_tag 4
#define User_hw_model_tag 6
#define User_is_licensed_tag 7
#define User_hw_model_tag 5
#define User_is_licensed_tag 6
#define Waypoint_id_tag 1
#define Waypoint_latitude_i_tag 2
#define Waypoint_longitude_i_tag 3
@ -829,11 +831,11 @@ extern "C" {
#define MeshPacket_id_tag 6
#define MeshPacket_rx_time_tag 7
#define MeshPacket_rx_snr_tag 8
#define MeshPacket_hop_limit_tag 10
#define MeshPacket_want_ack_tag 11
#define MeshPacket_priority_tag 12
#define MeshPacket_rx_rssi_tag 13
#define MeshPacket_delayed_tag 15
#define MeshPacket_hop_limit_tag 9
#define MeshPacket_want_ack_tag 10
#define MeshPacket_priority_tag 11
#define MeshPacket_rx_rssi_tag 12
#define MeshPacket_delayed_tag 13
#define NodeInfo_num_tag 1
#define NodeInfo_user_tag 2
#define NodeInfo_position_tag 3
@ -844,43 +846,43 @@ extern "C" {
#define Routing_route_reply_tag 2
#define Routing_error_reason_tag 3
#define FromRadio_id_tag 1
#define FromRadio_packet_tag 2
#define FromRadio_my_info_tag 3
#define FromRadio_node_info_tag 4
#define FromRadio_config_tag 6
#define FromRadio_log_record_tag 7
#define FromRadio_config_complete_id_tag 8
#define FromRadio_rebooted_tag 9
#define FromRadio_moduleConfig_tag 10
#define FromRadio_packet_tag 11
#define ToRadio_packet_tag 2
#define ToRadio_peer_info_tag 3
#define ToRadio_want_config_id_tag 100
#define ToRadio_disconnect_tag 104
#define FromRadio_config_tag 5
#define FromRadio_log_record_tag 6
#define FromRadio_config_complete_id_tag 7
#define FromRadio_rebooted_tag 8
#define FromRadio_moduleConfig_tag 9
#define ToRadio_packet_tag 1
#define ToRadio_peer_info_tag 2
#define ToRadio_want_config_id_tag 3
#define ToRadio_disconnect_tag 4
/* Struct field encoding specification for nanopb */
#define Position_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 1) \
X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 2) \
X(a, STATIC, SINGULAR, INT32, altitude, 3) \
X(a, STATIC, SINGULAR, FIXED32, time, 9) \
X(a, STATIC, SINGULAR, UENUM, location_source, 10) \
X(a, STATIC, SINGULAR, UENUM, altitude_source, 11) \
X(a, STATIC, SINGULAR, FIXED32, pos_timestamp, 12) \
X(a, STATIC, SINGULAR, INT32, pos_time_millis, 13) \
X(a, STATIC, SINGULAR, SINT32, altitude_hae, 14) \
X(a, STATIC, SINGULAR, SINT32, alt_geoid_sep, 15) \
X(a, STATIC, SINGULAR, UINT32, PDOP, 16) \
X(a, STATIC, SINGULAR, UINT32, HDOP, 17) \
X(a, STATIC, SINGULAR, UINT32, VDOP, 18) \
X(a, STATIC, SINGULAR, UINT32, gps_accuracy, 19) \
X(a, STATIC, SINGULAR, UINT32, ground_speed, 20) \
X(a, STATIC, SINGULAR, UINT32, ground_track, 21) \
X(a, STATIC, SINGULAR, UINT32, fix_quality, 22) \
X(a, STATIC, SINGULAR, UINT32, fix_type, 23) \
X(a, STATIC, SINGULAR, UINT32, sats_in_view, 24) \
X(a, STATIC, SINGULAR, UINT32, sensor_id, 25) \
X(a, STATIC, SINGULAR, UINT32, pos_next_update, 40) \
X(a, STATIC, SINGULAR, UINT32, pos_seq_number, 41)
X(a, STATIC, SINGULAR, FIXED32, time, 4) \
X(a, STATIC, SINGULAR, UENUM, location_source, 5) \
X(a, STATIC, SINGULAR, UENUM, altitude_source, 6) \
X(a, STATIC, SINGULAR, FIXED32, timestamp, 7) \
X(a, STATIC, SINGULAR, INT32, timestamp_millis_adjust, 8) \
X(a, STATIC, SINGULAR, SINT32, altitude_hae, 9) \
X(a, STATIC, SINGULAR, SINT32, altitude_geoidal_seperation, 10) \
X(a, STATIC, SINGULAR, UINT32, PDOP, 11) \
X(a, STATIC, SINGULAR, UINT32, HDOP, 12) \
X(a, STATIC, SINGULAR, UINT32, VDOP, 13) \
X(a, STATIC, SINGULAR, UINT32, gps_accuracy, 14) \
X(a, STATIC, SINGULAR, UINT32, ground_speed, 15) \
X(a, STATIC, SINGULAR, UINT32, ground_track, 16) \
X(a, STATIC, SINGULAR, UINT32, fix_quality, 17) \
X(a, STATIC, SINGULAR, UINT32, fix_type, 18) \
X(a, STATIC, SINGULAR, UINT32, sats_in_view, 19) \
X(a, STATIC, SINGULAR, UINT32, sensor_id, 20) \
X(a, STATIC, SINGULAR, UINT32, next_update, 21) \
X(a, STATIC, SINGULAR, UINT32, seq_number, 22)
#define Position_CALLBACK NULL
#define Position_DEFAULT NULL
@ -889,13 +891,13 @@ X(a, STATIC, SINGULAR, STRING, id, 1) \
X(a, STATIC, SINGULAR, STRING, long_name, 2) \
X(a, STATIC, SINGULAR, STRING, short_name, 3) \
X(a, STATIC, SINGULAR, FIXED_LENGTH_BYTES, macaddr, 4) \
X(a, STATIC, SINGULAR, UENUM, hw_model, 6) \
X(a, STATIC, SINGULAR, BOOL, is_licensed, 7)
X(a, STATIC, SINGULAR, UENUM, hw_model, 5) \
X(a, STATIC, SINGULAR, BOOL, is_licensed, 6)
#define User_CALLBACK NULL
#define User_DEFAULT NULL
#define RouteDiscovery_FIELDLIST(X, a) \
X(a, STATIC, REPEATED, FIXED32, route, 2)
X(a, STATIC, REPEATED, FIXED32, route, 1)
#define RouteDiscovery_CALLBACK NULL
#define RouteDiscovery_DEFAULT NULL
@ -935,19 +937,19 @@ X(a, STATIC, SINGULAR, STRING, description, 7)
X(a, STATIC, SINGULAR, FIXED32, from, 1) \
X(a, STATIC, SINGULAR, FIXED32, to, 2) \
X(a, STATIC, SINGULAR, UINT32, channel, 3) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,decoded,decoded), 4) \
X(a, STATIC, ONEOF, BYTES, (payloadVariant,encrypted,encrypted), 5) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,decoded,decoded), 4) \
X(a, STATIC, ONEOF, BYTES, (payload_variant,encrypted,encrypted), 5) \
X(a, STATIC, SINGULAR, FIXED32, id, 6) \
X(a, STATIC, SINGULAR, FIXED32, rx_time, 7) \
X(a, STATIC, SINGULAR, FLOAT, rx_snr, 8) \
X(a, STATIC, SINGULAR, UINT32, hop_limit, 10) \
X(a, STATIC, SINGULAR, BOOL, want_ack, 11) \
X(a, STATIC, SINGULAR, UENUM, priority, 12) \
X(a, STATIC, SINGULAR, INT32, rx_rssi, 13) \
X(a, STATIC, SINGULAR, UENUM, delayed, 15)
X(a, STATIC, SINGULAR, UINT32, hop_limit, 9) \
X(a, STATIC, SINGULAR, BOOL, want_ack, 10) \
X(a, STATIC, SINGULAR, UENUM, priority, 11) \
X(a, STATIC, SINGULAR, INT32, rx_rssi, 12) \
X(a, STATIC, SINGULAR, UENUM, delayed, 13)
#define MeshPacket_CALLBACK NULL
#define MeshPacket_DEFAULT NULL
#define MeshPacket_payloadVariant_decoded_MSGTYPE Data
#define MeshPacket_payload_variant_decoded_MSGTYPE Data
#define NodeInfo_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UINT32, num, 1) \
@ -965,20 +967,20 @@ X(a, STATIC, OPTIONAL, MESSAGE, device_metrics, 6)
#define MyNodeInfo_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UINT32, my_node_num, 1) \
X(a, STATIC, SINGULAR, BOOL, has_gps, 2) \
X(a, STATIC, SINGULAR, STRING, firmware_version, 6) \
X(a, STATIC, SINGULAR, UENUM, error_code, 7) \
X(a, STATIC, SINGULAR, UINT32, error_address, 8) \
X(a, STATIC, SINGULAR, UINT32, error_count, 9) \
X(a, STATIC, SINGULAR, UINT32, reboot_count, 10) \
X(a, STATIC, SINGULAR, FLOAT, bitrate, 11) \
X(a, STATIC, SINGULAR, UINT32, message_timeout_msec, 13) \
X(a, STATIC, SINGULAR, UINT32, min_app_version, 14) \
X(a, STATIC, SINGULAR, UINT32, max_channels, 15) \
X(a, STATIC, REPEATED, UINT32, air_period_tx, 16) \
X(a, STATIC, REPEATED, UINT32, air_period_rx, 17) \
X(a, STATIC, SINGULAR, BOOL, has_wifi, 18) \
X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 19) \
X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 20)
X(a, STATIC, SINGULAR, UINT32, max_channels, 3) \
X(a, STATIC, SINGULAR, STRING, firmware_version, 4) \
X(a, STATIC, SINGULAR, UENUM, error_code, 5) \
X(a, STATIC, SINGULAR, UINT32, error_address, 6) \
X(a, STATIC, SINGULAR, UINT32, error_count, 7) \
X(a, STATIC, SINGULAR, UINT32, reboot_count, 8) \
X(a, STATIC, SINGULAR, FLOAT, bitrate, 9) \
X(a, STATIC, SINGULAR, UINT32, message_timeout_msec, 10) \
X(a, STATIC, SINGULAR, UINT32, min_app_version, 11) \
X(a, STATIC, REPEATED, UINT32, air_period_tx, 12) \
X(a, STATIC, REPEATED, UINT32, air_period_rx, 13) \
X(a, STATIC, SINGULAR, BOOL, has_wifi, 14) \
X(a, STATIC, SINGULAR, FLOAT, channel_utilization, 15) \
X(a, STATIC, SINGULAR, FLOAT, air_util_tx, 16)
#define MyNodeInfo_CALLBACK NULL
#define MyNodeInfo_DEFAULT NULL
@ -992,32 +994,32 @@ X(a, STATIC, SINGULAR, UENUM, level, 4)
#define FromRadio_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UINT32, id, 1) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,my_info,my_info), 3) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,node_info,node_info), 4) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,config,config), 6) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,log_record,log_record), 7) \
X(a, STATIC, ONEOF, UINT32, (payloadVariant,config_complete_id,config_complete_id), 8) \
X(a, STATIC, ONEOF, BOOL, (payloadVariant,rebooted,rebooted), 9) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,moduleConfig,moduleConfig), 10) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 11)
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 2) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,my_info,my_info), 3) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,node_info,node_info), 4) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,config,config), 5) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,log_record,log_record), 6) \
X(a, STATIC, ONEOF, UINT32, (payload_variant,config_complete_id,config_complete_id), 7) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,rebooted,rebooted), 8) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,moduleConfig,moduleConfig), 9)
#define FromRadio_CALLBACK NULL
#define FromRadio_DEFAULT NULL
#define FromRadio_payloadVariant_my_info_MSGTYPE MyNodeInfo
#define FromRadio_payloadVariant_node_info_MSGTYPE NodeInfo
#define FromRadio_payloadVariant_config_MSGTYPE Config
#define FromRadio_payloadVariant_log_record_MSGTYPE LogRecord
#define FromRadio_payloadVariant_moduleConfig_MSGTYPE ModuleConfig
#define FromRadio_payloadVariant_packet_MSGTYPE MeshPacket
#define FromRadio_payload_variant_packet_MSGTYPE MeshPacket
#define FromRadio_payload_variant_my_info_MSGTYPE MyNodeInfo
#define FromRadio_payload_variant_node_info_MSGTYPE NodeInfo
#define FromRadio_payload_variant_config_MSGTYPE Config
#define FromRadio_payload_variant_log_record_MSGTYPE LogRecord
#define FromRadio_payload_variant_moduleConfig_MSGTYPE ModuleConfig
#define ToRadio_FIELDLIST(X, a) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 2) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,peer_info,peer_info), 3) \
X(a, STATIC, ONEOF, UINT32, (payloadVariant,want_config_id,want_config_id), 100) \
X(a, STATIC, ONEOF, BOOL, (payloadVariant,disconnect,disconnect), 104)
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,packet,packet), 1) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,peer_info,peer_info), 2) \
X(a, STATIC, ONEOF, UINT32, (payload_variant,want_config_id,want_config_id), 3) \
X(a, STATIC, ONEOF, BOOL, (payload_variant,disconnect,disconnect), 4)
#define ToRadio_CALLBACK NULL
#define ToRadio_DEFAULT NULL
#define ToRadio_payloadVariant_packet_MSGTYPE MeshPacket
#define ToRadio_payloadVariant_peer_info_MSGTYPE ToRadio_PeerInfo
#define ToRadio_payload_variant_packet_MSGTYPE MeshPacket
#define ToRadio_payload_variant_peer_info_MSGTYPE ToRadio_PeerInfo
#define ToRadio_PeerInfo_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UINT32, app_version, 1) \
@ -1063,20 +1065,25 @@ extern const pb_msgdesc_t Compressed_msg;
#define Compressed_fields &Compressed_msg
/* Maximum encoded size of messages (where known) */
#if defined(Config_size)
union FromRadio_payload_variant_size_union {char f5[(6 + Config_size)]; char f0[324];};
#endif
#define Compressed_size 243
#define Data_size 270
#define FromRadio_size 330
#define LogRecord_size 81
#define MeshPacket_size 321
#define MyNodeInfo_size 197
#define NodeInfo_size 263
#define Position_size 142
#define MyNodeInfo_size 179
#define NodeInfo_size 258
#define Position_size 137
#define RouteDiscovery_size 40
#define Routing_size 42
#define ToRadio_PeerInfo_size 8
#define ToRadio_size 324
#define User_size 77
#define Waypoint_size 156
#if defined(Config_size)
#define FromRadio_size (6 + sizeof(union FromRadio_payload_variant_size_union))
#endif
#ifdef __cplusplus
} /* extern "C" */

View File

@ -11,7 +11,7 @@
/* Enum definitions */
typedef enum _ModuleConfig_SerialConfig_Serial_Baud {
ModuleConfig_SerialConfig_Serial_Baud_BAUD_Default = 0,
ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT = 0,
ModuleConfig_SerialConfig_Serial_Baud_BAUD_110 = 1,
ModuleConfig_SerialConfig_Serial_Baud_BAUD_300 = 2,
ModuleConfig_SerialConfig_Serial_Baud_BAUD_600 = 3,
@ -30,20 +30,20 @@ typedef enum _ModuleConfig_SerialConfig_Serial_Baud {
} ModuleConfig_SerialConfig_Serial_Baud;
typedef enum _ModuleConfig_SerialConfig_Serial_Mode {
ModuleConfig_SerialConfig_Serial_Mode_MODE_Default = 0,
ModuleConfig_SerialConfig_Serial_Mode_MODE_SIMPLE = 1,
ModuleConfig_SerialConfig_Serial_Mode_MODE_PROTO = 2
ModuleConfig_SerialConfig_Serial_Mode_DEFAULT = 0,
ModuleConfig_SerialConfig_Serial_Mode_SIMPLE = 1,
ModuleConfig_SerialConfig_Serial_Mode_PROTO = 2
} ModuleConfig_SerialConfig_Serial_Mode;
typedef enum _ModuleConfig_CannedMessageConfig_InputEventChar {
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE = 0,
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_UP = 17,
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_DOWN = 18,
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_LEFT = 19,
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_RIGHT = 20,
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_SELECT = 10,
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_BACK = 27,
ModuleConfig_CannedMessageConfig_InputEventChar_KEY_CANCEL = 24
ModuleConfig_CannedMessageConfig_InputEventChar_NONE = 0,
ModuleConfig_CannedMessageConfig_InputEventChar_UP = 17,
ModuleConfig_CannedMessageConfig_InputEventChar_DOWN = 18,
ModuleConfig_CannedMessageConfig_InputEventChar_LEFT = 19,
ModuleConfig_CannedMessageConfig_InputEventChar_RIGHT = 20,
ModuleConfig_CannedMessageConfig_InputEventChar_SELECT = 10,
ModuleConfig_CannedMessageConfig_InputEventChar_BACK = 27,
ModuleConfig_CannedMessageConfig_InputEventChar_CANCEL = 24
} ModuleConfig_CannedMessageConfig_InputEventChar;
/* Struct definitions */
@ -113,7 +113,7 @@ typedef struct _ModuleConfig_TelemetryConfig {
/* Module Config */
typedef struct _ModuleConfig {
pb_size_t which_payloadVariant;
pb_size_t which_payload_variant;
union {
/* TODO: REPLACE */
ModuleConfig_MQTTConfig mqtt;
@ -129,22 +129,22 @@ typedef struct _ModuleConfig {
ModuleConfig_TelemetryConfig telemetry;
/* TODO: REPLACE */
ModuleConfig_CannedMessageConfig canned_message;
} payloadVariant;
} payload_variant;
} ModuleConfig;
/* Helper constants for enums */
#define _ModuleConfig_SerialConfig_Serial_Baud_MIN ModuleConfig_SerialConfig_Serial_Baud_BAUD_Default
#define _ModuleConfig_SerialConfig_Serial_Baud_MIN ModuleConfig_SerialConfig_Serial_Baud_BAUD_DEFAULT
#define _ModuleConfig_SerialConfig_Serial_Baud_MAX ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600
#define _ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Baud)(ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1))
#define _ModuleConfig_SerialConfig_Serial_Mode_MIN ModuleConfig_SerialConfig_Serial_Mode_MODE_Default
#define _ModuleConfig_SerialConfig_Serial_Mode_MAX ModuleConfig_SerialConfig_Serial_Mode_MODE_PROTO
#define _ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Mode)(ModuleConfig_SerialConfig_Serial_Mode_MODE_PROTO+1))
#define _ModuleConfig_SerialConfig_Serial_Mode_MIN ModuleConfig_SerialConfig_Serial_Mode_DEFAULT
#define _ModuleConfig_SerialConfig_Serial_Mode_MAX ModuleConfig_SerialConfig_Serial_Mode_PROTO
#define _ModuleConfig_SerialConfig_Serial_Mode_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Mode)(ModuleConfig_SerialConfig_Serial_Mode_PROTO+1))
#define _ModuleConfig_CannedMessageConfig_InputEventChar_MIN ModuleConfig_CannedMessageConfig_InputEventChar_KEY_NONE
#define _ModuleConfig_CannedMessageConfig_InputEventChar_MAX ModuleConfig_CannedMessageConfig_InputEventChar_KEY_BACK
#define _ModuleConfig_CannedMessageConfig_InputEventChar_ARRAYSIZE ((ModuleConfig_CannedMessageConfig_InputEventChar)(ModuleConfig_CannedMessageConfig_InputEventChar_KEY_BACK+1))
#define _ModuleConfig_CannedMessageConfig_InputEventChar_MIN ModuleConfig_CannedMessageConfig_InputEventChar_NONE
#define _ModuleConfig_CannedMessageConfig_InputEventChar_MAX ModuleConfig_CannedMessageConfig_InputEventChar_BACK
#define _ModuleConfig_CannedMessageConfig_InputEventChar_ARRAYSIZE ((ModuleConfig_CannedMessageConfig_InputEventChar)(ModuleConfig_CannedMessageConfig_InputEventChar_BACK+1))
#ifdef __cplusplus
@ -212,7 +212,7 @@ extern "C" {
#define ModuleConfig_TelemetryConfig_environment_update_interval_tag 2
#define ModuleConfig_TelemetryConfig_environment_measurement_enabled_tag 3
#define ModuleConfig_TelemetryConfig_environment_screen_enabled_tag 4
#define ModuleConfig_TelemetryConfig_environment_display_fahrenheit_tag 7
#define ModuleConfig_TelemetryConfig_environment_display_fahrenheit_tag 5
#define ModuleConfig_mqtt_tag 1
#define ModuleConfig_serial_tag 2
#define ModuleConfig_external_notification_tag 3
@ -223,22 +223,22 @@ extern "C" {
/* Struct field encoding specification for nanopb */
#define ModuleConfig_FIELDLIST(X, a) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,mqtt,payloadVariant.mqtt), 1) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,serial,payloadVariant.serial), 2) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,external_notification,payloadVariant.external_notification), 3) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,store_forward,payloadVariant.store_forward), 4) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,range_test,payloadVariant.range_test), 5) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,telemetry,payloadVariant.telemetry), 6) \
X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,canned_message,payloadVariant.canned_message), 7)
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,mqtt,payload_variant.mqtt), 1) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,serial,payload_variant.serial), 2) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,external_notification,payload_variant.external_notification), 3) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,store_forward,payload_variant.store_forward), 4) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,range_test,payload_variant.range_test), 5) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,telemetry,payload_variant.telemetry), 6) \
X(a, STATIC, ONEOF, MESSAGE, (payload_variant,canned_message,payload_variant.canned_message), 7)
#define ModuleConfig_CALLBACK NULL
#define ModuleConfig_DEFAULT NULL
#define ModuleConfig_payloadVariant_mqtt_MSGTYPE ModuleConfig_MQTTConfig
#define ModuleConfig_payloadVariant_serial_MSGTYPE ModuleConfig_SerialConfig
#define ModuleConfig_payloadVariant_external_notification_MSGTYPE ModuleConfig_ExternalNotificationConfig
#define ModuleConfig_payloadVariant_store_forward_MSGTYPE ModuleConfig_StoreForwardConfig
#define ModuleConfig_payloadVariant_range_test_MSGTYPE ModuleConfig_RangeTestConfig
#define ModuleConfig_payloadVariant_telemetry_MSGTYPE ModuleConfig_TelemetryConfig
#define ModuleConfig_payloadVariant_canned_message_MSGTYPE ModuleConfig_CannedMessageConfig
#define ModuleConfig_payload_variant_mqtt_MSGTYPE ModuleConfig_MQTTConfig
#define ModuleConfig_payload_variant_serial_MSGTYPE ModuleConfig_SerialConfig
#define ModuleConfig_payload_variant_external_notification_MSGTYPE ModuleConfig_ExternalNotificationConfig
#define ModuleConfig_payload_variant_store_forward_MSGTYPE ModuleConfig_StoreForwardConfig
#define ModuleConfig_payload_variant_range_test_MSGTYPE ModuleConfig_RangeTestConfig
#define ModuleConfig_payload_variant_telemetry_MSGTYPE ModuleConfig_TelemetryConfig
#define ModuleConfig_payload_variant_canned_message_MSGTYPE ModuleConfig_CannedMessageConfig
#define ModuleConfig_MQTTConfig_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, BOOL, enabled, 1) \
@ -292,7 +292,7 @@ X(a, STATIC, SINGULAR, UINT32, device_update_interval, 1) \
X(a, STATIC, SINGULAR, UINT32, environment_update_interval, 2) \
X(a, STATIC, SINGULAR, BOOL, environment_measurement_enabled, 3) \
X(a, STATIC, SINGULAR, BOOL, environment_screen_enabled, 4) \
X(a, STATIC, SINGULAR, BOOL, environment_display_fahrenheit, 7)
X(a, STATIC, SINGULAR, BOOL, environment_display_fahrenheit, 5)
#define ModuleConfig_TelemetryConfig_CALLBACK NULL
#define ModuleConfig_TelemetryConfig_DEFAULT NULL

View File

@ -31,7 +31,7 @@ typedef enum _HardwareMessage_Type {
(a special channel once multichannel support is included?) */
typedef struct _HardwareMessage {
/* What type of HardwareMessage is this? */
HardwareMessage_Type typ;
HardwareMessage_Type type;
/* What gpios are we changing. Not used for all MessageTypes, see MessageType for details */
uint64_t gpio_mask;
/* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios.
@ -55,13 +55,13 @@ extern "C" {
#define HardwareMessage_init_zero {_HardwareMessage_Type_MIN, 0, 0}
/* Field tags (for use in manual encoding/decoding) */
#define HardwareMessage_typ_tag 1
#define HardwareMessage_type_tag 1
#define HardwareMessage_gpio_mask_tag 2
#define HardwareMessage_gpio_value_tag 3
/* Struct field encoding specification for nanopb */
#define HardwareMessage_FIELDLIST(X, a) \
X(a, STATIC, SINGULAR, UENUM, typ, 1) \
X(a, STATIC, SINGULAR, UENUM, type, 1) \
X(a, STATIC, SINGULAR, UINT64, gpio_mask, 2) \
X(a, STATIC, SINGULAR, UINT64, gpio_value, 3)
#define HardwareMessage_CALLBACK NULL

View File

@ -13,7 +13,7 @@
/* TODO: REPLACE */
typedef enum _TelemetrySensorType {
/* No external telemetry sensor explicitly set */
TelemetrySensorType_NotSet = 0,
TelemetrySensorType_SENSOR_UNSET = 0,
/* High accuracy temperature, pressure, humidity */
TelemetrySensorType_BME280 = 1,
/* High accuracy temperature, pressure, humidity, and air resistance */
@ -76,7 +76,7 @@ typedef struct _Telemetry {
/* Helper constants for enums */
#define _TelemetrySensorType_MIN TelemetrySensorType_NotSet
#define _TelemetrySensorType_MIN TelemetrySensorType_SENSOR_UNSET
#define _TelemetrySensorType_MAX TelemetrySensorType_BMP280
#define _TelemetrySensorType_ARRAYSIZE ((TelemetrySensorType)(TelemetrySensorType_BMP280+1))