From 2645c2c2c304f0eec82f56b41c161df36defa209 Mon Sep 17 00:00:00 2001 From: me Date: Mon, 22 Jun 2026 13:07:18 -0700 Subject: [PATCH] Add getCodingRate() and getFreqMHz() to CustomLR1110/Wrapper getCodingRate() returns codingRate+4 (RadioLib stores 1-4 internally, expose as CR4/5-8 matching the rest of the codebase). CustomLR1110Wrapper overrides both getCodingRate() and getFreqMHz() so isJapanMode() and getMaxTextLen() work correctly on T1000-E. --- src/helpers/radiolib/CustomLR1110.h | 1 + src/helpers/radiolib/CustomLR1110Wrapper.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/helpers/radiolib/CustomLR1110.h b/src/helpers/radiolib/CustomLR1110.h index 0470e48f2..33c20cca2 100644 --- a/src/helpers/radiolib/CustomLR1110.h +++ b/src/helpers/radiolib/CustomLR1110.h @@ -82,4 +82,5 @@ class CustomLR1110 : public LR1110 { } uint8_t getSpreadingFactor() const { return spreadingFactor; } + uint8_t getCodingRate() const { return this->codingRate + 4; } // RadioLib stores 1-4, return 5-8 }; \ No newline at end of file diff --git a/src/helpers/radiolib/CustomLR1110Wrapper.h b/src/helpers/radiolib/CustomLR1110Wrapper.h index 44230c61c..ca86bc95f 100644 --- a/src/helpers/radiolib/CustomLR1110Wrapper.h +++ b/src/helpers/radiolib/CustomLR1110Wrapper.h @@ -43,6 +43,8 @@ public: float getLastSNR() const override { return ((CustomLR1110 *)_radio)->getSNR(); } uint8_t getSpreadingFactor() const override { return ((CustomLR1110 *)_radio)->getSpreadingFactor(); } + uint8_t getCodingRate() const override { return ((CustomLR1110 *)_radio)->getCodingRate(); } + float getFreqMHz() const override { return ((CustomLR1110 *)_radio)->getFreqMHz(); } bool setRxBoostedGainMode(bool en) override { return ((CustomLR1110 *)_radio)->setRxBoostedGainMode(en) == RADIOLIB_ERR_NONE;