mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 19:20:41 +00:00
Finish config transition
This commit is contained in:
@@ -83,9 +83,9 @@ void Channels::initDefaultChannel(ChannelIndex chIndex)
|
||||
{
|
||||
Channel &ch = getByIndex(chIndex);
|
||||
ChannelSettings &channelSettings = ch.settings;
|
||||
Config_LoRaConfig &loraConfig = config.payloadVariant.lora_config;
|
||||
Config_LoRaConfig &loraConfig = config.payloadVariant.lora;
|
||||
|
||||
loraConfig.modem_config = Config_LoRaConfig_ModemConfig_LongFast; // Default to Long Range & Fast
|
||||
loraConfig.modem_preset = Config_LoRaConfig_ModemPreset_LongFast; // Default to Long Range & Fast
|
||||
|
||||
loraConfig.tx_power = 0; // default
|
||||
uint8_t defaultpskIndex = 1;
|
||||
@@ -203,37 +203,37 @@ void Channels::setChannel(const Channel &c)
|
||||
|
||||
const char *Channels::getName(size_t chIndex)
|
||||
{
|
||||
Config_LoRaConfig &loraConfig = config.payloadVariant.lora_config;
|
||||
Config_LoRaConfig &loraConfig = config.payloadVariant.lora;
|
||||
// Convert the short "" representation for Default into a usable string
|
||||
const ChannelSettings &channelSettings = getByIndex(chIndex).settings;
|
||||
const char *channelName = channelSettings.name;
|
||||
if (!*channelName) { // emptystring
|
||||
// Per mesh.proto spec, if bandwidth is specified we must ignore modemConfig enum, we assume that in that case
|
||||
// Per mesh.proto spec, if bandwidth is specified we must ignore modemPreset enum, we assume that in that case
|
||||
// the app fucked up and forgot to set channelSettings.name
|
||||
|
||||
if (loraConfig.bandwidth != 0)
|
||||
channelName = "Unset";
|
||||
else
|
||||
switch (loraConfig.modem_config) {
|
||||
case Config_LoRaConfig_ModemConfig_ShortSlow:
|
||||
switch (loraConfig.modem_preset) {
|
||||
case Config_LoRaConfig_ModemPreset_ShortSlow:
|
||||
channelName = "ShortSlow";
|
||||
break;
|
||||
case Config_LoRaConfig_ModemConfig_ShortFast:
|
||||
case Config_LoRaConfig_ModemPreset_ShortFast:
|
||||
channelName = "ShortFast";
|
||||
break;
|
||||
case Config_LoRaConfig_ModemConfig_MidSlow:
|
||||
case Config_LoRaConfig_ModemPreset_MidSlow:
|
||||
channelName = "MediumSlow";
|
||||
break;
|
||||
case Config_LoRaConfig_ModemConfig_MidFast:
|
||||
case Config_LoRaConfig_ModemPreset_MidFast:
|
||||
channelName = "MediumFast";
|
||||
break;
|
||||
case Config_LoRaConfig_ModemConfig_LongFast:
|
||||
case Config_LoRaConfig_ModemPreset_LongFast:
|
||||
channelName = "LongFast";
|
||||
break;
|
||||
case Config_LoRaConfig_ModemConfig_LongSlow:
|
||||
case Config_LoRaConfig_ModemPreset_LongSlow:
|
||||
channelName = "LongSlow";
|
||||
break;
|
||||
case Config_LoRaConfig_ModemConfig_VLongSlow:
|
||||
case Config_LoRaConfig_ModemPreset_VLongSlow:
|
||||
channelName = "VLongSlow";
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user