fix #349 channel suffix letter didn't match between device and phone

This commit is contained in:
geeksville 2020-08-30 12:38:15 -07:00
parent c370eb4a88
commit 6cdaf8c600

View File

@ -86,7 +86,7 @@ const char *getChannelName()
static char buf[32]; static char buf[32];
uint8_t code = 0; uint8_t code = 0;
for (int i = 0; i < sizeof(channelSettings.psk.size); i++) for (int i = 0; i < channelSettings.psk.size; i++)
code ^= channelSettings.psk.bytes[i]; code ^= channelSettings.psk.bytes[i];
snprintf(buf, sizeof(buf), "#%s-%c", channelSettings.name, 'A' + (code % 26)); snprintf(buf, sizeof(buf), "#%s-%c", channelSettings.name, 'A' + (code % 26));
@ -121,7 +121,7 @@ void NodeDB::resetRadioConfig()
channelSettings.modem_config = ChannelSettings_ModemConfig_Bw125Cr48Sf4096; // slow and long range channelSettings.modem_config = ChannelSettings_ModemConfig_Bw125Cr48Sf4096; // slow and long range
channelSettings.tx_power = 0; // default channelSettings.tx_power = 0; // default
memcpy(&channelSettings.psk.bytes, &defaultpsk, sizeof(channelSettings.psk)); memcpy(&channelSettings.psk.bytes, defaultpsk, sizeof(channelSettings.psk));
channelSettings.psk.size = sizeof(defaultpsk); channelSettings.psk.size = sizeof(defaultpsk);
strcpy(channelSettings.name, "Default"); strcpy(channelSettings.name, "Default");
} }