Use hardware channel activity detection for checking interference

This commit is contained in:
Wessel Nieboer
2026-06-14 15:19:18 +02:00
parent 29f0a7fc4f
commit 4f9a091671
6 changed files with 16 additions and 8 deletions
+10 -3
View File
@@ -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 {