Windows 10 開発で ibeacons を使用する方法はありますか? 以前のバージョンの Windows で ibeacons を開発することはほとんど不可能に思えたので、このテクノロジをサポートする機会は今ありますか?
誰かがこのようなものを開発し始めましたか?
Windows 10 開発で ibeacons を使用する方法はありますか? 以前のバージョンの Windows で ibeacons を開発することはほとんど不可能に思えたので、このテクノロジをサポートする機会は今ありますか?
誰かがこのようなものを開発し始めましたか?
Rob Caplan による回答で言及されている新しい Windows 10 API に基づいて Apple iBeacons を操作する方法は次のとおりです。
BluetoothLEAdvertisementWatcher watcher = new BluetoothLEAdvertisementWatcher { ScanningMode = BluetoothLEScanningMode.Active };
watcher.Received += WatcherOnReceived;
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();
}
}
}
}
これは、オープン ソースの Universal Beacon Library に実装した方法でもあります。これには、完全なサンプル コードとそれを試すためのアプリが付属しています: https://github.com/andijakl/universal-beacon
Windows 10 より前のバージョンでは、マネージ C# ライブラリWinBeaconを使用できました。ライブラリは単純な HCI レイヤーを使用し、デフォルトの Bluetooth スタックを使用する代わりにドングルと直接通信します。