I want to create a two-way Bluetooth Rfcomm connection. The server side is implemented in UWP. Using InTheHand.Devices.Bluetooth (NuGet v4.0.1803.22-preview) I find no way to attach an SDP record to the service provider. This results in an error when trying to advertise the service.
I suppose one could cast the 'InTheHand' service provider to the Windows.Devices.Bluetooth.Rfcomm variety, but I'd prefer a solution within the InTheHand library if possible. Am I missing something?
private async void InitializeService(){
var localRfcommServiceID = RfcommServiceId.FromUuid(uuid);
var localRfcommService = await RfcommServiceProvider.CreateAsync(localRfcommServiceID);
//This is where I would expect to add SDP records to the service provider
localRfcommService.StartAdvertising();
localRfcommService.ConnectionReceived += LocalRfcommService_ConnectionReceived;
}
I get an exception when I try to start advertising. (Sorry for German error messages)
Exception thrown: 'System.IO.FileNotFoundException' in InTheHand.Devices.Bluetooth.dll
WinRT information: Der StreamSocketListener muss gebunden werden, bevor Sie mit der Ankündigung beginnen können.
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.ni.dll
WinRT information: Der StreamSocketListener muss gebunden werden, bevor Sie mit der Ankündigung beginnen können.
Translated: The StreamSocketListener needs to be bound before advertising can begin.