Fix Chuango devices with some zeroes in their ID (#2205)

This commit is contained in:
Lorenzo J. Lucchini
2022-10-20 10:17:09 +02:00
committed by GitHub
parent e066b669f7
commit 151dfe79a5

View File

@@ -48,7 +48,7 @@ static int chuango_callback(r_device *decoder, bitbuffer_t *bitbuffer)
// Validate package
if (!(b[3] & 0x80) // Last bit (MSB here) is always 1
|| !b[0] || !b[1] || !(b[2] & 0xF0)) // Reduce false positives. ID 0x00000 not supported
|| (!b[0] && !b[1] && !(b[2] & 0xF0))) // Reduce false positives. ID 0x00000 not supported
return DECODE_ABORT_EARLY;
id = (b[0] << 12) | (b[1] << 4) | (b[2] >> 4); // ID is 20 bits (Ad: "1 Million combinations" :-)