From 585bec9e391a28b755b39ca46e4d3cc085b90312 Mon Sep 17 00:00:00 2001 From: Henry N Date: Fri, 8 May 2020 22:11:26 +0200 Subject: [PATCH] amb8465: Print checksum errors from responses --- src/wmbus_amb8465.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wmbus_amb8465.cc b/src/wmbus_amb8465.cc index ca57710..0dffd2f 100644 --- a/src/wmbus_amb8465.cc +++ b/src/wmbus_amb8465.cc @@ -324,6 +324,12 @@ FrameStatus WMBusAmber::checkAMB8465Frame(vector &data, *rssi = data[*frame_length-1]; } debug("(amb8465) received full command frame\n"); + + uchar cs = xorChecksum(data, *frame_length-1); + if (data[*frame_length-1] != cs) { + verbose("(amb8465) checksum error %02x (should %02x)\n", data[*frame_length-1], cs); + } + return FullFrame; } // If it is not a 0xff we assume it is a message beginning with a length.