Description
现象和步骤:
-
使用play_bt_source_example例子,esp32开机主动扫描并且连接上耳机。
-
把耳机放到耳机盒子,连接会断开
-
把耳机从耳机盒子拿出来,这时耳机会主动发起连接。
-
这时,耳机会很快连接上esp32,但很快有会断开。
LOG如下:
*****************耳机放到盒子,断开连接
I (42710) BT_AVCT: AVCT_MsgReq
I (42720) BT_AVCT: len: 5
I (42720) BT_AVCT: AVCT_MsgReq
I (42720) BT_AVCT: len: 5
I (45230) BT_BTM: BTM_SetPowerMode: pm_id 128 BDA: a391c3f6 mode:0x0
I (45230) BT_L2CAP: L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x0043 Conf Needed
I (45230) BT_L2CAP: L2CA_DisconnectRsp() CID: 0x0043
I (45230) BT_AVCT: AVCT_RemoveConn
I (45240) A2DP_STREAM: AVRC conn_state evt: state 0, [00:00:00:00:00:00]
I (45300) BT_BTM: BTM_SetPowerMode: pm_id 128 BDA: a391c3f6 mode:0x0
I (45300) BT_L2CAP: L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x0040 Conf Needed
I (45300) BT_L2CAP: L2CA_DisconnectRsp() CID: 0x0040
I (45310) BT_BTM: BTM_SetLinkPolicy hold not supported (settings: 0x000d)
I (45310) BT_BTM: BTM_SetLinkPolicy park not supported (settings: 0x0005)
I (45320) BT_L2CAP: L2CA_SetDesireRole() new:x80, disallow_switch:0
I (45320) BT_L2CAP: L2CA_SetDesireRole() new:x0, disallow_switch:0
I (45330) BT_L2CAP: L2CA_SetDesireRole() new:x0, disallow_switch:0
W (45340) BT_APPL: bta_dm_act no entry for connected service cbs
I (45340) BT_BTM: BTM_SetPowerMode: pm_id 128 BDA: a391c3f6 mode:0x0
I (45350) BT_L2CAP: L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x0042 Conf Needed
I (45360) BT_L2CAP: L2CA_DisconnectRsp() CID: 0x0042
I (45360) A2DP_STREAM: a2dp source disconnected
W (45370) BLUETOOTH_SOURCE_EXAMPLE: [ * ] Bluetooth disconnected or suspended
E (45370) BT_LOG: esp_a2d_media_ctrl 4
W (45370) BT_LOG: ESP_A2D_MEDIA_CTRL_STOP is deprecated, using ESP_A2D_MEDIA_CTRL_SUSPEND instead.
W (49360) BT_HCI: hci cmd send: disconnect: hdl 0x80, rsn:0x13
W (49510) BT_HCI: hcif disc complete: hdl 0x80, rsn 0x16 dev_find 1
I (49510) BT_L2CAP: L2CA_SetDesireRole() new:x0, disallow_switch:0
*****************耳机从盒子拿出来,耳机主动去连接32
I (63240) BT_BTM: btm_sec_set_peer_sec_caps: sm4: 0x11, rmt_support_for_secure_connections 0
I (63240) BT_BTM: btm_acl_created: pend:0
W (63240) BT_HCI: hcif conn complete: hdl 0x81, st 0x0
I (63250) BT_L2CAP: L2CA_SetDesireRole() new:x0, disallow_switch:0
I (63250) BT_BTM: BTM_InqDbRead: bd addr [b0f1a391c3f6]
I (63360) BT_BTM: BTM_SetPowerMode: pm_id 128 BDA: a391c3f6 mode:0x0
I (63360) BT_L2CAP: L2CAP - Calling Connect_Ind_Cb(), CID: 0x0040
I (63360) BT_L2CAP: L2CA_ErtmConnectRsp() CID: 0x0040 Result: 0 Status: 0 BDA: b0f1a391c3f6 p_ertm_info:0x0
I (63370) BT_L2CAP: L2CA_ConfigReq() CID 0x0040: fcr_present:0 (mode 0) mtu_present:1 (672)
I (63390) BT_L2CAP: L2CA_ConfigRsp() CID: 0x0040 Result: 0 MTU present:0 Flush TO:0 FCR:0 FCS:0
I (63390) BT_L2CAP: L2CAP - Calling Config_Rsp_Cb(), CID: 0x0040
I (63530) BT_BTM: BTM_SetPowerMode: pm_id 128 BDA: a391c3f6 mode:0x0
I (63530) BT_L2CAP: L2CAP - Calling Disconnect_Ind_Cb(), CID: 0x0040 Conf Needed
I (63530) BT_L2CAP: L2CA_DisconnectRsp() CID: 0x0040
W (64520) BT_HCI: hcif disc complete: hdl 0x81, rsn 0x16 dev_find 1
I (64520) BT_L2CAP: L2CA_SetDesireRole() new:x0, disallow_switch:0
连上后,会马上出现断开。