kopia lustrzana https://github.com/espressif/esp-idf
bluedroid: fix ble adv data construct for device name
rodzic
b68fb2be7c
commit
375be9e109
|
@ -2229,9 +2229,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;
|
||||||
|
|
Ładowanie…
Reference in New Issue