mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
components/bt: Set discoverable after create server
This commit is contained in:
parent
98c20ce417
commit
b41108b60a
@ -56,8 +56,6 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
|
||||
switch (event) {
|
||||
case ESP_SPP_INIT_EVT:
|
||||
ESP_LOGI(SPP_TAG, "ESP_SPP_INIT_EVT");
|
||||
esp_bt_dev_set_device_name(EXAMPLE_DEVICE_NAME);
|
||||
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
|
||||
esp_spp_start_srv(sec_mask,role_slave, 0, SPP_SERVER_NAME);
|
||||
break;
|
||||
case ESP_SPP_DISCOVERY_COMP_EVT:
|
||||
@ -71,6 +69,8 @@ static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
|
||||
break;
|
||||
case ESP_SPP_START_EVT:
|
||||
ESP_LOGI(SPP_TAG, "ESP_SPP_START_EVT");
|
||||
esp_bt_dev_set_device_name(EXAMPLE_DEVICE_NAME);
|
||||
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
|
||||
break;
|
||||
case ESP_SPP_CL_INIT_EVT:
|
||||
ESP_LOGI(SPP_TAG, "ESP_SPP_CL_INIT_EVT");
|
||||
|
@ -80,8 +80,6 @@ static void esp_spp_cb(uint16_t e, void *p)
|
||||
ESP_LOGI(SPP_TAG, "ESP_SPP_INIT_EVT status=%d", param->init.status);
|
||||
if (param->init.status == ESP_SPP_SUCCESS) {
|
||||
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_spp_start_srv(sec_mask, role_slave, 0, SPP_SERVER_NAME);
|
||||
}
|
||||
break;
|
||||
@ -96,6 +94,8 @@ static void esp_spp_cb(uint16_t e, void *p)
|
||||
break;
|
||||
case ESP_SPP_START_EVT:
|
||||
ESP_LOGI(SPP_TAG, "ESP_SPP_START_EVT");
|
||||
esp_bt_dev_set_device_name(EXAMPLE_DEVICE_NAME);
|
||||
esp_bt_gap_set_scan_mode(ESP_BT_CONNECTABLE, ESP_BT_GENERAL_DISCOVERABLE);
|
||||
break;
|
||||
case ESP_SPP_CL_INIT_EVT:
|
||||
ESP_LOGI(SPP_TAG, "ESP_SPP_CL_INIT_EVT");
|
||||
|
Loading…
Reference in New Issue
Block a user