|
|
@@ -109,7 +109,13 @@ void bleprph_host_task(void *param)
|
|
|
|
|
|
esp_err_t esp_blufi_host_init(void)
|
|
|
{
|
|
|
- nimble_port_init();
|
|
|
+ esp_err_t err;
|
|
|
+ err = esp_nimble_init();
|
|
|
+ if (err) {
|
|
|
+ BLUFI_ERROR("%s failed: %s\n", __func__, esp_err_to_name(err));
|
|
|
+ return ESP_FAIL;
|
|
|
+ }
|
|
|
+
|
|
|
/* Initialize the NimBLE host configuration. */
|
|
|
ble_hs_cfg.reset_cb = blufi_on_reset;
|
|
|
ble_hs_cfg.sync_cb = blufi_on_sync;
|
|
|
@@ -146,7 +152,11 @@ esp_err_t esp_blufi_host_init(void)
|
|
|
|
|
|
esp_blufi_btc_init();
|
|
|
|
|
|
- nimble_port_freertos_init(bleprph_host_task);
|
|
|
+ err = esp_nimble_enable(bleprph_host_task);
|
|
|
+ if (err) {
|
|
|
+ BLUFI_ERROR("%s failed: %s\n", __func__, esp_err_to_name(err));
|
|
|
+ return ESP_FAIL;
|
|
|
+ }
|
|
|
|
|
|
return ESP_OK;
|
|
|
}
|