Skip to content

Commit 5fcf25a

Browse files
committed
Add getCodingRate() to CustomLR1110 and CustomLR1110Wrapper
LR1110 has codingRate as protected field in LR_common.h, so getCodingRate() is implemented in CustomLR1110 class directly, and exposed via CustomLR1110Wrapper override. This enables dynamic MAX_TEXT_LEN calculation for T1000-E under JP_STRICT mode.
1 parent b6ca679 commit 5fcf25a

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/helpers/radiolib/CustomLR1110.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@ class CustomLR1110 : public LR1110 {
3636
bool detected = ((irq & RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID) || (irq & RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED));
3737
return detected;
3838
}
39-
};
39+
40+
uint8_t getCodingRate() const {
41+
return this->codingRate + 4; // RadioLib stores 1-4, return 5-8
42+
}
43+
};

src/helpers/radiolib/CustomLR1110Wrapper.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ class CustomLR1110Wrapper : public RadioLibWrapper {
3131
bool getRxBoostedGainMode() const override {
3232
return ((CustomLR1110 *)_radio)->getRxBoostedGainMode();
3333
}
34+
35+
uint8_t getCodingRate() const override {
36+
return ((CustomLR1110 *)_radio)->getCodingRate();
37+
}
3438
};

0 commit comments

Comments
 (0)