Browse Source

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.
pull/2218/head
me 1 month ago
parent
commit
2645c2c2c3
  1. 1
      src/helpers/radiolib/CustomLR1110.h
  2. 2
      src/helpers/radiolib/CustomLR1110Wrapper.h

1
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
};

2
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;

Loading…
Cancel
Save