Make UWP App Discoverable in iOS Bluetooth Settings

时光总嘲笑我的痴心妄想 提交于 2019-12-24 18:12:59

问题


I am trying to make my VB.NET UWP application discoverable in iOS Bluetooth settings. I have based my implementation on the Bluetooth Advertisement sample code. However, my Windows device does not appear in iOS settings. I manually enable the Bluetooth radio via the Radios API, and have added the bluetooth, proximity and radio device capabilities to my app. I can tell that a signal is being sent out by my Bluetooth adapter, so I am unsure if I am sending the wrong data. The code I am using is below:

        Dim radlist = Await Radios.Radio.GetRadiosAsync()

        For Each rad As Radios.Radio In radlist
            If rad.Kind = Radios.RadioKind.Bluetooth Then
                Await rad.SetStateAsync(Radios.RadioState.On)
            End If
        Next

        Dim publisher As BluetoothLEAdvertisementPublisher = New BluetoothLEAdvertisementPublisher()
        Dim manufacturerData = New BluetoothLEManufacturerData()
        manufacturerData.CompanyId = &HFFFE
        Dim writer = New DataWriter()
        Dim uuidData As UInt16 = &H1234
        writer.WriteUInt16(uuidData)
        manufacturerData.Data = writer.DetachBuffer()
        publisher.Advertisement.ManufacturerData.Add(manufacturerData)
        publisher.Start()

What data should I send to make my Windows device discoverable, and how would I detect and handle pairing by the iOS device?

来源:https://stackoverflow.com/questions/56981438/make-uwp-app-discoverable-in-ios-bluetooth-settings

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