From 5c1a43ca3d205c3d5183e57dedce335fb6a81155 Mon Sep 17 00:00:00 2001 From: Sumeet Singh Date: Wed, 11 Mar 2026 17:04:22 +0530 Subject: [PATCH] fix(nimble): modify logic to print mbuf in ble_hs_log_mbuf --- nimble/host/src/ble_hs_log.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nimble/host/src/ble_hs_log.c b/nimble/host/src/ble_hs_log.c index 5aafd61ec..7ccc49331 100644 --- a/nimble/host/src/ble_hs_log.c +++ b/nimble/host/src/ble_hs_log.c @@ -26,17 +26,16 @@ struct log ble_hs_log; void ble_hs_log_mbuf(const struct os_mbuf *om) { - const struct os_mbuf *cur; + uint8_t u8; int i; if (om == NULL) { return; } - for (cur = om; cur != NULL; cur = SLIST_NEXT(cur, om_next)) { - for (i = 0; i < cur->om_len; i++) { - BLE_HS_LOG(DEBUG, "0x%02x ", cur->om_data[i]); - } + for (i = 0; i < OS_MBUF_PKTLEN(om); i++) { + os_mbuf_copydata(om, i, 1, &u8); + BLE_HS_LOG(DEBUG, "0x%02x ", u8); } }