BLE - Connectivity issue when clientIf value is greater than 7

721 Views Asked by At

BLE works perfectly fine on almost all device where clientIf value is upto 8. But when it is greater than that it fails.

On some devices when I restart the device it works perfectly but as soon I turn my device's Bluetooth On/OFF it stops working again. I tried other apps available on playstore but observed same behaviour on those apps as wel.

Device facing issues: Asus Zenfone MaxPro, Samsung s10e

Any idea how it could be solved ?

Log: ONE PLUS 6T : BLE Working :

2020-03-13 12:51:05.664 6496-6496/ble D/BluetoothAdapter: isLeEnabled(): ON
2020-03-13 12:51:05.666 6496-6496/ble D/MainActivity: *** TIME OUT ****
2020-03-13 12:51:05.692 6496-6496/ble D/MainActivity: scan finish
2020-03-13 12:51:05.779 6496-6496/ble V/ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
2020-03-13 12:51:06.422 6496-6496/ble V/ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
2020-03-13 12:51:06.427 6496-6496/ble D/MainActivity: connectToDevice() HANDLERRRR called with:  message = [Connecting...]BleDevice{connected=false, connecting=false, address='00:1E:C0:46:8D:E6', name='unknown', device=00:1E:C0:46:8D:E6}
2020-03-13 12:51:06.434 6496-6496/ble D/MainActivity: setHandlerForTimeout: handler is set....!! 
2020-03-13 12:51:06.440 6496-6496/ble D/BluetoothGatt: connect() - device: 00:1E:C0:46:8D:E6, auto: true
2020-03-13 12:51:06.440 6496-6496/ble D/BluetoothGatt: registerApp()
2020-03-13 12:51:06.441 6496-6496/ble D/BluetoothGatt: registerApp() - UUID=de971a16-3e50-4e23-94cf-fa77cc7e135f
2020-03-13 12:51:06.442 6496-6496/ble D/BluetoothGatt: configureMTU() - device: 00:1E:C0:46:8D:E6 mtu: 512
2020-03-13 12:51:06.442 6496-6496/ble D/BluetoothGatt: refresh() - device: 00:1E:C0:46:8D:E6
2020-03-13 12:51:06.442 6496-6496/ble D/BluetoothGatt: requestConnectionPriority() - params: 2
2020-03-13 12:51:06.445 6496-6513/ble D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
2020-03-13 12:51:06.498 6496-6514/ble D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@21386b6[MainActivity]
2020-03-13 12:51:06.606 6496-6496/ble D/OnePlusJankManager:  Chor uploadMDM JANK_TYPE_ONCE mViewTitle = ble/ble.MainActivity--- jank level = 2
2020-03-13 12:51:06.608 6496-6496/ble D/MainActivity: start connecting = true     info: Start connection...
2020-03-13 12:51:06.622 6496-6513/ble D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=5 device=00:1E:C0:46:8D:E6
2020-03-13 12:51:06.623 6496-6513/ble D/BleGattImpl: onConnectionStateChange() called with: gatt = [android.bluetooth.BluetoothGatt@d3aeea8], status = [0], newState = [2]
2020-03-13 12:51:06.627 6496-6513/ble D/BluetoothGatt: discoverServices() - device: 00:1E:C0:46:8D:E6
2020-03-13 12:51:06.628 6496-6513/ble D/BleGattImpl: onConnectionStateChange: connected and discoversies status: true
2020-03-13 12:51:07.098 6496-6513/ble D/BluetoothGatt: onConnectionUpdated() - Device=00:1E:C0:46:8D:E6 interval=6 latency=0 timeout=500 status=0
2020-03-13 12:51:07.258 6496-6513/ble D/BluetoothGatt: onSearchComplete() = Device=00:1E:C0:46:8D:E6 Status=0
2020-03-13 12:51:07.259 6496-6513/ble D/BleGattImpl: onServicesDiscovered() called with: gatt = [android.bluetooth.BluetoothGatt@d3aeea8], status = [0]
2020-03-13 12:51:07.275 6496-6496/ble D/MainActivity: onConnected() called with: device = [BleDevice{connected=true, connecting=false, address='00:1E:C0:46:8D:E6', name='unknown', device=00:1E:C0:46:8D:E6}]
2020-03-13 12:51:07.316 6496-6513/ble D/DecorView: onWindowFocusChangedFromViewRoot hasFocus: true, DecorView@b94b93b[MainActivity]
2020-03-13 12:51:07.333 6496-6513/ble D/BluetoothGatt: onConnectionUpdated() - Device=00:1E:C0:46:8D:E6 interval=38 latency=0 timeout=500 status=0
2020-03-13 12:51:07.718 6496-6496/ble V/ViewRootImpl: The specified message queue synchronization  barrier token has not been posted or has already been removed
2020-03-13 12:51:07.749 6496-6496/ble W/Choreographer: Already have a pending vsync event.  There should only be one at a time.

BLE Log - Samsung S10e - NOT WORKING:

