This is a normal Bluetooth device discovery that has been available for some time. Access Bluetooth Deviceįirst, you obviously need to know which device to connect to. Then, you need to find the battery service, which contains the battery level characteristic, which in turn has the battery level value. This requires connecting to the Bluetooth device (which isn’t the same as the more permanent pairing!). LocalAdapter.IsPeripheralRoleSupported) Read Battery Level of Bluetooth Beacons or Surface DialsĪfter you’re sure that your hardware supports the required features, let’s check how to read the battery level of a Kontakt.io Bluetooth Beacon or a (paired) Microsoft Surface Dial. You can detect support using the following simple queries: var localAdapter = await BluetoothAdapter.GetDefaultAsync() ĭebug.WriteLine("Low energy supported? -> " +ĭebug.WriteLine("Central role supported? -> " +ĭebug.WriteLine("Peripheral role supported? -> " + The hardware built into your Windows 10 device + the drivers also have to support the new features. If you can use all the new APIs not only depends on the Windows 10 version. Query Central and Peripheral Role Support Windows 10 Target VersionĪs the new APIs were introduced with the Creators Update, you need to update your app target to the new Windows version in Visual Studio: Now that the new Windows version has rolled out, it’s possible to ship applications that support the new APIs. The following adapted image from the blog shows the new possibilities: The upcoming support of Windows for these scenarios was already announced in January at the Microsoft Bluetooth team blog. For implementing IoT scenarios, the GAP peripheral role is also needed. However, if a device should notify a wearable like a smart watch when an incoming email arrives, it needs to support the GATT server role. Arguably, that’s most important for Windows devices – it’s made for phones / PCs that access remote sensors. So far, Windows was only capable of using Bluetooth LE in GATT Client / GAP Central role. What’s New for Bluetooth in Windows 10 Creators Update? That gave me the opportunity to explore the new APIs based on the short documentation overview page and the videos.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |