Skip to content

USB

In this section you will learn how to get information about detected USB devices:

For function reference and examples we assume, that we imported systeminspector as follows:

const si = require('@ambicuity/systeminspector');

Detected USB Devices

All functions in this section return a promise or can be called with a callback function (parameter cb in the function reference)

FunctionResult objectLinuxBSDMacWinSunComments
si.usb(cb)[{...}]XXXarray detected USB devices
[0].busXUSB bus
[0].deviceIdXBus device ID
[0].idXXXID e.g. 0bda:8821
[0].nameXXXname, e.g. root hub
[0].typeXXXtype e.g. keyboard or mouse
[0].removableXis removable
[0].vendorXXvendor e.g. Realtek
[0].manufacturerXXXmanufacturer e.g. Chicony
[0].maxPowerXmax power e.g. 100mA
[0].serialNumberXXserial number if available

Examples

Example
const si = require('@ambicuity/systeminspector');
si.usb().then(data => console.log(data));
json
[
  {
    bus: 1,
    deviceId: 2,
    id: '8087:8001',
    name: '',
    type: 'Hub',
    removable: null,
    vendor: 'Intel Corp.',
    manufacturer: '',
    maxPower: '0mA',
    serialNumber: null
  },
  {
    bus: 1,
    deviceId: 1,
    id: '1d6b:0002',
    name: '2.0 root hub',
    type: 'Hub',
    removable: null,
    vendor: 'Linux Foundation',
    manufacturer: 'Linux 4.4.0-169-generic ehci_hcd',
    maxPower: '0mA',
    serialNumber: null
  },
  {
    bus: 2,
    deviceId: 4,
    id: '04f2:0402',
    name: 'Genius LuxeMate i200 Keyboard',
    type: 'Keyboard',
    removable: null,
    vendor: 'Chicony Electronics Co., Ltd',
    manufacturer: 'Chicony',
    maxPower: '100mA',
    serialNumber: null
  },
  {
    bus: 2,
    deviceId: 3,
    id: '093a:2510',
    name: 'Optical Mouse',
    type: 'Mouse',
    removable: null,
    vendor: 'Pixart Imaging, Inc.',
    manufacturer: 'PIXART',
    maxPower: '100mA',
    serialNumber: null }
]
Inspector AI
SystemInspector AI initialized. How can I help you query your hardware?