Skip to content

Commit 728b586

Browse files
committed
Address comments
1 parent 7413928 commit 728b586

3 files changed

Lines changed: 27 additions & 12 deletions

File tree

docs/cli_commands.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,16 +506,31 @@ This document provides an overview of CLI commands that can be sent to MeshCore
506506
- `set dutycycle <value>`
507507

508508
**Parameters:**
509-
- `value`: Duty cycle percentage (10-100)
509+
- `value`: Duty cycle percentage (1-100)
510510

511511
**Default:** `50%` (equivalent to airtime factor 1.0)
512512

513513
**Examples:**
514514
- `set dutycycle 100` — no duty cycle limit
515515
- `set dutycycle 50` — 50% duty cycle (default)
516-
- `set dutycycle 10` — 10% duty cycle (strictest EU requirement)
516+
- `set dutycycle 10` — 10% duty cycle
517+
- `set dutycycle 1` — 1% duty cycle (strictest EU requirement)
517518

518-
> **Deprecated:** `get af` / `set af` still work but are deprecated in favour of `dutycycle`.
519+
> **Note:** Added in firmware v1.15.0
520+
521+
---
522+
523+
#### View or change the airtime factor (duty cycle limit)
524+
> **Deprecated** as of firmware v1.15.0. Use [`get/set dutycycle`](#view-or-change-the-duty-cycle-limit) instead.
525+
526+
**Usage:**
527+
- `get af`
528+
- `set af <value>`
529+
530+
**Parameters:**
531+
- `value`: Airtime factor (0-9)
532+
533+
**Default:** `1.0`
519534

520535
---
521536

docs/terminal_chat_cli.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ Sets your advertisement map longitude. (decimal degrees)
3030
```
3131
set dutycycle {percent}
3232
```
33-
Sets the transmit duty cycle limit (10-100%). Example: `set dutycycle 10` for 10%.
33+
Sets the transmit duty cycle limit (1-100%). Example: `set dutycycle 10` for 10%.
3434

35-
> **Deprecated:** `set af` still works but is deprecated in favour of `set dutycycle`.
35+
```
36+
set af {air-time-factor}
37+
```
38+
Sets the transmit air-time-factor. Deprecated — use `set dutycycle` instead.
3639

3740

3841
```

src/helpers/CommonCLI.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
300300
int dc_frac = (int)((dc - dc_int) * 10.0f + 0.5f);
301301
sprintf(reply, "> %d.%d%%", dc_int, dc_frac);
302302
} else if (memcmp(config, "af", 2) == 0) {
303-
sprintf(reply, "> %s (deprecated, use 'get dutycycle')", StrHelper::ftoa(_prefs->airtime_factor));
303+
sprintf(reply, "> %s", StrHelper::ftoa(_prefs->airtime_factor));
304304
} else if (memcmp(config, "int.thresh", 10) == 0) {
305305
sprintf(reply, "> %d", (uint32_t) _prefs->interference_threshold);
306306
} else if (memcmp(config, "agc.reset.interval", 18) == 0) {
@@ -458,8 +458,8 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
458458
const char* config = &command[4];
459459
if (memcmp(config, "dutycycle ", 10) == 0) {
460460
float dc = atof(&config[10]);
461-
if (dc < 10 || dc > 100) {
462-
strcpy(reply, "ERROR: dutycycle must be 10-100");
461+
if (dc < 1 || dc > 100) {
462+
strcpy(reply, "ERROR: dutycycle must be 1-100");
463463
} else {
464464
_prefs->airtime_factor = (100.0f / dc) - 1.0f;
465465
savePrefs();
@@ -471,10 +471,7 @@ void CommonCLI::handleCommand(uint32_t sender_timestamp, const char* command, ch
471471
} else if (memcmp(config, "af ", 3) == 0) {
472472
_prefs->airtime_factor = atof(&config[3]);
473473
savePrefs();
474-
float actual = 100.0f / (_prefs->airtime_factor + 1.0f);
475-
int a_int = (int)actual;
476-
int a_frac = (int)((actual - a_int) * 10.0f + 0.5f);
477-
sprintf(reply, "OK - %d.%d%% (deprecated, use 'set dutycycle')", a_int, a_frac);
474+
strcpy(reply, "OK");
478475
} else if (memcmp(config, "int.thresh ", 11) == 0) {
479476
_prefs->interference_threshold = atoi(&config[11]);
480477
savePrefs();

0 commit comments

Comments
 (0)