Closed faxioman closed 6 years ago
The code here looks reasonable. Are you certain that the characteristic you're testing with actually supports indications, and not just notifications? For example, a correctly built Health Thermometer service has the right permissions on the temperature characteristic.
Yes, I'm successfully testing the device with an iOS app. Anyway, the next week I'll have a meeting with the device manufacturer. He wrote a driver like mine using the C bgapi. I'll check my code with him and I'll let you know ;) Thanks!
Ok, solved ... even if I cannot figure why this change solves the problem:
Byte[] cmdIndicate = bglib.BLECommandATTClientAttributeWrite(dev.connectionHandle.Value, (ushort)(chrhandle.Value + 1), new Byte[] { 0x02, 0x00 });
instead of:
Byte[] cmdIndicate = bglib.BLECommandATTClientAttributeWrite(dev.connectionHandle.Value, notify_chrhandle.Value, new Byte[] { 0x02, 0x00 });
Just searching for 2902 directly may give you the 'wrong one' if your service has multiple characteristics which each have their own 2902. You need to find the 'next' 2902 that occurs after the desired chrhandle
Ok, I got it! Thanks!!
Hi. I'm using your great bglib library (c#) to create a react native module for windows wpf/uwp. I'm starting to implement notification and indication. Notifications are working perfectly but I'm unable to work with indication. This is my piece of code:
But the AttributeValueEvent is never fired. Am I missing something?