From e5167278eee112cd26450b05b12008f0c5b46693 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Tue, 22 Dec 2020 05:18:34 +0100 Subject: [PATCH] Ignore unknown response from AQC Haven't seen any non-0x86 responses yet, but who knows... --- operame.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operame.ino b/operame.ino index d24fbe8..8ccca6f 100644 --- a/operame.ino +++ b/operame.ino @@ -268,7 +268,7 @@ int aqc_get_co2() { hwserial1.write(command, sizeof(command)); delay(50); int c = hwserial1.readBytes(response, sizeof(response)); - if (c != sizeof(response)) { + if (c != sizeof(response) || response[0] != 0xff || response[1] != 0x86) { continue; } uint8_t checksum = 255;