USB HID transfer layer
Transfer layer for BRP over HID
For BRP over HID, we've added a special transfer layer consisting of HID reports. These report types are important if you use BRP without the SDK, i.e. create the command frames yourself.
Each command has to be sent within an HID report. The reponse is returned within an HID report as well. You send HID reports to the reader via control pipe (endpoint 0) and receive it via interrupt pipe (endpoint 1). It's not allowed to receive a report from the reader via control pipe (endpoint 0).
Each BRP frame has to be transmitted within 1 HID report. An HID report has the following data structure:
Field name | Field size | Field description |
---|---|---|
ReportId | 1 byte | The report ID (1-4; see table below) |
BrpFrameLen | 2 bytes (LSB-first encoded) | The actual size of the BRP frame transmitted in the report |
BrpFrame | BRP frame size | BRP command or BRP response frame |
Padding | x bytes | Padding bytes that fill the remaining bytes of the HID report |
The reader supports 4 different HID report sizes:
Report ID | Type | Max length (in bytes) |
---|---|---|
1 | Data, array, absolute | 12 |
2 | Data, array, absolute | 60 |
3 | Data, array, absolute | 252 |
4 | Data, array, absolute | 1020 |
For best performance, we recommend you choose the smallest possible report size into which the BRP command frame fits. This is also the way the reader usually sends BRP frames to the host.
Examples:
- To send a BRP frame of 12 bytes, use report ID 1, as the frame fits exactly into it.
- To send a BRP frame of 13 bytes, use report ID 2, as this is the smallest report size into which 13 bytes fit.