[−][src]Struct usbd_bulk_only_transport::CommandBlockWrapper
A wrapper that identifies a command sent from the host to the device on the OUT endpoint. Describes the data transfer IN or OUT that should happen immediatly after this wrapper is received. Little Endian
Fields
signature: u32
Signature that identifies this packet as CBW Must contain 0x43425355
tag: u32
Tag sent by the host. Must be echoed back to host in tag field of the command status wrapper sent after the command has been executed/rejected. Host uses it to positively associate a CSW with the corresponding CBW
data_transfer_length: u32
Number of bytes of data that the host expects to receive on the IN or OUT endpoint (as indicated by the direction field) during the execution of this command. If this field is zero, must respond directly with CSW
direction: Direction
Direction of transfer initiated by this command. 0b0XXXXXXX = OUT from host to device 0b1XXXXXXX = IN from device to host X bits are obsolete or reserved
lun: u8
The device Logical Unit Number (LUN) to which the command is for. For devices that don't support multiple LUNs the host will set this field to zero. Devices that don't support multiple LUNS must not ignore this field and apply all commands to LUN 0, see General Problems with Commands
data_length: u8
The number of valid bytes in data field
data: [u8; 16]
The command set specific data for this command
Methods
impl CommandBlockWrapper
[src]
pub fn truncate_to_signature(buf: &mut [u8]) -> usize
[src]
Trait Implementations
impl Clone for CommandBlockWrapper
[src]
fn clone(&self) -> CommandBlockWrapper
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CommandBlockWrapper
[src]
impl Debug for CommandBlockWrapper
[src]
impl Default for CommandBlockWrapper
[src]
impl Eq for CommandBlockWrapper
[src]
impl Packed for CommandBlockWrapper
[src]
type Error = Error
fn pack(&self, bytes: &mut [u8]) -> Result<(), Self::Error>
[src]
Pack into the provided byte slice.
bytes.len()
must be at least 31
byte | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
0 | signature MSB | - | - | - | - | - | - | - |
1 | - | - | - | - | - | - | - | - |
2 | - | - | - | - | - | - | - | - |
3 | - | - | - | - | - | - | - | signature LSB |
4 | tag MSB | - | - | - | - | - | - | - |
5 | - | - | - | - | - | - | - | - |
6 | - | - | - | - | - | - | - | - |
7 | - | - | - | - | - | - | - | tag LSB |
8 | data_transfer_length MSB | - | - | - | - | - | - | - |
9 | - | - | - | - | - | - | - | - |
10 | - | - | - | - | - | - | - | - |
11 | - | - | - | - | - | - | - | data_transfer_length LSB |
12 | direction MSB | - | - | - | - | - | - | direction LSB |
13 | lun MSB | - | - | - | - | - | - | lun LSB |
14 | data_length MSB | - | - | - | - | - | - | data_length LSB |
15 | data MSB | - | - | - | - | - | - | - |
16 | - | - | - | - | - | - | - | - |
17 | - | - | - | - | - | - | - | - |
18 | - | - | - | - | - | - | - | - |
19 | - | - | - | - | - | - | - | - |
20 | - | - | - | - | - | - | - | - |
21 | - | - | - | - | - | - | - | - |
22 | - | - | - | - | - | - | - | - |
23 | - | - | - | - | - | - | - | - |
24 | - | - | - | - | - | - | - | - |
25 | - | - | - | - | - | - | - | - |
26 | - | - | - | - | - | - | - | - |
27 | - | - | - | - | - | - | - | - |
28 | - | - | - | - | - | - | - | - |
29 | - | - | - | - | - | - | - | - |
30 | - | - | - | - | - | - | - | data LSB |
fn unpack(bytes: &[u8]) -> Result<Self, Self::Error>
[src]
impl PackedBytes<[u8; 31]> for CommandBlockWrapper
[src]
type Error = Error
fn to_bytes<En: Endian>(&self) -> Result<[u8; 31], Self::Error>
[src]
fn from_bytes<En: Endian>(bytes: [u8; 31]) -> Result<Self, Self::Error>
[src]
impl PackedSize for CommandBlockWrapper
[src]
impl PartialEq<CommandBlockWrapper> for CommandBlockWrapper
[src]
fn eq(&self, other: &CommandBlockWrapper) -> bool
[src]
fn ne(&self, other: &CommandBlockWrapper) -> bool
[src]
impl StructuralEq for CommandBlockWrapper
[src]
impl StructuralPartialEq for CommandBlockWrapper
[src]
Auto Trait Implementations
impl Send for CommandBlockWrapper
impl Sync for CommandBlockWrapper
impl Unpin for CommandBlockWrapper
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,