Here is a fragment of the UWP application that I am writing
I added to the Package.appxmanifest file for the project
following:
<DeviceCapability Name="serialcommunication"> <Device Id="any"> <Function Type="name:serialPort" /> </Device> </DeviceCapability>
When I get to the line var serialDevice = await SerialDevice.FromIdAsync(deviceInfo.Id); , it throws an exception:
{System.Exception: semaphore timeout period has expired. (Exception from HRESULT: 0x80070079)
in System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (task task) in System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (Task task)
in System.Runtime.CompilerServices.TaskAwaiter`1.GetResult ()
in TorinoBluetooth.UwpHidConnector.d__9.MoveNext ()}
Why is this failing? Is there anything in UWP that prevents serial connections this way?
(NB I know that the serial connection is OK, as I can find it in the Device Manager, where it is listed as “Standard Bluetooth Serial Communication (COM8)”, and then connect the other code manually to “COM8”.)
bluetooth uwp serial-port
dumbledad
source share