From 3a262d80dddf606037c72d45a6662407a7b6c497 Mon Sep 17 00:00:00 2001 From: liyi Date: Sat, 26 Apr 2025 15:15:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B3=A8=E9=87=8ACRC=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/blue/reciver_data.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/blue/reciver_data.dart b/lib/blue/reciver_data.dart index 2fc7fe54..0b0f4c61 100755 --- a/lib/blue/reciver_data.dart +++ b/lib/blue/reciver_data.dart @@ -61,16 +61,16 @@ class CommandReciverManager { final int dataSize = data.length; // 验证CRC校验 - if (dataSize >= 2) { - final int calculatedCrc = - _calculateCRC16(data.sublist(0, dataSize - 2), dataSize - 2); - final int receivedCrc = (data[dataSize - 2] << 8) | data[dataSize - 1]; - - if (calculatedCrc != receivedCrc) { - AppLog.log('CRC校验失败'); - return; - } - } + // if (dataSize >= 2) { + // final int calculatedCrc = + // _calculateCRC16(data.sublist(0, dataSize - 2), dataSize - 2); + // final int receivedCrc = (data[dataSize - 2] << 8) | data[dataSize - 1]; + // + // if (calculatedCrc != receivedCrc) { + // throw Exception('CRC校验失败'); + // return; + // } + // } // 当小于包头加起来13个字节 if (dataSize < 13) { return;