Skip to content

Commit

Permalink
Merge branch 'backport_v5.1' into 'release/v5.1'
Browse files Browse the repository at this point in the history
fix(bt): Fix the issue of not printing the Bluetooth MAC address for ESP32(backport v5.1)

See merge request espressif/esp-idf!24780
  • Loading branch information
jack0c committed Jul 14, 2023
2 parents bba66a1 + 2b1269d commit 82fde1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion components/bt/controller/esp32/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,11 @@ static void *malloc_internal_wrapper(size_t size)

static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
{
return esp_read_mac(mac, ESP_MAC_BT);
int ret = esp_read_mac(mac, ESP_MAC_BT);
ESP_LOGI(BTDM_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);

return ret;
}

static void IRAM_ATTR srand_wrapper(unsigned int seed)
Expand Down
3 changes: 1 addition & 2 deletions components/bt/host/bluedroid/api/esp_gap_ble_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 82fde1e

Please sign in to comment.