NetMD.Devices (NetMD v0.1.0)

Copy Markdown View Source

Known NetMD USB devices, from the netmd-js device table.

Summary

Types

A known device.

Per-device quirk flags.

Functions

All known devices.

Look up a device by USB ids.

Quirk flags for a device, empty map if not in the table.

Whether the USB ids belong to a known NetMD device.

Device display name, "Unknown Device" if not in the table.

Types

device()

@type device() :: %{
  vendor_id: 0..65535,
  product_id: 0..65535,
  name: String.t(),
  flags: flags()
}

A known device.

flags()

@type flags() :: %{optional(:native_mono_upload) => boolean()}

Per-device quirk flags.

Functions

all()

@spec all() :: [device()]

All known devices.

find(vendor_id, product_id)

@spec find(0..65535, 0..65535) :: {:ok, device()} | :error

Look up a device by USB ids.

flags(vendor_id, product_id)

@spec flags(0..65535, 0..65535) :: flags()

Quirk flags for a device, empty map if not in the table.

known?(vendor_id, product_id)

@spec known?(0..65535, 0..65535) :: boolean()

Whether the USB ids belong to a known NetMD device.

name(vendor_id, product_id)

@spec name(0..65535, 0..65535) :: String.t()

Device display name, "Unknown Device" if not in the table.