1.我的代码
var uwp=require("uwp");
uwp.projectNamespace("Windows");
var deviceInformation = Windows.Devices.Enumeration.DeviceInformation;
var VID=0x10C4;
var PID=0x81B9;
deviceInformation.findAllAsync().done(
function(devices){
console.log(devices);
},
function(err){
console.log(err);
}
);
2.结果:Windows.Devices.Enumeration.DeviceInformationCollection {
'0': Windows.Devices.Enumeration.DeviceInformation {},
'1': Windows.Devices.Enumeration.DeviceInformation {},
'2': Windows.Devices.Enumeration.DeviceInformation {},
'3': Windows.Devices.Enumeration.DeviceInformation {},
..........
'785': Windows.Devices.Enumeration.DeviceInformation {} }
3.参考: Windows 运行时应用程序的 Windows API 参考
我已经使用:
Windows.Devices.Enumeration
Windows.Devices.Enumeration.Pnp
Windows.Devices.HumanInterfaceDevice
Windows.Devices.Usb
但仍然返回空对象。</p>
操作系统:Windows 10 企业版 nodejs:Node.js (Chakra) node@6.0.0
设备可以在设备管理器中显示
信息:
USB\VID_10C4&PID_81B9\5&369d87d2&0&1。</p>
指南:{745A17A0-74D3-11D0-B6FE-00A0C90F57DA}