LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to read the bluetooth beacon data in labview 2015 running on Windows 10

Solved!
Go to solution

Hi all,

 

I have a nordic semiconductor nr51 development board. This board is programmed as a bluetooth beacon that simply advertises its address with 16 bit data appended to it.

My laptop came with bluetooth smart ready hardware. I had installed a bluetooth beacon interactor application in my laptop and the app is able to detect the beacon as if shown in the image below.

 

 

Capture.JPG

 

I wanted to write a program in LabVIEW that will simply watch for bluetooth beacons and notify me in my computer whenever a beacon with the specified address is detected. This mobile app shown below is provided by the manufactuerer of the board and i wanted to develop a program in LabVIEW something similar to this which will read the advertised data and extract values.

Screenshot_2016-06-29-12-40-45_no.nordicsemi.android.mcp_1467175263524.jpg

Somehow, all the example applications given shows only how to read and write to a connected bletooth device but not to scan for beacons. I had also tried using "bluetooth discover" function and it doesn't detect the bluetooth beacons. 

 

Could anyone provide me with necessary information or sample program to detect/ read bluetooth beacons in LabVIEW 2015 running on Windows 10?

Do i need to install third party software to read data from bluetooth ?

0 Kudos
Message 1 of 4
(5,042 Views)
Solution
Accepted by topic author PrasanthTP

The Bluetooth function nodes in LabVIEW use the Winsock interface to access bluetooth resources. This works fine for Bluethooth 2.0 devices but not for Bluetooth 4.0 aka BLE devices. Microsoft created a completely different API to interface to these resources since the entire service model for BLE devices has changed dramatically.

 

The API to use BLE devices is the GATT (Generic Attribute Profile) API in Windows. There is supposedly some .Net interface available which you could try to use (Windows.Devices.Bluetooth.GenericAttributeProfile). The lower level WinAPI (https://msdn.microsoft.com/en-us/library/windows/hardware/hh450825(v=vs.85).aspx) is a C DLL API and doesn't lend itself at all for being called directly through the LabVIEW call library node, since some of the function parameters are rather complicated and you also need to access the SetupDI API in order to enumerate the BLE resources and that has even more complicated function parameters. In order to access this low level API one needs to write an intermediate DLL that translates the low level C API into a more palatable API for LabVIEW.

 

Another possible problem is that Windows does at least in Windows 8 not allow to pair devices programmatically. Microsoft wanted to force developers into using the "inbox experience" meaning that all users should go through the Microsoft provided pairing service, instead of each application implementing its own pairing technique.

Rolf Kalbermatter
My Blog
Message 2 of 4
(5,001 Views)

Thanks for the detailed explanation.

 

Could you kindly explain more on the .net interface available (Though i have used LabVIEW before, i am new to .net)

It would be better if you can share me some examples or tutorials on how to use .net interface to read data from bluetooth

 

 

Thanks again

 

0 Kudos
Message 3 of 4
(4,996 Views)

To access .Net functionality in LabVIEW and get an idea how it works, you should look at the example finder and search for .Net. There are many examples how .Net can be accessed from LabVIEW (but no BLE examples specifically).

 

And while I understand that you would love to receive ready made examples for BLE, I have to disappoint you. BLE before Windows 8.1 was simply not possible except with some BLE dongles and their proprietary APIs. I still work mostly with Windows 7 systems which simply lacks any built-in BLE support completely, so I can't even try to make such examples. If I could I would not use the .Net API but rather the Windows API.

 

What I know about BLE is from reading and studying various documentation for project evaluations but nothing so far has resulted in a decision to make the effort of actually developing this further for use in LabVIEW.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(4,990 Views)