|
|
@ -7,6 +7,15 @@ |
|
|
class CustomLR1121Wrapper : public RadioLibWrapper { |
|
|
class CustomLR1121Wrapper : public RadioLibWrapper { |
|
|
public: |
|
|
public: |
|
|
CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { } |
|
|
CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { } |
|
|
|
|
|
|
|
|
|
|
|
void setParams(float freq, float bw, uint8_t sf, uint8_t cr) override { |
|
|
|
|
|
((CustomLR1121 *)_radio)->setFrequency(freq); |
|
|
|
|
|
((CustomLR1121 *)_radio)->setSpreadingFactor(sf); |
|
|
|
|
|
((CustomLR1121 *)_radio)->setBandwidth(bw); |
|
|
|
|
|
((CustomLR1121 *)_radio)->setCodingRate(cr); |
|
|
|
|
|
updatePreamble(sf); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz()); } |
|
|
void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz()); } |
|
|
bool isReceivingPacket() override { |
|
|
bool isReceivingPacket() override { |
|
|
return ((CustomLR1121 *)_radio)->isReceiving(); |
|
|
return ((CustomLR1121 *)_radio)->isReceiving(); |
|
|
@ -19,12 +28,14 @@ public: |
|
|
|
|
|
|
|
|
void onSendFinished() override { |
|
|
void onSendFinished() override { |
|
|
RadioLibWrapper::onSendFinished(); |
|
|
RadioLibWrapper::onSendFinished(); |
|
|
_radio->setPreambleLength(16); // overcomes weird issues with small and big pkts
|
|
|
_radio->setPreambleLength(preambleLengthForSF(getSpreadingFactor())); // overcomes weird issues with small and big pkts
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
float getLastRSSI() const override { return ((CustomLR1121 *)_radio)->getRSSI(); } |
|
|
float getLastRSSI() const override { return ((CustomLR1121 *)_radio)->getRSSI(); } |
|
|
float getLastSNR() const override { return ((CustomLR1121 *)_radio)->getSNR(); } |
|
|
float getLastSNR() const override { return ((CustomLR1121 *)_radio)->getSNR(); } |
|
|
|
|
|
|
|
|
|
|
|
uint8_t getSpreadingFactor() const override { return ((CustomLR1121 *)_radio)->getSpreadingFactor(); } |
|
|
|
|
|
|
|
|
void setRxBoostedGainMode(bool en) override { |
|
|
void setRxBoostedGainMode(bool en) override { |
|
|
((CustomLR1121 *)_radio)->setRxBoostedGainMode(en); |
|
|
((CustomLR1121 *)_radio)->setRxBoostedGainMode(en); |
|
|
} |
|
|
} |
|
|
|