Skip to content

Commit

Permalink
Merge branch 'bugfix/add_ad_type_adv_v5.0' into 'release/v5.0'
Browse files Browse the repository at this point in the history
feat(nimble): additional AD types for advertisements (v5.0)

See merge request espressif/esp-idf!33237
  • Loading branch information
rahult-github committed Sep 3, 2024
2 parents 6d947cd + 9c64db5 commit a2d2076
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/bt/host/nimble/nimble
62 changes: 61 additions & 1 deletion examples/bluetooth/nimble/common/nimble_central_utils/misc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
Expand Down Expand Up @@ -169,6 +169,43 @@ print_adv_fields(const struct ble_hs_adv_fields *fields)
MODLOG_DFLT(DEBUG, "\n");
}

if (fields->sm_tk_value_is_present) {
MODLOG_DFLT(DEBUG, " sm_tk_value=");
print_bytes(fields->sm_tk_value, 16);
MODLOG_DFLT(DEBUG, "\n");
}

if (fields->sm_oob_flag_is_present) {
MODLOG_DFLT(DEBUG, " sm_oob_flag=%d\n", fields->sm_oob_flag);
}

if (fields->sol_uuids16 != NULL) {
MODLOG_DFLT(DEBUG, " sol_uuids16=");
for (i = 0; i < fields->sol_num_uuids16; i++) {
print_uuid(&fields->sol_uuids16[i].u);
MODLOG_DFLT(DEBUG, " ");
}
MODLOG_DFLT(DEBUG, "\n");
}

if (fields->sol_uuids32 != NULL) {
MODLOG_DFLT(DEBUG, " sol_uuids32=");
for (i = 0; i < fields->sol_num_uuids32; i++) {
print_uuid(&fields->sol_uuids32[i].u);
MODLOG_DFLT(DEBUG, "\n");
}
MODLOG_DFLT(DEBUG, "\n");
}

if (fields->sol_uuids128 != NULL) {
MODLOG_DFLT(DEBUG, " sol_uuids128=");
for (i = 0; i < fields->sol_num_uuids128; i++) {
print_uuid(&fields->sol_uuids128[i].u);
MODLOG_DFLT(DEBUG, " ");
}
MODLOG_DFLT(DEBUG, "\n");
}

if (fields->svc_data_uuid16 != NULL) {
MODLOG_DFLT(DEBUG, " svc_data_uuid16=");
print_bytes(fields->svc_data_uuid16, fields->svc_data_uuid16_len);
Expand All @@ -185,6 +222,16 @@ print_adv_fields(const struct ble_hs_adv_fields *fields)
MODLOG_DFLT(DEBUG, "\n");
}

if (fields->random_tgt_addr != NULL) {
MODLOG_DFLT(DEBUG, " random_tgt_addr=");
u8p = fields->random_tgt_addr;
for (i = 0; i < fields->num_random_tgt_addrs; i++) {
MODLOG_DFLT(DEBUG, "random_tgt_addr=%s ", addr_str(u8p));
u8p += BLE_HS_ADV_PUBLIC_TGT_ADDR_ENTRY_LEN;
}
MODLOG_DFLT(DEBUG, "\n");
}

if (fields->appearance_is_present) {
MODLOG_DFLT(DEBUG, " appearance=0x%04x\n", fields->appearance);
}
Expand All @@ -193,6 +240,19 @@ print_adv_fields(const struct ble_hs_adv_fields *fields)
MODLOG_DFLT(DEBUG, " adv_itvl=0x%04x\n", fields->adv_itvl);
}

if (fields->device_addr_is_present) {
MODLOG_DFLT(DEBUG, " device_addr=");
u8p = fields->device_addr;
MODLOG_DFLT(DEBUG, "%s ", addr_str(u8p));

u8p += BLE_HS_ADV_PUBLIC_TGT_ADDR_ENTRY_LEN;
MODLOG_DFLT(DEBUG, "addr_type %d ", *u8p);
}

if (fields->le_role_is_present) {
MODLOG_DFLT(DEBUG, " le_role=%d\n", fields->le_role);
}

if (fields->svc_data_uuid32 != NULL) {
MODLOG_DFLT(DEBUG, " svc_data_uuid32=");
print_bytes(fields->svc_data_uuid32, fields->svc_data_uuid32_len);
Expand Down

0 comments on commit a2d2076

Please sign in to comment.