From 60576b2b3339a176eefd44e493c8f135bb1c827c Mon Sep 17 00:00:00 2001 From: wangfq Date: Wed, 12 Aug 2026 14:02:23 +0800 Subject: [PATCH] =?UTF-8?q?debug(vd960DBN):=20=E6=8A=93=E7=8E=B0=E8=A1=8C?= =?UTF-8?q?=E6=89=93=E5=8D=B0=20=E2=80=94=20=E5=8F=91=E9=80=81=E5=89=8D?= =?UTF-8?q?=E9=98=9F=E5=88=97=E7=8A=B6=E6=80=81=20+=20resp=20flag=20?= =?UTF-8?q?=E5=8F=98=E5=8C=96=E6=B2=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 心跳证实: 第一包发出后 resp=0 amt=0, 队列已被意外清空 (第二包不存在) - poll_dbn_ble 尾部: resp flag 变化沿打印 (0->1/1->0 各一次, 不刷屏) - performPeriodicTask: 发送前打印 len + resp 队列状态 - 烧录后一次看清 谁在何时清了 g_buf_ble_response --- .../BLE/OnlyUpdateApp_Peripheral/APP/dbn_ble_srv.c | 13 +++++++++++-- .../BLE/OnlyUpdateApp_Peripheral/APP/peripheral.c | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/dbn_ble_srv.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/dbn_ble_srv.c index b7f16d5..46dd290 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/dbn_ble_srv.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/dbn_ble_srv.c @@ -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; + } } } diff --git a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral.c b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral.c index 22f9ee6..4190b21 100644 --- a/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral.c +++ b/vd960DBN/BLE/OnlyUpdateApp_Peripheral/APP/peripheral.c @@ -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); }