Hi there,
I'm trying to create a Command Block Wrapper (CBW) with a Command Descriptor Block (CDB) for the SCSI Command: Inquiry and I don't know how to get the dCBWDataTransferLength value of it.
I'v read in "USB Mass Storage Devices - Designing and Programming Devices and Embedded Hosts":
The dCBWDataTransferLength field indicates how many bytes the host will send or how many bytes the host expects to receive.
and
The response to an INQUIRY command is at least 36 bytes. [...]
Is it enough to initialize with:
struct cbw {
...
uint32_t dCBWDataTransferLength;
...
}cbw_inquiry;
...
cbw_inquiry->dCBWDataTransferLength = 36;
Or better using
#define INQUIRY_RESPONSE_LENGTH 0x00000024
cbw_inquiry->dCBWDataTransferLength = INQUIRY_RESPONSE_LENGTH;
How to initalize?
EDIT:
Just one more Question, I've
read that the Inquiry Command consists of three transport phases:
- Command Transport
- Data Transport
- Status Transport
I created a URB with a CBW(and a CDB for an Inquiry Command) and submitted it to the out endpoint. Is that the Command Transport Phase?
What I have to do for receiving the Data? Will it be enough to create a CSW (Command Status Wrapper) and listening on the IN endpoint?