Skip to content
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

again: BleWinrtDll.cpp:501 SubscribeCharacteristicAsync catch: The attribute cannot be written. #56

Open
zhouyexi98 opened this issue Oct 27, 2023 · 6 comments

Comments

@zhouyexi98
Copy link

Hello:
I was able to use the computer's Bluetooth LE Explorer tool to connect to my device and debug it. When I was running Blewinrtdell in unity I was able to search the device to find services and characteristics, but when I clicked subscribe I got the error warning above. Can you kindly give me some advice?

@zhouyexi98
Copy link
Author

I find the reason why I can't debug. Every time I write a value, I only write the content to the characteristic 1,but I need to write the value to the characteristics 3. How can I solve this problem?

@adabru
Copy link
Owner

adabru commented Nov 8, 2023

Hi @zhouyexi98,
for investigation, you can download and run the Microsoft's Bluetooth Low Energy sample and see whether subscribing works there. If the demo works, it should be fixable in this repo.

@arafi123
Copy link

Hi @adabru

I tested the Microsoft BLE sample and saw the data coming there for few characteristic but here I get for the same characteristic the same error that "the attribute cannot be written ". Could you please look into that ?

Thanks

@adabru
Copy link
Owner

adabru commented Dec 31, 2023

Hi @arafi123,
do I understand you correctly: There is a characteristic that is consistently read from the Microsoft BLE sample without error but shows the error BleWinrtDll.cpp:501 SubscribeCharacteristicAsync catch: The attribute cannot be written everytime you try to subscribe to that characteristic from the BleWinrtDll demo scene?

@arafi123
Copy link

arafi123 commented Jan 2, 2024

Hi @adabru Yes you have understood it correctly.

@adabru
Copy link
Owner

adabru commented Jan 7, 2024

The relevant line should be

auto status = co_await characteristic.WriteClientCharacteristicConfigurationDescriptorAsync(GattClientCharacteristicConfigurationDescriptorValue::Notify);

You can compare it to the code in the Microsoft sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants