mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-06 11:39:32 +00:00
trunk fmt
This commit is contained in:
parent
81a4c84c2e
commit
6ea3642919
@ -425,10 +425,13 @@ bool Channels::decryptForHash(ChannelIndex chIndex, ChannelHash channelHash)
|
||||
bool Channels::setDefaultPresetCryptoForHash(ChannelHash channelHash)
|
||||
{
|
||||
// Iterate all known presets
|
||||
for (int preset = _meshtastic_Config_LoRaConfig_ModemPreset_MIN; preset <= _meshtastic_Config_LoRaConfig_ModemPreset_MAX; ++preset) {
|
||||
for (int preset = _meshtastic_Config_LoRaConfig_ModemPreset_MIN; preset <= _meshtastic_Config_LoRaConfig_ModemPreset_MAX;
|
||||
++preset) {
|
||||
const char *name = DisplayFormatters::getModemPresetDisplayName((meshtastic_Config_LoRaConfig_ModemPreset)preset, false);
|
||||
if (!name) continue;
|
||||
if (strcmp(name, "Invalid") == 0) continue; // skip invalid placeholder
|
||||
if (!name)
|
||||
continue;
|
||||
if (strcmp(name, "Invalid") == 0)
|
||||
continue; // skip invalid placeholder
|
||||
uint8_t h = xorHash((const uint8_t *)name, strlen(name));
|
||||
// Expand default PSK alias 1 to actual bytes and xor into hash
|
||||
uint8_t tmp = h ^ xorHash(defaultpsk, sizeof(defaultpsk));
|
||||
|
@ -100,4 +100,3 @@
|
||||
#define MODEM_DTR 8
|
||||
#define MODEM_RX 10
|
||||
#define MODEM_TX 11
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user