AI's Latest and Greatest

iBeacons and UWP | Coding4Fun Blog

You see iBeacon and think you’re stuck in the iOS world?

Nope!

Peter Foot writes up a cool post on how you can read iBeacons from within your UWP apps.

I recently got some estimate beacons and have been trying out various things with them. By default they are configured to support Apple’s iBeacon format and could be used in an iOS app to provide location awareness in a close environment. You can read the same data from UWP and can add some location/context awareness in this way. In this post I’ll just discuss the iBeacon approach.

In UWP development there is a BluetoothLEAdvertisementWatcher which is used to read advertisement data from nearby Bluetooth Low Energy devices. The watcher fires the Received event for each advertisement found and you can read the data as required. The key to using iBeacon is to understand how the data is encoded. Advertisement sizes are limited so they need to be designed to be as compact as possible while providing enough information to uniquely identify each device. The iBeacon format consists of a UUID (Guid) and two unsigned short integers. These should be thought of as a hierarchical format:-

We must be careful to respect the byte ordering of the Guid element, the following Gist wraps up the operation:-

The event also gives you the Rssi, you can use this to make a general assumption about the relative distance of multiple beacons but should not assume a direct measurement of distance from it.

[Read the entire post]



[Page Thumbnail via wikipedia]

Greg Duncan

https://channel9.msdn.com/coding4fun/blog/iBeacons-and-UWP

Source link

Similar Posts

WP2Social Auto Publish Powered By : XYZScripts.com