mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(ble/bluedroid): Optimize BLE function 'esp_ble_resolve_adv_data_by_type'
This commit is contained in:
parent
fff9b4e779
commit
243d6752ad
@ -493,13 +493,17 @@ uint8_t *esp_ble_resolve_adv_data_by_type( uint8_t *adv_data, uint16_t adv_data_
|
||||
|
||||
if (((type < ESP_BLE_AD_TYPE_FLAG) || (type > ESP_BLE_AD_TYPE_128SERVICE_DATA)) &&
|
||||
(type != ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE)) {
|
||||
LOG_ERROR("the eir type not define, type = %x\n", type);
|
||||
LOG_ERROR("The advertising data type is not defined, type = %x", type);
|
||||
*length = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (adv_data == NULL || adv_data_len == 0) {
|
||||
LOG_ERROR("Invalid advertising data.\n");
|
||||
if (adv_data_len == 0) {
|
||||
*length = 0;
|
||||
return NULL;
|
||||
}
|
||||
if (adv_data == NULL) {
|
||||
LOG_ERROR("Invalid advertising data.");
|
||||
*length = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user