/* Automatically generated nanopb header */ /* Generated by nanopb-0.4.7 */ #ifndef PB_MESHTASTIC_MESHTASTIC_CONFIG_PB_H_INCLUDED #define PB_MESHTASTIC_MESHTASTIC_CONFIG_PB_H_INCLUDED #include #if PB_PROTO_HEADER_VERSION != 40 #error Regenerate this file with the current version of nanopb generator. #endif /* Enum definitions */ /* Defines the device's role on the Mesh network */ typedef enum _meshtastic_Config_DeviceConfig_Role { /* Client device role */ meshtastic_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. */ meshtastic_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. This mode may still potentially have higher power usage due to it's preference in message rebroadcasting on the mesh. */ meshtastic_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. */ meshtastic_Config_DeviceConfig_Role_ROUTER_CLIENT = 3, /* Repeater device role Mesh packets will simply be rebroadcasted over this node. Nodes configured with this role will not originate NodeInfo, Position, Telemetry or any other packet type. They will simply rebroadcast any mesh packets on the same frequency, channel num, spread factor, and coding rate. */ meshtastic_Config_DeviceConfig_Role_REPEATER = 4, /* Tracker device role Position Mesh packets will be prioritized higher and sent more frequently by default. */ meshtastic_Config_DeviceConfig_Role_TRACKER = 5, /* Sensor device role Telemetry Mesh packets will be prioritized higher and sent more frequently by default. */ meshtastic_Config_DeviceConfig_Role_SENSOR = 6 } meshtastic_Config_DeviceConfig_Role; /* Defines the device's behavior for how messages are rebroadcast */ typedef enum _meshtastic_Config_DeviceConfig_RebroadcastMode { /* Default behavior. Rebroadcast any observed message, if it was on our private channel or from another mesh with the same lora params. */ meshtastic_Config_DeviceConfig_RebroadcastMode_ALL = 0, /* Same as behavior as ALL but skips packet decoding and simply rebroadcasts them. Only available in Repeater role. Setting this on any other roles will result in ALL behavior. */ meshtastic_Config_DeviceConfig_RebroadcastMode_ALL_SKIP_DECODING = 1, /* Ignores observed messages from foreign meshes that are open or those which it cannot decrypt. Only rebroadcasts message on the nodes local primary / secondary channels. */ meshtastic_Config_DeviceConfig_RebroadcastMode_LOCAL_ONLY = 2 } meshtastic_Config_DeviceConfig_RebroadcastMode; /* 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 _meshtastic_Config_PositionConfig_PositionFlags { /* Required for compilation */ meshtastic_Config_PositionConfig_PositionFlags_UNSET = 0, /* Include an altitude value (if available) */ meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE = 1, /* Altitude value is MSL */ meshtastic_Config_PositionConfig_PositionFlags_ALTITUDE_MSL = 2, /* Include geoidal separation */ meshtastic_Config_PositionConfig_PositionFlags_GEOIDAL_SEPARATION = 4, /* Include the DOP value ; PDOP used by default, see below */ meshtastic_Config_PositionConfig_PositionFlags_DOP = 8, /* If POS_DOP set, send separate HDOP / VDOP values instead of PDOP */ meshtastic_Config_PositionConfig_PositionFlags_HVDOP = 16, /* Include number of "satellites in view" */ meshtastic_Config_PositionConfig_PositionFlags_SATINVIEW = 32, /* Include a sequence number incremented per packet */ meshtastic_Config_PositionConfig_PositionFlags_SEQ_NO = 64, /* Include positional timestamp (from GPS solution) */ meshtastic_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 */ meshtastic_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 */ meshtastic_Config_PositionConfig_PositionFlags_SPEED = 512 } meshtastic_Config_PositionConfig_PositionFlags; typedef enum _meshtastic_Config_NetworkConfig_AddressMode { /* obtain ip address via DHCP */ meshtastic_Config_NetworkConfig_AddressMode_DHCP = 0, /* use static ip address */ meshtastic_Config_NetworkConfig_AddressMode_STATIC = 1 } meshtastic_Config_NetworkConfig_AddressMode; /* How the GPS coordinates are displayed on the OLED screen. */ typedef enum _meshtastic_Config_DisplayConfig_GpsCoordinateFormat { /* GPS coordinates are displayed in the normal decimal degrees format: DD.DDDDDD DDD.DDDDDD */ meshtastic_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 */ meshtastic_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 */ meshtastic_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 */ meshtastic_Config_DisplayConfig_GpsCoordinateFormat_MGRS = 3, /* Open Location Code (aka Plus Codes). */ meshtastic_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 */ meshtastic_Config_DisplayConfig_GpsCoordinateFormat_OSGR = 5 } meshtastic_Config_DisplayConfig_GpsCoordinateFormat; /* Unit display preference */ typedef enum _meshtastic_Config_DisplayConfig_DisplayUnits { /* Metric (Default) */ meshtastic_Config_DisplayConfig_DisplayUnits_METRIC = 0, /* Imperial */ meshtastic_Config_DisplayConfig_DisplayUnits_IMPERIAL = 1 } meshtastic_Config_DisplayConfig_DisplayUnits; /* Override OLED outo detect with this if it fails. */ typedef enum _meshtastic_Config_DisplayConfig_OledType { /* Default / Auto */ meshtastic_Config_DisplayConfig_OledType_OLED_AUTO = 0, /* Default / Auto */ meshtastic_Config_DisplayConfig_OledType_OLED_SSD1306 = 1, /* Default / Auto */ meshtastic_Config_DisplayConfig_OledType_OLED_SH1106 = 2, /* Can not be auto detected but set by proto. Used for 128x128 screens */ meshtastic_Config_DisplayConfig_OledType_OLED_SH1107 = 3 } meshtastic_Config_DisplayConfig_OledType; typedef enum _meshtastic_Config_DisplayConfig_DisplayMode { /* Default. The old style for the 128x64 OLED screen */ meshtastic_Config_DisplayConfig_DisplayMode_DEFAULT = 0, /* Rearrange display elements to cater for bicolor OLED displays */ meshtastic_Config_DisplayConfig_DisplayMode_TWOCOLOR = 1, /* Same as TwoColor, but with inverted top bar. Not so good for Epaper displays */ meshtastic_Config_DisplayConfig_DisplayMode_INVERTED = 2, /* TFT Full Color Displays (not implemented yet) */ meshtastic_Config_DisplayConfig_DisplayMode_COLOR = 3 } meshtastic_Config_DisplayConfig_DisplayMode; typedef enum _meshtastic_Config_LoRaConfig_RegionCode { /* Region is not set */ meshtastic_Config_LoRaConfig_RegionCode_UNSET = 0, /* United States */ meshtastic_Config_LoRaConfig_RegionCode_US = 1, /* European Union 433mhz */ meshtastic_Config_LoRaConfig_RegionCode_EU_433 = 2, /* European Union 868mhz */ meshtastic_Config_LoRaConfig_RegionCode_EU_868 = 3, /* China */ meshtastic_Config_LoRaConfig_RegionCode_CN = 4, /* Japan */ meshtastic_Config_LoRaConfig_RegionCode_JP = 5, /* Australia / New Zealand */ meshtastic_Config_LoRaConfig_RegionCode_ANZ = 6, /* Korea */ meshtastic_Config_LoRaConfig_RegionCode_KR = 7, /* Taiwan */ meshtastic_Config_LoRaConfig_RegionCode_TW = 8, /* Russia */ meshtastic_Config_LoRaConfig_RegionCode_RU = 9, /* India */ meshtastic_Config_LoRaConfig_RegionCode_IN = 10, /* New Zealand 865mhz */ meshtastic_Config_LoRaConfig_RegionCode_NZ_865 = 11, /* Thailand */ meshtastic_Config_LoRaConfig_RegionCode_TH = 12, /* WLAN Band */ meshtastic_Config_LoRaConfig_RegionCode_LORA_24 = 13, /* Ukraine 433mhz */ meshtastic_Config_LoRaConfig_RegionCode_UA_433 = 14, /* Ukraine 868mhz */ meshtastic_Config_LoRaConfig_RegionCode_UA_868 = 15 } meshtastic_Config_LoRaConfig_RegionCode; /* Standard predefined channel settings Note: these mappings must match ModemPreset Choice in the device code. */ typedef enum _meshtastic_Config_LoRaConfig_ModemPreset { /* Long Range - Fast */ meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST = 0, /* Long Range - Slow */ meshtastic_Config_LoRaConfig_ModemPreset_LONG_SLOW = 1, /* Very Long Range - Slow */ meshtastic_Config_LoRaConfig_ModemPreset_VERY_LONG_SLOW = 2, /* Medium Range - Slow */ meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_SLOW = 3, /* Medium Range - Fast */ meshtastic_Config_LoRaConfig_ModemPreset_MEDIUM_FAST = 4, /* Short Range - Slow */ meshtastic_Config_LoRaConfig_ModemPreset_SHORT_SLOW = 5, /* Short Range - Fast */ meshtastic_Config_LoRaConfig_ModemPreset_SHORT_FAST = 6, /* Long Range - Moderately Fast */ meshtastic_Config_LoRaConfig_ModemPreset_LONG_MODERATE = 7 } meshtastic_Config_LoRaConfig_ModemPreset; typedef enum _meshtastic_Config_BluetoothConfig_PairingMode { /* Device generates a random PIN that will be shown on the screen of the device for pairing */ meshtastic_Config_BluetoothConfig_PairingMode_RANDOM_PIN = 0, /* Device requires a specified fixed PIN for pairing */ meshtastic_Config_BluetoothConfig_PairingMode_FIXED_PIN = 1, /* Device requires no PIN for pairing */ meshtastic_Config_BluetoothConfig_PairingMode_NO_PIN = 2 } meshtastic_Config_BluetoothConfig_PairingMode; /* Struct definitions */ /* Configuration */ typedef struct _meshtastic_Config_DeviceConfig { /* Sets the role of node */ meshtastic_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; /* Sets the role of node */ meshtastic_Config_DeviceConfig_RebroadcastMode rebroadcast_mode; /* Send our nodeinfo this often Defaults to 900 Seconds (15 minutes) */ uint32_t node_info_broadcast_secs; /* Treat double tap interrupt on supported accelerometers as a button press if set to true */ bool double_tap_as_button_press; /* If true, device is considered to be "managed" by a mesh administrator Clients should then limit available configuration and administrative options inside the user interface */ bool is_managed; } meshtastic_Config_DeviceConfig; /* Position Config */ typedef struct _meshtastic_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; /* The minimum distance in meters traveled (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled */ uint32_t broadcast_smart_minimum_distance; /* The minimum number of seconds (since the last send) before we can send a position to the mesh if position_broadcast_smart_enabled */ uint32_t broadcast_smart_minimum_interval_secs; } meshtastic_Config_PositionConfig; /* Power Config\ See [Power Config](/docs/settings/config/power) for additional power config details. */ typedef struct _meshtastic_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; /* 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; /* I2C address of INA_2XX to use for reading device battery voltage */ uint8_t device_battery_ina_address; } meshtastic_Config_PowerConfig; typedef struct _meshtastic_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; } meshtastic_Config_NetworkConfig_IpV4Config; /* Network Config */ typedef struct _meshtastic_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 */ meshtastic_Config_NetworkConfig_AddressMode address_mode; /* struct to keep static address */ bool has_ipv4_config; meshtastic_Config_NetworkConfig_IpV4Config ipv4_config; /* rsyslog Server and Port */ char rsyslog_server[33]; } meshtastic_Config_NetworkConfig; /* Display Config */ typedef struct _meshtastic_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. */ meshtastic_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 */ meshtastic_Config_DisplayConfig_DisplayUnits units; /* Override auto-detect in screen */ meshtastic_Config_DisplayConfig_OledType oled; /* Display Mode */ meshtastic_Config_DisplayConfig_DisplayMode displaymode; /* Print first line in pseudo-bold? FALSE is original style, TRUE is bold */ bool heading_bold; /* Should we wake the screen up on accelerometer detected motion or tap */ bool wake_on_tap_or_motion; } meshtastic_Config_DisplayConfig; /* Lora Config */ typedef struct _meshtastic_Config_LoRaConfig { /* When enabled, the `modem_preset` fields will be adhered 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. */ meshtastic_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<