Skip to content

Commit

Permalink
Merge branch 'feat/print_the_ble_mac_when_init_5.2' into 'release/v5.2'
Browse files Browse the repository at this point in the history
feat(ble): Print out the BT mac when the controller is initialized

See merge request espressif/esp-idf!32731
  • Loading branch information
Isl2017 committed Aug 12, 2024
2 parents 726d796 + 1c0a4db commit 2cd9da5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/bt/controller/esp32c2/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
uint8_t mac[6];
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));

ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);

swap_in_place(mac, 6);

esp_ble_ll_set_public_addr(mac);
Expand Down
2 changes: 2 additions & 0 deletions components/bt/controller/esp32c6/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,8 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
}

ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
r_esp_ble_ll_set_public_addr(mac);

Expand Down
2 changes: 2 additions & 0 deletions components/bt/controller/esp32h2/bt.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,8 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_controller;
}
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
r_esp_ble_ll_set_public_addr(mac);

Expand Down

0 comments on commit 2cd9da5

Please sign in to comment.