feat(ble_log): consume frame_sn on loss path and bump BLE_LOG_VERSION

Add BLE_LOG_GET_FRAME_SN() on the buffer-full loss path so the SN
counter advances even when frames are dropped. This allows the console
to detect firmware-side buffer loss via SN gaps. Bump BLE_LOG_VERSION
to reflect the semantic change.
This commit is contained in:
Zhou Xiao
2026-03-23 02:10:12 +08:00
parent 490acad912
commit 30ad222662
2 changed files with 2 additions and 1 deletions
@@ -173,6 +173,7 @@ void ble_log_stat_mgr_update(ble_log_src_t src_code, uint32_t len, bool lost)
/* Update aligned counters */
uint32_t bytes_cnt = len + BLE_LOG_FRAME_OVERHEAD;
if (lost) {
BLE_LOG_GET_FRAME_SN(&(stat_mgr->frame_sn)); /* consume SN for loss detection */
stat_mgr->lost_frame_cnt++;
stat_mgr->lost_bytes_cnt += bytes_cnt;
} else {
@@ -130,7 +130,7 @@ bool ble_log_cas_acquire(volatile bool *cas_lock);
void ble_log_cas_release(volatile bool *cas_lock);
#endif /* UNIT_TEST */
#define BLE_LOG_VERSION (3)
#define BLE_LOG_VERSION (4)
/* TYPEDEF */
typedef enum {