Переглядів 29,270
Quickly create a C# application to read values from a Bluetooth Low Energy device. This application is a Dot.Net 4.7.2 console application that uses the Universal Windows Platform libraries to interact with Bluetooth LE. The specific device is a Wahoo Tickr heart rate monitor. Learn the basics of discovering devices, pairing a device and subscribing for notifications.
Bluetooth LE on UWP
docs.microsoft.com/en-us/wind...
Project references for Windows.winmd and System.Runtime.WindowsRuntime.dll
C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.19041.0\Windows.winmd
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
Bluetooth Assigned Number
www.bluetooth.com/specificati...
Data Formats for Bluetooth devices
This is a pdf and you should be able to find your device in specific measurement inside this document
www.bluetooth.org/DocMan/hand...
Bluetooth Heart Rate Sensor Data Format Document
www.silabs.com/documents/publ...
Project Git Repo
github.com/cornelhuman/QuickB...
Related UKposts content from AngelSix
• Discovering Bluetooth ...
0:00 Start
0:42 Create C# console application Dot.Net 4.7.2
1:41 Detect nearby devices
2:20 Add project references to be able to work with Bluetooth LE
3:02 Update using statements and implement event handlers
3:53 Handle DeviceWatcher_Added event
4:40 Create a while loop to wait for application input
6:53 Keep a reference to desired device
8:24 Pair with Bluetooth LE device
12:22 Get list of GATT services for paired device
14:34 Proceed with Heart Rate Monitor Service with partial Uuid 0000180d
20:59 Check if GATT service match 180D service for heart rate data
26:37 Subscribing for notifications
31:38 Deal with actual data that is received from Bluetooth LE device (16 bits) first byte is flags, second byte is heart rate value
34:48 Display correct values