mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* basic CAD before TX, for sx126x wrappers
This commit is contained in:
parent
e838f405a7
commit
de27dfacb6
5 changed files with 24 additions and 3 deletions
|
|
@ -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(); }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue