-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read Characteristic from rxBleDevice gives exception in Android, in iOS why it works fine using same UUID? #635
Comments
In the logs you should see a warning that says that you want to perform operation that is not supported by this characteristic. Android does not allow it and therefore you get an exception. iOS handles this differently. You could try override properties of the characteristic and report back if it worked. Link to related SO question |
You could try override properties of the characteristic and report back if it worked. |
I could imagine that you could try to override characteristic properties by some reflection hack and / or inheriting from it and overriding getters. No specifics though. I do not have time by myself to tinker with it. |
I have tried to override characteristics permissions like this:
I have tried on a wrongly implemented peripheral. The above approach works. |
I have updated my previous comment |
Currently i am working with an application where it involves reading data from the ble device. I am trying to read data from Andesfit Thermometer, Andesfit Blood Pressure, Andesfit Body Weight Scale.
For that i need to notify using Characteristic UUID. The notification stuff works fine and i am receiving data properly when any of the devices emits data.
Think about a situation where the user has already taken a measurement using the blood pressure machine. Then he picked up his device, got connected. I should be able to retrieve the last record and show it in the device.
In order to show the last record i need to read the characteristic using UUID
In iOS i am can retrieve the last record & notify using the same characteristic UUID and it is working fine.
But in Android if i try to read using the characteristic UUID that used for notify it gives me exception.
Exception message is
GATT exception from MAC address F4:5E:AB:0D:7B:93, with type BleGattOperation{description='CHARACTERISTIC_READ'}
Here is my service discovery operation in Android
In my service discovery i can clearly see that this characteristic UUID is just meant for notify.
The text was updated successfully, but these errors were encountered: