阅读:837回复:0
大虾帮忙:ezusb描述符的问题
为什么例子程序EzBulk_asm自己没有描述表,control panel可以运行它,能读取端点IN2的数据。不是说必须有描述符吗?控制面板是怎么辨识它的?
我自己编了一个应用程序与EzBulk_asm通信,应用程序很简单应该没社么问题的,但为什么读不到数据呢?每次运行到 DeviceIoControl(handle,IOCTL_EZUSB_BULK_READ, &bulkControl,sizeof(BULK_TRANSFER_CONTROL), &inBuffer[0],inPacketSize,&nBytes,NULL); 总是提示Correct pipe not found。而且bulkControl.pipeNum从0-15我都是过了,一样的结果。是因为EzBulk_asm没有描述符吗? 请大虾们帮帮忙,指点指点,谢谢啦!急。。。。。。。。。。。 应用程序如下: handle = CreateFile(\"\\\\\\\\.\\\\ezusb-0\", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); if (handle == INVALID_HANDLE_VALUE) { printf(\"Failed to open driver\\n\"); return; } else { printf(\"Opened successfully.\\n\"); } success = DeviceIoControl(handle, IOCTL_Ezusb_GET_DEVICE_DESCRIPTOR, NULL, 0, buffer, sizeof(USB_DEVICE_DESCRIPTOR), &nBytes, NULL); if (success) { DumpDeviceDescriptor((PUSB_DEVICE_DESCRIPTOR) buffer); bulkControl.pipeNum=8; bResult=DeviceIoControl(handle,IOCTL_EZUSB_BULK_READ, &bulkControl,sizeof(BULK_TRANSFER_CONTROL), &inBuffer[0],inPacketSize,&nBytes,NULL); if(!bResult) { printf(\"Correct pipe not found.\"); } else { for(i=0;i<64;i++) { printf(\"%d\\t\",inBuffer); } } } else { printf(\"IOCTL Failed\\n\"); } CloseHandle(handle); } |
|