MeshCore/src/helpers/CustomSTM32WLxWrapper.h

24 lines
797 B
C
Raw Normal View History

2025-05-11 09:26:32 +02:00
#pragma once
#include "CustomSTM32WLx.h"
#include "RadioLibWrappers.h"
#include <math.h>
class CustomSTM32WLxWrapper : public RadioLibWrapper {
public:
CustomSTM32WLxWrapper(CustomSTM32WLx& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { }
bool isReceivingPacket() override {
return ((CustomSTM32WLx *)_radio)->isReceiving();
2025-05-11 09:26:32 +02:00
}
float getCurrentRSSI() override {
return ((CustomSTM32WLx *)_radio)->getRSSI(false);
}
2025-05-11 09:26:32 +02:00
float getLastRSSI() const override { return ((CustomSTM32WLx *)_radio)->getRSSI(); }
float getLastSNR() const override { return ((CustomSTM32WLx *)_radio)->getSNR(); }
float packetScore(float snr, int packet_len) override {
int sf = ((CustomSTM32WLx *)_radio)->spreadingFactor;
return packetScoreInt(snr, sf, packet_len);
}
};