How to detect Bluetooth dongal has inserted in PC or not?
How to detect Bluetooth dongal has inserted in PC or not using C# code?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jay Krishna ReddyPosted Aug 27, 2020, 4:49 AM
2. Implement code to detect paired devices.
This link explains how to find Serial COM ports (including BT devices)
It should be possible to modify the code so you can find paired BT devices only.
Finding Bluetooth paired NXTs with WMI[^]
3. Identify your device.
4. Use polling to see if your device exist in the list or not and is connected.
Polling is easy to implement, but you should do it in a thread so it can be easily aborted.
If the API provides events when devices appears or disappears it is preferable to use the events but I don't know if there is any. You have to read for yourself.
5. If exists, unlock computer; else, lock computer.
This page is for Windows 8 Bluetooth API. I hope it will be helpful.
Bluetooth API[^]
Here is another link using 32feet.NET that should work for Windows 7
Working With Bluetooth Devices Using C# – Part 1[^]