AP_Beacon: checksum check uses XOR

This commit is contained in:
murata 2016-12-01 03:39:13 +09:00 committed by Randy Mackay
parent bcdd836820
commit 292257eaf2
1 changed files with 2 additions and 2 deletions

View File

@ -111,11 +111,11 @@ void AP_Beacon_Pozyx::parse_buffer()
uint8_t checksum = 0;
checksum ^= parse_msg_id;
checksum ^= parse_msg_len;
for (uint8_t i=0; i<linebuf_len-1; i++) {
for (uint8_t i=0; i<linebuf_len; i++) {
checksum ^= linebuf[i];
}
// return if failed checksum check
if (checksum != linebuf[linebuf_len-1]) {
if (checksum != 0) {
return;
}