rusel1989 / react-native-bluetooth-serial

Port of https://github.com/don/BluetoothSerial for react native
476 stars 291 forks source link

Cannot connect to Bluetooth v2.1+EDR audio receiver #54

Open nishiltamboli opened 7 years ago

nishiltamboli commented 7 years ago

Good job with this library!

I used this library to connect to iOS device from Android and it worked well! However when I am trying to connect to a Bluetooth 2.1+EDR audio receiver, it doesnt connect.

Below is the Logcat for the same -


06-22 12:10:31.563 10360 14004 D BluetoothSerial: connect to: 11:09:33:36:6A:FE 06-22 12:10:31.564 10360 15618 E BluetoothSerial: java.io.IOException: read failed, socket might closed or timeout, read ret: -1 06-22 12:10:31.564 10360 15618 D BluetoothSerial: Sending event: error 06-22 12:10:31.564 10360 15618 I BluetoothSerial: Trying fallback... 06-22 12:10:31.565 5627 5726 E bt_btif_sock_rfcomm: btsock_rfc_signaled socket signaled for read while disconnected, slot: 6, channel: -1 06-22 12:10:31.565 10360 14004 D BluetoothSerial: setState() connecting -> connecting 06-22 12:10:31.568 10360 15618 W BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback 06-22 12:10:31.570 10360 15660 D BluetoothSerial: BEGIN mConnectThread 06-22 12:10:31.571 5627 5722 W bt_l2cap: L2CA_ErtmConnectReq() PSM: 0x0003 BDA: 648af40616b2 p_ertm_info: 0x00000000 allowed:0x0 preferred:0 06-22 12:10:31.571 10360 15660 D BluetoothSerial: Connecting to socket... 06-22 12:10:31.572 5627 5722 E bt_btif : bte_scan_filt_param_cfg_evt, 1 06-22 12:10:31.574 10360 15660 W BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback 06-22 12:10:31.575 5627 5726 E bt_btif_sock_rfcomm: find_rfc_slot_by_id unable to find RFCOMM slot id: 8 06-22 12:10:31.575 10360 15660 E BluetoothSerial: java.io.IOException: read failed, socket might closed or timeout, read ret: -1 06-22 12:10:31.575 10360 15660 D BluetoothSerial: Sending event: error 06-22 12:10:31.576 10360 15660 I BluetoothSerial: Trying fallback... 06-22 12:10:31.578 10360 15660 W BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback 06-22 12:10:31.579 5627 5722 W bt_l2cap: L2CA_ErtmConnectReq() PSM: 0x0003 BDA: 110933366afe p_ertm_info: 0x00000000 allowed:0x0 preferred:0 06-22 12:10:31.579 5627 5722 W bt_l2cap: L2CAP - st: CLOSED evt: 21 06-22 12:10:31.579 5627 5722 W bt_l2cap: L2CAP - st: CLOSED evt: 7 06-22 12:10:31.607 5627 5666 W bt_hci_packet_fragmenter: reassemble_and_dispatch complete l2cap packet received:l2cap full length 12 and hci length 20. 06-22 12:10:31.607 5627 5722 W bt_l2cap: L2CAP - st: W4_L2CAP_CON_RSP evt: 13 06-22 12:10:31.607 5627 5722 W bt_rfcomm: PORT_StartCnf failed result:2 06-22 12:10:31.608 5627 5726 E bt_btif_sock_rfcomm: find_rfc_slot_by_id unable to find RFCOMM slot id: 9 06-22 12:10:31.608 10360 15660 E BluetoothSerial: Couldn't establish a Bluetooth connection. 06-22 12:10:31.608 10360 15660 D BluetoothSerial: Sending event: error 06-22 12:10:31.611 10360 15660 D BluetoothSerial: Sending event: connectionFailed 06-22 12:10:31.611 10360 15660 D BluetoothSerial: stop 06-22 12:10:31.611 10360 15660 D BluetoothSerial: setState() connecting -> none 06-22 12:10:33.974 5627 5722 W bt_l2cap: L2CAP - st: CLOSED evt: 1 06-22 12:10:33.974 5627 5722 W bt_sdp : SDP - Rcvd conn cnf with error: 0x4 CID 0x45 06-22 12:10:33.974 5627 5722 E bt_btif_sock_rfcomm: find_rfc_slot_by_id unable to find RFCOMM slot id: 6 06-22 12:10:33.974 5627 5722 W bt_l2cap: L2CAP - st: CLOSED evt: 1 06-22 12:10:33.975 5627 5722 W bt_rfcomm: PORT_StartCnf failed result:4 06-22 12:10:33.975 5627 5726 E bt_btif_sock_rfcomm: find_rfc_slot_by_id unable to find RFCOMM slot id: 7 06-22 12:10:33.975 10360 15618 E BluetoothSerial: Couldn't establish a Bluetooth connection. 06-22 12:10:33.976 10360 15618 D BluetoothSerial: Sending event: error 06-22 12:10:33.986 10360 15618 D BluetoothSerial: Sending event: connectionFailed


I am not sure but does it have to do something with A2DP profile? We cannot stream audio with this?

nishiltamboli commented 7 years ago

Is there an update on this issue?