mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 10:50:40 +00:00
Set tx_enabled upon initial region assignment (#1700)
This commit is contained in:
parent
128d20b290
commit
0e2ab75bb0
@ -177,6 +177,7 @@ void AdminModule::handleSetConfig(const Config &c)
|
|||||||
{
|
{
|
||||||
bool requiresReboot = false;
|
bool requiresReboot = false;
|
||||||
bool isRouter = (config.device.role == Config_DeviceConfig_Role_ROUTER);
|
bool isRouter = (config.device.role == Config_DeviceConfig_Role_ROUTER);
|
||||||
|
bool isRegionUnset = (config.lora.region == Config_LoRaConfig_RegionCode_UNSET);
|
||||||
|
|
||||||
switch (c.which_payload_variant) {
|
switch (c.which_payload_variant) {
|
||||||
case Config_device_tag:
|
case Config_device_tag:
|
||||||
@ -216,6 +217,10 @@ void AdminModule::handleSetConfig(const Config &c)
|
|||||||
DEBUG_MSG("Setting config: LoRa\n");
|
DEBUG_MSG("Setting config: LoRa\n");
|
||||||
config.has_lora = true;
|
config.has_lora = true;
|
||||||
config.lora = c.payload_variant.lora;
|
config.lora = c.payload_variant.lora;
|
||||||
|
if (isRegionUnset &&
|
||||||
|
config.lora.region > Config_LoRaConfig_RegionCode_UNSET) {
|
||||||
|
config.lora.tx_enabled = true;
|
||||||
|
}
|
||||||
requiresReboot = true;
|
requiresReboot = true;
|
||||||
break;
|
break;
|
||||||
case Config_bluetooth_tag:
|
case Config_bluetooth_tag:
|
||||||
|
Loading…
Reference in New Issue
Block a user