mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 03:00:56 +00:00
[create-pull-request] automated change
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
/* Generated by nanopb-0.4.7 */
|
||||
|
||||
#ifndef PB_CONFIG_PB_H_INCLUDED
|
||||
#define PB_CONFIG_PB_H_INCLUDED
|
||||
@@ -10,169 +10,371 @@
|
||||
#endif
|
||||
|
||||
/* Enum definitions */
|
||||
typedef enum _Config_DeviceConfig_Role {
|
||||
Config_DeviceConfig_Role_CLIENT = 0,
|
||||
Config_DeviceConfig_Role_CLIENT_MUTE = 1,
|
||||
Config_DeviceConfig_Role_ROUTER = 2,
|
||||
Config_DeviceConfig_Role_ROUTER_CLIENT = 3
|
||||
/* Defines the device's role on the Mesh network */
|
||||
typedef enum _Config_DeviceConfig_Role {
|
||||
/* Client device role */
|
||||
Config_DeviceConfig_Role_CLIENT = 0,
|
||||
/* Client Mute device role
|
||||
Same as a client except packets will not hop over this node, does not contribute to routing packets for mesh. */
|
||||
Config_DeviceConfig_Role_CLIENT_MUTE = 1,
|
||||
/* Router device role.
|
||||
Mesh packets will prefer to be routed over this node. This node will not be used by client apps.
|
||||
The wifi/ble radios and the oled screen will be put to sleep. */
|
||||
Config_DeviceConfig_Role_ROUTER = 2,
|
||||
/* Router Client device role
|
||||
Mesh packets will prefer to be routed over this node. The Router Client can be used as both a Router and an app connected Client. */
|
||||
Config_DeviceConfig_Role_ROUTER_CLIENT = 3
|
||||
} Config_DeviceConfig_Role;
|
||||
|
||||
typedef enum _Config_PositionConfig_PositionFlags {
|
||||
Config_PositionConfig_PositionFlags_UNSET = 0,
|
||||
Config_PositionConfig_PositionFlags_ALTITUDE = 1,
|
||||
Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2,
|
||||
Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 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
|
||||
/* Bit field of boolean configuration options, indicating which optional
|
||||
fields to include when assembling POSITION messages
|
||||
Longitude and latitude are always included (also time if GPS-synced)
|
||||
NOTE: the more fields are included, the larger the message will be -
|
||||
leading to longer airtime and a higher risk of packet loss */
|
||||
typedef enum _Config_PositionConfig_PositionFlags {
|
||||
/* Required for compilation */
|
||||
Config_PositionConfig_PositionFlags_UNSET = 0,
|
||||
/* Include an altitude value (if available) */
|
||||
Config_PositionConfig_PositionFlags_ALTITUDE = 1,
|
||||
/* Altitude value is MSL */
|
||||
Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2,
|
||||
/* Include geoidal separation */
|
||||
Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 4,
|
||||
/* Include the DOP value ; PDOP used by default, see below */
|
||||
Config_PositionConfig_PositionFlags_DOP = 8,
|
||||
/* If POS_DOP set, send separate HDOP / VDOP values instead of PDOP */
|
||||
Config_PositionConfig_PositionFlags_HVDOP = 16,
|
||||
/* Include number of "satellites in view" */
|
||||
Config_PositionConfig_PositionFlags_SATINVIEW = 32,
|
||||
/* Include a sequence number incremented per packet */
|
||||
Config_PositionConfig_PositionFlags_SEQ_NO = 64,
|
||||
/* Include positional timestamp (from GPS solution) */
|
||||
Config_PositionConfig_PositionFlags_TIMESTAMP = 128,
|
||||
/* Include positional heading
|
||||
Intended for use with vehicle not walking speeds
|
||||
walking speeds are likely to be error prone like the compass */
|
||||
Config_PositionConfig_PositionFlags_HEADING = 256,
|
||||
/* Include positional speed
|
||||
Intended for use with vehicle not walking speeds
|
||||
walking speeds are likely to be error prone like the compass */
|
||||
Config_PositionConfig_PositionFlags_SPEED = 512
|
||||
} Config_PositionConfig_PositionFlags;
|
||||
|
||||
typedef enum _Config_NetworkConfig_EthMode {
|
||||
Config_NetworkConfig_EthMode_DHCP = 0,
|
||||
Config_NetworkConfig_EthMode_STATIC = 1
|
||||
typedef enum _Config_NetworkConfig_EthMode {
|
||||
/* obtain ip address via DHCP */
|
||||
Config_NetworkConfig_EthMode_DHCP = 0,
|
||||
/* use static ip address */
|
||||
Config_NetworkConfig_EthMode_STATIC = 1
|
||||
} Config_NetworkConfig_EthMode;
|
||||
|
||||
typedef enum _Config_DisplayConfig_GpsCoordinateFormat {
|
||||
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
|
||||
/* How the GPS coordinates are displayed on the OLED screen. */
|
||||
typedef enum _Config_DisplayConfig_GpsCoordinateFormat {
|
||||
/* GPS coordinates are displayed in the normal decimal degrees format:
|
||||
DD.DDDDDD DDD.DDDDDD */
|
||||
Config_DisplayConfig_GpsCoordinateFormat_DEC = 0,
|
||||
/* GPS coordinates are displayed in the degrees minutes seconds format:
|
||||
DD°MM'SS"C DDD°MM'SS"C, where C is the compass point representing the locations quadrant */
|
||||
Config_DisplayConfig_GpsCoordinateFormat_DMS = 1,
|
||||
/* Universal Transverse Mercator format:
|
||||
ZZB EEEEEE NNNNNNN, where Z is zone, B is band, E is easting, N is northing */
|
||||
Config_DisplayConfig_GpsCoordinateFormat_UTM = 2,
|
||||
/* Military Grid Reference System format:
|
||||
ZZB CD EEEEE NNNNN, where Z is zone, B is band, C is the east 100k square, D is the north 100k square,
|
||||
E is easting, N is northing */
|
||||
Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3,
|
||||
/* Open Location Code (aka Plus Codes). */
|
||||
Config_DisplayConfig_GpsCoordinateFormat_OLC = 4,
|
||||
/* Ordnance Survey Grid Reference (the National Grid System of the UK).
|
||||
Format: AB EEEEE NNNNN, where A is the east 100k square, B is the north 100k square,
|
||||
E is the easting, N is the northing */
|
||||
Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5
|
||||
} Config_DisplayConfig_GpsCoordinateFormat;
|
||||
|
||||
typedef enum _Config_DisplayConfig_DisplayUnits {
|
||||
Config_DisplayConfig_DisplayUnits_METRIC = 0,
|
||||
Config_DisplayConfig_DisplayUnits_IMPERIAL = 1
|
||||
/* Unit display preference */
|
||||
typedef enum _Config_DisplayConfig_DisplayUnits {
|
||||
/* Metric (Default) */
|
||||
Config_DisplayConfig_DisplayUnits_METRIC = 0,
|
||||
/* Imperial */
|
||||
Config_DisplayConfig_DisplayUnits_IMPERIAL = 1
|
||||
} Config_DisplayConfig_DisplayUnits;
|
||||
|
||||
typedef enum _Config_DisplayConfig_OledType {
|
||||
Config_DisplayConfig_OledType_OLED_AUTO = 0,
|
||||
Config_DisplayConfig_OledType_OLED_SSD1306 = 1,
|
||||
Config_DisplayConfig_OledType_OLED_SH1106 = 2
|
||||
/* Override OLED outo detect with this if it fails. */
|
||||
typedef enum _Config_DisplayConfig_OledType {
|
||||
/* Default / Auto */
|
||||
Config_DisplayConfig_OledType_OLED_AUTO = 0,
|
||||
/* Default / Auto */
|
||||
Config_DisplayConfig_OledType_OLED_SSD1306 = 1,
|
||||
/* Default / Auto */
|
||||
Config_DisplayConfig_OledType_OLED_SH1106 = 2
|
||||
} Config_DisplayConfig_OledType;
|
||||
|
||||
typedef enum _Config_LoRaConfig_RegionCode {
|
||||
Config_LoRaConfig_RegionCode_UNSET = 0,
|
||||
Config_LoRaConfig_RegionCode_US = 1,
|
||||
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,
|
||||
Config_LoRaConfig_RegionCode_KR = 7,
|
||||
Config_LoRaConfig_RegionCode_TW = 8,
|
||||
Config_LoRaConfig_RegionCode_RU = 9,
|
||||
Config_LoRaConfig_RegionCode_IN = 10,
|
||||
Config_LoRaConfig_RegionCode_NZ_865 = 11,
|
||||
Config_LoRaConfig_RegionCode_TH = 12,
|
||||
Config_LoRaConfig_RegionCode_LORA_24 = 13
|
||||
typedef enum _Config_LoRaConfig_RegionCode {
|
||||
/* Region is not set */
|
||||
Config_LoRaConfig_RegionCode_UNSET = 0,
|
||||
/* United States */
|
||||
Config_LoRaConfig_RegionCode_US = 1,
|
||||
/* European Union 433mhz */
|
||||
Config_LoRaConfig_RegionCode_EU_433 = 2,
|
||||
/* European Union 433mhz */
|
||||
Config_LoRaConfig_RegionCode_EU_868 = 3,
|
||||
/* China */
|
||||
Config_LoRaConfig_RegionCode_CN = 4,
|
||||
/* Japan */
|
||||
Config_LoRaConfig_RegionCode_JP = 5,
|
||||
/* Australia / New Zealand */
|
||||
Config_LoRaConfig_RegionCode_ANZ = 6,
|
||||
/* Korea */
|
||||
Config_LoRaConfig_RegionCode_KR = 7,
|
||||
/* Taiwan */
|
||||
Config_LoRaConfig_RegionCode_TW = 8,
|
||||
/* Russia */
|
||||
Config_LoRaConfig_RegionCode_RU = 9,
|
||||
/* India */
|
||||
Config_LoRaConfig_RegionCode_IN = 10,
|
||||
/* New Zealand 865mhz */
|
||||
Config_LoRaConfig_RegionCode_NZ_865 = 11,
|
||||
/* Thailand */
|
||||
Config_LoRaConfig_RegionCode_TH = 12,
|
||||
/* WLAN Band */
|
||||
Config_LoRaConfig_RegionCode_LORA_24 = 13
|
||||
} Config_LoRaConfig_RegionCode;
|
||||
|
||||
typedef enum _Config_LoRaConfig_ModemPreset {
|
||||
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
|
||||
/* Standard predefined channel settings
|
||||
Note: these mappings must match ModemPreset Choice in the device code. */
|
||||
typedef enum _Config_LoRaConfig_ModemPreset {
|
||||
/* Long Range - Fast */
|
||||
Config_LoRaConfig_ModemPreset_LONG_FAST = 0,
|
||||
/* Long Range - Slow */
|
||||
Config_LoRaConfig_ModemPreset_LONG_SLOW = 1,
|
||||
/* Very Long Range - Slow */
|
||||
Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2,
|
||||
/* Medium Range - Slow */
|
||||
Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3,
|
||||
/* Medium Range - Fast */
|
||||
Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4,
|
||||
/* Short Range - Slow */
|
||||
Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5,
|
||||
/* Short Range - Fast */
|
||||
Config_LoRaConfig_ModemPreset_SHORT_FAST = 6
|
||||
} Config_LoRaConfig_ModemPreset;
|
||||
|
||||
typedef enum _Config_BluetoothConfig_PairingMode {
|
||||
Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0,
|
||||
Config_BluetoothConfig_PairingMode_FIXED_PIN = 1,
|
||||
Config_BluetoothConfig_PairingMode_NO_PIN = 2
|
||||
typedef enum _Config_BluetoothConfig_PairingMode {
|
||||
/* Device generates a random pin that will be shown on the screen of the device for pairing */
|
||||
Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0,
|
||||
/* Device requires a specified fixed pin for pairing */
|
||||
Config_BluetoothConfig_PairingMode_FIXED_PIN = 1,
|
||||
/* Device requires no pin for pairing */
|
||||
Config_BluetoothConfig_PairingMode_NO_PIN = 2
|
||||
} Config_BluetoothConfig_PairingMode;
|
||||
|
||||
/* Struct definitions */
|
||||
typedef struct _Config_BluetoothConfig {
|
||||
bool enabled;
|
||||
Config_BluetoothConfig_PairingMode mode;
|
||||
uint32_t fixed_pin;
|
||||
} Config_BluetoothConfig;
|
||||
|
||||
typedef struct _Config_DeviceConfig {
|
||||
/* Configuration */
|
||||
typedef struct _Config_DeviceConfig {
|
||||
/* Sets the role of node */
|
||||
Config_DeviceConfig_Role role;
|
||||
/* Disabling this will disable the SerialConsole by not initilizing the StreamAPI */
|
||||
bool serial_enabled;
|
||||
/* By default we turn off logging as soon as an API client connects (to keep shared serial link quiet).
|
||||
Set this to true to leave the debug log outputting even when API is active. */
|
||||
bool debug_log_enabled;
|
||||
/* For boards without a hard wired button, this is the pin number that will be used
|
||||
Boards that have more than one button can swap the function with this one. defaults to BUTTON_PIN if defined. */
|
||||
uint32_t button_gpio;
|
||||
/* For boards without a PWM buzzer, this is the pin number that will be used
|
||||
Defaults to PIN_BUZZER if defined. */
|
||||
uint32_t buzzer_gpio;
|
||||
} Config_DeviceConfig;
|
||||
|
||||
typedef struct _Config_DisplayConfig {
|
||||
uint32_t screen_on_secs;
|
||||
Config_DisplayConfig_GpsCoordinateFormat gps_format;
|
||||
uint32_t auto_screen_carousel_secs;
|
||||
bool compass_north_top;
|
||||
bool flip_screen;
|
||||
Config_DisplayConfig_DisplayUnits units;
|
||||
Config_DisplayConfig_OledType oled;
|
||||
} Config_DisplayConfig;
|
||||
|
||||
typedef struct _Config_LoRaConfig {
|
||||
bool use_preset;
|
||||
Config_LoRaConfig_ModemPreset modem_preset;
|
||||
uint16_t bandwidth;
|
||||
uint32_t spread_factor;
|
||||
uint8_t coding_rate;
|
||||
float frequency_offset;
|
||||
Config_LoRaConfig_RegionCode region;
|
||||
uint32_t hop_limit;
|
||||
bool tx_enabled;
|
||||
int8_t tx_power;
|
||||
uint16_t channel_num;
|
||||
bool override_duty_cycle;
|
||||
pb_size_t ignore_incoming_count;
|
||||
uint32_t ignore_incoming[3];
|
||||
} Config_LoRaConfig;
|
||||
|
||||
typedef struct _Config_NetworkConfig_IpV4Config {
|
||||
uint32_t ip;
|
||||
uint32_t gateway;
|
||||
uint32_t subnet;
|
||||
uint32_t dns;
|
||||
} Config_NetworkConfig_IpV4Config;
|
||||
|
||||
typedef struct _Config_PositionConfig {
|
||||
/* Position Config */
|
||||
typedef struct _Config_PositionConfig {
|
||||
/* We should send our position this often (but only if it has changed significantly)
|
||||
Defaults to 15 minutes */
|
||||
uint32_t position_broadcast_secs;
|
||||
/* Adaptive position braoadcast, which is now the default. */
|
||||
bool position_broadcast_smart_enabled;
|
||||
/* If set, this node is at a fixed position.
|
||||
We will generate GPS position updates at the regular interval, but use whatever the last lat/lon/alt we have for the node.
|
||||
The lat/lon/alt can be set by an internal GPS or with the help of the app. */
|
||||
bool fixed_position;
|
||||
/* Is GPS enabled for this node? */
|
||||
bool gps_enabled;
|
||||
/* How often should we try to get GPS position (in seconds)
|
||||
or zero for the default of once every 30 seconds
|
||||
or a very large value (maxint) to update only once at boot. */
|
||||
uint32_t gps_update_interval;
|
||||
/* How long should we try to get our position during each gps_update_interval attempt? (in seconds)
|
||||
Or if zero, use the default of 30 seconds.
|
||||
If we don't get a new gps fix in that time, the gps will be put into sleep until the next gps_update_rate
|
||||
window. */
|
||||
uint32_t gps_attempt_time;
|
||||
/* Bit field of boolean configuration options for POSITION messages
|
||||
(bitwise OR of PositionFlags) */
|
||||
uint32_t position_flags;
|
||||
/* (Re)define GPS_RX_PIN for your board. */
|
||||
uint32_t rx_gpio;
|
||||
/* (Re)define GPS_TX_PIN for your board. */
|
||||
uint32_t tx_gpio;
|
||||
} Config_PositionConfig;
|
||||
|
||||
typedef struct _Config_PowerConfig {
|
||||
/* Power Config\
|
||||
See [Power Config](/docs/settings/config/power) for additional power config details. */
|
||||
typedef struct _Config_PowerConfig {
|
||||
/* If set, we are powered from a low-current source (i.e. solar), so even if it looks like we have power flowing in
|
||||
we should try to minimize power consumption as much as possible.
|
||||
YOU DO NOT NEED TO SET THIS IF YOU'VE set is_router (it is implied in that case).
|
||||
Advanced Option */
|
||||
bool is_power_saving;
|
||||
/* If non-zero, the device will fully power off this many seconds after external power is removed. */
|
||||
uint32_t on_battery_shutdown_after_secs;
|
||||
/* Ratio of voltage divider for battery pin eg. 3.20 (R1=100k, R2=220k)
|
||||
Overrides the ADC_MULTIPLIER defined in variant for battery voltage calculation.
|
||||
Should be set to floating point value between 2 and 4
|
||||
Fixes issues on Heltec v2 */
|
||||
float adc_multiplier_override;
|
||||
/* Wait Bluetooth Seconds
|
||||
The number of seconds for to wait before turning off BLE in No Bluetooth states
|
||||
0 for default of 1 minute */
|
||||
uint32_t wait_bluetooth_secs;
|
||||
/* Mesh Super Deep Sleep Timeout Seconds
|
||||
While in Light Sleep if this value is exceeded we will lower into super deep sleep
|
||||
for sds_secs (default 1 year) or a button press
|
||||
0 for default of two hours, MAXUINT for disabled */
|
||||
uint32_t mesh_sds_timeout_secs;
|
||||
/* Super Deep Sleep Seconds
|
||||
While in Light Sleep if mesh_sds_timeout_secs is exceeded we will lower into super deep sleep
|
||||
for this value (default 1 year) or a button press
|
||||
0 for default of one year */
|
||||
uint32_t sds_secs;
|
||||
/* Light Sleep Seconds
|
||||
In light sleep the CPU is suspended, LoRa radio is on, BLE is off an GPS is on
|
||||
ESP32 Only
|
||||
0 for default of 300 */
|
||||
uint32_t ls_secs;
|
||||
/* Minimum Wake Seconds
|
||||
While in light sleep when we receive packets on the LoRa radio we will wake and handle them and stay awake in no BLE mode for this value
|
||||
0 for default of 10 seconds */
|
||||
uint32_t min_wake_secs;
|
||||
} Config_PowerConfig;
|
||||
|
||||
typedef struct _Config_NetworkConfig {
|
||||
typedef struct _Config_NetworkConfig_IpV4Config {
|
||||
/* Static IP address */
|
||||
uint32_t ip;
|
||||
/* Static gateway address */
|
||||
uint32_t gateway;
|
||||
/* Static subnet mask */
|
||||
uint32_t subnet;
|
||||
/* Static DNS server address */
|
||||
uint32_t dns;
|
||||
} Config_NetworkConfig_IpV4Config;
|
||||
|
||||
/* Network Config */
|
||||
typedef struct _Config_NetworkConfig {
|
||||
/* Enable WiFi (disables Bluetooth) */
|
||||
bool wifi_enabled;
|
||||
/* If set, this node will try to join the specified wifi network and
|
||||
acquire an address via DHCP */
|
||||
char wifi_ssid[33];
|
||||
/* If set, will be use to authenticate to the named wifi */
|
||||
char wifi_psk[64];
|
||||
/* NTP server to use if WiFi is conneced, defaults to `0.pool.ntp.org` */
|
||||
char ntp_server[33];
|
||||
/* Enable Ethernet */
|
||||
bool eth_enabled;
|
||||
/* acquire an address via DHCP or assign static */
|
||||
Config_NetworkConfig_EthMode eth_mode;
|
||||
/* struct to keep static address */
|
||||
bool has_ipv4_config;
|
||||
Config_NetworkConfig_IpV4Config ipv4_config;
|
||||
} Config_NetworkConfig;
|
||||
|
||||
typedef struct _Config {
|
||||
/* Display Config */
|
||||
typedef struct _Config_DisplayConfig {
|
||||
/* Number of seconds the screen stays on after pressing the user button or receiving a message
|
||||
0 for default of one minute MAXUINT for always on */
|
||||
uint32_t screen_on_secs;
|
||||
/* How the GPS coordinates are formatted on the OLED screen. */
|
||||
Config_DisplayConfig_GpsCoordinateFormat gps_format;
|
||||
/* Automatically toggles to the next page on the screen like a carousel, based the specified interval in seconds.
|
||||
Potentially useful for devices without user buttons. */
|
||||
uint32_t auto_screen_carousel_secs;
|
||||
/* If this is set, the displayed compass will always point north. if unset, the old behaviour
|
||||
(top of display is heading direction) is used. */
|
||||
bool compass_north_top;
|
||||
/* Flip screen vertically, for cases that mount the screen upside down */
|
||||
bool flip_screen;
|
||||
/* Perferred display units */
|
||||
Config_DisplayConfig_DisplayUnits units;
|
||||
/* Override auto-detect in screen */
|
||||
Config_DisplayConfig_OledType oled;
|
||||
} Config_DisplayConfig;
|
||||
|
||||
/* Lora Config */
|
||||
typedef struct _Config_LoRaConfig {
|
||||
/* When enabled, the `modem_preset` fields will be adheared to, else the `bandwidth`/`spread_factor`/`coding_rate`
|
||||
will be taked from their respective manually defined fields */
|
||||
bool use_preset;
|
||||
/* Either modem_config or bandwidth/spreading/coding will be specified - NOT BOTH.
|
||||
As a heuristic: If bandwidth is specified, do not use modem_config.
|
||||
Because protobufs take ZERO space when the value is zero this works out nicely.
|
||||
This value is replaced by bandwidth/spread_factor/coding_rate.
|
||||
If you'd like to experiment with other options add them to MeshRadio.cpp in the device code. */
|
||||
Config_LoRaConfig_ModemPreset modem_preset;
|
||||
/* Bandwidth in MHz
|
||||
Certain bandwidth numbers are 'special' and will be converted to the
|
||||
appropriate floating point value: 31 -> 31.25MHz */
|
||||
uint16_t bandwidth;
|
||||
/* A number from 7 to 12.
|
||||
Indicates number of chirps per symbol as 1<<spread_factor. */
|
||||
uint32_t spread_factor;
|
||||
/* The denominator of the coding rate.
|
||||
ie for 4/5, the value is 5. 4/8 the value is 8. */
|
||||
uint8_t coding_rate;
|
||||
/* This parameter is for advanced users with advanced test equipment, we do not recommend most users use it.
|
||||
A frequency offset that is added to to the calculated band center frequency.
|
||||
Used to correct for crystal calibration errors. */
|
||||
float frequency_offset;
|
||||
/* The region code for the radio (US, CN, EU433, etc...) */
|
||||
Config_LoRaConfig_RegionCode region;
|
||||
/* Maximum number of hops. This can't be greater than 7.
|
||||
Default of 3 */
|
||||
uint32_t hop_limit;
|
||||
/* Disable TX from the LoRa radio. Useful for hot-swapping antennas and other tests.
|
||||
Defaults to false */
|
||||
bool tx_enabled;
|
||||
/* If zero then, use default max legal continuous power (ie. something that won't
|
||||
burn out the radio hardware)
|
||||
In most cases you should use zero here.
|
||||
Units are in dBm. */
|
||||
int8_t tx_power;
|
||||
/* This is controlling the actual hardware frequency the radio is transmitting on.
|
||||
Most users should never need to be exposed to this field/concept.
|
||||
A channel number between 1 and NUM_CHANNELS (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). */
|
||||
uint16_t channel_num;
|
||||
/* If true, duty cycle limits will be exceeded and thus you're possibly not following
|
||||
the local regulations if you're not a HAM.
|
||||
Has no effect if the duty cycle of the used region is 100%. */
|
||||
bool override_duty_cycle;
|
||||
/* For testing it is useful sometimes to force a node to never listen to
|
||||
particular other nodes (simulating radio out of range). All nodenums listed
|
||||
in ignore_incoming will have packets they send droped on receive (by router.cpp) */
|
||||
pb_size_t ignore_incoming_count;
|
||||
uint32_t ignore_incoming[3];
|
||||
} Config_LoRaConfig;
|
||||
|
||||
typedef struct _Config_BluetoothConfig {
|
||||
/* Enable Bluetooth on the device */
|
||||
bool enabled;
|
||||
/* Determines the pairing strategy for the device */
|
||||
Config_BluetoothConfig_PairingMode mode;
|
||||
/* Specified pin for PairingMode.FixedPin */
|
||||
uint32_t fixed_pin;
|
||||
} Config_BluetoothConfig;
|
||||
|
||||
typedef struct _Config {
|
||||
pb_size_t which_payload_variant;
|
||||
union {
|
||||
Config_DeviceConfig device;
|
||||
@@ -186,6 +388,10 @@ typedef struct _Config {
|
||||
} Config;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Helper constants for enums */
|
||||
#define _Config_DeviceConfig_Role_MIN Config_DeviceConfig_Role_CLIENT
|
||||
#define _Config_DeviceConfig_Role_MAX Config_DeviceConfig_Role_ROUTER_CLIENT
|
||||
@@ -224,9 +430,22 @@ typedef struct _Config {
|
||||
#define _Config_BluetoothConfig_PairingMode_ARRAYSIZE ((Config_BluetoothConfig_PairingMode)(Config_BluetoothConfig_PairingMode_NO_PIN+1))
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#define Config_DeviceConfig_role_ENUMTYPE Config_DeviceConfig_Role
|
||||
|
||||
|
||||
|
||||
#define Config_NetworkConfig_eth_mode_ENUMTYPE Config_NetworkConfig_EthMode
|
||||
|
||||
|
||||
#define Config_DisplayConfig_gps_format_ENUMTYPE Config_DisplayConfig_GpsCoordinateFormat
|
||||
#define Config_DisplayConfig_units_ENUMTYPE Config_DisplayConfig_DisplayUnits
|
||||
#define Config_DisplayConfig_oled_ENUMTYPE Config_DisplayConfig_OledType
|
||||
|
||||
#define Config_LoRaConfig_modem_preset_ENUMTYPE Config_LoRaConfig_ModemPreset
|
||||
#define Config_LoRaConfig_region_ENUMTYPE Config_LoRaConfig_RegionCode
|
||||
|
||||
#define Config_BluetoothConfig_mode_ENUMTYPE Config_BluetoothConfig_PairingMode
|
||||
|
||||
|
||||
/* Initializer values for message structs */
|
||||
#define Config_init_default {0, {Config_DeviceConfig_init_default}}
|
||||
@@ -249,14 +468,39 @@ extern "C" {
|
||||
#define Config_BluetoothConfig_init_zero {0, _Config_BluetoothConfig_PairingMode_MIN, 0}
|
||||
|
||||
/* Field tags (for use in manual encoding/decoding) */
|
||||
#define Config_BluetoothConfig_enabled_tag 1
|
||||
#define Config_BluetoothConfig_mode_tag 2
|
||||
#define Config_BluetoothConfig_fixed_pin_tag 3
|
||||
#define Config_DeviceConfig_role_tag 1
|
||||
#define Config_DeviceConfig_serial_enabled_tag 2
|
||||
#define Config_DeviceConfig_debug_log_enabled_tag 3
|
||||
#define Config_DeviceConfig_button_gpio_tag 4
|
||||
#define Config_DeviceConfig_buzzer_gpio_tag 5
|
||||
#define Config_PositionConfig_position_broadcast_secs_tag 1
|
||||
#define Config_PositionConfig_position_broadcast_smart_enabled_tag 2
|
||||
#define Config_PositionConfig_fixed_position_tag 3
|
||||
#define Config_PositionConfig_gps_enabled_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_PositionConfig_rx_gpio_tag 8
|
||||
#define Config_PositionConfig_tx_gpio_tag 9
|
||||
#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_NetworkConfig_IpV4Config_ip_tag 1
|
||||
#define Config_NetworkConfig_IpV4Config_gateway_tag 2
|
||||
#define Config_NetworkConfig_IpV4Config_subnet_tag 3
|
||||
#define Config_NetworkConfig_IpV4Config_dns_tag 4
|
||||
#define Config_NetworkConfig_wifi_enabled_tag 1
|
||||
#define Config_NetworkConfig_wifi_ssid_tag 3
|
||||
#define Config_NetworkConfig_wifi_psk_tag 4
|
||||
#define Config_NetworkConfig_ntp_server_tag 5
|
||||
#define Config_NetworkConfig_eth_enabled_tag 6
|
||||
#define Config_NetworkConfig_eth_mode_tag 7
|
||||
#define Config_NetworkConfig_ipv4_config_tag 8
|
||||
#define Config_DisplayConfig_screen_on_secs_tag 1
|
||||
#define Config_DisplayConfig_gps_format_tag 2
|
||||
#define Config_DisplayConfig_auto_screen_carousel_secs_tag 3
|
||||
@@ -277,34 +521,9 @@ extern "C" {
|
||||
#define Config_LoRaConfig_channel_num_tag 11
|
||||
#define Config_LoRaConfig_override_duty_cycle_tag 12
|
||||
#define Config_LoRaConfig_ignore_incoming_tag 103
|
||||
#define Config_NetworkConfig_IpV4Config_ip_tag 1
|
||||
#define Config_NetworkConfig_IpV4Config_gateway_tag 2
|
||||
#define Config_NetworkConfig_IpV4Config_subnet_tag 3
|
||||
#define Config_NetworkConfig_IpV4Config_dns_tag 4
|
||||
#define Config_PositionConfig_position_broadcast_secs_tag 1
|
||||
#define Config_PositionConfig_position_broadcast_smart_enabled_tag 2
|
||||
#define Config_PositionConfig_fixed_position_tag 3
|
||||
#define Config_PositionConfig_gps_enabled_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_PositionConfig_rx_gpio_tag 8
|
||||
#define Config_PositionConfig_tx_gpio_tag 9
|
||||
#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_NetworkConfig_wifi_enabled_tag 1
|
||||
#define Config_NetworkConfig_wifi_ssid_tag 3
|
||||
#define Config_NetworkConfig_wifi_psk_tag 4
|
||||
#define Config_NetworkConfig_ntp_server_tag 5
|
||||
#define Config_NetworkConfig_eth_enabled_tag 6
|
||||
#define Config_NetworkConfig_eth_mode_tag 7
|
||||
#define Config_NetworkConfig_ipv4_config_tag 8
|
||||
#define Config_BluetoothConfig_enabled_tag 1
|
||||
#define Config_BluetoothConfig_mode_tag 2
|
||||
#define Config_BluetoothConfig_fixed_pin_tag 3
|
||||
#define Config_device_tag 1
|
||||
#define Config_position_tag 2
|
||||
#define Config_power_tag 3
|
||||
|
||||
Reference in New Issue
Block a user