diff --git a/CHANGELOG.md b/CHANGELOG.md index 52c40890f..efa53782f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - ATT DB: call write callback for validated signed writes - ATT Server: abort signed write validation on incoming new request - Bluetooth SIG web scraping tools updated +- ESP32: Configure SCO over HCI after power up ### Added - SM: Track if connection encryption is based on LE Secure Connection pairing diff --git a/port/esp32/components/btstack/main.c b/port/esp32/components/btstack/main.c index fb5abb9aa..f9692e37a 100644 --- a/port/esp32/components/btstack/main.c +++ b/port/esp32/components/btstack/main.c @@ -246,11 +246,6 @@ static int transport_open(void){ return -1; } -#ifdef ENABLE_SCO_OVER_HCI - ret = esp_bredr_sco_datapath_set(ESP_SCO_DATA_PATH_HCI); - log_info("transport: configure SCO over HCI, result 0x%04x", ret); -#endif - return 0; } @@ -340,8 +335,15 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack if (packet_type != HCI_EVENT_PACKET) return; switch(hci_event_packet_get_type(packet)){ case BTSTACK_EVENT_STATE: - if (btstack_event_state_get_state(packet) != HCI_STATE_WORKING) return; - printf("BTstack: up and running.\n"); + if (btstack_event_state_get_state(packet) == HCI_STATE_WORKING) { +#ifdef ENABLE_SCO_OVER_HCI + esp_err_t ret = esp_bredr_sco_datapath_set(ESP_SCO_DATA_PATH_HCI); + log_info("transport: configure SCO over HCI, result 0x%04x", ret); +#endif + bd_addr_t addr; + gap_local_bd_addr(addr); + printf("BTstack up and running at %s\n", bd_addr_to_str(addr)); + } break; case HCI_EVENT_COMMAND_COMPLETE: if (HCI_EVENT_IS_COMMAND_COMPLETE(packet, hci_read_local_version_information)){