Hi all,
I am having an intermittent issue with the Bluetooth RFCOMM API for Windows store apps. I have 2 devices that normally connect fine, but after some amount of time the following call just stops working:
await RfcommDeviceService.FromIdAsync(chatServiceInfo.Id);
and throws the following exception:
No such service is known. The service cannot be found in the specified name space. (Exception from HRESULT: 0x8007277C)
The only 2 ways to fix the issue seem to be:
- Restart the Bluetooth adapter (going into Change PC Settings on Windows 8 etc.) or
- Restart the entire Windows device
Unfortunately restarting the app alone does not solve the problem. The only other post on the MSDN forums that seemed relevant was this one by nicksav: "RFCOMM API. RfcommDeviceService. Error opening Socket. WinRT"
(see post 3)
Where he ultimately attributed the issue to a bad PC.
My questions are:
- What could be causing this issue, which seems to be at a deeper OS level? As best as I can tell, all of the unmanaged resources are properly unloaded by my app.
- Is there any way for my app to rectify it if it does happen?
Thanks for any help you can provide!