kopia lustrzana https://github.com/weetmuts/wmbusmeters
Merge pull request #111 from HenryNe/HenryNe-patch-cs-print
amb8465: Print checksum errors from responsespull/113/head
commit
74e84c6881
|
@ -326,11 +326,17 @@ FrameStatus WMBusAmber::checkAMB8465Frame(vector<uchar> &data,
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
if (rssi_len) {
|
||||
*rssi = data[*frame_length-2];
|
||||
signed int dbm = (*rssi >= 128) ? (*rssi - 256) / 2 - 74 : *rssi / 2 - 74;
|
||||
verbose("(amb8465) rssi %d (%d dBm)\n", *rssi, dbm);
|
||||
}
|
||||
|
||||
return FullFrame;
|
||||
}
|
||||
// If it is not a 0xff we assume it is a message beginning with a length.
|
||||
|
|
Ładowanie…
Reference in New Issue