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

Does BleWinrtDll provide API for pairing with passkey? #55

Closed snowuyl closed 10 months ago

snowuyl commented 10 months ago

I would like to implement pairing with passkey on Windows 11. Does BleWinrtDll provide API for pairing with passkey?

adabru commented 10 months ago

I did a googling and found a question on SO regarding UWP pairing PINs and a microsoft sample with C# and cppwinrt . BleWinrtDll does not provide pairing with passkey. This is the implementation of BleWinrtDll: https://github.com/adabru/BleWinrtDll/blob/main/BleWinrtDll/BleWinrtDll.cpp

This is the exposed API: https://github.com/adabru/BleWinrtDll/blob/main/BleWinrtDll/BleWinrtDll.h

But looking at the microsoft sample, it should be possible to extend BleWinrtDll with passkey support. You could try to download and run the linked microsoft sample. If it works out, you can transfer its code to BleWinrtDll and use it in Unity. It should work.

snowuyl commented 10 months ago

Thanks for your reply! I would like to implement a Windows C++ application (i.e. not Unity application). Do you suggest to use BleWinrtDll?

adabru commented 10 months ago

If your outside Unity, things get easier. Just use the Windows API without BleWinrtDll. I might suggest C# instead of C++ as I perceive C# as faster to program than C++. But that's just preference.

snowuyl commented 10 months ago

Thanks for your reply!