2020-03-13 12:52:13.481 2426-7119/com.pravin.ble W/ratestblesampl: Something went wrong with handling the ddm chunk.
2020-03-13 12:52:14.747 2426-2426/com.pravin.ble D/ViewRootImpl@deec49d[MainActivity]: ViewPostIme pointer 0
2020-03-13 12:52:14.812 2426-2426/com.pravin.ble D/ViewRootImpl@deec49d[MainActivity]: ViewPostIme pointer 1
2020-03-13 12:52:14.817 2426-2426/com.pravin.ble I/MultiWindowDecorSupport: updateCaptionType >> DecorView@d3168a7[MainActivity], isFloating: true, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: false
2020-03-13 12:52:14.818 2426-2426/com.pravin.ble D/MultiWindowDecorSupport: setCaptionType = 0, DecorView = DecorView@d3168a7[MainActivity]
2020-03-13 12:52:14.857 2426-2426/com.pravin.ble D/ViewRootImpl@cdaec46[MainActivity]: setView = DecorView@d3168a7[MainActivity] TM=true MM=false
2020-03-13 12:52:14.858 2426-2426/com.pravin.ble D/MainActivity: connectToDevice() HANDLERRRR called with:  message = [Connecting...]BleDevice{connected=false, connecting=false, address='00:1E:C0:46:8D:E6', name='unknown', device=00:1E:C0:46:8D:E6}
2020-03-13 12:52:14.866 2426-2426/com.pravin.ble D/MainActivity: setHandlerForTimeout: handler is set....!! 
2020-03-13 12:52:14.874 2426-2426/com.pravin.ble D/BluetoothAdapter: STATE_ON
2020-03-13 12:52:14.876 2426-2426/com.pravin.ble D/BluetoothGatt: connect() - device: 00:1E:C0:46:8D:E6, auto: true
2020-03-13 12:52:14.876 2426-2426/com.pravin.ble D/BluetoothAdapter: isSecureModeEnabled
2020-03-13 12:52:14.877 2426-2426/com.pravin.ble D/BluetoothGatt: registerApp()
2020-03-13 12:52:14.878 2426-2426/com.pravin.ble D/BluetoothGatt: registerApp() - UUID=20db861e-0afa-4d3e-ad28-8fd9116db8b4
2020-03-13 12:52:14.880 2426-2426/com.pravin.ble D/BluetoothGatt: configureMTU() - device: 00:1E:C0:46:8D:E6 mtu: 512
2020-03-13 12:52:14.880 2426-2426/com.pravin.ble D/BluetoothGatt: requestConnectionPriority() - params: 2
2020-03-13 12:52:14.881 2426-2448/com.pravin.ble D/BluetoothGatt: onClientRegistered() - status=0 clientIf=9
2020-03-13 12:52:14.933 2426-2426/com.pravin.ble D/ViewRootImpl@cdaec46[MainActivity]: Relayout returned: old=[0,117][1080,2235] new=[27,1002][1053,1350] req=(1026,348)0 dur=8 res=0x7 s={true 479479746560} ch=true
2020-03-13 12:52:14.934 2426-2460/com.pravin.ble D/OpenGLRenderer: createReliableSurface : 0x6f35547dc0, 0x6fa3385000
2020-03-13 12:52:14.934 2426-2460/com.pravin.ble I/mali_winsys: new_window_surface() [1218x540] return: 0x3000
2020-03-13 12:52:14.945 2426-2426/com.pravin.ble E/DecorView: mWindow.mActivityCurrentConfig is null
2020-03-13 12:52:14.947 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:14.962 2426-2448/com.pravin.ble D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=9 device=00:1E:C0:46:8D:E6
2020-03-13 12:52:14.972 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x6f50f30200
2020-03-13 12:52:14.974 2426-2448/com.pravin.ble D/BleGattImpl: onConnectionStateChange() called with: gatt = [android.bluetooth.BluetoothGatt@a4e93a3], status = [0], newState = [2]
2020-03-13 12:52:14.975 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:14.984 2426-2448/com.pravin.ble D/BluetoothGatt: discoverServices() - device: 00:1E:C0:46:8D:E6
2020-03-13 12:52:14.985 2426-2448/com.pravin.ble D/BleGattImpl: onConnectionStateChange: connected and discoversies status: true
2020-03-13 12:52:14.989 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x6f50f30200
2020-03-13 12:52:14.990 2426-2426/com.pravin.ble D/ViewRootImpl@cdaec46[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2020-03-13 12:52:14.992 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:14.997 2426-2426/com.pravin.ble D/MainActivity: start connecting = true     info: Start connection...
2020-03-13 12:52:15.010 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x6f50f30200
2020-03-13 12:52:15.013 2426-2426/com.pravin.ble D/ViewRootImpl@deec49d[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2020-03-13 12:52:15.013 2426-2426/com.pravin.ble D/InputMethodManager: prepareNavigationBarInfo() DecorView@ff25fd9[MainActivity]
2020-03-13 12:52:15.014 2426-2426/com.pravin.ble D/InputMethodManager: getNavigationBarColor() -855310
2020-03-13 12:52:15.025 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:15.026 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x6f50f30200
2020-03-13 12:52:15.029 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:15.030 2426-2426/com.pravin.ble D/ViewRootImpl@cdaec46[MainActivity]: MSG_RESIZED: frame=[27,1002][1053,1350] ci=[0,0][0,0] vi=[0,0][0,0] or=1
2020-03-13 12:52:15.661 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:15.672 2426-2455/com.pravin.ble D/BluetoothGatt: onConnectionUpdated() - Device=00:1E:C0:46:8D:E6 interval=6 latency=0 timeout=500 status=0
2020-03-13 12:52:15.675 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x6f50f30200
2020-03-13 12:52:15.677 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:15.692 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x6f50f30200
2020-03-13 12:52:15.695 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:15.796 2426-2455/com.pravin.ble D/BluetoothGatt: onSearchComplete() = Device=00:1E:C0:46:8D:E6 Status=0
2020-03-13 12:52:15.797 2426-2455/com.pravin.ble D/BleGattImpl: onServicesDiscovered() called with: gatt = [android.bluetooth.BluetoothGatt@a4e93a3], status = [0]
2020-03-13 12:52:15.815 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x6f50f30200
2020-03-13 12:52:15.819 2426-2426/com.pravin.ble D/MainActivity: onConnected() called with: device = [BleDevice{connected=true, connecting=false, address='00:1E:C0:46:8D:E6', name='unknown', device=00:1E:C0:46:8D:E6}]
2020-03-13 12:52:15.827 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3387a00
2020-03-13 12:52:15.863 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3387a00 -> 0x0
2020-03-13 12:52:15.863 2426-2460/com.pravin.ble I/mali_egl: eglDestroySurface() in
2020-03-13 12:52:15.865 2426-2460/com.pravin.ble I/mali_winsys: delete_surface() [1218x540] return
2020-03-13 12:52:15.865 2426-2460/com.pravin.ble I/mali_egl: eglDestroySurface() out
2020-03-13 12:52:15.865 2426-2460/com.pravin.ble W/libEGL: EGLNativeWindowType 0x6f35547dd0 disconnect failed
2020-03-13 12:52:15.865 2426-2426/com.pravin.ble D/ViewRootImpl@cdaec46[MainActivity]: dispatchDetachedFromWindow
2020-03-13 12:52:15.870 2426-2426/com.pravin.ble D/InputTransport: Input channel destroyed: '597634e', fd=93
2020-03-13 12:52:15.881 2426-2448/com.pravin.ble D/BluetoothGatt: onConnectionUpdated() - Device=00:1E:C0:46:8D:E6 interval=39 latency=0 timeout=500 status=0
2020-03-13 12:52:15.918 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x0 -> 0x6f50f30200
2020-03-13 12:52:15.937 2426-2426/com.pravin.ble D/ViewRootImpl@e5cf2f6[Toast]: setView = android.widget.LinearLayout{fde96f7 V.E...... ......I. 0,0-0,0} TM=true MM=false
2020-03-13 12:52:15.937 2426-2426/com.pravin.ble V/Toast: Text: Donn in android.widget.Toast$TN@dcfb964
2020-03-13 12:52:15.937 2426-2426/com.pravin.ble D/ViewRootImpl@deec49d[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2020-03-13 12:52:15.938 2426-2426/com.pravin.ble D/InputMethodManager: prepareNavigationBarInfo() DecorView@ff25fd9[MainActivity]
2020-03-13 12:52:15.938 2426-2426/com.pravin.ble D/InputMethodManager: getNavigationBarColor() -855310
2020-03-13 12:52:15.945 2426-2426/com.pravin.ble E/ViewRootImpl: sendUserActionEvent() mView returned.
2020-03-13 12:52:15.961 2426-2426/com.pravin.ble D/ViewRootImpl@e5cf2f6[Toast]: Relayout returned: old=[0,117][1080,2235] new=[241,1911][839,2043] req=(598,132)0 dur=8 res=0x7 s={true 478099464192} ch=true
2020-03-13 12:52:15.963 2426-2460/com.pravin.ble D/OpenGLRenderer: createReliableSurface : 0x6f35547dc0, 0x6f50f2e000
2020-03-13 12:52:15.963 2426-2460/com.pravin.ble I/mali_winsys: new_window_surface() [598x132] return: 0x3000
2020-03-13 12:52:15.967 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3396900
2020-03-13 12:52:15.972 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3396900 -> 0x6f50f30200
2020-03-13 12:52:15.973 2426-2426/com.pravin.ble D/ViewRootImpl@e5cf2f6[Toast]: MSG_RESIZED_REPORT: frame=[241,1911][839,2043] ci=[0,0][0,0] vi=[0,0][598,132] or=1
2020-03-13 12:52:15.993 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6f50f30200 -> 0x6fa3396900
2020-03-13 12:52:16.262 2426-2460/com.pravin.ble D/OpenGLRenderer: SurfaceChanged : 0x6fa3396900 -> 0x6f50f30200
0

There are 0 best solutions below