|
|
|
@@ -1,3 +1,4 @@
|
|
|
|
|
#include "CLIReplyText.h"
|
|
|
|
|
#include <helpers/RegulatorSettings.h>
|
|
|
|
|
#if defined(USE_LR2021)
|
|
|
|
|
#include <helpers/radiolib/LR2021CalibrationSettings.h>
|
|
|
|
@@ -262,7 +263,7 @@ bool CommonCLI::applyAndSavePrimaryRadioParams(float freq, float bw, uint8_t sf,
|
|
|
|
|
uint8_t cr, uint16_t preamble, char* reply) {
|
|
|
|
|
const int8_t previous_power = _prefs->tx_power_dbm;
|
|
|
|
|
if (!savePrimaryRadioParams(freq, bw, sf, cr, preamble)) {
|
|
|
|
|
mesh::cli::formatError(reply, 160, "radio settings could not be saved");
|
|
|
|
|
mesh::cli::formatError(reply, 160, MESH_CLI_REPLY_TEXT("radio settings could not be saved", "radio settings not saved"));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// Arm the role's reply handoff now, while the originating CLI command is
|
|
|
|
@@ -3691,7 +3692,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
|
|
|
|
|
_callbacks->onManualClockSet();
|
|
|
|
|
uint32_t now = getRTCClock()->getCurrentTime();
|
|
|
|
|
DateTime dt = DateTime(now);
|
|
|
|
|
sprintf(reply, "OK - clock set: %02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("OK - clock set: %02d:%02d - %d/%d/%d UTC", "OK - clock: %02d:%02d - %d/%d/%d UTC"), dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "ERR: clock cannot go backwards");
|
|
|
|
|
}
|
|
|
|
@@ -3866,7 +3867,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
|
|
|
|
|
_callbacks->onManualClockSet();
|
|
|
|
|
uint32_t now = getRTCClock()->getCurrentTime();
|
|
|
|
|
DateTime dt = DateTime(now);
|
|
|
|
|
sprintf(reply, "OK - clock set: %02d:%02d - %d/%d/%d UTC", dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("OK - clock set: %02d:%02d - %d/%d/%d UTC", "OK - clock: %02d:%02d - %d/%d/%d UTC"), dt.hour(), dt.minute(), dt.day(), dt.month(), dt.year());
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "(ERR: clock cannot go backwards)");
|
|
|
|
|
}
|
|
|
|
@@ -3900,7 +3901,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
|
|
|
|
|
} else if (memcmp(command, "tempradio ", 10) == 0) {
|
|
|
|
|
uint16_t preamble = 0;
|
|
|
|
|
if (!mesh::RadioProfileCLI::parseSuffix(command + 10, 5, tmp, sizeof(tmp), preamble)) {
|
|
|
|
|
strcpy(reply, "Error, use: tempradio f,bw,sf,cr,minutes[,preamble]"); return;
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, use: tempradio f,bw,sf,cr,minutes[,preamble]", "Error, tempradio f,bw,sf,cr,minutes[,preamble]")); return;
|
|
|
|
|
}
|
|
|
|
|
const char *parts[5];
|
|
|
|
|
int num = mesh::Utils::parseTextParts(tmp, parts, 5);
|
|
|
|
@@ -3965,7 +3966,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
|
|
|
|
|
_callbacks->clearRecentRepeaters();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, unsupported on this role");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, unsupported on this role", "Error, unsupported role"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(command, "get ", 4) == 0) {
|
|
|
|
|
handleGetCmd(sender_timestamp, command, reply);
|
|
|
|
@@ -4047,7 +4048,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, char* command, char* re
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(command, "sensor set ", 11) == 0) {
|
|
|
|
|
if (!copyCLIArgument(tmp, sizeof(tmp), &command[11])) {
|
|
|
|
|
strcpy(reply, "Error, argument too long");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, argument too long", "Error, arg too long"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const char *parts[2];
|
|
|
|
@@ -4391,7 +4392,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0,1, or 2");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0,1, or 2", "Error, 0|1|2"));
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@@ -4781,18 +4782,18 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if (isAdvancedRetryConfig(config) && !_callbacks->supportsAdvancedRetryConfig()) {
|
|
|
|
|
strcpy(reply, "Error, unsupported on this role");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, unsupported on this role", "Error, unsupported role"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (isBasicRetryConfig(config) && !_callbacks->supportsBasicRetryConfig()) {
|
|
|
|
|
strcpy(reply, "Error, retry configuration unsupported on this role");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, retry configuration unsupported on this role", "Error, retry unsupported for role"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (memcmp(config, "dutycycle ", 10) == 0) {
|
|
|
|
|
float dc = 0.0f;
|
|
|
|
|
if (!mesh::cli::parseDecimalStrict(&config[10], dc)
|
|
|
|
|
|| dc < 1.0f || dc > 100.0f) {
|
|
|
|
|
strcpy(reply, "ERROR: dutycycle must be 1-100");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("ERROR: dutycycle must be 1-100", "ERROR: dutycycle 1-100"));
|
|
|
|
|
} else {
|
|
|
|
|
_prefs->airtime_factor = (100.0f / dc) - 1.0f;
|
|
|
|
|
savePrefs();
|
|
|
|
@@ -4816,7 +4817,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
mesh::cli::formatError(reply, 160, "use set system.watchdog on|off");
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
mesh::cli::formatError(reply, 160, "unsupported on this platform");
|
|
|
|
|
mesh::cli::formatError(reply, 160, MESH_CLI_REPLY_TEXT("unsupported on this platform", "platform unsupported"));
|
|
|
|
|
#endif
|
|
|
|
|
} else if (memcmp(config, "af ", 3) == 0) {
|
|
|
|
|
float factor = 0.0f;
|
|
|
|
@@ -4825,7 +4826,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, invalid airtime factor");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, invalid airtime factor", "Error, bad airtime factor"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "int.thresh ", 11) == 0) {
|
|
|
|
|
_prefs->interference_threshold = atoi(&config[11]);
|
|
|
|
@@ -4847,7 +4848,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
} else {
|
|
|
|
|
_prefs->agc_reset_interval = seconds / 4;
|
|
|
|
|
savePrefs();
|
|
|
|
|
sprintf(reply, "OK - interval rounded to %d", ((uint32_t) _prefs->agc_reset_interval) * 4);
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("OK - interval rounded to %d", "OK - rounded interval %d"), ((uint32_t) _prefs->agc_reset_interval) * 4);
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "multi.acks ", 11) == 0) {
|
|
|
|
|
_prefs->multi_acks = atoi(&config[11]);
|
|
|
|
@@ -4867,7 +4868,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "ERROR: telemetry.access must be all or acl");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("ERROR: telemetry.access must be all or acl", "ERROR: telemetry.access all|acl"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.advert.interval ", 22) == 0) {
|
|
|
|
|
uint32_t hours = 0;
|
|
|
|
@@ -4889,7 +4890,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
uint32_t mins = 0;
|
|
|
|
|
if (!parseUint32Strict(&config[16], mins)
|
|
|
|
|
|| (mins != 0 && (mins < MIN_LOCAL_ADVERT_INTERVAL || mins > 240))) {
|
|
|
|
|
sprintf(reply, "Error: interval must be 0 (off) or %d-240 minutes", MIN_LOCAL_ADVERT_INTERVAL);
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("Error: interval must be 0 (off) or %d-240 minutes", "Error: interval 0 (off) or %d-240 minutes"), MIN_LOCAL_ADVERT_INTERVAL);
|
|
|
|
|
} else {
|
|
|
|
|
const uint8_t previous = _prefs->advert_interval;
|
|
|
|
|
_prefs->advert_interval = (uint8_t)(mins / 2);
|
|
|
|
@@ -4940,9 +4941,9 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
_prefs->disable_fwd = strcmp(&config[7], "off") == 0;
|
|
|
|
|
savePrefs();
|
|
|
|
|
_callbacks->onRetryConfigChanged();
|
|
|
|
|
strcpy(reply, _prefs->disable_fwd ? "OK - repeat is now OFF" : "OK - repeat is now ON");
|
|
|
|
|
strcpy(reply, _prefs->disable_fwd ? MESH_CLI_REPLY_TEXT("OK - repeat is now OFF", "OK - repeat OFF") : MESH_CLI_REPLY_TEXT("OK - repeat is now ON", "OK - repeat ON"));
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be on or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be on or off", "Error, on|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "radio.rxgain ", 13) == 0) {
|
|
|
|
|
const char* value = &config[13];
|
|
|
|
@@ -4984,7 +4985,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
if (changed) _callbacks->recalibrateNoiseFloor();
|
|
|
|
|
_prefs->radio_fem_rxgain = 1;
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK - LoRa FEM RX gain on");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("OK - LoRa FEM RX gain on", "OK - FEM RX gain on"));
|
|
|
|
|
} else {
|
|
|
|
|
mesh::cli::formatError(reply, 160, "failed to apply LoRa FEM RX gain");
|
|
|
|
|
}
|
|
|
|
@@ -4994,7 +4995,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
if (changed) _callbacks->recalibrateNoiseFloor();
|
|
|
|
|
_prefs->radio_fem_rxgain = 0;
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK - LoRa FEM RX gain off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("OK - LoRa FEM RX gain off", "OK - FEM RX gain off"));
|
|
|
|
|
} else {
|
|
|
|
|
mesh::cli::formatError(reply, 160, "failed to apply LoRa FEM RX gain");
|
|
|
|
|
}
|
|
|
|
@@ -5013,7 +5014,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
if (_board->setLoRaFemPaGainEnabled(true)) {
|
|
|
|
|
_prefs->radio_fem_txgain = 1;
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK - LoRa FEM TX gain on");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("OK - LoRa FEM TX gain on", "OK - FEM TX gain on"));
|
|
|
|
|
} else {
|
|
|
|
|
mesh::cli::formatError(reply, 160, "failed to apply LoRa FEM TX gain");
|
|
|
|
|
}
|
|
|
|
@@ -5021,7 +5022,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
if (_board->setLoRaFemPaGainEnabled(false)) {
|
|
|
|
|
_prefs->radio_fem_txgain = 0;
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK - LoRa FEM TX gain off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("OK - LoRa FEM TX gain off", "OK - FEM TX gain off"));
|
|
|
|
|
} else {
|
|
|
|
|
mesh::cli::formatError(reply, 160, "failed to apply LoRa FEM TX gain");
|
|
|
|
|
}
|
|
|
|
@@ -5144,14 +5145,14 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
if (manual_timings_requested
|
|
|
|
|
&& (rx_us < RX_POWERSAVING_MIN_MANUAL_PERIOD_US
|
|
|
|
|
|| sleep_us < RX_POWERSAVING_MIN_MANUAL_PERIOD_US)) {
|
|
|
|
|
sprintf(reply, "ERROR: range is %lu-%lu us",
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("ERROR: range is %lu-%lu us", "ERROR: range %lu-%lu us"),
|
|
|
|
|
(unsigned long)RX_POWERSAVING_MIN_MANUAL_PERIOD_US,
|
|
|
|
|
(unsigned long)RX_POWERSAVING_MAX_PERIOD_US);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!isValidRxPowerSavingPeriod(rx_us) || !isValidRxPowerSavingPeriod(sleep_us)) {
|
|
|
|
|
sprintf(reply, "ERROR: range is %lu-%lu us",
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("ERROR: range is %lu-%lu us", "ERROR: range %lu-%lu us"),
|
|
|
|
|
(unsigned long)RX_POWERSAVING_MIN_MANUAL_PERIOD_US,
|
|
|
|
|
(unsigned long)RX_POWERSAVING_MAX_PERIOD_US);
|
|
|
|
|
return;
|
|
|
|
@@ -5223,7 +5224,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
appendRxPowerSavingAdjustmentNote(reply, _prefs, sf, bw);
|
|
|
|
|
_radio_profiles.appendPrimaryChirpWarning(reply, 160, sf, bw, preamble);
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, invalid radio params");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, invalid radio params", "Error, bad radio params"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "radioat ", 8) == 0) {
|
|
|
|
|
float freq, bw;
|
|
|
|
@@ -5233,9 +5234,9 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
char legacy[120];
|
|
|
|
|
if (!mesh::RadioProfileCLI::parseSuffix(&config[8], 5, legacy, sizeof(legacy), preamble)
|
|
|
|
|
|| !parseScheduledRadioArgs(legacy, false, freq, bw, sf, cr, start_time, end_time, _rtc->getCurrentTime())) {
|
|
|
|
|
strcpy(reply, "Error, use: set radioat f,bw,sf,cr,start (UTC or +minutes)");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, use: set radioat f,bw,sf,cr,start (UTC or +minutes)", "Error, set radioat f,bw,sf,cr,start (UTC or +minutes)"));
|
|
|
|
|
} else if (!acceptsPrimaryRadioParams(freq, bw, sf, cr, preamble)) {
|
|
|
|
|
strcpy(reply, "Error, invalid radio params");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, invalid radio params", "Error, bad radio params"));
|
|
|
|
|
} else {
|
|
|
|
|
_callbacks->addScheduledRadioParams(false, freq, bw, sf, cr, start_time, end_time, reply, preamble);
|
|
|
|
|
if (strncmp(reply, "OK", 2) == 0) {
|
|
|
|
@@ -5251,9 +5252,9 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
char legacy[120];
|
|
|
|
|
if (!mesh::RadioProfileCLI::parseSuffix(&config[12], 6, legacy, sizeof(legacy), preamble)
|
|
|
|
|
|| !parseScheduledRadioArgs(legacy, true, freq, bw, sf, cr, start_time, end_time, _rtc->getCurrentTime())) {
|
|
|
|
|
strcpy(reply, "Error, use: set tempradioat f,bw,sf,cr,start,end (UTC or +minutes)");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, use: set tempradioat f,bw,sf,cr,start,end (UTC or +minutes)", "Error, set tempradioat f,bw,sf,cr,start,end (UTC or +minutes)"));
|
|
|
|
|
} else if (!acceptsPrimaryRadioParams(freq, bw, sf, cr, preamble)) {
|
|
|
|
|
strcpy(reply, "Error, invalid radio params");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, invalid radio params", "Error, bad radio params"));
|
|
|
|
|
} else {
|
|
|
|
|
_callbacks->addScheduledRadioParams(true, freq, bw, sf, cr, start_time, end_time, reply, preamble);
|
|
|
|
|
if (strncmp(reply, "OK", 2) == 0) {
|
|
|
|
@@ -5268,7 +5269,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, invalid latitude");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, invalid latitude", "Error, bad latitude"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "lon ", 4) == 0) {
|
|
|
|
|
float longitude = 0.0f;
|
|
|
|
@@ -5277,7 +5278,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, invalid longitude");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, invalid longitude", "Error, bad longitude"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "rxdelay ", 8) == 0) {
|
|
|
|
|
float db = 0.0f;
|
|
|
|
@@ -5287,7 +5288,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-20");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-20", "Error, 0-20"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "txdelay ", 8) == 0) {
|
|
|
|
|
float f = 0.0f;
|
|
|
|
@@ -5297,7 +5298,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-2");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-2", "Error, 0-2"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.max.unscoped ", 19) == 0) {
|
|
|
|
|
uint32_t m;
|
|
|
|
@@ -5334,7 +5335,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-2");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-2", "Error, 0-2"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "retry.preset ", 13) == 0) {
|
|
|
|
|
uint8_t preset;
|
|
|
|
@@ -5343,7 +5344,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
sprintf(reply, "OK - %s", retryPresetName(_prefs->retry_preset));
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be infra, rooftop, or mobile");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be infra, rooftop, or mobile", "Error, infra|rooftop|mobile"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "direct.retry ", 13) == 0) {
|
|
|
|
|
if (strcmp(&config[13], "on") == 0) {
|
|
|
|
@@ -5357,7 +5358,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
_callbacks->onRetryConfigChanged();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be on or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be on or off", "Error, on|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "direct.retry.heard ", 19) == 0) {
|
|
|
|
|
if (strcmp(&config[19], "on") == 0) {
|
|
|
|
@@ -5369,11 +5370,11 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be on or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be on or off", "Error, on|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "direct.retry.margin ", 20) == 0) {
|
|
|
|
|
if (!looksNumeric(&config[20])) {
|
|
|
|
|
strcpy(reply, "Error, must be 0-40 dB");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-40 dB", "Error, 0-40 dB"));
|
|
|
|
|
} else {
|
|
|
|
|
int16_t margin_x4 = parseSnrDbX4(&config[20]);
|
|
|
|
|
if (margin_x4 >= 0 && margin_x4 <= 160) {
|
|
|
|
@@ -5382,7 +5383,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-40 dB");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-40 dB", "Error, 0-40 dB"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "direct.retry.count ", 19) == 0) {
|
|
|
|
@@ -5393,7 +5394,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 1-15");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 1-15", "Error, 1-15"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "direct.retry.base ", 18) == 0) {
|
|
|
|
|
int base_ms = looksUnsignedInteger(&config[18]) ? _atoi(&config[18]) : -1;
|
|
|
|
@@ -5403,7 +5404,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 10-5000 ms");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 10-5000 ms", "Error, 10-5000 ms"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "direct.retry.step ", 18) == 0) {
|
|
|
|
|
int step_ms = looksUnsignedInteger(&config[18]) ? _atoi(&config[18]) : -1;
|
|
|
|
@@ -5413,7 +5414,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-5000 ms");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-5000 ms", "Error, 0-5000 ms"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.channel.data.hops ", 24) == 0) {
|
|
|
|
|
uint8_t max_hops;
|
|
|
|
@@ -5422,7 +5423,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be all or 1-7");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be all or 1-7", "Error, all|1-7"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.channel.data ", 19) == 0) {
|
|
|
|
|
if (strcmp(&config[19], "on") == 0) {
|
|
|
|
@@ -5434,7 +5435,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be on or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be on or off", "Error, on|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.count ", 18) == 0) {
|
|
|
|
|
int attempts = looksUnsignedInteger(&config[18]) ? _atoi(&config[18]) : -1;
|
|
|
|
@@ -5445,7 +5446,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
_callbacks->onRetryConfigChanged();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-15");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-15", "Error, 0-15"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.path ", 17) == 0) {
|
|
|
|
|
uint8_t path_gate;
|
|
|
|
@@ -5458,7 +5459,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-63 or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-63 or off", "Error, 0-63|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.group.path ", 23) == 0) {
|
|
|
|
|
uint8_t path_gate;
|
|
|
|
@@ -5470,7 +5471,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be 0-63 or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be 0-63 or off", "Error, 0-63|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.prefixes ", 21) == 0) {
|
|
|
|
|
if (parseFloodRetryPrefixList(_prefs->flood_retry_prefixes, FLOOD_RETRY_PREFIX_SLOTS, &config[21])) {
|
|
|
|
@@ -5479,7 +5480,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
sprintf(reply, "Error, use up to %u comma-separated 3-byte hex prefixes",
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("Error, use up to %u comma-separated 3-byte hex prefixes", "Error, max %u comma-separated 3-byte hex prefixes"),
|
|
|
|
|
(unsigned int)FLOOD_RETRY_PREFIX_SLOTS);
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.ignore ", 19) == 0) {
|
|
|
|
@@ -5488,7 +5489,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
sprintf(reply, "Error, use up to %u comma-separated 3-byte hex prefixes",
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("Error, use up to %u comma-separated 3-byte hex prefixes", "Error, max %u comma-separated 3-byte hex prefixes"),
|
|
|
|
|
(unsigned int)FLOOD_RETRY_IGNORE_PREFIXES);
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.advert ", 19) == 0) {
|
|
|
|
@@ -5501,7 +5502,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be on or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be on or off", "Error, on|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.bridge ", 19) == 0) {
|
|
|
|
|
if (strcmp(&config[19], "on") == 0) {
|
|
|
|
@@ -5519,7 +5520,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, must be on or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be on or off", "Error, on|off"));
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "flood.retry.bucket ", 19) == 0) {
|
|
|
|
|
const char* params = &config[19];
|
|
|
|
@@ -5536,12 +5537,12 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
sprintf(reply, "Error, use up to %u comma-separated 3-byte hex prefixes",
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("Error, use up to %u comma-separated 3-byte hex prefixes", "Error, max %u comma-separated 3-byte hex prefixes"),
|
|
|
|
|
(unsigned int)FLOOD_RETRY_BUCKET_PREFIXES);
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "direct.retry.cr ", 16) == 0) {
|
|
|
|
|
if (!copyCLIArgument(tmp, sizeof(tmp), &config[16])) {
|
|
|
|
|
strcpy(reply, "Error, argument too long");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, argument too long", "Error, arg too long"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (strcmp(&config[16], "off") == 0) {
|
|
|
|
@@ -5554,7 +5555,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, use on or off on this role");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, use on or off on this role", "Error, on|off"));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
const char *parts[4];
|
|
|
|
@@ -5573,15 +5574,15 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
savePrefs();
|
|
|
|
|
strcpy(reply, "OK");
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, SNR must fit -32.00..31.75 dB");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, SNR must fit -32.00..31.75 dB", "Error, SNR -32.00..31.75 dB"));
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, use CR4,CR5,CR7,CR8 SNRs or off");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, use CR4,CR5,CR7,CR8 SNRs or off", "Error, CR4,CR5,CR7,CR8 SNRs|off"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "recent.repeater ", 16) == 0) {
|
|
|
|
|
if (!copyCLIArgument(tmp, sizeof(tmp), &config[16])) {
|
|
|
|
|
strcpy(reply, "Error, argument too long");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, argument too long", "Error, arg too long"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const char *parts[2];
|
|
|
|
@@ -5590,15 +5591,15 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
uint8_t prefix_len = 0;
|
|
|
|
|
int16_t snr_x4 = 12; // default to +3.0 dB when omitted or invalid
|
|
|
|
|
if (num < 1 || !parseHashPrefix(parts[0], prefix, prefix_len)) {
|
|
|
|
|
strcpy(reply, "Error, use: set recent.repeater <hex> [snr_db]");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, use: set recent.repeater <hex> [snr_db]", "Error, set recent.repeater <hex> [snr_db]"));
|
|
|
|
|
} else if (num > 1 && !looksNumeric(parts[1])) {
|
|
|
|
|
strcpy(reply, "Error, SNR must be numeric");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, SNR must be numeric", "Error, numeric SNR needed"));
|
|
|
|
|
} else {
|
|
|
|
|
if (num > 1) {
|
|
|
|
|
snr_x4 = parseSnrDbX4(parts[1]);
|
|
|
|
|
}
|
|
|
|
|
if (snr_x4 < -128 || snr_x4 > 127) {
|
|
|
|
|
strcpy(reply, "Error, SNR must fit -32.00..31.75 dB");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, SNR must fit -32.00..31.75 dB", "Error, SNR -32.00..31.75 dB"));
|
|
|
|
|
} else if (_callbacks->setRecentRepeater(prefix, prefix_len, (int8_t)snr_x4)) {
|
|
|
|
|
char prefix_hex[RECENT_REPEATER_PREFIX_MAX_BYTES * 2 + 1];
|
|
|
|
|
char snr[12];
|
|
|
|
@@ -5607,7 +5608,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
formatSnrDbX4Short(snr, sizeof(snr), snr_x4);
|
|
|
|
|
sprintf(reply, "OK - set %s at %s SNR", prefix_hex, snr);
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, table rejected prefix");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, table rejected prefix", "Error, prefix rejected"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (memcmp(config, "owner.info ", 11) == 0) {
|
|
|
|
@@ -5633,7 +5634,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
mode = LOOP_DETECT_STRICT;
|
|
|
|
|
} else {
|
|
|
|
|
mode = 0xFF;
|
|
|
|
|
strcpy(reply, "Error, must be: off, minimal, moderate, or strict");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, must be: off, minimal, moderate, or strict", "Error, off|minimal|moderate|strict"));
|
|
|
|
|
}
|
|
|
|
|
if (mode != 0xFF) {
|
|
|
|
|
_prefs->loop_detect = mode;
|
|
|
|
@@ -5647,7 +5648,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
if (!mesh::cli::parseIntegerStrict(&config[3], power)) {
|
|
|
|
|
mesh::cli::formatError(reply, 160, "invalid TX power");
|
|
|
|
|
} else if (!mesh::isLoRaTxPowerValid(power, _prefs->freq)) {
|
|
|
|
|
sprintf(reply, "Error: TX power range is %d to %d dBm",
|
|
|
|
|
sprintf(reply, MESH_CLI_REPLY_TEXT("Error: TX power range is %d to %d dBm", "Error: TX power %d..%d dBm"),
|
|
|
|
|
(int)minimum, (int)maximum);
|
|
|
|
|
} else {
|
|
|
|
|
applyAndSaveTxPower(static_cast<int8_t>(power), reply);
|
|
|
|
@@ -5659,7 +5660,7 @@ void CommonCLI::handleSetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
applyAndSavePrimaryRadioParams(freq, _prefs->bw, _prefs->sf, _prefs->cr,
|
|
|
|
|
_prefs->primary_radio_preamble, reply);
|
|
|
|
|
} else {
|
|
|
|
|
strcpy(reply, "Error, invalid frequency");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, invalid frequency", "Error, bad frequency"));
|
|
|
|
|
}
|
|
|
|
|
#ifdef WITH_BRIDGE
|
|
|
|
|
} else if (memcmp(config, "bridge.enabled ", 15) == 0) {
|
|
|
|
@@ -6167,11 +6168,11 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if (isAdvancedRetryConfig(config) && !_callbacks->supportsAdvancedRetryConfig()) {
|
|
|
|
|
strcpy(reply, "Error, unsupported on this role");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, unsupported on this role", "Error, unsupported role"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (isBasicRetryConfig(config) && !_callbacks->supportsBasicRetryConfig()) {
|
|
|
|
|
strcpy(reply, "Error, retry configuration unsupported on this role");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, retry configuration unsupported on this role", "Error, retry unsupported for role"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
mesh::cli::RecentRepeaterGetQuery recent_query;
|
|
|
|
@@ -6186,7 +6187,7 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
#if defined(NRF52_PLATFORM)
|
|
|
|
|
sprintf(reply, "> %s", _prefs->system_watchdog_enabled ? "on" : "off");
|
|
|
|
|
#else
|
|
|
|
|
mesh::cli::formatError(reply, 160, "unsupported on this platform");
|
|
|
|
|
mesh::cli::formatError(reply, 160, MESH_CLI_REPLY_TEXT("unsupported on this platform", "platform unsupported"));
|
|
|
|
|
#endif
|
|
|
|
|
} else if (configKeyEquals(config, "af")) {
|
|
|
|
|
sprintf(reply, "> %s", StrHelper::ftoa(_prefs->airtime_factor));
|
|
|
|
@@ -6357,7 +6358,7 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
recent_query.search_prefix_len == 0 ? NULL : recent_query.search_prefix,
|
|
|
|
|
recent_query.search_prefix_len);
|
|
|
|
|
} else if (recent_query_match == mesh::cli::RecentRepeaterGetMatch::Invalid) {
|
|
|
|
|
strcpy(reply, "Error, use: get recent.repeaters [page] | search <2|4|6 hex> [page]");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("Error, use: get recent.repeaters [page] | search <2|4|6 hex> [page]", "Error, get recent.repeaters [page] | search <2|4|6 hex> [page]"));
|
|
|
|
|
} else if (configKeyEquals(config, "owner.info")) {
|
|
|
|
|
*reply++ = '>';
|
|
|
|
|
*reply++ = ' ';
|
|
|
|
@@ -6513,7 +6514,7 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
#ifdef NRF52_POWER_MANAGEMENT
|
|
|
|
|
strcpy(reply, _board->isExternalPowered() ? "> external" : "> battery");
|
|
|
|
|
#else
|
|
|
|
|
strcpy(reply, "ERROR: Power management not supported");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("ERROR: Power management not supported", "ERROR: Power management unsupported"));
|
|
|
|
|
#endif
|
|
|
|
|
} else if (configKeyEquals(config, "pwrmgt.bootreason")) {
|
|
|
|
|
sprintf(reply, "> Reset: %s; Shutdown: %s",
|
|
|
|
@@ -6523,7 +6524,7 @@ void CommonCLI::handleGetCmd(uint32_t sender_timestamp, char* command, char* rep
|
|
|
|
|
#ifdef NRF52_POWER_MANAGEMENT
|
|
|
|
|
sprintf(reply, "> %u mV", _board->getBootVoltage());
|
|
|
|
|
#else
|
|
|
|
|
strcpy(reply, "ERROR: Power management not supported");
|
|
|
|
|
strcpy(reply, MESH_CLI_REPLY_TEXT("ERROR: Power management not supported", "ERROR: Power management unsupported"));
|
|
|
|
|
#endif
|
|
|
|
|
} else if (configKeyEquals(config, "reboot.interval")) {
|
|
|
|
|
if (_prefs->reboot_interval == 0) {
|
|
|
|
@@ -6608,7 +6609,7 @@ static bool processRegionDefSegment(RegionMap* map, char* tok, RegionEntry** cur
|
|
|
|
|
|
|
|
|
|
if (jump) {
|
|
|
|
|
RegionEntry* j = map->findByNamePrefix(jump);
|
|
|
|
|
if (j == NULL) { snprintf(reply, 160, "Err - unknown or ambiguous jump: %s", jump); return false; }
|
|
|
|
|
if (j == NULL) { snprintf(reply, 160, MESH_CLI_REPLY_TEXT("Err - unknown or ambiguous jump: %s", "Err - unknown/ambiguous jump: %s"), jump); return false; }
|
|
|
|
|
*cursor = j;
|
|
|
|
|
} else {
|
|
|
|
|
*cursor = r;
|
|
|
|
|