debug-2
This commit is contained in:
parent
97372f1d89
commit
2057adf843
@ -82,7 +82,7 @@ class AsensingProtocol
|
|||||||
{
|
{
|
||||||
frame_buf_[frame_index_++] = data[i];
|
frame_buf_[frame_index_++] = data[i];
|
||||||
total_sync_attempts++;
|
total_sync_attempts++;
|
||||||
LOG_DEBUG("[DEBUG-PROTO] 找到帧头 BD DB, 累计尝试: %d", total_sync_attempts);
|
LOG_INFO("[DEBUG-PROTO] 找到帧头 BD DB, 累计尝试: %d", total_sync_attempts);
|
||||||
}
|
}
|
||||||
else if (frame_index_ == 1 && data[i] != 0xDB)
|
else if (frame_index_ == 1 && data[i] != 0xDB)
|
||||||
{
|
{
|
||||||
@ -110,7 +110,7 @@ class AsensingProtocol
|
|||||||
|
|
||||||
if (frame_index_ == 3)
|
if (frame_index_ == 3)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("[DEBUG-PROTO] 帧类型: 0x%02X", frame_buf_[2]);
|
LOG_INFO("[DEBUG-PROTO] 帧类型: 0x%02X", frame_buf_[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查是否接收完整帧 (帧头2字节 + 类型1字节 + 数据58字节 + GPS周4字节 + 校验1字节 = 66字节)
|
// 检查是否接收完整帧 (帧头2字节 + 类型1字节 + 数据58字节 + GPS周4字节 + 校验1字节 = 66字节)
|
||||||
@ -122,7 +122,7 @@ class AsensingProtocol
|
|||||||
if (frame_buf_[2] != 0x0B)
|
if (frame_buf_[2] != 0x0B)
|
||||||
{
|
{
|
||||||
total_frame_type_fail++;
|
total_frame_type_fail++;
|
||||||
LOG_DEBUG("[DEBUG-PROTO] 帧类型不匹配: 0x%02X (期望 0x0B), 累计失败: %d", frame_buf_[2], total_frame_type_fail);
|
LOG_INFO("[DEBUG-PROTO] 帧类型不匹配: 0x%02X (期望 0x0B), 累计失败: %d", frame_buf_[2], total_frame_type_fail);
|
||||||
// 帧类型不匹配,重新同步
|
// 帧类型不匹配,重新同步
|
||||||
is_synced_ = false;
|
is_synced_ = false;
|
||||||
frame_index_ = 0;
|
frame_index_ = 0;
|
||||||
@ -139,7 +139,7 @@ class AsensingProtocol
|
|||||||
if (xor_check1 != frame_buf_[57])
|
if (xor_check1 != frame_buf_[57])
|
||||||
{
|
{
|
||||||
total_checksum1_fail++;
|
total_checksum1_fail++;
|
||||||
LOG_DEBUG("[DEBUG-PROTO] 校验位1失败: 计算=0x%02X, 接收=0x%02X, 累计失败: %d",
|
LOG_INFO("[DEBUG-PROTO] 校验位1失败: 计算=0x%02X, 接收=0x%02X, 累计失败: %d",
|
||||||
xor_check1, frame_buf_[57], total_checksum1_fail);
|
xor_check1, frame_buf_[57], total_checksum1_fail);
|
||||||
// 校验失败,重新同步
|
// 校验失败,重新同步
|
||||||
is_synced_ = false;
|
is_synced_ = false;
|
||||||
@ -157,7 +157,7 @@ class AsensingProtocol
|
|||||||
if (xor_check2 != frame_buf_[62])
|
if (xor_check2 != frame_buf_[62])
|
||||||
{
|
{
|
||||||
total_checksum2_fail++;
|
total_checksum2_fail++;
|
||||||
LOG_DEBUG("[DEBUG-PROTO] 校验位2失败: 计算=0x%02X, 接收=0x%02X, 累计失败: %d",
|
LOG_INFO("[DEBUG-PROTO] 校验位2失败: 计算=0x%02X, 接收=0x%02X, 累计失败: %d",
|
||||||
xor_check2, frame_buf_[62], total_checksum2_fail);
|
xor_check2, frame_buf_[62], total_checksum2_fail);
|
||||||
// 校验失败,重新同步
|
// 校验失败,重新同步
|
||||||
is_synced_ = false;
|
is_synced_ = false;
|
||||||
@ -165,7 +165,7 @@ class AsensingProtocol
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_DEBUG("[DEBUG-PROTO] 解析成功! 帧头: %02X %02X, 类型: %02X",
|
LOG_INFO("[DEBUG-PROTO] 解析成功! 帧头: %02X %02X, 类型: %02X",
|
||||||
frame_buf_[0], frame_buf_[1], frame_buf_[2]);
|
frame_buf_[0], frame_buf_[1], frame_buf_[2]);
|
||||||
|
|
||||||
// 校验通过,复制数据到结构体
|
// 校验通过,复制数据到结构体
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user