08-01-2024 08:14 AM
My company has a BLe product that will be going to production soon, I have a LabView program that can pair and communicate with our board. A PIN number is required for pairing, currently Windows pops up a window then I have to manually enter the PIN. For production I would like to have LabView enter the PIN instead of having production workers having to do it manually. I have never done anything like this so wondering if it is even possible? If possible can someone point me in the right direction? Sample code?
Here is screen shot of window that pops up that i am needing to enter the PIN number into.
08-01-2024 08:53 AM - edited 08-01-2024 09:00 AM
You can do programmatic pairing using the Windows Bluetooth API with a C# program:
https://learn.microsoft.com/en-us/windows/uwp/devices-sensors/pair-devices
Create a library that does this for you or maybe use the program from the second link. I have not tested it, but it looks promising.
Note that in order to pair, you first need to do a scan and discover the device.
What library do you use for BLE communication?
08-01-2024 09:22 AM
I am using BLELib.dll that I found here on NI Community.
I have the scan/discover working, just trying to automate entering the pin.
I am a hardware tech so not familiar with C# but have couple software engineers in the office that can probably help. They are on GITHUB daily so I will have them get the program you linked.
08-01-2024 09:46 AM
You mean this one, right?
https://github.com/prabubharathi85/LabVIEW-BLE-Driver
Definitely see if they can help. While you are at it, see if you can convince them to write a more complete wrapper for the Windows Bluetooth API. Then you can use callback VIs to receive data from your devices without polling and do not need to convert from strings so much. It should not be too much work for C# developers.