1,question about function "ept->Read(&buf, bytestosend);" in control transfer
after running the code “ept->Read(&buf, bytestosend);”,Has the transfer ended?
it's vital to know the answer in continous control transfer while repeated inquring a status variable through control transfer.
2,question about large bulk transfer
in a case that a DSP transmit an image to the host by using bulk transfer, the image has 1447680 bytes,so can the bulk transfer code be executable as below:
OVERLAPPED inOvLap;
inOvLap.hEvent = CreateEvent(NULL, false, false, "CYUSB_IN");
LONG length =1447680;
USBDevice->EndPointCount();
BulkInEpt=(CCyBulkEndPoint *) USBDevice->EndPoints[1];
UCHAR *inContext = BulkInEpt->BeginDataXfer(inBuf, length, &inOvLap);
BulkInEpt->WaitForXfer(&inOvLap,1000);
BulkInEpt->FinishDataXfer(inBuf, length, &inOvLap,inContext);
CloseHandle(inOvLap.hEvent);
|