adabru / BleWinrtDll

BLE for Unity 3d in Windows without UWP.
Do What The F*ck You Want To Public License
168 stars 52 forks source link

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

Open zhouyexi98 opened 10 months ago

zhouyexi98 commented 10 months ago

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 commented 10 months ago

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 commented 9 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

Hi @adabru Yes you have understood it correctly.

adabru commented 7 months ago

The relevant line should be https://github.com/adabru/BleWinrtDll/blob/f2635b7b02432ea3006983657107f092c862171d/BleWinrtDll/BleWinrtDll.cpp#L486

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