Merge pull request #3469 from Blake-Latchford/issue/3409/constrain-agc-interval

Constrain `agc.reset.interval` and allow intervals > 255s
This commit is contained in:
ripplebiz
2026-09-22 15:03:03 +10:00
committed by GitHub
5 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -628,7 +628,7 @@ This document provides an overview of CLI commands that can be sent to MeshCore
- `set agc.reset.interval <value>`
**Parameters:**
- `value`: Interval in seconds rounded down to a multiple of 4 (17 becomes 16). 0 to disable.
- `value`: Interval in seconds, 0-1020, rounded down to a multiple of 4 (17 becomes 16). 0 to disable.
**Default:** `0.0`
+2 -2
View File
@@ -106,8 +106,8 @@ private:
void setTxPower(uint8_t dbm) override { _parent->tx_power_dbm = dbm; markDirty(); }
float getRxDelay() const override { return _parent->rx_delay_base; }
void setRxDelay(float d) override { _parent->rx_delay_base = d; markDirty(); }
uint8_t getAgcResetInt() const override { return _parent->agc_reset_interval * 4; }
void setAgcResetInt(uint8_t secs) override { _parent->agc_reset_interval = secs / 4; markDirty(); }
uint16_t getAgcResetInt() const override { return _parent->agc_reset_interval * 4; }
void setAgcResetInt(uint16_t secs) override { _parent->agc_reset_interval = secs / 4; markDirty(); }
uint8_t getHashMode() const override { return _parent->path_hash_mode; }
void setHashMode(uint8_t m) override { _parent->path_hash_mode = m; markDirty(); }
uint8_t getMultiAcks() const override { return _parent->multi_acks; }
+2 -2
View File
@@ -119,8 +119,8 @@ private:
void setTxPower(uint8_t dbm) override { _parent->tx_power_dbm = dbm; markDirty(); }
float getRxDelay() const override { return _parent->rx_delay_base; }
void setRxDelay(float d) override { _parent->rx_delay_base = d; markDirty(); }
uint8_t getAgcResetInt() const override { return _parent->agc_reset_interval * 4; }
void setAgcResetInt(uint8_t secs) override { _parent->agc_reset_interval = secs / 4; markDirty(); }
uint16_t getAgcResetInt() const override { return _parent->agc_reset_interval * 4; }
void setAgcResetInt(uint16_t secs) override { _parent->agc_reset_interval = secs / 4; markDirty(); }
uint8_t getHashMode() const override { return _parent->path_hash_mode; }
void setHashMode(uint8_t m) override { _parent->path_hash_mode = m; markDirty(); }
uint8_t getMultiAcks() const override { return _parent->multi_acks; }
+3 -1
View File
@@ -165,7 +165,9 @@ bool CommonRadioPrefs::handleCommand(const char* command, uint32_t sender_timest
return true;
}
if (memcmp(command, "set agc.reset.interval ", 23) == 0) {
setAgcResetInt(atoi(&command[23]));
int secs = atoi(&command[23]);
secs = constrain(secs, 0, 255 * 4);
setAgcResetInt((uint16_t) secs);
sprintf(reply, "OK - interval rounded to %d", (uint32_t) getAgcResetInt());
return true;
}
+2 -2
View File
@@ -41,8 +41,8 @@ public:
virtual float getRxDelay() const = 0;
virtual void setRxDelay(float d) = 0;
virtual uint8_t getAgcResetInt() const = 0;
virtual void setAgcResetInt(uint8_t secs) = 0;
virtual uint16_t getAgcResetInt() const = 0;
virtual void setAgcResetInt(uint16_t secs) = 0;
virtual uint8_t getHashMode() const = 0;
virtual void setHashMode(uint8_t m) = 0;