arduino-LoRa
arduino-LoRa copied to clipboard
Corrupted header may let corrupted packets to go through even CRC is enable?
I realized even I enableCrc(), visibble corrupted packets are still received. Possible reason is due to corrupted header.
// check packet header integrity
if(_crcEnabled && (_mod->SPIgetRegValue(SX127X_REG_HOP_CHANNEL, 6, 6)) == 0) {
// CRC is disabled according to packet header and enabled according to user
// most likely damaged packet header
clearIRQFlags();
return(ERR_LORA_HEADER_DAMAGED);
}
Ref: https://github.com/jgromes/RadioLib/pull/111#issuecomment-725713815 https://github.com/jgromes/RadioLib/issues/200
Nice find! However, how do we implement this in the current LoRa.cpp? Can we add another condition on line 237?
if ((irqFlags & IRQ_RX_DONE_MASK) && (irqFlags & IRQ_PAYLOAD_CRC_ERROR_MASK) == 0) {
// received a packet