mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 22:52:07 +00:00
Remove confusing channel suffix (#3432)
* Remove confusing channel suffix * Missed it
This commit is contained in:
parent
0d1d79b6d1
commit
aae49f5ecf
@ -1513,8 +1513,7 @@ void DebugInfo::drawFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
|
|||||||
char channelStr[20];
|
char channelStr[20];
|
||||||
{
|
{
|
||||||
concurrency::LockGuard guard(&lock);
|
concurrency::LockGuard guard(&lock);
|
||||||
auto chName = channels.getPrimaryName();
|
snprintf(channelStr, sizeof(channelStr), "#%s", channels.getName(channels.getPrimaryIndex()));
|
||||||
snprintf(channelStr, sizeof(channelStr), "%s", chName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Display power status
|
// Display power status
|
||||||
|
@ -290,40 +290,6 @@ bool Channels::hasDefaultChannel()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a short suffix used to disambiguate channels that might have the same "name" entered by the human but different PSKs.
|
|
||||||
* The ideas is that the PSK changing should be visible to the user so that they see they probably messed up and that's why they
|
|
||||||
their nodes
|
|
||||||
* aren't talking to each other.
|
|
||||||
*
|
|
||||||
* This string is of the form "#name-X".
|
|
||||||
*
|
|
||||||
* Where X is either:
|
|
||||||
* (for custom PSKS) a letter from A to Z (base26), and formed by xoring all the bytes of the PSK together,
|
|
||||||
*
|
|
||||||
* This function will also need to be implemented in GUI apps that talk to the radio.
|
|
||||||
*
|
|
||||||
* https://github.com/meshtastic/firmware/issues/269
|
|
||||||
*/
|
|
||||||
const char *Channels::getPrimaryName()
|
|
||||||
{
|
|
||||||
static char buf[32];
|
|
||||||
|
|
||||||
char suffix;
|
|
||||||
// auto channelSettings = getPrimary();
|
|
||||||
// if (channelSettings.psk.size != 1) {
|
|
||||||
// We have a standard PSK, so generate a letter based hash.
|
|
||||||
uint8_t code = getHash(primaryIndex);
|
|
||||||
|
|
||||||
suffix = 'A' + (code % 26);
|
|
||||||
/* } else {
|
|
||||||
suffix = '0' + channelSettings.psk.bytes[0];
|
|
||||||
} */
|
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "#%s-%c", getName(primaryIndex), suffix);
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Given a channel hash setup crypto for decoding that channel (or the primary channel if that channel is unsecured)
|
/** Given a channel hash setup crypto for decoding that channel (or the primary channel if that channel is unsecured)
|
||||||
*
|
*
|
||||||
* This method is called before decoding inbound packets
|
* This method is called before decoding inbound packets
|
||||||
|
@ -61,25 +61,6 @@ class Channels
|
|||||||
|
|
||||||
ChannelIndex getNumChannels() { return channelFile.channels_count; }
|
ChannelIndex getNumChannels() { return channelFile.channels_count; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate a short suffix used to disambiguate channels that might have the same "name" entered by the human but different
|
|
||||||
PSKs.
|
|
||||||
* The ideas is that the PSK changing should be visible to the user so that they see they probably messed up and that's why
|
|
||||||
they their nodes
|
|
||||||
* aren't talking to each other.
|
|
||||||
*
|
|
||||||
* This string is of the form "#name-X".
|
|
||||||
*
|
|
||||||
* Where X is either:
|
|
||||||
* (for custom PSKS) a letter from A to Z (base26), and formed by xoring all the bytes of the PSK together,
|
|
||||||
* OR (for the standard minimially secure PSKs) a number from 0 to 9.
|
|
||||||
*
|
|
||||||
* This function will also need to be implemented in GUI apps that talk to the radio.
|
|
||||||
*
|
|
||||||
* https://github.com/meshtastic/firmware/issues/269
|
|
||||||
*/
|
|
||||||
const char *getPrimaryName();
|
|
||||||
|
|
||||||
/// Called by NodeDB on initial boot when the radio config settings are unset. Set a default single channel config.
|
/// Called by NodeDB on initial boot when the radio config settings are unset. Set a default single channel config.
|
||||||
void initDefaults();
|
void initDefaults();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user