Uwp 我的设备坏了吗?无法与视频、Pid连接
UWP应用程序,连接串行设备(如COM3),我成功获得所有可用设备列表,代码如下。但有一点很奇怪。我的设备没有视频,没有PIDUwp 我的设备坏了吗?无法与视频、Pid连接,uwp,serial-port,Uwp,Serial Port,UWP应用程序,连接串行设备(如COM3),我成功获得所有可用设备列表,代码如下。但有一点很奇怪。我的设备没有视频,没有PID 首先,我使用“GetDeviceSelector”,我可以找到我的串行设备。我得到了这个字符串“\?\FTDIBUS#VID#u 0403+PID#u 6001+AL03INW7A#0000{86e0d1e0-8089-11d0-9ce4-08003e301f73}”,然后我知道我的设备有VID=0x0403,PID=0x6001 接下来,如果我使用“GetDevic
public MainPage()
{
this.InitializeComponent();
Task.Run(() => this.test()).Wait();
}
public async Task test()
{
try
{
// Not Work
// var DeviceSelector = SerialDevice.GetDeviceSelectorFromUsbVidPid(0x0403, 0x6001); //
// Work
var DeviceSelector = SerialDevice.GetDeviceSelector();
var DeviceInformations = await DeviceInformation.FindAllAsync(DeviceSelector);
for (int i = 0; i < DeviceInformations.Count; i++)
{
var d = DeviceInformations[i];
SerialDevice port = await SerialDevice.FromIdAsync(d.Id);
Debug.WriteLine(String.Format("{0}\n{1}\n{2}\n{3}\n{4}\n{5}\n---------------------",
d.Name,
d.Id,
d.IsEnabled,
port?.PortName,
port?.UsbProductId.ToString("X4"),
port?.UsbVendorId.ToString("X4")
));
}
}
catch (Exception ex)
{
Debug.WriteLine("SerialController/ListAvailablePorts/Exception/" + ex.Message);
}
return;
}
参见最后两个零值。维德,PID看起来像零。怎么了
更新1:
在吴荪婷(谢谢)的建议下,我尝试使用其他设备。下一个设备是RS232-USB设备。两个设备都是虚拟COM端口。我试过同样的代码。第二个设备具有视频、Pid!!隐马尔可夫模型。。。。。我的设备错了
ATEN USB to Serial Bridge (COM13)
\\?\USB#VID_0557&PID_2008#8&1d38065f&1&4#{86e0d1e0-8089-11d0-9ce4-08003e301f73}
System.Runtime.InteropServices.WindowsRuntime.ReadOnlyDictionaryValueCollection`2[System.String,System.Object]
COM13
2008
0557
这是我的设备故障。我向制造商报告了。我希望他们将来会增加视频、Pid关于详细信息,请阅读我问题中的“更新”。 在购买之前,没有办法知道它…:(
我喜欢他们的产品。非常好。我可以知道你的设备是什么吗?你有其他设备测试吗?我在这里买的。()…我稍后将测试另一个设备…我尝试了另一个设备。两个设备都有虚拟COM端口。第二个设备有Vid,PId!。嗯…我向maker请求此项。我的第一个设备是FTDI。是否有自己设置Vid,PId的设备…?无论如何,谢谢。。。
FT232R USB UART
\\?\FTDIBUS#VID_0403+PID_6001+AL03INW7A#0000#{86e0d1e0-8089-11d0-9ce4-08003e301f73}
True
COM12
0000
0000
ATEN USB to Serial Bridge (COM13)
\\?\USB#VID_0557&PID_2008#8&1d38065f&1&4#{86e0d1e0-8089-11d0-9ce4-08003e301f73}
System.Runtime.InteropServices.WindowsRuntime.ReadOnlyDictionaryValueCollection`2[System.String,System.Object]
COM13
2008
0557