mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* new Dispatcher::getCADFailRetryDelay()
This commit is contained in:
parent
be2af61dfe
commit
189ed79d46
13 changed files with 55 additions and 15 deletions
|
|
@ -12,8 +12,11 @@ public:
|
|||
idle(); // put sx126x into standby
|
||||
// do some basic CAD (blocks for ~12780 micros (on SF 10)!)
|
||||
bool activity = (((CustomLLCC68 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED);
|
||||
idle();
|
||||
|
||||
if (activity) {
|
||||
startRecv();
|
||||
} else {
|
||||
idle();
|
||||
}
|
||||
return activity;
|
||||
}
|
||||
float getLastRSSI() const override { return ((CustomLLCC68 *)_radio)->getRSSI(); }
|
||||
|
|
|
|||
|
|
@ -12,8 +12,11 @@ public:
|
|||
idle(); // put sx126x into standby
|
||||
// do some basic CAD (blocks for ~12780 micros (on SF 10)!)
|
||||
bool activity = (((CustomLR1110 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED);
|
||||
idle();
|
||||
|
||||
if (activity) {
|
||||
startRecv();
|
||||
} else {
|
||||
idle();
|
||||
}
|
||||
return activity;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,11 @@ public:
|
|||
idle(); // put sx126x into standby
|
||||
// do some basic CAD (blocks for ~12780 micros (on SF 10)!)
|
||||
bool activity = (((CustomSX1262 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED);
|
||||
idle();
|
||||
|
||||
if (activity) {
|
||||
startRecv();
|
||||
} else {
|
||||
idle();
|
||||
}
|
||||
return activity;
|
||||
}
|
||||
float getLastRSSI() const override { return ((CustomSX1262 *)_radio)->getRSSI(); }
|
||||
|
|
|
|||
|
|
@ -12,8 +12,11 @@ public:
|
|||
idle(); // put sx126x into standby
|
||||
// do some basic CAD (blocks for ~12780 micros (on SF 10)!)
|
||||
bool activity = (((CustomSX1268 *)_radio)->scanChannel() == RADIOLIB_LORA_DETECTED);
|
||||
idle();
|
||||
|
||||
if (activity) {
|
||||
startRecv();
|
||||
} else {
|
||||
idle();
|
||||
}
|
||||
return activity;
|
||||
}
|
||||
float getLastRSSI() const override { return ((CustomSX1268 *)_radio)->getRSSI(); }
|
||||
|
|
|
|||
|
|
@ -12,8 +12,11 @@ public:
|
|||
idle(); // put into standby
|
||||
// do some basic CAD (blocks for ~12780 micros (on SF 10)!)
|
||||
bool activity = (((CustomSX1276 *)_radio)->tryScanChannel() == RADIOLIB_PREAMBLE_DETECTED);
|
||||
idle();
|
||||
|
||||
if (activity) {
|
||||
startRecv();
|
||||
} else {
|
||||
idle();
|
||||
}
|
||||
return activity;
|
||||
}
|
||||
float getLastRSSI() const override { return ((CustomSX1276 *)_radio)->getRSSI(); }
|
||||
|
|
|
|||
|
|
@ -35,6 +35,15 @@ void RadioLibWrapper::idle() {
|
|||
state = STATE_IDLE; // need another startReceive()
|
||||
}
|
||||
|
||||
void RadioLibWrapper::startRecv() {
|
||||
int err = _radio->startReceive();
|
||||
if (err == RADIOLIB_ERR_NONE) {
|
||||
state = STATE_RX;
|
||||
} else {
|
||||
MESH_DEBUG_PRINTLN("RadioLibWrapper: error: startReceive(%d)", err);
|
||||
}
|
||||
}
|
||||
|
||||
int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
|
||||
if (state & STATE_INT_READY) {
|
||||
int len = _radio->getPacketLength();
|
||||
|
|
@ -54,10 +63,11 @@ int RadioLibWrapper::recvRaw(uint8_t* bytes, int sz) {
|
|||
|
||||
if (state != STATE_RX) {
|
||||
int err = _radio->startReceive();
|
||||
if (err != RADIOLIB_ERR_NONE) {
|
||||
if (err == RADIOLIB_ERR_NONE) {
|
||||
state = STATE_RX;
|
||||
} else {
|
||||
MESH_DEBUG_PRINTLN("RadioLibWrapper: error: startReceive(%d)", err);
|
||||
}
|
||||
state = STATE_RX;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ protected:
|
|||
uint32_t n_recv, n_sent;
|
||||
|
||||
void idle();
|
||||
void startRecv();
|
||||
float packetScoreInt(float snr, int sf, int packet_len);
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue