diff --git a/ble_through/ble_proto_utils.c b/ble_through/ble_proto_utils.c index 234e67d..4ae8e07 100644 --- a/ble_through/ble_proto_utils.c +++ b/ble_through/ble_proto_utils.c @@ -16,10 +16,7 @@ bool ble_through_proto_check_packet(zble_proto_packet_t *packet) { return false; } - uint8_t checksum = 0; - for (int i = 0; i < packet->packetlen - 2; i++) { - checksum += pu8[i]; - } + uint8_t checksum = ble_through_proto_sum(packet); if (checksum != pu8[packet->packetlen - 2]) { return false; }