-
• #2
You can check out on the app loader:
BLE GATT HRM Service (v0.04)
Adds the GATT HRM Service to advertise the measured HRM over Bluetooth.
-
• #3
. Is there any library (preferably in C or C#) that offers BLE connection and data transmission?
That depends on operating system. For Windows 10 and up there is c# api, check *.cs sources of this project
https://github.com/fanoush/BLEConsole/tree/master/BLEConsole
I managed to fork it, do some changes and rebuild it in Visual Studio and it worked pretty well.It uses this nuget https://www.nuget.org/packages/DirectWindowsWinmd.Net that makes the API available
EDIT: Or for c/c++ check Noble WinRT implementation https://github.com/Timeular/noble-winrt - it is using same API from C++
-
• #4
There's an example of using a webpage with Web Bluetooth to get like HRM data from the Bangle, so that could help: https://www.espruino.com/Bangle.js+Data+Streaming#bonus-2-heart-rate-monitoring-graph
As a hack you may even be able to use AJAX/etc requests from a webpage like that to push the data to your app.
There are some BLE examples for Node.js and Python at https://www.espruino.com/Interfacing#bluetooth-le
There is also a C++ library for Windows at https://github.com/espruino/winnus/blob/master/cpp/winnus.cpp that handles the UART connection over BLE. It is meant for Node.js but it'd be trivial to use in in your application, however I believe it uses an old API (which needs the device to be paired?) and Windows 10/11 have a better one (so the one @fanoush suggested is probably better).
But otherwise once you find a BLE library for the programming language you're wanting to use it's pretty straightforward if you look at what the examples in https://www.espruino.com/Interfacing#bluetooth-le do.
If you google for the language you want and "Nordic UART" you might even find an app/library that handles the comms for you. For example for me top hit for C# is: https://github.com/lzhengwei/UWP_Nordic_Uart_Transmitter
It looks like a bit of a mess but I think the relevant code you need is https://github.com/lzhengwei/UWP_Nordic_Uart_Transmitter/blob/master/BLE_uart_connector/App1/MainPage.xaml.cs#L97-L108
-
• #5
Thank you for all your answers! Now my students have something to do, haha. Maybe we'll come back with some questions ;-)
Best
Martina
Hi there!
I have a question about how to get the raw heart rate data stored on a PC and without using the web interface. Is there any library (preferably in C or C#) that offers BLE connection and data transmission?
We are doing research in a university and want to integrate the heart rate data into a rehab videogame.
All kinds of hints are welcome!
BR
Martina