From a743ee12f80d03ada3a35dbacadd9bf8e338211e Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 10 Mar 2024 16:42:12 +0100 Subject: [PATCH] Ingore last three bytes of truma_message_header #25. --- components/truma_inetbox/TrumaiNetBoxApp.cpp | 2 +- components/truma_inetbox/helpers.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/truma_inetbox/TrumaiNetBoxApp.cpp b/components/truma_inetbox/TrumaiNetBoxApp.cpp index cb59c9f..b2fad32 100644 --- a/components/truma_inetbox/TrumaiNetBoxApp.cpp +++ b/components/truma_inetbox/TrumaiNetBoxApp.cpp @@ -132,7 +132,7 @@ const u_int8_t *TrumaiNetBoxApp::lin_multiframe_recieved(const u_int8_t *message if (message_len < truma_message_header.size()) { return nullptr; } - for (u_int8_t i = 1; i < truma_message_header.size(); i++) { + for (u_int8_t i = 1; i < truma_message_header.size() - 3; i++) { if (message[i] != truma_message_header[i]) { return nullptr; } diff --git a/components/truma_inetbox/helpers.h b/components/truma_inetbox/helpers.h index 89e0885..35ccaba 100644 --- a/components/truma_inetbox/helpers.h +++ b/components/truma_inetbox/helpers.h @@ -5,7 +5,7 @@ namespace esphome { namespace truma_inetbox { -// First byte is service identifier and to be ignored. +// First byte is service identifier and to be ignored. Last three bytes can be `xFF` or `x00` (see ). const std::array truma_message_header = {0x00, 0x00, 0x1F, 0x00, 0x1E, 0x00, 0x00, 0x22, 0xFF, 0xFF, 0xFF};