Merge branch 'bugfix/btdm_controller_enable_failed_in_examples_for_v3.1' into 'release/v3.1'

Bugfix/btdm controller enable failed in examples for v3.1(backport v3.1)

See merge request idf/esp-idf!3266
This commit is contained in:
Jiang Jiang Jian 2018-09-14 19:41:10 +08:00
commit 1a9d40ca3d
7 changed files with 14 additions and 3 deletions

View file

@ -106,6 +106,8 @@ void app_main()
} }
ESP_ERROR_CHECK( ret ); ESP_ERROR_CHECK( ret );
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if (esp_bt_controller_init(&bt_cfg) != ESP_OK) { if (esp_bt_controller_init(&bt_cfg) != ESP_OK) {
@ -113,7 +115,7 @@ void app_main()
return; return;
} }
if (esp_bt_controller_enable(ESP_BT_MODE_BTDM) != ESP_OK) { if (esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT) != ESP_OK) {
ESP_LOGE(BT_AV_TAG, "%s enable controller failed\n", __func__); ESP_LOGE(BT_AV_TAG, "%s enable controller failed\n", __func__);
return; return;
} }

View file

@ -271,6 +271,8 @@ void app_main()
} }
ESP_ERROR_CHECK( ret ); ESP_ERROR_CHECK( ret );
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
ret = esp_bt_controller_init(&bt_cfg); ret = esp_bt_controller_init(&bt_cfg);
if (ret) { if (ret) {
@ -278,7 +280,7 @@ void app_main()
return; return;
} }
ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM); ret = esp_bt_controller_enable(ESP_BT_MODE_BLE);
if (ret) { if (ret) {
ESP_LOGE(HID_DEMO_TAG, "%s enable controller failed\n", __func__); ESP_LOGE(HID_DEMO_TAG, "%s enable controller failed\n", __func__);
return; return;

View file

@ -279,13 +279,15 @@ void app_main()
} }
ESP_ERROR_CHECK( ret ); ESP_ERROR_CHECK( ret );
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if ((ret = esp_bt_controller_init(&bt_cfg)) != ESP_OK) { if ((ret = esp_bt_controller_init(&bt_cfg)) != ESP_OK) {
ESP_LOGE(GAP_TAG, "%s initialize controller failed: %s\n", __func__, esp_err_to_name(ret)); ESP_LOGE(GAP_TAG, "%s initialize controller failed: %s\n", __func__, esp_err_to_name(ret));
return; return;
} }
if ((ret = esp_bt_controller_enable(ESP_BT_MODE_BTDM)) != ESP_OK) { if ((ret = esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT)) != ESP_OK) {
ESP_LOGE(GAP_TAG, "%s enable controller failed: %s\n", __func__, esp_err_to_name(ret)); ESP_LOGE(GAP_TAG, "%s enable controller failed: %s\n", __func__, esp_err_to_name(ret));
return; return;
} }

View file

@ -150,6 +150,7 @@ void app_main()
} }
ESP_ERROR_CHECK( ret ); ESP_ERROR_CHECK( ret );
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if ((ret = esp_bt_controller_init(&bt_cfg)) != ESP_OK) { if ((ret = esp_bt_controller_init(&bt_cfg)) != ESP_OK) {

View file

@ -234,6 +234,7 @@ void app_main()
} }
ESP_ERROR_CHECK( ret ); ESP_ERROR_CHECK( ret );
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if ((ret = esp_bt_controller_init(&bt_cfg)) != ESP_OK) { if ((ret = esp_bt_controller_init(&bt_cfg)) != ESP_OK) {

View file

@ -151,6 +151,8 @@ void app_main()
} }
ESP_ERROR_CHECK( ret ); ESP_ERROR_CHECK( ret );
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if (esp_bt_controller_init(&bt_cfg) != ESP_OK) { if (esp_bt_controller_init(&bt_cfg) != ESP_OK) {
ESP_LOGE(SPP_TAG, "%s initialize controller failed", __func__); ESP_LOGE(SPP_TAG, "%s initialize controller failed", __func__);

View file

@ -219,6 +219,7 @@ void app_main()
} }
ESP_ERROR_CHECK( ret ); ESP_ERROR_CHECK( ret );
ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE));
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();
if (esp_bt_controller_init(&bt_cfg) != ESP_OK) { if (esp_bt_controller_init(&bt_cfg) != ESP_OK) {