Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Device Object

Bruce Williams edited this page Aug 20, 2015 · 4 revisions

Device objects represent attached USB devices and model the data about them.

Here's an example:

{
  id: '0x0a-0x12-IDQFB0023AB', // VID-PID-(SERIAL|INCREMENTED_ID)
  vendorCode: '0x0a',
  productCode: '0x12',
  manufacturer: 'Foo Bar Technologies',
  product: 'Baz Sensing Quux',
  serialNumber: 'IDQFB0023AB',
  mount: '/Volumes/FOOBAR1'
}

Note that the property names are snakeCased.

Properties

id

REQUIRED, String | Integer

The id is a unique identifier for an attached device.

While it would be nice for the id to be stable across device insertions/removals (eg, that a specific sensor has the same ID every time that it's inserted), that's not required. As long as the id doesn't change for a device while it's attached -- that getAll() and get() and the attach and detach event all report the same ID consistently -- it should meet our needs.

vendorCode

REQUIRED, String

The hex for the USB vendor ID.

productCode

REQUIRED, String

The hex for the USB product ID.

manufacturer

OPTIONAL, String

The name of the manufacturer/vendor, if available as a USB descriptor.

product

OPTIONAL, String

The name of the product, if available as a USB descriptor.

serialNumber

OPTIONAL, String

The serial number of the device, if available as a USB descriptor.

mount

OPTIONAL, String

The path to the volume mount point, if mounted.

Clone this wiki locally