When I connect ble after I try to open the notification, but often return BleGattException status = 133, sometimes it will sometimes not .
this is my code :
mConnectingDevice.establishConnection(false)
.doOnNext(this::storeConnect)
.flatMap(rxBleConnection -> rxBleConnection.setupNotification(notifyUuid))
.observeOn(AndroidSchedulers.mainThread())
.flatMap(notificationObservable -> notificationObservable)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(this::onNotify, this::connectFail);
connectFail return BleGattException status = 133
This is the print log // behind my comments:
08-22 14:12:00.777 31399-31399/com.evan.yeeuusample D/BluetoothAdapter: STATE_ON
08-22 14:12:00.781 31399-31399/com.evan.yeeuusample D/BluetoothGatt: connect() - device: F0:65:A0:1A:20:16, auto: false
mConnectingDevice.establishConnection(false)
08-22 14:12:00.781 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp()
08-22 14:12:00.782 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp() - UUID=58cec16e-bb91-4603-bd28-11da0e5e17c0
08-22 14:12:00.785 31399-31410/com.evan.yeeuusample D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
08-22 14:12:02.965 31399-31410/com.evan.yeeuusample D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5
device=F0:65:A0:1A:20:16
connectstatus 133
08-22 14:12:02.969 31399-31399/com.evan.yeeuusample D/BluetoothManager: getConnectionState()
08-22 14:12:02.970 31399-31399/com.evan.yeeuusample D/BluetoothManager: getConnectedDevices
08-22 14:12:02.997 31399-31399/com.evan.yeeuusample D/BluetoothGatt: close()
connect fail gatt is close
08-22 14:12:02.997 31399-31399/com.evan.yeeuusample D/BluetoothGatt: unregisterApp() - mClientIf=5
Continue to try to connect:
08-22 14:17:35.278 31399-31399/com.evan.yeeuusample D/BluetoothGatt: connect() - device: F0:65:A0:1A:20:16, auto: false
08-22 14:17:35.278 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp()
08-22 14:17:35.278 31399-31399/com.evan.yeeuusample D/BluetoothGatt: registerApp() - UUID=b8fa445c-aab2-46d1-b2c2-e67bb475caf9
08-22 14:17:35.280 31399-31411/com.evan.yeeuusample D/BluetoothGatt: onClientRegistered() - status=0 clientIf=5
08-22 14:17:43.666 31399-31441/com.evan.yeeuusample D/BluetoothGatt: onClientConnectionState() - status=133 clientIf=5 device=F0:65:A0:1A:20:16
Failed to connect again! Is there any solution? i do not know why the connection status is 133, gatt has been closed! Now this state happens frequently, help me thank you .