MeshCore/src/helpers/CustomLR1110Wrapper.h

27 lines
899 B
C
Raw Normal View History

2025-02-14 09:54:06 +01:00
#pragma once
#include "CustomLR1110.h"
#include "RadioLibWrappers.h"
class CustomLR1110Wrapper : public RadioLibWrapper {
public:
CustomLR1110Wrapper(CustomLR1110& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { }
bool isReceivingPacket() override {
return ((CustomLR1110 *)_radio)->isReceiving();
2025-02-14 09:54:06 +01:00
}
float getCurrentRSSI() override {
float rssi = -110;
((CustomLR1110 *)_radio)->getRssiInst(&rssi);
return rssi;
}
2025-02-14 09:54:06 +01:00
void onSendFinished() override {
RadioLibWrapper::onSendFinished();
_radio->setPreambleLength(8); // overcomes weird issues with small and big pkts
}
float getLastRSSI() const override { return ((CustomLR1110 *)_radio)->getRSSI(); }
float getLastSNR() const override { return ((CustomLR1110 *)_radio)->getSNR(); }
int16_t setRxBoostedGainMode(bool en) { return ((CustomLR1110 *)_radio)->setRxBoostedGainMode(en); };
2025-02-14 09:54:06 +01:00
};