mirror of https://github.com/meshcore-dev/MeshCore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
#pragma once
|
|
|
|
#include "CustomLR1121.h"
|
|
#include "RadioLibWrappers.h"
|
|
#include "LR11x0Reset.h"
|
|
|
|
class CustomLR1121Wrapper : public RadioLibWrapper {
|
|
public:
|
|
CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { }
|
|
void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz()); }
|
|
bool isReceivingPacket() override {
|
|
return ((CustomLR1121 *)_radio)->isReceiving();
|
|
}
|
|
float getCurrentRSSI() override {
|
|
float rssi = -110;
|
|
((CustomLR1121 *)_radio)->getRssiInst(&rssi);
|
|
return rssi;
|
|
}
|
|
|
|
void onSendFinished() override {
|
|
RadioLibWrapper::onSendFinished();
|
|
_radio->setPreambleLength(16); // overcomes weird issues with small and big pkts
|
|
}
|
|
|
|
float getLastRSSI() const override { return ((CustomLR1121 *)_radio)->getRSSI(); }
|
|
float getLastSNR() const override { return ((CustomLR1121 *)_radio)->getSNR(); }
|
|
|
|
void setRxBoostedGainMode(bool en) override {
|
|
((CustomLR1121 *)_radio)->setRxBoostedGainMode(en);
|
|
}
|
|
bool getRxBoostedGainMode() const override {
|
|
return ((CustomLR1121 *)_radio)->getRxBoostedGainMode();
|
|
}
|
|
};
|