mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-26 12:46:39 +00:00
Use hardware channel activity detection for checking interference
This commit is contained in:
@@ -178,10 +178,17 @@ void RadioLibWrapper::onSendFinished() {
|
||||
state = STATE_IDLE;
|
||||
}
|
||||
|
||||
int16_t RadioLibWrapper::performChannelScan() {
|
||||
return _radio->scanChannel();
|
||||
}
|
||||
|
||||
bool RadioLibWrapper::isChannelActive() {
|
||||
return _threshold == 0
|
||||
? false // interference check is disabled
|
||||
: getCurrentRSSI() > _noise_floor + _threshold;
|
||||
if (_threshold == 0) return false; // interference check is disabled
|
||||
|
||||
int16_t result = performChannelScan();
|
||||
// scanChannel() leaves radio in standby — restart RX regardless of result
|
||||
startRecv();
|
||||
return (result == RADIOLIB_LORA_DETECTED);
|
||||
}
|
||||
|
||||
float RadioLibWrapper::getLastRSSI() const {
|
||||
|
||||
Reference in New Issue
Block a user