esp-idf: [TW#20819] Bluetooth classic SPP cannot connect the other device (IDFGH-7605)
On bt_spp_initiator sample, I try to connect the other device (HC-06), but unfortunately I received error logs as:
I (5673) SPP_INITIATOR_DEMO: ESP_SPP_DISCOVERY_COMP_EVT status=0 scn_num=1
I (5683) SPP_INITIATOR_DEMO: ESP_SPP_CL_INIT_EVT
E (35903) BT: port_rfc_closed RFCOMM connection in state 1 closed: Peer connection failed (res: 16)
E (35913) BT: bta_gattc_mark_bg_conn unable to find the bg connection mask for: 98:d3:31:fd:8f:28
I (35913) SPP_INITIATOR_DEMO: ESP_SPP_CLOSE_EVT
it is seems that esp_spp_connect
does not works correctly.
static void esp_spp_cb(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
{
// ...
case ESP_SPP_DISCOVERY_COMP_EVT:
ESP_LOGI(SPP_TAG, "ESP_SPP_DISCOVERY_COMP_EVT status=%d scn_num=%d",param->disc_comp.status, param->disc_comp.scn_num);
if (param->disc_comp.status == ESP_SPP_SUCCESS) {
esp_spp_connect(sec_mask, role_master, param->disc_comp.scn[0], peer_bd_addr);
}
break;
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 26 (1 by maintainers)
I am glad to hear that it works OK now. The different of the log is caused by flow control, there is no problem.