keil/include/drivers/serial_at_cmd_app.c
@@ -155,7 +155,7 @@ // 包头 0x55 0xAA 0x41 if (buff[n] == 0x55 && buff[n+1] == 0xAA && buff[n+2] == 0x41) { report_ancnum_bt=buff[n+4]; length = buff[n+3]; if (n + 6 + report_ancnum_bt * 6 + length > 1024) { continue; // 如果数据越界,跳过该包 @@ -163,7 +163,7 @@ // 将数据复制到 DMA 缓冲区 memcpy(DMA_RXBuf_BT, &buff[n+4], length); report_ancnum_bt=buff[n+4]; // 为了避免多次重复解析同一个数据包,可以在这里添加跳跃 n += 6 + report_ancnum_bt * 6 + length - 1; // 跳过当前数据包 }