0

I'm trying to read test results from a USB Serial Port device, the code below picks up that it's connected to the usb, so i do get a deviceInterface object. BUT now when i use UsbDevice.FromUsAsync it's always null.

var selector = "System.Devices.InterfaceClassGuid:=\"" + "{GUID}";

var interfaces = await DeviceInformation.FindAllAsync(selector, null);
OutputText.Text = interfaces.Count + " device interface(s) found\n\n";
foreach (DeviceInformation deviceInterface in interfaces)
{
    if (deviceInterface.Name == "CardioChek Link")
    {
        UsbDevice device = await UsbDevice.FromIdAsync(deviceInterface.Id);

    if (device != null)
       System.Diagnostics.Debug.WriteLine("FOUND!!!!!!!");
    }
}

in the app manifest my configs looks like this:

<m2:DeviceCapability Name="serialcommunication">
  <m2:Device Id="vidpid:0403 6001">
    <m2:Function Type="name:serialPort"/>
  </m2:Device>
</m2:DeviceCapability>

the device id = \\?\FTDIBUS#VID_0403+PID_6001+A60336ECA#0000#{4d36e978-e325-11ce-bfc1-08002be10318}

i'm at the point of having to convert the entire app to a Desktop app because of this...

Andre Grobler
  • 73
  • 2
  • 10
  • should the interface name be ""CardioCheck Link" instead of "CardioChek Link"? :) – Nathan Apr 25 '16 at 12:14
  • Wish it was that simple:-) I wrote a Windows service that reads the results form the device, then saves it as text to the store app's folder. The store app then picks up the result. Not pretty, but works. – Andre Grobler Apr 30 '16 at 06:21

0 Answers0