On Sun, 15 Aug 2004, Nuno Tavares wrote: > >> #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. > > I had tried it already, same result.
Right. It doesn't matter whether you use NULL or 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. > > The there is an "URB coming back" right? And it comes from the device..? > From what I've understood, this is a reply from the device which just > acknoledges the packet. It's easy to understand your confusion; the terms used by the sniffer program aren't very precise. "URB going down" means the contents of the URB at the time it is submitted to the kernel. "URB coming back" means the contents of the URB when the kernel returns to the caller. It has nothing to do with the direction of data transfer; for that you have to look at the other parts of the log message. For instance, in this case the strings "Send 0x0 bytes to the device" and "Direction: Host->Device" tell you what's really happening. > >> 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. > > I thought of 2 possibilities, both in these 2 paragraphs. > So this means I have to proceed blindly, right? > Isn't there anyway to detect camera state? There probably is. But since you're reverse-engineering a vendor's protocol, you don't have any way to know what it is! 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