How to handle Indications (Question)
See original GitHub issueHi,
I’m trying to connect to my Glucose meter device and read my latest measurements. I can discover/connect to the device using this library. My device supports the Bluetooth standard about the Glucose devices (I can see the right service uuid’s when I connect to the device).
After I have successfully connect my device to my app,
BleManager.connect(mac_adress) .then((peripheralInfo) => { console.log(peripheralInfo); }) .catch((error) => { console.log(error); });
I’m enabling the notifications on the Glucose Measurement characteristic,
BleManager.startNotification(mac, "00001808-0000-1000-8000-00805F9B34FB", "00002a18-0000-1000-8000-00805F9B34FB") .then(() => { console.log('GLUCOSE MEASUREMENT NOTIFICATION STARTED'); }) .catch((error) => { console.log(error); });
and then I’m supposed to enable the indications on the RECORD ACCESS CONTROL POINT characteristic, and then follow up by writing some data to the same characteristic that will inform the device on how many records I want to read for example.
Currently I have no idea how to enable indications on this service/characteristic. I’ve tried using the startNotification method again, but I get this error:
Failed to set client characteristic notification for 00002a52-0000-1000-8000-00805f9b34fb
Do you know how I can enable indications on a BLE device? To be honest I’m not 100% sure that these steps are the ones that I have to follow in order to read the measurements, but I can’t even try this method.
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (5 by maintainers)
Top GitHub Comments
Hi and sorry for the delay!
To be honest, after connecting to the device, I gave up on this project, so I haven’t implemented any functions for reading/writing data to the device.
Also, the connect method is truly ugly, you should do something about it!
By the way, I was learning React Native + Redux + ECMAScript 6 at the time, so the code is messed up (a lot) 😕
If I recall correctly my train of thought was something like this: Use is_on to check if bluetooth is turned on the device and then use initiate I had a button assigned to toggle device scanning with toggle_scan peripheral_found was executed upon discovery connect to the device by adding some ugly intervals between the “commands”
I did get some data back from the device by I didn’t bother to continue at the time.
Hope this gives you an idea on how to write your API, and maybe share your work with others too 😃
@stephenjen Your above issue fixed? if yes, so can you tell me that how we can resolve it. I am getting issue in the android device. Failed to set client characteristic notification for “charID(xyz)”.