Skip to content

Commit

Permalink
Merge branch 'backport_v4.4' into 'release/v4.4'
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 v4.4)

See merge request espressif/esp-idf!24778
  • Loading branch information
jack0c committed Jul 18, 2023
2 parents 558398f + 05faa8f commit 922af41
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 @@ -908,7 +908,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 @@ -439,8 +439,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 922af41

Please sign in to comment.