Skip to content

Commit

Permalink
fix #349 channel suffix letter didn't match between device and phone
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksville committed Aug 30, 2020
1 parent c370eb4 commit 6cdaf8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mesh/NodeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const char *getChannelName()
static char buf[32];

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];

snprintf(buf, sizeof(buf), "#%s-%c", channelSettings.name, 'A' + (code % 26));
Expand Down Expand Up @@ -121,7 +121,7 @@ void NodeDB::resetRadioConfig()
channelSettings.modem_config = ChannelSettings_ModemConfig_Bw125Cr48Sf4096; // slow and long range

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);
strcpy(channelSettings.name, "Default");
}
Expand Down

0 comments on commit 6cdaf8c

Please sign in to comment.