wsqss2004
驱动小牛
驱动小牛
  • 注册日期2004-06-11
  • 最后登录2012-02-17
  • 粉丝0
  • 关注0
  • 积分994分
  • 威望202点
  • 贡献值2点
  • 好评度91点
  • 原创分0分
  • 专家分0分
阅读:1945回复:4

IOCTL代码中BULK传输为什么不能运行?但控制传输可以,代码如下:

楼主#
更多 发布于:2005-05-10 09:34
if (bOpenDriver(&hDevice,m_strDeviceName))
{
// build VENDOR_OR_CLASS_REQUEST_CONTROL structure
   vendreq.direction = 0; // host to device
vendreq.requestType = 2; // vendor request
vendreq.recepient = 0; // recipient is device
vendreq.requestTypeReservedBits = 0; // not used
vendreq.request = 0xB8; // request value = 0xB2
vendreq.value = 0; // not used
vendreq.index = 0; // not used

  // write to HPIA register
bResult = DeviceIoControl(hDevice, // device handle
 IOCTL_EZUSB_VENDOR_OR_CLASS_REQUEST, // dwIoControlCode
     &vendreq,        // ptr to vend req struct
     sizeof(VENDOR_OR_CLASS_REQUEST_CONTROL), // input buffer size
     &Read_addr, // data to send
     sizeof(Read_addr), // size of output buffer
     &nBytes, // required dummy var
     NULL);    

     btc.pipeNum = 6; // EP6In is pipe 6
bResult = DeviceIoControl (hDevice,
IOCTL_EZUSB_BULK_READ,
&btc,
sizeof (BULK_TRANSFER_CONTROL),
In_Buffer,
Read_length,
(unsigned long *)&nBytes,
NULL);
wsqss2004
驱动小牛
驱动小牛
  • 注册日期2004-06-11
  • 最后登录2012-02-17
  • 粉丝0
  • 关注0
  • 积分994分
  • 威望202点
  • 贡献值2点
  • 好评度91点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2005-05-10 11:17
难道做BULK传输还需要一些其他动作?
wsqss2004
驱动小牛
驱动小牛
  • 注册日期2004-06-11
  • 最后登录2012-02-17
  • 粉丝0
  • 关注0
  • 积分994分
  • 威望202点
  • 贡献值2点
  • 好评度91点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2005-06-13 08:14
多谢,早已搞好。程序下载,BULK传输都可以,但有时需要传两次,怎么才能复位端点?
游客

返回顶部