From 39145925ff35e058b192c162ac74c9deae04772a Mon Sep 17 00:00:00 2001 From: bemabalu <84475320+bemabalu@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:11:21 +0200 Subject: [PATCH] Fixed wrong MSB LSB order in id filtering as well --- src/type1/CollarRxType1.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/type1/CollarRxType1.cpp b/src/type1/CollarRxType1.cpp index c41b6e8..0d6c4a4 100644 --- a/src/type1/CollarRxType1.cpp +++ b/src/type1/CollarRxType1.cpp @@ -37,7 +37,8 @@ void CollarRxType1::buffer_to_collar_message(const uint8_t buffer[5], struct col bool CollarRxType1::is_message_valid(const uint8_t buffer[5]) { // if we're filtering by ID, check it matches - if (_use_id && (memcmp(buffer, &_id, 2))) + uint16_t id= ((buffer[0]<<8)|buffer[1]); + if (_use_id && (id!=_id)) return false; // calculate checksum