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?