diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/main/main.c b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/main/main.c index abcdde4d8b5..7621568b4e7 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/main/main.c +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_acceptor/main/main.c @@ -102,7 +102,6 @@ static void esp_spp_cb(uint16_t e, void *p) ESP_LOGI(SPP_TAG, "ESP_SPP_INIT_EVT"); /* Enable SPP VFS mode */ esp_spp_vfs_register(); - esp_spp_start_srv(sec_mask, role_slave, 0, SPP_SERVER_NAME); } else { ESP_LOGE(SPP_TAG, "ESP_SPP_INIT_EVT status:%d", param->init.status); } @@ -137,6 +136,14 @@ static void esp_spp_cb(uint16_t e, void *p) spp_wr_task_start_up(spp_read_handle, param->srv_open.fd); } break; + case ESP_SPP_VFS_REGISTER_EVT: + if (param->vfs_register.status == ESP_SPP_SUCCESS) { + ESP_LOGI(SPP_TAG, "ESP_SPP_VFS_REGISTER_EVT"); + esp_spp_start_srv(sec_mask, role_slave, 0, SPP_SERVER_NAME); + } else { + ESP_LOGE(SPP_TAG, "ESP_SPP_VFS_REGISTER_EVT status:%d", param->vfs_register.status); + } + break; default: break; } diff --git a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/main/main.c b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/main/main.c index dea4c6d2bf8..fc2e62c3000 100644 --- a/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/main/main.c +++ b/examples/bluetooth/bluedroid/classic_bt/bt_spp_vfs_initiator/main/main.c @@ -147,9 +147,6 @@ static void esp_spp_cb(uint16_t e, void *p) ESP_LOGI(SPP_TAG, "ESP_SPP_INIT_EVT"); /* Enable SPP VFS mode */ esp_spp_vfs_register(); - esp_bt_dev_set_device_name(EXAMPLE_DEVICE_NAME); - esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE); - esp_bt_gap_start_discovery(inq_mode, inq_len, inq_num_rsps); } else { ESP_LOGE(SPP_TAG, "ESP_SPP_INIT_EVT status:%d", param->init.status); } @@ -193,6 +190,16 @@ static void esp_spp_cb(uint16_t e, void *p) case ESP_SPP_SRV_OPEN_EVT: ESP_LOGI(SPP_TAG, "ESP_SPP_SRV_OPEN_EVT"); break; + case ESP_SPP_VFS_REGISTER_EVT: + if (param->vfs_register.status == ESP_SPP_SUCCESS) { + ESP_LOGI(SPP_TAG, "ESP_SPP_VFS_REGISTER_EVT"); + esp_bt_dev_set_device_name(EXAMPLE_DEVICE_NAME); + esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE); + esp_bt_gap_start_discovery(inq_mode, inq_len, inq_num_rsps); + } else { + ESP_LOGE(SPP_TAG, "ESP_SPP_VFS_REGISTER_EVT status:%d", param->vfs_register.status); + } + break; default: break; }