-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
Need to be able to register for notification from characteristics that is only INDICATE #847
Comments
Hi @CodeMusher, I'm the friendly issue checker. |
This fix is supposed to go into dotnet-bluetooth-le/Source/Plugin.BLE/Windows/Characteristic.cs Lines 57 to 64 in 1e19fa8
@CodeMusher Can you open a PR for it? |
I do not understand the issue. In our project we have a device with a lot of characteristics with only INDICATE. Remember:
|
@janusw I can try. What is the correct procedure? |
But It could be related to how the device handle the requests. I see the same in the current implementation for Windows, which is also what @janusw points out. var result = await NativeCharacteristic.WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify); |
@AskBojesen Do you refer to my suggestion in the original issue? |
I actually see now, that our device is lying in the characteristic properties - reporting NOTIFY, but it is indicate. |
Ok, so then you can understand my issue? |
Yes I can imagine there could be an issue - I cannot reproduce. |
To help us fix your issue, please provide the information in the below template. If something causes a crash, provide as much information as you can gather.
Just imagine: we do not know what you are doing!
Steps to reproduce
Try to use a peripheral with a characteristic with only INDICATE
Expected behavior
Registration for updates should succeed
Actual behavior
Registration is not performed. The Windows implementation of the StartUpdatesNativeAsync only register in case of Notify.
It could be solved this way
GattWriteResult result;
if (NativeCharacteristic.CharacteristicProperties.HasFlag(GattCharacteristicProperties.Indicate))
result = await NativeCharacteristic.WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue.Indicate);
else
result = await NativeCharacteristic.WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue.Notify);
Crashlog
If something causes an exception paste full stack trace + Exception here
Configuration
Version of the Plugin: e.g. 1.0.0 / 1.0.1-alpha3
3.1.0-rc.1
Platform: e.g. iOS 10.1 / Android 4.4 / ... (including version!!! e.g. Android 5.1 / i0S 10)
UWP/Windows 10
Device: e.g. HTC Sensation /i Phone 7 ...
The text was updated successfully, but these errors were encountered: