To download NI software, including the products shown below, visit ni.com/downloads.
This example demonstrate on how to use the windows 10 BLE native library to communicate with BLE devices (Smart watch, bulb or any device which support BLE). Developed the DLL to interact with windows 10 BLE library in C# platform and integrated the dll into LabVIEW by using .Net constructor node.
Here demonstrates usage of the Bluetooth Generic Attribute (GATT) Client APIs for Universal Windows Platform (UWP), along with sample code for common GATT client tasks:
Description-Separate-2
Following are the methods available in BLE library:
Methods:
When setting the debug logs to true, C# library created the BLE log files under C drive
Development Environment:
LabVIEW 2020 32 Bit
OS: Win 10 64 bit
Added the Example code in HLD where user has to change the BLE address before run. The BLE address can be get after running the watcher.
Additional-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Screen shot of BLE device communication using windows UWP library. I have used my smart watch to communicate by using LabVIEW and C# library
Great!
I was waiting for this.
I was able to capture my heart rate monitor with this example.
Thank you Bharathi-CLD.😆
Hi, I´m trying to use the write function using:
0000fff2-0000-1000-8000-00805f9b34fb as UUID.
Converting the command string (F0;) to byte array, but I don´t know how to extract the response.
hi, suddenly I started to get "Object reference not set to an instance of an object." error. even using simple code:
and now it works again, can it be antivirus?
in order to receive the data stream from the BLE device using Notify you have to remove for loop and wait from BLE_Notify_Listener.vi and control it from your app. Also it's good to remove key from the Gatt_Characteristic_NotifyValue after read so you don't read same value over and over.
example: config notify using BLE_Notify.vi, get Gatt_Characteristic_NotifyValue, check if it contains key - new packet of data, if no write "NO DATA/FAILURE" if yes read data and remove it from Gatt_Characteristic_NotifyValue so it's not read multiple times
I got "Object reference not set to an instance of an object." error agian
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8XnSAK&l=en-CH
Hello,
Pls. let me know are you still getting Object reference not set to an instance of an object error. And let me know if you need any inputs on the driver.
Thanks
Bharathi T
the issue appeared again and tips from the link above do not work...
just tried on LV2021 SP1 32 and 64 bit
Could you please share source code of the library too?
debug info:
Log : 28.01.2021 20:29:12 ,ConnectBLE method called with address:123456789
Log : 28.01.2021 20:29:12 ,Waiting for BLE to connect with address:123456789
Log : 28.01.2021 20:29:12 ,Exception in ConnectBLE method:Object reference not set to an instance of an object.
vs debug without error:
Log : 26.01.2021 13:49:56 ,BLE_LIB method called
Log : 26.01.2021 13:49:56 ,ConnectBLE method called with address:123456789
Log : 26.01.2021 13:49:56 ,Waiting for BLE to connect with address:123456789
Log : 26.01.2021 13:49:56 ,Received the BLE Reference
Log : 26.01.2021 13:49:56 ,Connected with address:123456789
Log : 26.01.2021 13:50:04 ,ConnectBLE method pairstatus:Device unreachable
Hi,
I am using the library and am able to pair with my device and get the available UUIDs. I can read the values for the 'standard' UUIDs like device name, serial number, manufacturer. But when I try to read the custom UUIDs I get ProtocolError. Any idea how to correct this?
"in order to receive the data stream from the BLE device using Notify you have to remove for loop and wait from BLE_Notify_Listener.vi and control it from your app. Also it's good to remove key from the Gatt_Characteristic_NotifyValue after read so you don't read same value over and over.
example: config notify using BLE_Notify.vi, get Gatt_Characteristic_NotifyValue, check if it contains key - new packet of data, if no write "NO DATA/FAILURE" if yes read data and remove it from Gatt_Characteristic_NotifyValue so it's not read multiple times"
Still not working.
First i´m using write function sending the command "J;", than your notify process with UUID selected, is that correct?