Nimble: Added return value (success / failure ) to nimble_port_init

This commit is contained in:
Rahul Tank
2022-12-20 14:11:52 +05:30
parent 1195b6cb2b
commit 826495a145
23 changed files with 144 additions and 49 deletions

View File

@@ -132,13 +132,20 @@ void mesh_host_task(void *param)
esp_err_t bluetooth_init(void)
{
esp_err_t ret;
mesh_sem = xSemaphoreCreateBinary();
if (mesh_sem == NULL) {
ESP_LOGE(TAG, "Failed to create mesh semaphore");
return ESP_FAIL;
}
nimble_port_init();
ret = nimble_port_init();
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to init nimble %d ", ret);
return ret;
}
/* Initialize the NimBLE host configuration. */
ble_hs_cfg.reset_cb = mesh_on_reset;
ble_hs_cfg.sync_cb = mesh_on_sync;