Draft: Initial commit for HID LampArray Controller
Implements the HID LampArray protocol documented here:
https://www.usb.org/sites/default/files/hutrr84_-_lighting_and_illumination_page.pdf
Testing and developed with Microsoft's ArduinoHidForWindows demo:
https://github.com/microsoft/ArduinoHidForWindows/tree/main/examples/LampArray
The source code for that Arduino sketch provides some packet format specifics and report ID values that aren't specified in the original document.
What has been implemented so far:
- Requesting Lamp Array Attributes (lamp count, dimensions, etc)
- Requesting each Lamp Attribute (lamp ID, location, limits, etc)
- Disabling Autonomous Mode (allows software control)
- Multi Update (direct mode/per LED update packet)
What has not been implemented
- Turning dimension/location parameters into a matrix map
- Dealing with brightness/intensity
- Dealing with LEDs that have a maximum less than 255
- Dealing with single color/intensity-only LEDs
This change will also likely need work done to the Resource Manager to provide a new type of Detector that provides a group of hid_devices all from the same physical device. Due to how hidapi is written, each hid_device actually represents just a specific interface/usage/usage page combination rather than an entire device, and this means for protocols like LampArray that use many different usages, we would very strongly benefit from a layer above the Detector that goes through the entire hid_device list and batches them up by descriptor strings/location and passes us a group object containing all the hid_devices associated with one physical device. We can then check that the group object contains all the required usage/usage page entries needed for the LampArray protocol before instancing a new Controller. This is prototyped in this MR but with the restriction that you can only have one device connected at a time and that device has to be the Arduino Zero LampArray test device.