This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new b7590dc34 porting: Fix name length in advertising data for linux sample
b7590dc34 is described below
commit b7590dc3499f6b1da45dc41bb2f05a4d6122d753
Author: Szymon Janc <[email protected]>
AuthorDate: Tue Sep 16 14:01:17 2025 +0200
porting: Fix name length in advertising data for linux sample
Advertised name unnecessarily contained NULL termination.
---
porting/examples/linux/ble.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/porting/examples/linux/ble.c b/porting/examples/linux/ble.c
index ea6655f21..f196f514a 100644
--- a/porting/examples/linux/ble.c
+++ b/porting/examples/linux/ble.c
@@ -52,7 +52,7 @@ update_ad(void)
uint8_t ad_flags = BLE_HS_ADV_F_DISC_GEN | BLE_HS_ADV_F_BREDR_UNSUP;
put_ad(BLE_HS_ADV_TYPE_FLAGS, 1, &ad_flags, ad, &ad_len);
- put_ad(BLE_HS_ADV_TYPE_COMP_NAME, sizeof(gap_name), gap_name, ad, &ad_len);
+ put_ad(BLE_HS_ADV_TYPE_COMP_NAME, strlen(gap_name), gap_name, ad, &ad_len);
ble_gap_adv_set_data(ad, ad_len);
}