@@ -371,6 +371,9 @@ uint8_t Radio::listen()
371371 status.lastPacketInfo .snr = newPacketInfo.snr ;
372372 status.lastPacketInfo .frequencyerror = newPacketInfo.frequencyerror ;
373373
374+ // print RSSI (Received Signal Strength Indicator)
375+ Log::console (PSTR (" [SX12x8] RSSI:\t\t %f dBm\n [SX12x8] SNR:\t\t %f dB\n [SX12x8] Frequency error:\t %f Hz" ), status.lastPacketInfo .rssi , status.lastPacketInfo .snr , status.lastPacketInfo .frequencyerror );
376+
374377 if (state == ERR_NONE && respLen > 0 )
375378 {
376379 // read optional data
@@ -408,7 +411,7 @@ uint8_t Radio::listen()
408411 startRx ();
409412 return 5 ;
410413 }
411-
414+
412415 }
413416
414417 status.lastPacketInfo .crc_error = false ;
@@ -417,10 +420,18 @@ uint8_t Radio::listen()
417420 }
418421 else if (state == ERR_CRC_MISMATCH)
419422 {
420- // packet was received, but is malformed
421- status.lastPacketInfo .crc_error = true ;
422- String error_encoded = base64::encode (" Error_CRC" );
423- MQTT_Client::getInstance ().sendRx (error_encoded, noisyInterrupt);
423+ // if filter is active, filter the CRC errors
424+ if (status.modeminfo .filter [0 ]==0 ) {
425+ // packet was received, but is malformed
426+ status.lastPacketInfo .crc_error = true ;
427+ String error_encoded = base64::encode (" Error_CRC" );
428+ MQTT_Client::getInstance ().sendRx (error_encoded, noisyInterrupt);
429+ } else {
430+ Log::console (PSTR (" Filter enabled, Error CRC filtered" ));
431+ delete[] respFrame;
432+ startRx ();
433+ return 5 ;
434+ }
424435 }
425436
426437 delete[] respFrame;
@@ -447,8 +458,6 @@ uint8_t Radio::listen()
447458 status.lastPacketInfo .time = thisTime;
448459 }
449460
450- // print RSSI (Received Signal Strength Indicator)
451- Log::console (PSTR (" [SX12x8] RSSI:\t\t %f dBm\n [SX12x8] SNR:\t\t %f dB\n [SX12x8] Frequency error:\t %f Hz" ), status.lastPacketInfo .rssi , status.lastPacketInfo .snr , status.lastPacketInfo .frequencyerror );
452461
453462 noisyInterrupt = false ;
454463
0 commit comments