[hci1]# power on hci1 Set Powered complete, settings: powered bondable ssp br/edr le secure-conn [hci1]# find Discovery started hci1 type 7 discovering on hci1 dev_found: 6F:E6:68:BD:41:05 type LE Random rssi -94 flags 0x0000 AD flags 0x1a eir_len 18 hci1 dev_found: 0C:E9:99:CE:F5:7D type LE Random rssi -69 flags 0x0004 AD flags 0x00 eir_len 31 [hci1]# stop-find Discovery stopped hci1 type 7 discovering off [hci1]# power off hci1 Set Powered complete, settings: bondable ssp br/edr le secure-conn hci1 class of device changed: 0x000000 [hci1]#
/* Initialize NVS — it is used to store PHY calibration data */ ret = nvs_flash_init(); if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { ESP_ERROR_CHECK(nvs_flash_erase()); ret = nvs_flash_init(); } ESP_ERROR_CHECK( ret );
// HCI_UART_PORT == 0 had been enabled #if HCI_UART_PORT == 1 periph_module_enable(PERIPH_UART1_MODULE); #elif HCI_UART_PORT == 2 periph_module_enable(PERIPH_UART2_MODULE); #endif periph_module_enable(PERIPH_UHCI0_MODULE);
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); /* Set the uart number used by hci*/ bt_cfg.hci_uart_no = HCI_UART_PORT; ret = esp_bt_controller_init(&bt_cfg); if (ret != ESP_OK) { ESP_LOGE(tag, "Bluetooth Controller initialize failed: %s", esp_err_to_name(ret)); return; } reconfig_hci_uart();
ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM); if (ret != ESP_OK) { ESP_LOGE(tag, "Bluetooth Controller initialize failed: %s", esp_err_to_name(ret)); return; }