I am having troubles with reading a Ble device and using the RxAndroidBle library.
I keep getting this error:
BleGattException{status=22, bleGattOperation=BleGattOperation{description='CONNECTION_STATE'}}
Can anyone look at my code and see what I might be doing wrong:
subscription = rxBleDevice.establishConnection(context, true)
.subscribe(rxBleConnection -> {
rxBleConnection.readCharacteristic(UUID.fromString(UUID_LOG_COUNT)).doOnNext(Action1 -> Logger.d(Helper_Utils.reverseHex(HexString.bytesToHex(Action1))));
}, throwable -> {
Logger.d("Error", throwable.getMessage());
});
If you need more info, I will try to provide it.
EDIT
I have used 2 different phones: OnePlus Two Android 6.0.1 Moto G Play Android 6.0.1
I have tried multiple times switching wifi and bluetooth on and off. I have never been able to get a reading with this example.