[][src]Module luxafor::usb_hid

Implementation of the Device trait for USB connected lights.

Specification

The identifiers used to discover the device using the HID API are as follows:

  1. The vendor identifier (VID) is 0x04D8.
  2. The product identifier (PID) is 0xF372.

The following command groups exist for controlling the lights. Note that byte 0, the USB HID report identifier, must always be set to 0x00. Also, trailing 0x00 values need not be written.

Command Group012345678
Simple0x000x00COLOR*0x000x000x000x000x000x00
Solid0x000x01LEDREDGREENBLUE0x000x000x00
Fade0x000x02LEDREDGREENBLUETIME0x000x00
Strobe0x000x03LEDREDGREENBLUESPEED0x00REPEAT
Wave0x000x04WTYPEREDGREENBLUE0x00REPEATSPEED
Pattern0x000x06PTYPEREPEAT0x000x000x000x000x00
Productivity0x000x0ACOLOR0x000x000x000x000x000x00
Get Ver/Serial0x000x800x000x000x000x000x000x000x00

Notes

  1. The values for LED, COLOR, WTYPE, and PTYPE, are shown in the corresponding tables below.
  2. The values for RED, GREEN, BLUE, are 0..255 and correspond to standard RGB color.
  3. The value for TIME is the number of seconds to fade from the current color to the new color specified.
  4. The value for SPEED is the time to cycle through the change.
  5. The value of REPEAT is the number of times to repeat the wave or pattern.
  6. The response data for the get version and serial number command group is described below.

LED values

ValueAddressed LED
0x01..0x06Specific LED
0x41all back LEDs
0x42all front LEDs
0xFFall LEDs one color

The addressable LEDs on the Flag USB product are as follows, shown in vertical orientation:

BackFront
63
52
41

COLOR values

  1. For the command group Productivity all the values below are valid.
  2. For the command group Simple the values 'E' and 'D' are not valid.
LetterValueColor
'E'0x45Enable
'D'0x44Disable
'R'0x52Red
'G'0x47Green
'B'0x42Blue
'C'0x43Cyan
'M'0x4DMagenta
'Y'0x59Yellow
'W'0x57White
'O'0x4FOff

WTYPE values

ValuePattern
0x01Short
0x02Long
0x03Overlapping Short
0x04Overlapping Long
0x05?
  1. Luxafor describe wave type as a value 0x01..0x05 and yet there seems to be no description of 0x05 anywhere.

PTYPE values

ValuePatternWindows Only
0x00?Unknown
0x01Luxafor/Traffic LightsNo
0x02Random 1No
0x03Random 2No
0x04Random 3No
0x05PoliceNo
0x06Random 4No
0x07Random 5No
0x08Rainbow WaveYes
  1. Luxafor describe pattern type as a value 0x00..0x08 and yet there seems to be no description of 0x00 anywhere.

Version/Serial response

0123
0x80FW VersionSerial HighSerial Low

The serial number is returned as a pair, (high,low) bytes.

Structs

USBDevice

The device implementation for a USB connected light.

USBDeviceDiscovery

This enables the discovery of the device using the USB HID descriptor.