debug(vd960DBN): 抓现行打印 — 发送前队列状态 + resp flag 变化沿

- 心跳证实: 第一包发出后 resp=0 amt=0, 队列已被意外清空 (第二包不存在)
- poll_dbn_ble 尾部: resp flag 变化沿打印 (0->1/1->0 各一次, 不刷屏)
- performPeriodicTask: 发送前打印 len + resp 队列状态
- 烧录后一次看清 谁在何时清了 g_buf_ble_response
This commit is contained in:
wangfq
2026-08-12 14:02:23 +08:00
parent ef3316f2b3
commit 60576b2b33
2 changed files with 15 additions and 2 deletions
@@ -1053,8 +1053,17 @@ void poll_dbn_ble(void)
}
if(g_notify_buftemp.flag == 0)
{
// report_sens_acs();
g_flag_notify_temp = set_response_to_notify(&g_buf_ble_response, &g_notify_buftemp);
static uint8_t _last_resp_flag = 0;
uint8_t _pull = set_response_to_notify(&g_buf_ble_response, &g_notify_buftemp);
g_flag_notify_temp = _pull;
if(g_buf_ble_response.flag != _last_resp_flag)
{
PRINT("BLE resp flag %d->%d (pull=%d amt=%d seq=%d off=%d)\n",
_last_resp_flag, g_buf_ble_response.flag, _pull,
g_buf_ble_response.pkg_amount, g_buf_ble_response.pkg_seq,
g_buf_ble_response.dat_offset);
_last_resp_flag = g_buf_ble_response.flag;
}
}
}
@@ -695,6 +695,10 @@ static void performPeriodicTask(void)
}
if(g_flag_notify_temp){
g_flag_notify_temp = 0;
PRINT("BLE send: len=%d resp=%d amt=%d seq=%d off=%d\n",
g_notify_buftemp.len, g_buf_ble_response.flag,
g_buf_ble_response.pkg_amount, g_buf_ble_response.pkg_seq,
g_buf_ble_response.dat_offset);
peripheralChar4Notify(g_notify_buftemp.buf, g_notify_buftemp.len);
clear_ble_notify_buf(&g_notify_buftemp);
}