mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
bluedroid: fix ble adv data construct for device name
This commit is contained in:
parent
dfe7cffd09
commit
747daffc28
@ -2169,9 +2169,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 BTM_MAX_LOC_BD_NAME_LEN > 0
|
||||||
if (len > MIN_ADV_LENGTH && data_mask & BTM_BLE_AD_BIT_DEV_NAME) {
|
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)) {
|
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;
|
*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 {
|
} else {
|
||||||
cp_len = (UINT16)strlen(btm_cb.cfg.bd_name);
|
cp_len = (UINT16)strlen(btm_cb.cfg.bd_name);
|
||||||
*p++ = cp_len + 1;
|
*p++ = cp_len + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user