From fbdab2c0a2f05c3dd5eed5cc35b02bd24f627232 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 29 Aug 2024 14:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86bleproto=20?= =?UTF-8?q?utils=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ble_through/ble_proto_utils.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; }