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.


(cherry picked from commit 42f2aeedb7)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
This commit is contained in:
Zhou Xiao
2026-04-03 21:14:45 +08:00
parent e4f952d8cd
commit 5b1823c3ff
2 changed files with 2 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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 {