innoveit / react-native-ble-manager

React Native BLE communication module
http://innoveit.github.io/react-native-ble-manager/
Apache License 2.0
2.11k stars 757 forks source link

Device disconnect on BLE_GATT_STATUS_SUCCESS #1228

Closed varun761 closed 2 weeks ago

varun761 commented 3 months ago

The react native module sends a disconnect event on BLE_GATT_STATUS_SUCCESS 0x0000

This generally happens when we send 3 data packets in 25ms. I am using PHY 2 and requestConnectionPriority too.

Expected behaviours:

It doesn't need to send the disconnect event on the device state changes to 0.

Version

react-native-ble-manager : 11.5.3 react-native: 0.73.4

System Information:

System:
  OS: Windows 10 10.0.19045
  CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  Memory: 1.44 GB / 7.88 GB
Binaries:
  Node:
    version: 18.19.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 7.24.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "23"
      - "24"
      - "25"
      - "26"
      - "27"
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-31 | Google Play Intel x86 Atom_64
      - android-33 | Intel x86_64 Atom
      - android-34 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK:
    AllowAllTrustedApps: Disabled
    Versions:
      - 10.0.19041.0
IDEs:
  Android Studio: AI-231.9392.1.2311.11330709
  Visual Studio:
    - 17.1.32210.238 (Visual Studio Community 2022)
Languages:
  Java: 17.0.10
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.4
    wanted: 0.73.4
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
varun761 commented 3 months ago

Device Logs:

06-06 00:40:03.941 941 22637 D r_submix: read_frames 21813390336, T_rec 454445.656250s, p_vs_o 15209us 06-06 00:40:04.004 942 965 D mtk.hal.bt@1.1-impl: BtHostDebugInfo 06-06 00:40:04.004 942 965 D [BT] : mtk_bt_op: BT_VND_OP_SET_BTHOST 06-06 00:40:04.008 2096 2555 I bt_stack: [INFO:btsnoop.cc(342)] clear_l2cap_allowlist: Clearing acceptlist from l2cap channel. conn_handle=512 cid=4:4 06-06 00:40:04.009 2096 2555 I bt_stack: [INFO:gatt_attr.cc(338)] gatt_connect_cback: remove untrusted client status, bda=e7:01:a9:03:d3:8c 06-06 00:40:04.009 2096 2555 I bluetooth: system/bt/stack/gap/gap_ble.cc:298 client_connect_cback: No active GAP service found for peer:xx:xx:xx:xx:d3:8c callback:Disconnected 06-06 00:40:04.011 2096 2555 I bt_bta_gattc: system/bt/bta/gatt/bta_gattc_act.cc:1148 bta_gattc_conn_cback: Disconnected att_id:3 transport:le reason:GATT_CONN_TIMEOUT 06-06 00:40:04.011 2096 2555 I bt_bta_gattc: system/bt/bta/gatt/bta_gattc_act.cc:1148 bta_gattc_conn_cback: Disconnected att_id:4 transport:le reason:GATT_CONN_TIMEOUT 06-06 00:40:04.011 2096 2555 I bt_bta_gattc: system/bt/bta/gatt/bta_gattc_act.cc:1148 bta_gattc_conn_cback: Disconnected att_id:5 transport:le reason:GATT_CONN_TIMEOUT 06-06 00:40:04.011 2096 2555 I bt_bta_gattc: system/bt/bta/gatt/bta_gattc_act.cc:1148 bta_gattc_conn_cback: Disconnected att_id:6 transport:le reason:GATT_CONN_TIMEOUT 06-06 00:40:04.011 2096 2555 I bt_bta_gattc: system/bt/bta/gatt/bta_gattc_act.cc:1148 bta_gattc_conn_cback: Disconnected att_id:7 transport:le reason:GATT_CONN_TIMEOUT 06-06 00:40:04.011 2096 2555 I bt_bta_gattc: system/bt/bta/gatt/bta_gattc_act.cc:1148 bta_gattc_conn_cback: Disconnected att_id:8 transport:le reason:GATT_CONN_TIMEOUT 06-06 00:40:04.012 2096 2555 W bt_btm_sec: system/bt/stack/btm/btm_sec.cc:3849 btm_sec_disconnected: Got uncommon disconnection reason:Connection Timeout handle:0x0200 06-06 00:40:04.012 2096 2555 I btif_av : system/bt/btif/src/btif_av.cc:4184 btif_av_get_peer_sep: No active sink or source peer found 06-06 00:40:04.012 2096 2555 I bt_btif_a2dp_source: system/bt/btif/src/btif_a2dp_source.cc:850 btif_a2dp_source_on_idle: btif_a2dp_source_on_idle: state=STATE_OFF 06-06 00:40:04.012 2096 2555 I btif_av : system/bt/btif/src/btif_av.cc:4184 btif_av_get_peer_sep: No active sink or source peer found 06-06 00:40:04.012 2096 2555 I bt_btif_a2dp_source: system/bt/btif/src/btif_a2dp_source.cc:850 btif_a2dp_source_on_idle: btif_a2dp_source_on_idle: state=STATE_OFF 06-06 00:40:04.012 942 965 D mtk.hal.bt@1.1-impl: BtHostDebugInfo 06-06 00:40:04.012 942 965 D [BT] : mtk_bt_op: BT_VND_OP_SET_BTHOST 06-06 00:40:04.015 2096 31976 D BluetoothMetrics: btclass1f00 06-06 00:40:04.015 27885 27925 D BluetoothGatt: onClientConnectionState() - status=0 clientIf=8 device=E7:01:A9:03:D3:8C 06-06 00:40:04.016 942 965 D mtk.hal.bt@1.1-impl: BtHostDebugInfo 06-06 00:40:04.016 942 965 D [BT] : mtk_bt_op: BT_VND_OP_SET_BTHOST 06-06 00:40:04.016 27885 27925 D RNBleManager: onConnectionStateChange to 0 on peripheral: E7:01:A9:03:D3:8C with status 0 06-06 00:40:04.018 2096 31976 D Checkin : publish the event [tag = MOT_BT event name = DISC] 06-06 00:40:04.020 27885 27885 D BluetoothGatt: cancelOpen() - device: E7:01:A9:03:D3:8C 06-06 00:40:04.024 27885 27885 D BluetoothGatt: close() 06-06 00:40:04.024 27885 27885 D BluetoothGatt: unregisterApp() - mClientIf=8 06-06 00:40:04.034 27885 27885 D RNBleManager: Peripheral event (BleManagerDisconnectPeripheral):E7:01:A9:03:D3:8C 06-06 00:40:04.035 2128 2223 W BluetoothEventManager: AclStateChangedHandler: activeDevice is null

marcosinigaglia commented 3 weeks ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.