mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-01 13:16:36 +00:00
Merge branch 'master' of github.com:meshtastic/Meshtastic-device
This commit is contained in:
commit
515a411e8c
6
.github/workflows/update_protobufs.yml
vendored
6
.github/workflows/update_protobufs.yml
vendored
@ -17,9 +17,9 @@ jobs:
|
||||
|
||||
- name: Download nanopb
|
||||
run: |
|
||||
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.5-linux-x86.tar.gz
|
||||
tar xvzf nanopb-0.4.5-linux-x86.tar.gz
|
||||
mv nanopb-0.4.5-linux-x86 nanopb-0.4.5
|
||||
wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.6-linux-x86.tar.gz
|
||||
tar xvzf nanopb-0.4.6-linux-x86.tar.gz
|
||||
mv nanopb-0.4.6-linux-x86 nanopb-0.4.6
|
||||
|
||||
- name: Re-generate protocol buffers
|
||||
run: |
|
||||
|
@ -1 +1 @@
|
||||
cd protobufs && ..\nanopb-0.4.5\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto
|
||||
cd protobufs && ..\nanopb-0.4.6\generator-bin\protoc.exe --nanopb_out=-v:..\src\mesh\generated -I=..\protobufs *.proto
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.5 to be located in the"
|
||||
echo "This script requires https://jpa.kapsi.fi/nanopb/download/ version 0.4.6 to be located in the"
|
||||
echo "meshtastic-device root directory if the following step fails, you should download the correct"
|
||||
echo "prebuilt binaries for your computer into nanopb-0.4.5"
|
||||
echo "prebuilt binaries for your computer into nanopb-0.4.6"
|
||||
|
||||
# the nanopb tool seems to require that the .options file be in the current directory!
|
||||
cd protobufs
|
||||
../nanopb-0.4.5/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto
|
||||
../nanopb-0.4.6/generator-bin/protoc --nanopb_out=-v:../src/mesh/generated -I=../protobufs *.proto
|
||||
|
||||
#echo "Regenerating protobuf documentation - if you see an error message"
|
||||
#echo "you can ignore it unless doing a new protobuf release to github."
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 94a4dbb842961e75f89de13dc6d0437a256098aa
|
||||
Subproject commit 274aa01a3862ee83b1ae791c36205e661c4af7ca
|
@ -11,10 +11,10 @@
|
||||
/// Should we behave as if we have AC power now?
|
||||
static bool isPowered()
|
||||
{
|
||||
// Completely circumvents the battery / power sensing logic and assumes constant power source
|
||||
if (config.power.is_always_powered) {
|
||||
// Circumvent the battery sensing logic and assumes constant power if no battery pin or power mgmt IC
|
||||
#if !defined(BATTERY_PIN) && !defined(AXP192_SLAVE_ADDRESS)
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool isRouter = (config.device.role == Config_DeviceConfig_Role_Router ? 1 : 0);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "admin.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_ADMIN_PB_H_INCLUDED
|
||||
#define PB_ADMIN_PB_H_INCLUDED
|
||||
@ -38,39 +38,78 @@ 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 {
|
||||
/* Set the owner for this node */
|
||||
pb_size_t which_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;
|
||||
/* TODO: REPLACE */
|
||||
Channel get_channel_response;
|
||||
/* Send the current owner data in the response to this message. */
|
||||
bool get_owner_request;
|
||||
/* TODO: REPLACE */
|
||||
User get_owner_response;
|
||||
/* Ask for the following config data to be sent */
|
||||
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;
|
||||
/* 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.
|
||||
These messages are optional when changing the local node. */
|
||||
bool confirm_set_channel;
|
||||
/* TODO: REPLACE */
|
||||
bool confirm_set_radio;
|
||||
/* This message is only supported for the simulator porduino build.
|
||||
If received the simulator will exit successfully. */
|
||||
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 message part1 in the response to this message. */
|
||||
bool get_canned_message_module_part1_request;
|
||||
/* TODO: REPLACE */
|
||||
char get_canned_message_module_part1_response[201];
|
||||
/* Get the Canned Message Module message part2 in the response to this message. */
|
||||
bool get_canned_message_module_part2_request;
|
||||
/* TODO: REPLACE */
|
||||
char get_canned_message_module_part2_response[201];
|
||||
/* Get the Canned Message Module message part3 in the response to this message. */
|
||||
bool get_canned_message_module_part3_request;
|
||||
/* TODO: REPLACE */
|
||||
char get_canned_message_module_part3_response[201];
|
||||
/* Get the Canned Message Module message part4 in the response to this message. */
|
||||
bool get_canned_message_module_part4_request;
|
||||
/* TODO: REPLACE */
|
||||
char get_canned_message_module_part4_response[201];
|
||||
/* Set the canned message module part 1 text. */
|
||||
char set_canned_message_module_part1[201];
|
||||
/* Set the canned message module part 2 text. */
|
||||
char set_canned_message_module_part2[201];
|
||||
/* Set the canned message module part 3 text. */
|
||||
char set_canned_message_module_part3[201];
|
||||
/* Set the canned message module part 4 text. */
|
||||
char set_canned_message_module_part4[201];
|
||||
/* Tell the node to shutdown in this many seconds (or <0 to cancel shutdown) */
|
||||
int32_t shutdown_seconds;
|
||||
};
|
||||
} AdminMessage;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "apponly.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_APPONLY_PB_H_INCLUDED
|
||||
#define PB_APPONLY_PB_H_INCLUDED
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "cannedmessages.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_CANNEDMESSAGES_PB_H_INCLUDED
|
||||
#define PB_CANNEDMESSAGES_PB_H_INCLUDED
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "channel.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_CHANNEL_PB_H_INCLUDED
|
||||
#define PB_CHANNEL_PB_H_INCLUDED
|
||||
@ -38,6 +38,26 @@ 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 {
|
||||
/* 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.
|
||||
These psks should be treated as only minimally secure,
|
||||
because they are listed in this source code.
|
||||
Those bytes are mapped using the following scheme:
|
||||
`0` = No crypto
|
||||
`1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0xbf}
|
||||
`2` through 10 = The default channel key, except with 1 through 9 added to the last byte.
|
||||
Shown to user as simple1 through 10 */
|
||||
ChannelSettings_psk_t psk;
|
||||
/* A SHORT name that will be packed into the URL.
|
||||
Less than 12 bytes.
|
||||
Something for end users to call the channel
|
||||
If this is the empty string it is assumed that this channel
|
||||
is the special (minimally secure) "Default"channel.
|
||||
In user interfaces it should be rendered as a local language translation of "X".
|
||||
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.
|
||||
@ -56,26 +76,6 @@ typedef struct _ChannelSettings {
|
||||
hash = ((hash << 5) + hash) + (unsigned char) c;
|
||||
return hash;
|
||||
} */
|
||||
ChannelSettings_psk_t psk;
|
||||
/* 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.
|
||||
These psks should be treated as only minimally secure,
|
||||
because they are listed in this source code.
|
||||
Those bytes are mapped using the following scheme:
|
||||
`0` = No crypto
|
||||
`1` = The special "default" channel key: {0xd4, 0xf1, 0xbb, 0x3a, 0x20, 0x29, 0x07, 0x59, 0xf0, 0xbc, 0xff, 0xab, 0xcf, 0x4e, 0x69, 0xbf}
|
||||
`2` through 10 = The default channel key, except with 1 through 9 added to the last byte.
|
||||
Shown to user as simple1 through 10 */
|
||||
char name[12];
|
||||
/* A SHORT name that will be packed into the URL.
|
||||
Less than 12 bytes.
|
||||
Something for end users to call the channel
|
||||
If this is the empty string it is assumed that this channel
|
||||
is the special (minimally secure) "Default"channel.
|
||||
In user interfaces it should be rendered as a local language translation of "X".
|
||||
For channel_num hashing empty string will be treated as "X".
|
||||
Where "X" is selected based on the English words listed above for ModemPreset */
|
||||
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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "config.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_CONFIG_PB_H_INCLUDED
|
||||
#define PB_CONFIG_PB_H_INCLUDED
|
||||
@ -126,7 +126,6 @@ typedef struct _Config_PositionConfig {
|
||||
typedef struct _Config_PowerConfig {
|
||||
Config_PowerConfig_ChargeCurrent charge_current;
|
||||
bool is_power_saving;
|
||||
bool is_always_powered;
|
||||
uint32_t on_battery_shutdown_after_secs;
|
||||
float adc_multiplier_override;
|
||||
uint32_t wait_bluetooth_secs;
|
||||
@ -144,14 +143,19 @@ typedef struct _Config_WiFiConfig {
|
||||
} Config_WiFiConfig;
|
||||
|
||||
typedef struct _Config {
|
||||
/* TODO: REPLACE */
|
||||
pb_size_t which_payloadVariant;
|
||||
union {
|
||||
/* TODO: REPLACE */
|
||||
Config_DeviceConfig device;
|
||||
/* TODO: REPLACE */
|
||||
Config_PositionConfig position;
|
||||
/* TODO: REPLACE */
|
||||
Config_PowerConfig power;
|
||||
/* TODO: REPLACE */
|
||||
Config_WiFiConfig wifi;
|
||||
/* TODO: REPLACE */
|
||||
Config_DisplayConfig display;
|
||||
/* TODO: REPLACE */
|
||||
Config_LoRaConfig lora;
|
||||
} payloadVariant;
|
||||
} Config;
|
||||
@ -191,14 +195,14 @@ extern "C" {
|
||||
#define Config_init_default {0, {Config_DeviceConfig_init_default}}
|
||||
#define Config_DeviceConfig_init_default {_Config_DeviceConfig_Role_MIN, 0, 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, 0}
|
||||
#define Config_PowerConfig_init_default {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define Config_WiFiConfig_init_default {"", "", 0, 0}
|
||||
#define Config_DisplayConfig_init_default {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 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_init_zero {0, {Config_DeviceConfig_init_zero}}
|
||||
#define Config_DeviceConfig_init_zero {_Config_DeviceConfig_Role_MIN, 0, 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, 0}
|
||||
#define Config_PowerConfig_init_zero {_Config_PowerConfig_ChargeCurrent_MIN, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||
#define Config_WiFiConfig_init_zero {"", "", 0, 0}
|
||||
#define Config_DisplayConfig_init_zero {0, _Config_DisplayConfig_GpsCoordinateFormat_MIN, 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}}
|
||||
@ -231,7 +235,6 @@ extern "C" {
|
||||
#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_is_always_powered_tag 3
|
||||
#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
|
||||
@ -290,7 +293,6 @@ X(a, STATIC, SINGULAR, UINT32, position_flags, 10)
|
||||
#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, BOOL, is_always_powered, 3) \
|
||||
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) \
|
||||
@ -352,7 +354,7 @@ extern const pb_msgdesc_t Config_LoRaConfig_msg;
|
||||
#define Config_DisplayConfig_size 14
|
||||
#define Config_LoRaConfig_size 67
|
||||
#define Config_PositionConfig_size 30
|
||||
#define Config_PowerConfig_size 47
|
||||
#define Config_PowerConfig_size 45
|
||||
#define Config_WiFiConfig_size 103
|
||||
#define Config_size 105
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "deviceonly.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_DEVICEONLY_PB_H_INCLUDED
|
||||
#define PB_DEVICEONLY_PB_H_INCLUDED
|
||||
@ -52,14 +52,14 @@ typedef struct _DeviceState {
|
||||
/* Received packets saved for delivery to the phone */
|
||||
pb_size_t receive_queue_count;
|
||||
MeshPacket receive_queue[1];
|
||||
/* A version integer used to invalidate old save files when we make
|
||||
incompatible changes This integer is set at build time and is private to
|
||||
NodeDB.cpp in the device code. */
|
||||
bool has_rx_text_message;
|
||||
MeshPacket rx_text_message;
|
||||
/* We keep the last received text message (only) stored in the device flash,
|
||||
so we can show it on the screen.
|
||||
Might be null */
|
||||
bool has_rx_text_message;
|
||||
MeshPacket rx_text_message;
|
||||
/* A version integer used to invalidate old save files when we make
|
||||
incompatible changes This integer is set at build time and is private to
|
||||
NodeDB.cpp in the device code. */
|
||||
uint32_t version;
|
||||
/* Used only during development.
|
||||
Indicates developer is testing and changes should never be saved to flash. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "localonly.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_LOCALONLY_PB_H_INCLUDED
|
||||
#define PB_LOCALONLY_PB_H_INCLUDED
|
||||
@ -138,7 +138,7 @@ extern const pb_msgdesc_t LocalModuleConfig_msg;
|
||||
#define LocalModuleConfig_fields &LocalModuleConfig_msg
|
||||
|
||||
/* Maximum encoded size of messages (where known) */
|
||||
#define LocalConfig_size 321
|
||||
#define LocalConfig_size 319
|
||||
#define LocalModuleConfig_size 288
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "mesh.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_MESH_PB_H_INCLUDED
|
||||
#define PB_MESH_PB_H_INCLUDED
|
||||
@ -282,34 +282,34 @@ 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. */
|
||||
char firmware_version[18];
|
||||
/* 0.0.5 etc... */
|
||||
CriticalErrorCode error_code;
|
||||
char firmware_version[18];
|
||||
/* An error message we'd like to report back to the mothership through analytics.
|
||||
It indicates a serious bug occurred on the device, the device coped with it,
|
||||
but we still want to tell the devs about the bug.
|
||||
This field will be cleared after the phone reads MyNodeInfo
|
||||
(i.e. it will only be reported once)
|
||||
a numeric error code to go with error message, zero means no error */
|
||||
uint32_t error_address;
|
||||
CriticalErrorCode error_code;
|
||||
/* A numeric error address (nonzero if available) */
|
||||
uint32_t error_count;
|
||||
uint32_t error_address;
|
||||
/* The total number of errors this node has ever encountered
|
||||
(well - since the last time we discarded preferences) */
|
||||
uint32_t reboot_count;
|
||||
uint32_t error_count;
|
||||
/* The total number of reboots this node has ever encountered
|
||||
(well - since the last time we discarded preferences) */
|
||||
float bitrate;
|
||||
uint32_t reboot_count;
|
||||
/* Calculated bitrate of the current channel (in Bytes Per Second) */
|
||||
uint32_t message_timeout_msec;
|
||||
float bitrate;
|
||||
/* How long before we consider a message abandoned and we can clear our
|
||||
caches of any messages in flight Normally quite large to handle the worst case
|
||||
message delivery time, 5 minutes.
|
||||
Formerly called FLOOD_EXPIRE_TIME in the device code */
|
||||
uint32_t min_app_version;
|
||||
uint32_t message_timeout_msec;
|
||||
/* 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;
|
||||
@ -538,11 +538,14 @@ typedef struct _NodeInfo {
|
||||
|
||||
/* A Routing control Data packet handled by the routing module */
|
||||
typedef struct _Routing {
|
||||
/* A route request going from the requester */
|
||||
pb_size_t which_variant;
|
||||
union {
|
||||
/* A route request going from the requester */
|
||||
RouteDiscovery route_request;
|
||||
/* A route reply */
|
||||
RouteDiscovery route_reply;
|
||||
/* A failure in delivering a message (usually used for routing control messages, but might be provided
|
||||
in addition to ack.fail_id to provide details on the type of failure). */
|
||||
Routing_Error error_reason;
|
||||
};
|
||||
} Routing;
|
||||
@ -568,14 +571,13 @@ typedef struct _MeshPacket {
|
||||
contains the 'channel hash' instead of the index.
|
||||
This 'trick' is only used while the payloadVariant is an 'encrypted'. */
|
||||
uint8_t channel;
|
||||
/* TODO: REPLACE */
|
||||
pb_size_t which_payloadVariant;
|
||||
union {
|
||||
/* TODO: REPLACE */
|
||||
Data decoded;
|
||||
/* TODO: REPLACE */
|
||||
MeshPacket_encrypted_t encrypted;
|
||||
};
|
||||
/* TODO: REPLACE */
|
||||
uint32_t id;
|
||||
/* A unique ID for this packet.
|
||||
Always 0 for no-ack packets or non broadcast packets (and therefore take zero bytes of space).
|
||||
Otherwise a unique ID for this packet, useful for flooding algorithms.
|
||||
@ -586,21 +588,21 @@ typedef struct _MeshPacket {
|
||||
See [crypto](/docs/developers/firmware/encryption) for details.
|
||||
FIXME - really should be fixed32 instead, this encoding only
|
||||
hurts the ble link though. */
|
||||
uint32_t rx_time;
|
||||
uint32_t id;
|
||||
/* The time this message was received by the esp32 (secs since 1970).
|
||||
Note: this field is _never_ sent on the radio link itself (to save space) Times
|
||||
are typically not sent over the mesh, but they will be added to any Packet
|
||||
(chain of SubPacket) sent to the phone (so the phone can know exact time of reception) */
|
||||
float rx_snr;
|
||||
uint32_t rx_time;
|
||||
/* *Never* sent over the radio links.
|
||||
Set during reception to indicate the SNR of this packet.
|
||||
Used to collect statistics on current link quality. */
|
||||
uint8_t hop_limit;
|
||||
float rx_snr;
|
||||
/* If unset treated as zero (no forwarding, send to adjacent nodes only)
|
||||
if 1, allow hopping through one node, etc...
|
||||
For our usecase real world topologies probably have a max of about 3.
|
||||
This field is normally placed into a few of bits in the header. */
|
||||
bool want_ack;
|
||||
uint8_t hop_limit;
|
||||
/* This packet is being sent as a reliable message, we would prefer it to arrive at the destination.
|
||||
We would like to receive a ack packet in response.
|
||||
Broadcasts messages treat this flag specially: Since acks for broadcasts would
|
||||
@ -610,11 +612,13 @@ typedef struct _MeshPacket {
|
||||
So FloodingRouter.cpp generates an implicit ack which is delivered to the original sender.
|
||||
If after some time we don't hear anyone rebroadcast our packet, we will timeout and retransmit, using the regular resend logic.
|
||||
Note: This flag is normally sent in a flag bit in the header when sent over the wire */
|
||||
MeshPacket_Priority priority;
|
||||
bool want_ack;
|
||||
/* The priority of this message for sending.
|
||||
See MeshPacket.Priority description for more details. */
|
||||
int32_t rx_rssi;
|
||||
MeshPacket_Priority priority;
|
||||
/* rssi of received packet. Only sent to phone for dispay purposes. */
|
||||
int32_t rx_rssi;
|
||||
/* Describe if this message is delayed */
|
||||
MeshPacket_Delayed delayed;
|
||||
} MeshPacket;
|
||||
|
||||
@ -626,15 +630,29 @@ 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;
|
||||
/* Log levels, chosen to match python logging conventions. */
|
||||
pb_size_t which_payloadVariant;
|
||||
union {
|
||||
/* 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;
|
||||
/* One packet is sent for each node in the on radio DB
|
||||
starts over with the first node in our DB */
|
||||
NodeInfo node_info;
|
||||
/* Include a part of the config (was: RadioConfig radio) */
|
||||
Config config;
|
||||
/* Set to send debug console output over our protobuf stream */
|
||||
LogRecord log_record;
|
||||
/* Sent as true once the device has finished sending all of the responses to want_config
|
||||
recipient should check if this ID matches our original request nonce, if
|
||||
not, it means your config responses haven't started yet.
|
||||
NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */
|
||||
uint32_t config_complete_id;
|
||||
/* Sent to tell clients the radio has just rebooted.
|
||||
Set to true if present.
|
||||
Not used on all transports, currently just used for the serial console.
|
||||
NOTE: This ID must not change - to keep (minimal) compatibility with <1.2 version of android apps. */
|
||||
bool rebooted;
|
||||
/* Log levels, chosen to match python logging conventions. */
|
||||
MeshPacket packet;
|
||||
};
|
||||
} FromRadio;
|
||||
@ -642,12 +660,25 @@ typedef struct _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 {
|
||||
/* Send this packet on the mesh */
|
||||
pb_size_t which_payloadVariant;
|
||||
union {
|
||||
/* Send this packet on the mesh */
|
||||
MeshPacket packet;
|
||||
/* Information about the peer, sent after the phone sneds want_config_id.
|
||||
Old clients do not send this, which is fine. */
|
||||
ToRadio_PeerInfo peer_info;
|
||||
/* Phone wants radio to send full node db to the phone, This is
|
||||
typically the first packet sent to the radio when the phone gets a
|
||||
bluetooth connection. The radio will respond by sending back a
|
||||
MyNodeInfo, a owner, a radio config and a series of
|
||||
FromRadio.node_infos, and config_complete
|
||||
the integer you write into this field will be reported back in the
|
||||
config_complete_id response this allows clients to never be confused by
|
||||
a stale old partially sent config. */
|
||||
uint32_t want_config_id;
|
||||
/* Tell API server we are disconnecting now.
|
||||
This is useful for serial links where there is no hardware/protocol based notification that the client has dropped the link.
|
||||
(Sending this message is optional for clients) */
|
||||
bool disconnect;
|
||||
};
|
||||
} ToRadio;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "module_config.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_MODULE_CONFIG_PB_H_INCLUDED
|
||||
#define PB_MODULE_CONFIG_PB_H_INCLUDED
|
||||
@ -117,15 +117,21 @@ typedef struct _ModuleConfig_TelemetryConfig {
|
||||
|
||||
/* Module Config */
|
||||
typedef struct _ModuleConfig {
|
||||
/* TODO: REPLACE */
|
||||
pb_size_t which_payloadVariant;
|
||||
union {
|
||||
/* TODO: REPLACE */
|
||||
ModuleConfig_MQTTConfig mqtt;
|
||||
/* TODO: REPLACE */
|
||||
ModuleConfig_SerialConfig serial;
|
||||
/* TODO: REPLACE */
|
||||
ModuleConfig_ExternalNotificationConfig external_notification;
|
||||
/* TODO: REPLACE */
|
||||
ModuleConfig_StoreForwardConfig store_forward;
|
||||
/* TODO: REPLACE */
|
||||
ModuleConfig_RangeTestConfig range_test;
|
||||
/* TODO: REPLACE */
|
||||
ModuleConfig_TelemetryConfig telemetry;
|
||||
/* TODO: REPLACE */
|
||||
ModuleConfig_CannedMessageConfig canned_message;
|
||||
} payloadVariant;
|
||||
} ModuleConfig;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "mqtt.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_MQTT_PB_H_INCLUDED
|
||||
#define PB_MQTT_PB_H_INCLUDED
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "portnums.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_PORTNUMS_PB_H_INCLUDED
|
||||
#define PB_PORTNUMS_PB_H_INCLUDED
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "remote_hardware.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_REMOTE_HARDWARE_PB_H_INCLUDED
|
||||
#define PB_REMOTE_HARDWARE_PB_H_INCLUDED
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "storeforward.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_STOREFORWARD_PB_H_INCLUDED
|
||||
#define PB_STOREFORWARD_PB_H_INCLUDED
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb constant definitions */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#include "telemetry.pb.h"
|
||||
#if PB_PROTO_HEADER_VERSION != 40
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Automatically generated nanopb header */
|
||||
/* Generated by nanopb-0.4.5 */
|
||||
/* Generated by nanopb-0.4.6 */
|
||||
|
||||
#ifndef PB_TELEMETRY_PB_H_INCLUDED
|
||||
#define PB_TELEMETRY_PB_H_INCLUDED
|
||||
@ -75,10 +75,11 @@ typedef struct _Telemetry {
|
||||
be sent by devices which has a hardware GPS clock (IE Mobile Phone).
|
||||
seconds since 1970 */
|
||||
uint32_t time;
|
||||
/* Key native device metrics such as battery level */
|
||||
pb_size_t which_variant;
|
||||
union {
|
||||
/* Key native device metrics such as battery level */
|
||||
DeviceMetrics device_metrics;
|
||||
/* Weather station or other environmental metrics */
|
||||
EnvironmentMetrics environment_metrics;
|
||||
} variant;
|
||||
} Telemetry;
|
||||
|
@ -716,8 +716,6 @@ void handleAdminSettings(HTTPRequest *req, HTTPResponse *res)
|
||||
res->println("<tr><td><input type=checkbox></td><td>WiFi Password</td><td>false</td><td><input type=radio></td></tr>\n");
|
||||
res->println(
|
||||
"<tr><td><input type=checkbox></td><td>Smart Position Update</td><td>false</td><td><input type=radio></td></tr>\n");
|
||||
res->println("<tr><td><input type=checkbox></td><td>is_always_powered</td><td>false</td><td><input type=radio></td></tr>\n");
|
||||
res->println("<tr><td><input type=checkbox></td><td>is_always_powered</td><td>false</td><td><input type=radio></td></tr>\n");
|
||||
res->println("</table>\n");
|
||||
res->println("<table>\n");
|
||||
res->println("<input type=submit value=Apply New Settings>\n");
|
||||
|
@ -392,7 +392,6 @@ StoreForwardModule::StoreForwardModule()
|
||||
*/
|
||||
|
||||
moduleConfig.store_forward.enabled = 1;
|
||||
config.power.is_always_powered = 1;
|
||||
}
|
||||
|
||||
if (moduleConfig.store_forward.enabled) {
|
||||
|
Loading…
Reference in New Issue
Block a user