|
|
@ -300,7 +300,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch |
|
|
int dc_frac = (int)((dc - dc_int) * 10.0f + 0.5f); |
|
|
int dc_frac = (int)((dc - dc_int) * 10.0f + 0.5f); |
|
|
sprintf(reply, "> %d.%d%%", dc_int, dc_frac); |
|
|
sprintf(reply, "> %d.%d%%", dc_int, dc_frac); |
|
|
} else if (memcmp(config, "af", 2) == 0) { |
|
|
} else if (memcmp(config, "af", 2) == 0) { |
|
|
sprintf(reply, "> %s (deprecated, use 'get dutycycle')", StrHelper::ftoa(_prefs->airtime_factor)); |
|
|
sprintf(reply, "> %s", StrHelper::ftoa(_prefs->airtime_factor)); |
|
|
} else if (memcmp(config, "int.thresh", 10) == 0) { |
|
|
} else if (memcmp(config, "int.thresh", 10) == 0) { |
|
|
sprintf(reply, "> %d", (uint32_t) _prefs->interference_threshold); |
|
|
sprintf(reply, "> %d", (uint32_t) _prefs->interference_threshold); |
|
|
} else if (memcmp(config, "agc.reset.interval", 18) == 0) { |
|
|
} else if (memcmp(config, "agc.reset.interval", 18) == 0) { |
|
|
@ -458,8 +458,8 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch |
|
|
const char* config = &command[4]; |
|
|
const char* config = &command[4]; |
|
|
if (memcmp(config, "dutycycle ", 10) == 0) { |
|
|
if (memcmp(config, "dutycycle ", 10) == 0) { |
|
|
float dc = atof(&config[10]); |
|
|
float dc = atof(&config[10]); |
|
|
if (dc < 10 || dc > 100) { |
|
|
if (dc < 1 || dc > 100) { |
|
|
strcpy(reply, "ERROR: dutycycle must be 10-100"); |
|
|
strcpy(reply, "ERROR: dutycycle must be 1-100"); |
|
|
} else { |
|
|
} else { |
|
|
_prefs->airtime_factor = (100.0f / dc) - 1.0f; |
|
|
_prefs->airtime_factor = (100.0f / dc) - 1.0f; |
|
|
savePrefs(); |
|
|
savePrefs(); |
|
|
@ -471,10 +471,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch |
|
|
} else if (memcmp(config, "af ", 3) == 0) { |
|
|
} else if (memcmp(config, "af ", 3) == 0) { |
|
|
_prefs->airtime_factor = atof(&config[3]); |
|
|
_prefs->airtime_factor = atof(&config[3]); |
|
|
savePrefs(); |
|
|
savePrefs(); |
|
|
float actual = 100.0f / (_prefs->airtime_factor + 1.0f); |
|
|
strcpy(reply, "OK"); |
|
|
int a_int = (int)actual; |
|
|
|
|
|
int a_frac = (int)((actual - a_int) * 10.0f + 0.5f); |
|
|
|
|
|
sprintf(reply, "OK - %d.%d%% (deprecated, use 'set dutycycle')", a_int, a_frac); |
|
|
|
|
|
} else if (memcmp(config, "int.thresh ", 11) == 0) { |
|
|
} else if (memcmp(config, "int.thresh ", 11) == 0) { |
|
|
_prefs->interference_threshold = atoi(&config[11]); |
|
|
_prefs->interference_threshold = atoi(&config[11]); |
|
|
savePrefs(); |
|
|
savePrefs(); |
|
|
|