A I R E N C E - U S B M a n u a l P a g e 40
HID Control Protocol for software engineers
Introduction
This chapter describes the protocol which is used to communicate with the control section and the USB channel controls of the
Airence mixer. For the communication between the PC (host) and Airence (device) the USB generic HID (Human Interface Device)
class protocol is used. HID devices are identified by their PID and VID. For the Airence the
PID=0x2402
, and the
VID=0x03EB
.
On top of the HID protocol, a custom message based protocol provides the commands to send and receive data which will be
described in more detail in this chapter.
Message format
Transmitting data through the USB bus using the HID class protocol is done by reports. A report always contains an ID and the
data inside the report. In order to successfully communicate with the Airence control section
only reportID 0
may be used.
More information about report descriptors can be found on
www.usb.org
. For now, remember that the Airence only will listen to
reports with reportID = 0.
A control message has a fixed size of 8 bytes containing a
SIZE
byte,
COMMAND
byte, and a
PAYLOAD
section of maximal 6 bytes.
The
SIZE
byte contains the number of bytes used (max. 8) in the message, including this
SIZE
byte.
byte
0
1
2
3
4
5
6
7
SIZE
COMMAND
PAYLOAD
n
cmd
p0
p1
p2
p3
p4
p5
Command byte
The command byte consists of a 2-bit
TYPE
and a 6-bit
ID
field.
bit
7
6
5
4
3
2
1
0
TYPE
ID
t1
t0
id5
id4
id3
id2
id1
id0
Bit
Symbol
Value
Value
5:0
ID
-
Command Identifier (ID)
7:6
TYPE
00
Write command, from host to device
01
Request command, from host to device
10
Response command, reply from device to host on a request
11
Event, from device to host (i.e. button pressed)
Command ID
A commandID can have a value between 0x01 and 0x3F. The following commandIDs are currently available in the Airence:
VALUE
DESCRIPTION
0x01
AIRENCE_FIRMWARE_VERSION
0x02
AIRENCE_LED
0x03
AIRENCE_LED_BLINK
0x04
-
0x05
AIRENCE_SWITCH_CHANGE
0x06
AIRENCE_ENCODER_INCREMENT
0x07
AIRENCE_ENCODER_DECREMENT