我正在尝试使我的VB.NET UWP应用程序可在iOS蓝牙设置中发现。我的实现基于Bluetooth Advertisement示例代码。但是,我的Windows设备未出现在iOS设置中。我通过Radios
API手动启用了蓝牙无线电,并向我的应用程序添加了bluetooth
,proximity
和radio
设备功能。我可以确定蓝牙适配器正在发送信号,所以我不确定是否发送了错误的数据。我正在使用的代码如下:
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()
我应该发送什么数据以使Windows设备可被发现,以及如何检测和处理iOS设备的配对?