sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.63k stars 626 forks source link

Add ability for receiver to check if CRC is present in payload #333

Open mcgurk opened 4 years ago

mcgurk commented 4 years ago

enableCrc() doesn't affect when used with receiver in explicit header mode (datasheet page 30). This modification adds crcOnPayload()-function, which can be used to detect if CRC is present in payload. With this it is possible to verify that CRC is really used between sender and receiver.

SX1276/77/78/79 datasheet page 112: RegHopChannel (0x1C), bit 6: CrcOnPayload (read) CRC Information extracted from the received packet header (Explicit header mode only) 0 = Header indicates CRC off 1 = Header indicates CRC on