Skip to content

Commit

Permalink
Fixed not checking the calculated CRC8
Browse files Browse the repository at this point in the history
  • Loading branch information
Sobuno authored Jun 17, 2017
1 parent edc3c0e commit 68fb841
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Backend/RPIWeather/OOK433MHzReceiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def decodeOS2(self, data):
crcbytes = [(crcnibbles[i]<<4) | crcnibbles[i+1] for i in range(0, len(crcnibbles), 2)]
CRC = self.calcCRC8(crcbytes, 0x07, 0x9a)
providedCRC = (data[15]<<4) | data[14]
if checksum != providedChecksum:
if CRC != providedCRC:
raise Exception("OS2 error: Bad CRC8! Got 0x{0:02X} but calculated 0x{1:02X}".format(providedCRC, CRC))

# ID and channel
Expand Down

0 comments on commit 68fb841

Please sign in to comment.