From 151dfe79a5e5f3b80892f4e4ab2ee3f58f1fa24c Mon Sep 17 00:00:00 2001 From: "Lorenzo J. Lucchini" Date: Thu, 20 Oct 2022 10:17:09 +0200 Subject: [PATCH] Fix Chuango devices with some zeroes in their ID (#2205) --- src/devices/chuango.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/chuango.c b/src/devices/chuango.c index c931842e..89e1e469 100644 --- a/src/devices/chuango.c +++ b/src/devices/chuango.c @@ -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" :-)