From 2f8e663f03b5a817b95a58a0c4a5ca6ccd64d903 Mon Sep 17 00:00:00 2001 From: Jm Date: Mon, 29 Mar 2021 17:08:56 -0700 Subject: [PATCH] Add serial_disabled for #638 --- src/main.cpp | 4 +++- src/mesh/generated/admin.pb.h | 7 ++----- src/mesh/generated/deviceonly.pb.h | 2 +- src/mesh/generated/mesh.pb.h | 23 +++++++---------------- src/mesh/generated/radioconfig.pb.h | 11 +++++++---- 5 files changed, 20 insertions(+), 27 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ba99c88aa..1bd94221e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -317,7 +317,9 @@ void setup() #endif #ifdef DEBUG_PORT - consoleInit(); // Set serial baud rate and init our mesh console + if (radioConfig.preferences.serial_disabled) { + consoleInit(); // Set serial baud rate and init our mesh console + } #endif initDeepSleep(); diff --git a/src/mesh/generated/admin.pb.h b/src/mesh/generated/admin.pb.h index a2e753546..447e17fee 100644 --- a/src/mesh/generated/admin.pb.h +++ b/src/mesh/generated/admin.pb.h @@ -26,7 +26,6 @@ typedef struct _AdminMessage { bool confirm_set_channel; bool confirm_set_radio; bool exit_simulator; - int32_t reboot_seconds; }; } AdminMessage; @@ -50,7 +49,6 @@ extern "C" { #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 /* Struct field encoding specification for nanopb */ #define AdminMessage_FIELDLIST(X, a) \ @@ -63,8 +61,7 @@ X(a, STATIC, ONEOF, UINT32, (variant,get_channel_request,get_channel_requ X(a, STATIC, ONEOF, MESSAGE, (variant,get_channel_response,get_channel_response), 7) \ 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,exit_simulator,exit_simulator), 34) #define AdminMessage_CALLBACK NULL #define AdminMessage_DEFAULT NULL #define AdminMessage_variant_set_radio_MSGTYPE RadioConfig @@ -79,7 +76,7 @@ extern const pb_msgdesc_t AdminMessage_msg; #define AdminMessage_fields &AdminMessage_msg /* Maximum encoded size of messages (where known) */ -#define AdminMessage_size 351 +#define AdminMessage_size 354 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/deviceonly.pb.h b/src/mesh/generated/deviceonly.pb.h index fa5de7b93..ababb0e0c 100644 --- a/src/mesh/generated/deviceonly.pb.h +++ b/src/mesh/generated/deviceonly.pb.h @@ -125,7 +125,7 @@ extern const pb_msgdesc_t ChannelFile_msg; /* Maximum encoded size of messages (where known) */ #define LegacyRadioConfig_size 4 #define LegacyRadioConfig_LegacyPreferences_size 2 -#define DeviceState_size 5118 +#define DeviceState_size 4920 #define ChannelFile_size 832 #ifdef __cplusplus diff --git a/src/mesh/generated/mesh.pb.h b/src/mesh/generated/mesh.pb.h index 4f30ade8b..8ef7f16f7 100644 --- a/src/mesh/generated/mesh.pb.h +++ b/src/mesh/generated/mesh.pb.h @@ -110,7 +110,6 @@ typedef struct _MyNodeInfo { CriticalErrorCode error_code; uint32_t error_address; uint32_t error_count; - uint32_t reboot_count; uint32_t message_timeout_msec; uint32_t min_app_version; uint32_t max_channels; @@ -162,7 +161,6 @@ typedef struct _NodeInfo { User user; bool has_position; Position position; - uint32_t last_heard; float snr; } NodeInfo; @@ -193,7 +191,6 @@ typedef struct _ToRadio { union { MeshPacket packet; uint32_t want_config_id; - bool disconnect; }; } ToRadio; @@ -235,8 +232,8 @@ extern "C" { #define Routing_init_default {0, {RouteDiscovery_init_default}} #define Data_init_default {_PortNum_MIN, {0, {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} -#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0} -#define MyNodeInfo_init_default {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0} +#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0} +#define MyNodeInfo_init_default {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0} #define LogRecord_init_default {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_default {0, 0, {MyNodeInfo_init_default}} #define ToRadio_init_default {0, {MeshPacket_init_default}} @@ -246,8 +243,8 @@ extern "C" { #define Routing_init_zero {0, {RouteDiscovery_init_zero}} #define Data_init_zero {_PortNum_MIN, {0, {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} -#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0} -#define MyNodeInfo_init_zero {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0, 0} +#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0} +#define MyNodeInfo_init_zero {0, 0, 0, "", "", "", _CriticalErrorCode_MIN, 0, 0, 0, 0, 0} #define LogRecord_init_zero {"", 0, "", _LogRecord_Level_MIN} #define FromRadio_init_zero {0, 0, {MyNodeInfo_init_zero}} #define ToRadio_init_zero {0, {MeshPacket_init_zero}} @@ -272,7 +269,6 @@ extern "C" { #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_message_timeout_msec_tag 13 #define MyNodeInfo_min_app_version_tag 14 #define MyNodeInfo_max_channels_tag 15 @@ -302,7 +298,6 @@ extern "C" { #define NodeInfo_num_tag 1 #define NodeInfo_user_tag 2 #define NodeInfo_position_tag 3 -#define NodeInfo_last_heard_tag 4 #define NodeInfo_snr_tag 7 #define Routing_route_request_tag 1 #define Routing_route_reply_tag 2 @@ -316,7 +311,6 @@ extern "C" { #define FromRadio_packet_tag 11 #define ToRadio_packet_tag 2 #define ToRadio_want_config_id_tag 100 -#define ToRadio_disconnect_tag 104 /* Struct field encoding specification for nanopb */ #define Position_FIELDLIST(X, a) \ @@ -382,7 +376,6 @@ X(a, STATIC, SINGULAR, INT32, rx_rssi, 13) X(a, STATIC, SINGULAR, UINT32, num, 1) \ X(a, STATIC, OPTIONAL, MESSAGE, user, 2) \ X(a, STATIC, OPTIONAL, MESSAGE, position, 3) \ -X(a, STATIC, SINGULAR, FIXED32, last_heard, 4) \ X(a, STATIC, SINGULAR, FLOAT, snr, 7) #define NodeInfo_CALLBACK NULL #define NodeInfo_DEFAULT NULL @@ -399,7 +392,6 @@ 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, UINT32, message_timeout_msec, 13) \ X(a, STATIC, SINGULAR, UINT32, min_app_version, 14) \ X(a, STATIC, SINGULAR, UINT32, max_channels, 15) @@ -431,8 +423,7 @@ X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 11) #define ToRadio_FIELDLIST(X, a) \ X(a, STATIC, ONEOF, MESSAGE, (payloadVariant,packet,packet), 2) \ -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, UINT32, (payloadVariant,want_config_id,want_config_id), 100) #define ToRadio_CALLBACK NULL #define ToRadio_DEFAULT NULL #define ToRadio_payloadVariant_packet_MSGTYPE MeshPacket @@ -469,8 +460,8 @@ extern const pb_msgdesc_t ToRadio_msg; #define Routing_size 42 #define Data_size 260 #define MeshPacket_size 309 -#define NodeInfo_size 131 -#define MyNodeInfo_size 95 +#define NodeInfo_size 126 +#define MyNodeInfo_size 89 #define LogRecord_size 81 #define FromRadio_size 318 #define ToRadio_size 312 diff --git a/src/mesh/generated/radioconfig.pb.h b/src/mesh/generated/radioconfig.pb.h index 12224b99b..3dfbbdda0 100644 --- a/src/mesh/generated/radioconfig.pb.h +++ b/src/mesh/generated/radioconfig.pb.h @@ -85,6 +85,7 @@ typedef struct _RadioConfig_UserPreferences { bool is_router; bool is_low_power; bool fixed_position; + bool serial_disabled; bool factory_reset; bool debug_log_enabled; pb_size_t ignore_incoming_count; @@ -150,9 +151,9 @@ extern "C" { /* Initializer values for message structs */ #define RadioConfig_init_default {false, RadioConfig_UserPreferences_init_default} -#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_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, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0} +#define RadioConfig_UserPreferences_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_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, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0} #define RadioConfig_init_zero {false, RadioConfig_UserPreferences_init_zero} -#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_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, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0} +#define RadioConfig_UserPreferences_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0, _RegionCode_MIN, _ChargeCurrent_MIN, _LocationSharing_MIN, _GpsOperation_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, 0, 0, 0, 0, 0, 0, _RadioConfig_UserPreferences_EnvironmentalMeasurementSensorType_MIN, 0, 0} /* Field tags (for use in manual encoding/decoding) */ #define RadioConfig_UserPreferences_position_broadcast_secs_tag 1 @@ -177,6 +178,7 @@ extern "C" { #define RadioConfig_UserPreferences_is_router_tag 37 #define RadioConfig_UserPreferences_is_low_power_tag 38 #define RadioConfig_UserPreferences_fixed_position_tag 39 +#define RadioConfig_UserPreferences_serial_disabled_tag 40 #define RadioConfig_UserPreferences_factory_reset_tag 100 #define RadioConfig_UserPreferences_debug_log_enabled_tag 101 #define RadioConfig_UserPreferences_ignore_incoming_tag 103 @@ -237,6 +239,7 @@ X(a, STATIC, SINGULAR, UINT32, gps_attempt_time, 36) \ X(a, STATIC, SINGULAR, BOOL, is_router, 37) \ X(a, STATIC, SINGULAR, BOOL, is_low_power, 38) \ X(a, STATIC, SINGULAR, BOOL, fixed_position, 39) \ +X(a, STATIC, SINGULAR, BOOL, serial_disabled, 40) \ X(a, STATIC, SINGULAR, BOOL, factory_reset, 100) \ X(a, STATIC, SINGULAR, BOOL, debug_log_enabled, 101) \ X(a, STATIC, REPEATED, UINT32, ignore_incoming, 103) \ @@ -276,8 +279,8 @@ extern const pb_msgdesc_t RadioConfig_UserPreferences_msg; #define RadioConfig_UserPreferences_fields &RadioConfig_UserPreferences_msg /* Maximum encoded size of messages (where known) */ -#define RadioConfig_size 348 -#define RadioConfig_UserPreferences_size 345 +#define RadioConfig_size 351 +#define RadioConfig_UserPreferences_size 348 #ifdef __cplusplus } /* extern "C" */