mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-21 12:38:34 +00:00
Merge branch 'meshtastic:master' into compression
This commit is contained in:
commit
e218bba87e
@ -1 +1 @@
|
|||||||
Subproject commit 98a888f863a750464cd44526568af20c7bf12227
|
Subproject commit 40b822424221f4f7704e291d2b422c9dcca84c83
|
@ -146,6 +146,13 @@ bool NodeDB::resetRadioConfig()
|
|||||||
void NodeDB::installDefaultConfig()
|
void NodeDB::installDefaultConfig()
|
||||||
{
|
{
|
||||||
memset(&config, 0, sizeof(LocalConfig));
|
memset(&config, 0, sizeof(LocalConfig));
|
||||||
|
config.has_device = true;
|
||||||
|
config.has_display = true;
|
||||||
|
config.has_lora = true;
|
||||||
|
config.has_position = true;
|
||||||
|
config.has_power = true;
|
||||||
|
config.has_wifi = true;
|
||||||
|
|
||||||
config.lora.region = Config_LoRaConfig_RegionCode_Unset;
|
config.lora.region = Config_LoRaConfig_RegionCode_Unset;
|
||||||
config.lora.modem_preset = Config_LoRaConfig_ModemPreset_LongFast;
|
config.lora.modem_preset = Config_LoRaConfig_ModemPreset_LongFast;
|
||||||
resetRadioConfig();
|
resetRadioConfig();
|
||||||
@ -158,6 +165,13 @@ void NodeDB::installDefaultConfig()
|
|||||||
void NodeDB::installDefaultModuleConfig()
|
void NodeDB::installDefaultModuleConfig()
|
||||||
{
|
{
|
||||||
memset(&moduleConfig, 0, sizeof(ModuleConfig));
|
memset(&moduleConfig, 0, sizeof(ModuleConfig));
|
||||||
|
moduleConfig.has_canned_message = true;
|
||||||
|
moduleConfig.has_external_notification = true;
|
||||||
|
moduleConfig.has_mqtt = true;
|
||||||
|
moduleConfig.has_range_test = true;
|
||||||
|
moduleConfig.has_serial = true;
|
||||||
|
moduleConfig.has_store_forward = true;
|
||||||
|
moduleConfig.has_telemetry = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// void NodeDB::installDefaultRadioConfig()
|
// void NodeDB::installDefaultRadioConfig()
|
||||||
@ -341,7 +355,7 @@ void NodeDB::loadFromDisk()
|
|||||||
installDefaultConfig(); // Our in RAM copy might now be corrupt
|
installDefaultConfig(); // Our in RAM copy might now be corrupt
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!loadProto(moduleConfigfile, ModuleConfig_size, sizeof(ModuleConfig), ModuleConfig_fields, &moduleConfig)) {
|
if (!loadProto(moduleConfigfile, LocalModuleConfig_size, sizeof(LocalModuleConfig), LocalModuleConfig_fields, &moduleConfig)) {
|
||||||
installDefaultModuleConfig(); // Our in RAM copy might now be corrupt
|
installDefaultModuleConfig(); // Our in RAM copy might now be corrupt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,6 +416,7 @@ void NodeDB::saveToDisk()
|
|||||||
FSCom.mkdir("/prefs");
|
FSCom.mkdir("/prefs");
|
||||||
#endif
|
#endif
|
||||||
saveProto(preffile, DeviceState_size, sizeof(devicestate), DeviceState_fields, &devicestate);
|
saveProto(preffile, DeviceState_size, sizeof(devicestate), DeviceState_fields, &devicestate);
|
||||||
|
|
||||||
// save all config segments
|
// save all config segments
|
||||||
config.has_device = true;
|
config.has_device = true;
|
||||||
config.has_display = true;
|
config.has_display = true;
|
||||||
@ -410,7 +425,16 @@ void NodeDB::saveToDisk()
|
|||||||
config.has_power = true;
|
config.has_power = true;
|
||||||
config.has_wifi = true;
|
config.has_wifi = true;
|
||||||
saveProto(configfile, LocalConfig_size, sizeof(LocalConfig), LocalConfig_fields, &config);
|
saveProto(configfile, LocalConfig_size, sizeof(LocalConfig), LocalConfig_fields, &config);
|
||||||
saveProto(moduleConfigfile, Module_Config_size, sizeof(ModuleConfig), ModuleConfig_fields, &moduleConfig);
|
|
||||||
|
moduleConfig.has_canned_message = true;
|
||||||
|
moduleConfig.has_external_notification = true;
|
||||||
|
moduleConfig.has_mqtt = true;
|
||||||
|
moduleConfig.has_range_test = true;
|
||||||
|
moduleConfig.has_serial = true;
|
||||||
|
moduleConfig.has_store_forward = true;
|
||||||
|
moduleConfig.has_telemetry = true;
|
||||||
|
saveProto(moduleConfigfile, LocalModuleConfig_size, sizeof(LocalModuleConfig), LocalModuleConfig_fields, &moduleConfig);
|
||||||
|
|
||||||
saveChannelsToDisk();
|
saveChannelsToDisk();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -464,7 +464,6 @@ typedef struct _User {
|
|||||||
} User;
|
} User;
|
||||||
|
|
||||||
typedef PB_BYTES_ARRAY_T(237) Data_payload_t;
|
typedef PB_BYTES_ARRAY_T(237) Data_payload_t;
|
||||||
typedef PB_BYTES_ARRAY_T(237) Data_payload_compressed_t;
|
|
||||||
/* (Formerly called SubPacket)
|
/* (Formerly called SubPacket)
|
||||||
The payload portion fo a packet, this is the actual bytes that are sent
|
The payload portion fo a packet, this is the actual bytes that are sent
|
||||||
inside a radio packet (because from/to are broken out by the comms library) */
|
inside a radio packet (because from/to are broken out by the comms library) */
|
||||||
@ -472,34 +471,30 @@ typedef struct _Data {
|
|||||||
/* Formerly named typ and of type Type */
|
/* Formerly named typ and of type Type */
|
||||||
PortNum portnum;
|
PortNum portnum;
|
||||||
/* TODO: REPLACE */
|
/* TODO: REPLACE */
|
||||||
pb_size_t which_payloadVariant;
|
Data_payload_t payload;
|
||||||
union {
|
|
||||||
Data_payload_t payload;
|
|
||||||
Data_payload_compressed_t payload_compressed;
|
|
||||||
};
|
|
||||||
/* TODO: REPLACE */
|
|
||||||
bool want_response;
|
|
||||||
/* Not normally used, but for testing a sender can request that recipient
|
/* Not normally used, but for testing a sender can request that recipient
|
||||||
responds in kind (i.e. if it received a position, it should unicast back it's position).
|
responds in kind (i.e. if it received a position, it should unicast back it's position).
|
||||||
Note: that if you set this on a broadcast you will receive many replies. */
|
Note: that if you set this on a broadcast you will receive many replies. */
|
||||||
uint32_t dest;
|
bool want_response;
|
||||||
/* The address of the destination node.
|
/* The address of the destination node.
|
||||||
This field is is filled in by the mesh radio device software, application
|
This field is is filled in by the mesh radio device software, application
|
||||||
layer software should never need it.
|
layer software should never need it.
|
||||||
RouteDiscovery messages _must_ populate this.
|
RouteDiscovery messages _must_ populate this.
|
||||||
Other message types might need to if they are doing multihop routing. */
|
Other message types might need to if they are doing multihop routing. */
|
||||||
uint32_t source;
|
uint32_t dest;
|
||||||
/* The address of the original sender for this message.
|
/* The address of the original sender for this message.
|
||||||
This field should _only_ be populated for reliable multihop packets (to keep
|
This field should _only_ be populated for reliable multihop packets (to keep
|
||||||
packets small). */
|
packets small). */
|
||||||
uint32_t request_id;
|
uint32_t source;
|
||||||
/* Only used in routing or response messages.
|
/* Only used in routing or response messages.
|
||||||
Indicates the original message ID that this message is reporting failure on. (formerly called original_id) */
|
Indicates the original message ID that this message is reporting failure on. (formerly called original_id) */
|
||||||
uint32_t reply_id;
|
uint32_t request_id;
|
||||||
/* If set, this message is intened to be a reply to a previously sent message with the defined id. */
|
/* If set, this message is intened to be a reply to a previously sent message with the defined id. */
|
||||||
uint32_t emoji;
|
uint32_t reply_id;
|
||||||
/* Defaults to false. If true, then what is in the payload should be treated as an emoji like giving
|
/* Defaults to false. If true, then what is in the payload should be treated as an emoji like giving
|
||||||
a message a heart or poop emoji. */
|
a message a heart or poop emoji. */
|
||||||
|
uint32_t emoji;
|
||||||
|
/* Location structure */
|
||||||
bool has_location;
|
bool has_location;
|
||||||
Location location;
|
Location location;
|
||||||
} Data;
|
} Data;
|
||||||
@ -703,7 +698,7 @@ extern "C" {
|
|||||||
#define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0, 0, 0, 0}
|
#define User_init_default {"", "", "", {0}, _HardwareModel_MIN, 0, 0, 0, 0}
|
||||||
#define RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
#define RouteDiscovery_init_default {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||||
#define Routing_init_default {0, {RouteDiscovery_init_default}}
|
#define Routing_init_default {0, {RouteDiscovery_init_default}}
|
||||||
#define Data_init_default {_PortNum_MIN, 0, {{0, {0}}}, 0, 0, 0, 0, 0, 0, false, Location_init_default}
|
#define Data_init_default {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, Location_init_default}
|
||||||
#define Location_init_default {0, 0, 0, 0, 0}
|
#define Location_init_default {0, 0, 0, 0, 0}
|
||||||
#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
|
#define MeshPacket_init_default {0, 0, 0, 0, {Data_init_default}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
|
||||||
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, DeviceMetrics_init_default}
|
#define NodeInfo_init_default {0, false, User_init_default, false, Position_init_default, 0, 0, false, DeviceMetrics_init_default}
|
||||||
@ -717,7 +712,7 @@ extern "C" {
|
|||||||
#define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0, 0, 0, 0}
|
#define User_init_zero {"", "", "", {0}, _HardwareModel_MIN, 0, 0, 0, 0}
|
||||||
#define RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
#define RouteDiscovery_init_zero {0, {0, 0, 0, 0, 0, 0, 0, 0}}
|
||||||
#define Routing_init_zero {0, {RouteDiscovery_init_zero}}
|
#define Routing_init_zero {0, {RouteDiscovery_init_zero}}
|
||||||
#define Data_init_zero {_PortNum_MIN, 0, {{0, {0}}}, 0, 0, 0, 0, 0, 0, false, Location_init_zero}
|
#define Data_init_zero {_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, Location_init_zero}
|
||||||
#define Location_init_zero {0, 0, 0, 0, 0}
|
#define Location_init_zero {0, 0, 0, 0, 0}
|
||||||
#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
|
#define MeshPacket_init_zero {0, 0, 0, 0, {Data_init_zero}, 0, 0, 0, 0, 0, _MeshPacket_Priority_MIN, 0, _MeshPacket_Delayed_MIN}
|
||||||
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, DeviceMetrics_init_zero}
|
#define NodeInfo_init_zero {0, false, User_init_zero, false, Position_init_zero, 0, 0, false, DeviceMetrics_init_zero}
|
||||||
@ -792,7 +787,6 @@ extern "C" {
|
|||||||
#define User_ant_azimuth_tag 12
|
#define User_ant_azimuth_tag 12
|
||||||
#define Data_portnum_tag 1
|
#define Data_portnum_tag 1
|
||||||
#define Data_payload_tag 2
|
#define Data_payload_tag 2
|
||||||
#define Data_payload_compressed_tag 10
|
|
||||||
#define Data_want_response_tag 3
|
#define Data_want_response_tag 3
|
||||||
#define Data_dest_tag 4
|
#define Data_dest_tag 4
|
||||||
#define Data_source_tag 5
|
#define Data_source_tag 5
|
||||||
@ -890,15 +884,14 @@ X(a, STATIC, ONEOF, UENUM, (variant,error_reason,error_reason), 3)
|
|||||||
|
|
||||||
#define Data_FIELDLIST(X, a) \
|
#define Data_FIELDLIST(X, a) \
|
||||||
X(a, STATIC, SINGULAR, UENUM, portnum, 1) \
|
X(a, STATIC, SINGULAR, UENUM, portnum, 1) \
|
||||||
X(a, STATIC, ONEOF, BYTES, (payloadVariant,payload,payload), 2) \
|
X(a, STATIC, SINGULAR, BYTES, payload, 2) \
|
||||||
X(a, STATIC, SINGULAR, BOOL, want_response, 3) \
|
X(a, STATIC, SINGULAR, BOOL, want_response, 3) \
|
||||||
X(a, STATIC, SINGULAR, FIXED32, dest, 4) \
|
X(a, STATIC, SINGULAR, FIXED32, dest, 4) \
|
||||||
X(a, STATIC, SINGULAR, FIXED32, source, 5) \
|
X(a, STATIC, SINGULAR, FIXED32, source, 5) \
|
||||||
X(a, STATIC, SINGULAR, FIXED32, request_id, 6) \
|
X(a, STATIC, SINGULAR, FIXED32, request_id, 6) \
|
||||||
X(a, STATIC, SINGULAR, FIXED32, reply_id, 7) \
|
X(a, STATIC, SINGULAR, FIXED32, reply_id, 7) \
|
||||||
X(a, STATIC, SINGULAR, FIXED32, emoji, 8) \
|
X(a, STATIC, SINGULAR, FIXED32, emoji, 8) \
|
||||||
X(a, STATIC, OPTIONAL, MESSAGE, location, 9) \
|
X(a, STATIC, OPTIONAL, MESSAGE, location, 9)
|
||||||
X(a, STATIC, ONEOF, BYTES, (payloadVariant,payload_compressed,payload_compressed), 10)
|
|
||||||
#define Data_CALLBACK NULL
|
#define Data_CALLBACK NULL
|
||||||
#define Data_DEFAULT NULL
|
#define Data_DEFAULT NULL
|
||||||
#define Data_location_MSGTYPE Location
|
#define Data_location_MSGTYPE Location
|
||||||
|
@ -13,21 +13,21 @@
|
|||||||
/* Enum definitions */
|
/* Enum definitions */
|
||||||
typedef enum _ModuleConfig_SerialConfig_Serial_Baud {
|
typedef enum _ModuleConfig_SerialConfig_Serial_Baud {
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_Default = 0,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_Default = 0,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_2400 = 1,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_110 = 1,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_4800 = 2,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_300 = 2,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_9600 = 3,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_600 = 3,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_19200 = 4,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200 = 4,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_38400 = 5,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_2400 = 5,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_57600 = 6,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_4800 = 6,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_115200 = 7,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_9600 = 7,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_230400 = 8,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_19200 = 8,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_460800 = 9,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_38400 = 9,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_576000 = 10,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_57600 = 10,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 = 11,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_115200 = 11,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_110 = 12,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_230400 = 12,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_300 = 13,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_460800 = 13,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_600 = 14,
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_576000 = 14,
|
||||||
ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200 = 15
|
ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600 = 15
|
||||||
} ModuleConfig_SerialConfig_Serial_Baud;
|
} ModuleConfig_SerialConfig_Serial_Baud;
|
||||||
|
|
||||||
typedef enum _ModuleConfig_SerialConfig_Serial_Mode {
|
typedef enum _ModuleConfig_SerialConfig_Serial_Mode {
|
||||||
@ -133,8 +133,8 @@ typedef struct _ModuleConfig {
|
|||||||
|
|
||||||
/* Helper constants for enums */
|
/* Helper constants for enums */
|
||||||
#define _ModuleConfig_SerialConfig_Serial_Baud_MIN ModuleConfig_SerialConfig_Serial_Baud_BAUD_Default
|
#define _ModuleConfig_SerialConfig_Serial_Baud_MIN ModuleConfig_SerialConfig_Serial_Baud_BAUD_Default
|
||||||
#define _ModuleConfig_SerialConfig_Serial_Baud_MAX ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200
|
#define _ModuleConfig_SerialConfig_Serial_Baud_MAX ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600
|
||||||
#define _ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Baud)(ModuleConfig_SerialConfig_Serial_Baud_BAUD_1200+1))
|
#define _ModuleConfig_SerialConfig_Serial_Baud_ARRAYSIZE ((ModuleConfig_SerialConfig_Serial_Baud)(ModuleConfig_SerialConfig_Serial_Baud_BAUD_921600+1))
|
||||||
|
|
||||||
#define _ModuleConfig_SerialConfig_Serial_Mode_MIN ModuleConfig_SerialConfig_Serial_Mode_MODE_Default
|
#define _ModuleConfig_SerialConfig_Serial_Mode_MIN ModuleConfig_SerialConfig_Serial_Mode_MODE_Default
|
||||||
#define _ModuleConfig_SerialConfig_Serial_Mode_MAX ModuleConfig_SerialConfig_Serial_Mode_MODE_PROTO
|
#define _ModuleConfig_SerialConfig_Serial_Mode_MAX ModuleConfig_SerialConfig_Serial_Mode_MODE_PROTO
|
||||||
|
@ -46,6 +46,8 @@ typedef enum _PortNum {
|
|||||||
/* Admin control packets.
|
/* Admin control packets.
|
||||||
Payload is a [AdminMessage](/docs/developers/protobufs/api#adminmessage) message */
|
Payload is a [AdminMessage](/docs/developers/protobufs/api#adminmessage) message */
|
||||||
PortNum_ADMIN_APP = 6,
|
PortNum_ADMIN_APP = 6,
|
||||||
|
/* Compressed TEXT_MESSAGE payloads. */
|
||||||
|
PortNum_TEXT_MESSAGE_COMPRESSED_APP = 7,
|
||||||
/* Provides a 'ping' service that replies to any packet it receives.
|
/* Provides a 'ping' service that replies to any packet it receives.
|
||||||
Also serves as a small example module. */
|
Also serves as a small example module. */
|
||||||
PortNum_REPLY_APP = 32,
|
PortNum_REPLY_APP = 32,
|
||||||
@ -69,8 +71,6 @@ typedef enum _PortNum {
|
|||||||
Maintained by Github user a-f-G-U-C (a Meshtastic contributor)
|
Maintained by Github user a-f-G-U-C (a Meshtastic contributor)
|
||||||
Project files at https://github.com/a-f-G-U-C/Meshtastic-ZPS */
|
Project files at https://github.com/a-f-G-U-C/Meshtastic-ZPS */
|
||||||
PortNum_ZPS_APP = 68,
|
PortNum_ZPS_APP = 68,
|
||||||
/* Compressed payloads. */
|
|
||||||
PortNum_COMPRESSION_APP = 69,
|
|
||||||
/* Private applications should use portnums >= 256.
|
/* Private applications should use portnums >= 256.
|
||||||
To simplify initial development and testing you can use "PRIVATE_APP"
|
To simplify initial development and testing you can use "PRIVATE_APP"
|
||||||
in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/Meshtastic-device/blob/master/bin/regen-protos.sh)) */
|
in your code without needing to rebuild protobuf files (via [regen-protos.sh](https://github.com/meshtastic/Meshtastic-device/blob/master/bin/regen-protos.sh)) */
|
||||||
|
@ -216,6 +216,17 @@ bool initWifi(bool forceSoftAP)
|
|||||||
DEBUG_MSG("Starting (Forced) WIFI AP: ssid=%s, ok=%d\n", softAPssid, ok);
|
DEBUG_MSG("Starting (Forced) WIFI AP: ssid=%s, ok=%d\n", softAPssid, ok);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
// If AP is configured to be hidden hidden
|
||||||
|
if (config.wifi.ap_hidden) {
|
||||||
|
|
||||||
|
// The configurations on softAP are from the espresif library
|
||||||
|
int ok = WiFi.softAP(wifiName, wifiPsw, 1, 1, 4);
|
||||||
|
DEBUG_MSG("Starting hiddem WIFI AP: ssid=%s, ok=%d\n", wifiName, ok);
|
||||||
|
} else {
|
||||||
|
int ok = WiFi.softAP(wifiName, wifiPsw);
|
||||||
|
DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, ok);
|
||||||
|
}
|
||||||
int ok = WiFi.softAP(wifiName, wifiPsw);
|
int ok = WiFi.softAP(wifiName, wifiPsw);
|
||||||
DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, ok);
|
DEBUG_MSG("Starting WIFI AP: ssid=%s, ok=%d\n", wifiName, ok);
|
||||||
}
|
}
|
||||||
|
@ -176,26 +176,32 @@ void AdminModule::handleSetConfig(const Config &c)
|
|||||||
switch (c.which_payloadVariant) {
|
switch (c.which_payloadVariant) {
|
||||||
case Config_device_tag:
|
case Config_device_tag:
|
||||||
DEBUG_MSG("Setting config: Device\n");
|
DEBUG_MSG("Setting config: Device\n");
|
||||||
|
config.has_device = true;
|
||||||
config.device = c.payloadVariant.device;
|
config.device = c.payloadVariant.device;
|
||||||
break;
|
break;
|
||||||
case Config_position_tag:
|
case Config_position_tag:
|
||||||
DEBUG_MSG("Setting config: Position\n");
|
DEBUG_MSG("Setting config: Position\n");
|
||||||
|
config.has_position = true;
|
||||||
config.position = c.payloadVariant.position;
|
config.position = c.payloadVariant.position;
|
||||||
break;
|
break;
|
||||||
case Config_power_tag:
|
case Config_power_tag:
|
||||||
DEBUG_MSG("Setting config: Power\n");
|
DEBUG_MSG("Setting config: Power\n");
|
||||||
|
config.has_power = true;
|
||||||
config.power = c.payloadVariant.power;
|
config.power = c.payloadVariant.power;
|
||||||
break;
|
break;
|
||||||
case Config_wifi_tag:
|
case Config_wifi_tag:
|
||||||
DEBUG_MSG("Setting config: WiFi\n");
|
DEBUG_MSG("Setting config: WiFi\n");
|
||||||
|
config.has_wifi = true;
|
||||||
config.wifi = c.payloadVariant.wifi;
|
config.wifi = c.payloadVariant.wifi;
|
||||||
break;
|
break;
|
||||||
case Config_display_tag:
|
case Config_display_tag:
|
||||||
DEBUG_MSG("Setting config: Display\n");
|
DEBUG_MSG("Setting config: Display\n");
|
||||||
|
config.has_display = true;
|
||||||
config.display = c.payloadVariant.display;
|
config.display = c.payloadVariant.display;
|
||||||
break;
|
break;
|
||||||
case Config_lora_tag:
|
case Config_lora_tag:
|
||||||
DEBUG_MSG("Setting config: LoRa\n");
|
DEBUG_MSG("Setting config: LoRa\n");
|
||||||
|
config.has_lora = true;
|
||||||
config.lora = c.payloadVariant.lora;
|
config.lora = c.payloadVariant.lora;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -208,30 +214,37 @@ void AdminModule::handleSetModuleConfig(const ModuleConfig &c)
|
|||||||
switch (c.which_payloadVariant) {
|
switch (c.which_payloadVariant) {
|
||||||
case ModuleConfig_mqtt_tag:
|
case ModuleConfig_mqtt_tag:
|
||||||
DEBUG_MSG("Setting module config: MQTT\n");
|
DEBUG_MSG("Setting module config: MQTT\n");
|
||||||
|
moduleConfig.has_mqtt = true;
|
||||||
moduleConfig.mqtt = c.payloadVariant.mqtt;
|
moduleConfig.mqtt = c.payloadVariant.mqtt;
|
||||||
break;
|
break;
|
||||||
case ModuleConfig_serial_tag:
|
case ModuleConfig_serial_tag:
|
||||||
DEBUG_MSG("Setting module config: Serial\n");
|
DEBUG_MSG("Setting module config: Serial\n");
|
||||||
|
moduleConfig.has_serial = true;
|
||||||
moduleConfig.serial = c.payloadVariant.serial;
|
moduleConfig.serial = c.payloadVariant.serial;
|
||||||
break;
|
break;
|
||||||
case ModuleConfig_external_notification_tag:
|
case ModuleConfig_external_notification_tag:
|
||||||
DEBUG_MSG("Setting module config: External Notification\n");
|
DEBUG_MSG("Setting module config: External Notification\n");
|
||||||
|
moduleConfig.has_external_notification = true;
|
||||||
moduleConfig.external_notification = c.payloadVariant.external_notification;
|
moduleConfig.external_notification = c.payloadVariant.external_notification;
|
||||||
break;
|
break;
|
||||||
case ModuleConfig_store_forward_tag:
|
case ModuleConfig_store_forward_tag:
|
||||||
DEBUG_MSG("Setting module config: Store & Forward\n");
|
DEBUG_MSG("Setting module config: Store & Forward\n");
|
||||||
|
moduleConfig.has_store_forward = true;
|
||||||
moduleConfig.store_forward = c.payloadVariant.store_forward;
|
moduleConfig.store_forward = c.payloadVariant.store_forward;
|
||||||
break;
|
break;
|
||||||
case ModuleConfig_range_test_tag:
|
case ModuleConfig_range_test_tag:
|
||||||
DEBUG_MSG("Setting module config: Range Test\n");
|
DEBUG_MSG("Setting module config: Range Test\n");
|
||||||
|
moduleConfig.has_range_test = true;
|
||||||
moduleConfig.range_test = c.payloadVariant.range_test;
|
moduleConfig.range_test = c.payloadVariant.range_test;
|
||||||
break;
|
break;
|
||||||
case ModuleConfig_telemetry_tag:
|
case ModuleConfig_telemetry_tag:
|
||||||
DEBUG_MSG("Setting module config: Telemetry\n");
|
DEBUG_MSG("Setting module config: Telemetry\n");
|
||||||
|
moduleConfig.has_telemetry = true;
|
||||||
moduleConfig.telemetry = c.payloadVariant.telemetry;
|
moduleConfig.telemetry = c.payloadVariant.telemetry;
|
||||||
break;
|
break;
|
||||||
case ModuleConfig_canned_message_tag:
|
case ModuleConfig_canned_message_tag:
|
||||||
DEBUG_MSG("Setting module config: Canned Message\n");
|
DEBUG_MSG("Setting module config: Canned Message\n");
|
||||||
|
moduleConfig.has_canned_message = true;
|
||||||
moduleConfig.canned_message = c.payloadVariant.canned_message;
|
moduleConfig.canned_message = c.payloadVariant.canned_message;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user