pub struct ReportId(/* private fields */);Expand description
Unsigned value that specifies the Report ID.
If a Report ID tag is used anywhere in Report descriptor, all data reports for the device are preceded by a single byte ID field. All items succeeding the first Report ID tag but preceding a second Report ID tag are included in a report prefixed by a 1-byte ID. All items succeeding the second but preceding a third Report ID tag are included in a second report prefixed by a second ID, and so on.
This Report ID value indicates the prefix added
to a particular report. For example, a Report
descriptor could define a 3-byte report with a
Report ID of 01. This device would generate a
4-byte data report in which the first byte is 01.
The device may also generate other reports, each
with a unique ID. This allows the host to
distinguish different types of reports arriving
over a single interrupt in pipe. And allows the
device to distinguish different types of reports
arriving over a single interrupt out pipe. Report
ID zero is reserved and should not be used.
Implementations§
Source§impl ReportId
impl ReportId
Sourcepub const PREFIX: u8 = 132u8
pub const PREFIX: u8 = 132u8
Prefix consists of tag(bit 7-4), type(bit 3-2) and size(bit 1-0).
The “size” part is set to 00 in this constant value.
Sourcepub unsafe fn new_unchecked(raw: &[u8]) -> Self
pub unsafe fn new_unchecked(raw: &[u8]) -> Self
Sourcepub fn new_with(data: &[u8]) -> Result<Self, HidError>
pub fn new_with(data: &[u8]) -> Result<Self, HidError>
Create an item with specific data.
NOTE: data size must be: 0, 1, 2 or 4.