From ccc30738c00f12ae6c89177113bd15af9826b836 Mon Sep 17 00:00:00 2001 From: Paul Date: Wed, 2 Oct 2019 21:10:29 +0200 Subject: [PATCH] tidy up for https://github.com/proddy/EMS-ESP/issues/162 --- src/ems.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/ems.cpp b/src/ems.cpp index 21a48371e..9fd34f734 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -1420,18 +1420,13 @@ void _process_RC30StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { * received every 60 seconds */ void _process_RC35StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { - // ignore if 14th byte is 0x00, which I think is flow temp, means HC is not is use - if (EMS_RxTelegram->data[14] == 0x00) { - return; - } - - // only process broadcasts for now - if (EMS_RxTelegram->dest != EMS_ID_NONE) { - return; - } - - // if we have 0x7D00 as current room temp also ignore - if (EMS_RxTelegram->data[EMS_OFFSET_RC35StatusMessage_curr] == 0x7D) { + // exit if... + // a) the 14th byte is 0x00, which I think is flow temp, means HC is not is use + // b) its not a broadcast + // c) we have 0x7D00 as current room temp + // d) the 5th bit of the 2nd data byte is not set (e.g. x13 is ok, x03 is not) - based on examples above + if ((EMS_RxTelegram->data[14] == 0x00) || (EMS_RxTelegram->dest != EMS_ID_NONE) || (EMS_RxTelegram->data[EMS_OFFSET_RC35StatusMessage_curr] == 0x7D) + || (_bitRead(1, 4) == 1)) { return; }