On Sun, 15 Aug 2004, Nuno Tavares wrote: > Please take a look at URB 5 for [1] *or* 000015 for [2] (preferred) - > these are only the first transfers. Here is 000015: > --------------------------------------------------------------------------- > 000015: Vendor-Specific Request (DOWN), 15.08.2004 01:19:28.2916864 +0.0 > Destination: Device > Reserved Bits: 0 > Request: 0x0 > Value: 0x8 > Send 0x0 bytes to the device > > > 000016: Control Transfer (UP), 15.08.2004 01:19:28.2916864 +0.0 > Pipe Handle: 0x824559a0 > > Setup Packet > 40 00 08 00 00 82 00 00 > > Recipient: Device > Request Type: Vendor > Direction: Host->Device > Request: 0x0 (Unknown) > Value: 0x8 > Index: 0x8200 > Length: 0x0 > --------------------------------------------------------------------------- > > I think the corresponding libusb call would be: > #define USB_DIR_OUT 0x0 > #define USB_DIR_IN (0x1 << 7) > char buf[255]; > usb_control_msg(udev, \ > USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_DEVICE,\ > 0,0x08,0x8200,buf,0,500); > > Is this correct?
Yes, although you could just as easily use NULL instead of buf. > Why does usb_control() return 0, and buf is empty: > buf: 00 00 00 00 00 00 00 00 (00 ...) Since it's an OUT transfer, the only data in buf will be what you put there yourself (in this case, none). There won't be any data coming IN from the device. > According to the logs, buf should be: 40 00 08 00 00 82 00 00, right? Wrong. According to the logs, those bytes are the contents of the SETUP packet. They correspond to the second, third, fourth, fifth, and seventh arguments of the usb_control_msg() call. Alan Stern ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-users