Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beacons in Windows 10

Is there any way to use ibeacons with Windows 10 development? Since ibeacons development with previous versions of Windows seemed nearly impossible, will we have the oportunity to support this technology now?

Has anyone started developing something like this?

like image 800
meneses.pt Avatar asked May 04 '15 17:05

meneses.pt


3 Answers

Here is how you work with Apple iBeacons based on the new Windows 10 APIs mentioned in the answer by Rob Caplan:

  1. Start watching for beacons:

BluetoothLEAdvertisementWatcher watcher = new BluetoothLEAdvertisementWatcher { ScanningMode = BluetoothLEScanningMode.Active };
watcher.Received += WatcherOnReceived;
  1. Handle beacon data - note that depending on your scenario, you might need to distinguish between beacons by storing them and comparing the Bluetooth address

private void WatcherOnReceived(BluetoothLEAdvertisementWatcher sender, BluetoothLEAdvertisementReceivedEventArgs btAdv)
{
    // Optional: distinguish beacons based on the Bluetooth address (btAdv.BluetoothAddress)
    // Check if it's a beacon by Apple
    if (btAdv.Advertisement.ManufacturerData.Any())
    {
        foreach (var manufacturerData in btAdv.Advertisement.ManufacturerData)
        {
            // 0x4C is the ID assigned to Apple by the Bluetooth SIG
            if (manufacturerData.CompanyId == 0x4C)
            {
                // Parse the beacon data according to the Apple iBeacon specification
                // Access it through: var manufacturerDataArry = manufacturerData.Data.ToArray();
            }
        }
    }
}

This is also how I implemented it in the open source Universal Beacon Library, which comes with complete sample code and an app to try it out: https://github.com/andijakl/universal-beacon

like image 157
Andreas Jakl Avatar answered Nov 15 '22 22:11

Andreas Jakl


Yes, Beacons are supported for Windows apps in Windows 10 via the Windows.Devices.Bluetooth.Advertisement namespace

See the Build talk Building Compelling Bluetooth Apps in Windows 10 and the Bluetooth Advertisement Watcher and Publisher sample for more information.

like image 21
Rob Caplan - MSFT Avatar answered Nov 15 '22 23:11

Rob Caplan - MSFT


Microsoft has previously indicated it would support application-controlled scanning for Bluetooth LE devices in Windows 10. This is the fundamental capability that is missing from Windows 8.x for both Mobile and desktop. See here for more info: https://stackoverflow.com/a/26234432/1461050

So far, the published preview APIs for Windows 10 have not exposed this functionality. If and when it is exposed, these APIs should be possible to build a library to detect Bluetooth LE beacons.

EDIT:This capability is now available in the new BluetoothLeAdvertisementWatcher class. In anticipation of this capability, we have started work on an open source Windows Beacon Library which will ultimately be designed for use on Windows 10. This work is only in its infancy. For now, it can only be used on Windows 8.x devices in conjunction with add-on Bluetooth scanning dongles that can pass their scan results to the library for parsing.

If you are interested in helping in this effort, please send a note through the GitHub project linked above.

like image 27
davidgyoung Avatar answered Nov 15 '22 23:11

davidgyoung