kiss_modem: reach FEM gain through the board's radio.fem CLI commands

Boards own their FEM control through handleCommand() ("get/set
radio.fem.rxgain|txgain"). Use that instead of a parallel set of FEM
virtuals on MainBoard, so any board that implements the commands works
in KISS with no extra code.

- Remove the six FEM virtuals from MainBoard and the board overrides.
- KissModem talks to the board in one adapter. A gain counts as
  controllable only if "get" replies exactly "> on" or "> off". "set"
  is checked by reading the state back, never by its reply wording.
- SetFemState always replies with the read-back state once the
  requested bits pass the capability check.
- Guard the boards' prefs writes against a NULL store. KISS attaches
  no prefs, so "set radio.fem.*" would dereference NULL.
- Wio Tracker L1 1W TX gain is exposed again, matching its CLI.
This commit is contained in:
agessaman committed 2026-09-23 17:31:20 -07:00
1 parent 8cefda9612
commit 7652ec5c26
18 files changed
+161 -100

No files matched your search

-8
View File
@@ -77,14 +77,6 @@ public:
virtual bool handleCommand(const char* command, uint32_t sender_timestamp, char* reply) { return false; }
// External LoRa front-end (FEM) gain control. Boards without a controllable FEM keep these defaults.
virtual bool canControlLoRaFemLna() const { return false; }
virtual bool setLoRaFemLnaEnabled(bool enable) { return false; }
virtual bool isLoRaFemLnaEnabled() const { return false; }
virtual bool canControlLoRaFemPaGain() const { return false; }
virtual bool setLoRaFemPaGainEnabled(bool enable) { return false; }
virtual bool isLoRaFemPaGainEnabled() const { return false; }
// Called from the example main loops. Lets a board feed its watchdog and
// run periodic housekeeping. Default no-op.
virtual void loop() { /* no op */ }