* basic CAD before TX, for sx126x wrappers

This commit is contained in:
Scott Powell 2025-01-21 13:37:32 +11:00
parent e838f405a7
commit de27dfacb6
5 changed files with 24 additions and 3 deletions

View file

@ -6,7 +6,14 @@
class CustomSX1262Wrapper : public RadioLibWrapper {
public:
CustomSX1262Wrapper(CustomSX1262& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { }
bool isReceiving() override { return ((CustomSX1262 *)_radio)->isReceiving(); }
bool isReceiving() override {
if (((CustomSX1262 *)_radio)->isReceiving()) return true;
idle(); // put sx126x into standby
// do some basic CAD (blocks for ~12780 micros (on SF 10)!)
if (((CustomSX1262 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED) return true;
return false;
}
float getLastRSSI() const override { return ((CustomSX1262 *)_radio)->getRSSI(); }
float getLastSNR() const override { return ((CustomSX1262 *)_radio)->getSNR(); }
};