Closed nirbhaymanoj closed 2 years ago
The error -2 is defined here: https://github.com/NordicSemiconductor/Android-BLE-Library/blob/52d60a4de110b73faef05938ea31a699a9a38163/ble/src/main/java/no/nordicsemi/android/ble/callback/FailCallback.java#L32 It is thrown when this method https://github.com/NordicSemiconductor/Android-BLE-Library/blob/52d60a4de110b73faef05938ea31a699a9a38163/ble/src/main/java/no/nordicsemi/android/ble/BleManagerHandler.java#L1478-L1485 returns false. By design it should return false if required GATT service has not been found on the device, which may happen in the following cases:
getServices()
,Please, use nRF Connect to verify what services are on the device, refresh cache if necessary and compare it to your implementation of the BLE manager.
I am trying to connect to a BLE device but the thing is the device gets connected but within 1 or 2 seconds it gets disconnected showing status error of -2. Any help would be appreciated.
code snippet :
LOGS: