mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 17:49:10 -04:00
bluedroid: fix ble adv data construct for device name
This commit is contained in:
parent
e6f018a309
commit
ac42a8f2c7
@ -2237,9 +2237,10 @@ UINT8 *btm_ble_build_adv_data(tBTM_BLE_AD_MASK *p_data_mask, UINT8 **p_dst,
|
||||
#if BTM_MAX_LOC_BD_NAME_LEN > 0
|
||||
if (len > MIN_ADV_LENGTH && data_mask & BTM_BLE_AD_BIT_DEV_NAME) {
|
||||
if (strlen(btm_cb.cfg.bd_name) > (UINT16)(len - MIN_ADV_LENGTH)) {
|
||||
*p++ = len - MIN_ADV_LENGTH + 1;
|
||||
cp_len = (UINT16)(len - MIN_ADV_LENGTH);
|
||||
*p++ = cp_len + 1;
|
||||
*p++ = BTM_BLE_AD_TYPE_NAME_SHORT;
|
||||
ARRAY_TO_STREAM(p, btm_cb.cfg.bd_name, len - MIN_ADV_LENGTH);
|
||||
ARRAY_TO_STREAM(p, btm_cb.cfg.bd_name, cp_len);
|
||||
} else {
|
||||
cp_len = (UINT16)strlen(btm_cb.cfg.bd_name);
|
||||
*p++ = cp_len + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user