fix(bt): Fix ble advertising data length 0 error

- Fixed an issue where the BLE advertisement length of 0 was causing an error
This commit is contained in:
zhanghaipeng 2023-06-29 16:52:55 +08:00
parent cfa70abe0e
commit 124cce0de3

View File

@ -431,8 +431,7 @@ esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_l
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (raw_data == NULL
|| (raw_data_len <= 0 || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX)) {
if ((raw_data_len != 0 && raw_data == NULL) || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX) {
return ESP_ERR_INVALID_ARG;
}