mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* RadioLibWrapper: new isChannelActive() based on current RSSI being above noise_floor + THRESHOLD
23 lines
797 B
C++
23 lines
797 B
C++
#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();
|
|
}
|
|
float getCurrentRSSI() override {
|
|
return ((CustomSTM32WLx *)_radio)->getRSSI(false);
|
|
}
|
|
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);
|
|
}
|
|
};
|