Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

How to List USB device? #25

Open
Open

Description

@DecisionShen

my code:
DeviceInformation class

`
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);
}
);
`
result:
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 {} }

why I can't find any device?

OS: Win 10 Enterprise
nodejs: Node.js (Chakra) node@6.0.0

The device can display at Device Manager

info:
USB\VID_10C4&PID_81B9\5&369d87d2&0&1。
input.inf
Guid: {745A17A0-74D3-11D0-B6FE-00A0C90F57DA}

Activity

  1. curtisman commented on Aug 26, 2016

    @curtisman
    Member

    It seems like you have found 785 device.

    I haven't tried it, but instead of using console.log on the whole DeviceInformationCollection, you can write your own loop walking the collection and look at and output the properties of each DeviceInformation?

    https://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.enumeration.deviceinformation.aspx documents the properties it has.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions