Windows 10 Bluetooth Advertisement API

 ̄綄美尐妖づ 提交于 2019-12-01 13:09:53
kiewic

Yes, do this to send:

var manufacturerData = new BluetoothLEManufacturerData();

manufacturerData.CompanyId = 0x004c;

byte[] dataArray = new byte[] {
    // last 2 bytes of Apple's iBeacon
    0x02, 0x15,
    // Proximity UUID
    0x44, 0x50, 0x3f, 0x1b,
    0xc0, 0x9c, 0x4a, 0xee,
    0x97, 0x2f, 0x75, 0x0e,
    0x9d, 0x34, 0x67, 0x84,
    // Major
    0x00, 0x01,
    // Minor
    0x00, 0x10,
    // TX power
    0xc5
};

// using System.Runtime.InteropServices.WindowsRuntime;
manufacturerData.Data = dataArray.AsBuffer();

BluetoothLEAdvertisementPublisher publisher =
    new BluetoothLEAdvertisementPublisher();

publisher.Advertisement.ManufacturerData.Add(manufacturerData);

publisher.Start();

To receive, go to this question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!