举一个移植的例子:
bool ClearStatus()
{
bool Success ;
// VENDOR_OR_CLASS_REQUEST_CONTROL VR;
// unsigned long nBytes;
if (hUsbDevice != INVALID_HANDLE_VALUE )
{
/*
VR.direction = 0; // (0=host to device, 1=device to host)
VR.requestType = 2;
VR.recepient = 0;
VR.request = VR_ClearStatus;
VR.requestTypeReservedBits = 0;
Success = DeviceIoControl (hUsbDevice,
IOCTL_EZUSB_VENDOR_OR_CLASS_REQUEST,
&VR,
sizeof(VENDOR_OR_CLASS_REQUEST_CONTROL),
NULL,
0,
&nBytes,
NULL);
*/
}
移植后的代码:
ept->Direction = DIR_TO_DEVICE;
ept->ReqType = REQ_VENDOR;
ept->Target = TGT_DEVICE;
ept->ReqCode = VR_ClearStatus;
下面的不会移植了?
请高手指点。
return Success;
}
我的问题是:
1. VR.requestTypeReservedBits = 0; 这个如何设置?
2. IOCTL_EZUSB_VENDOR_OR_CLASS_REQUEST,对应ept的什么函数?如果单单是清除状态,那么它是用
BeginDataXfer呢?还是用Write就可以呢?