From: Johannes E. <joh...@er...> - 2002-05-04 00:01:30
|
On Fri, May 03, 2002, Marc Britten <yu...@mo...> wrote: > Just started using libusb, downloaded the cvs source compiled/installed > and started writing my app > > I find my device whiling through the busses/devices like the test app, > and do usb_open on the usb_device that's returned, and seem to get a > valid usb_dev_handle* however when I go to send a control_request > > char title_request[0x13] = <snipped> // static text for now > > ret = usb_control_msg(dev, 0, 0x80, 0, 0, title_request, 0x13, 5000); > > I get an error. i've got debug cranked up (usb_set_debug(3), i know 2 > seems to be the limit) > > and I'm getting > > USB error: error sending control message: Operation not permitted This is a normal permissions problem. You can use /sbin/hotplug under Linux to automatically set the perms, or you can use sudo. > as a normal user and > USB error: error sending control message: Broken pipe > > as root (sudo ./myapp) > > any ideas? usb_open doesn't seem to spit any debug info out so i'm not > sure if thats good or not. usb_open is probably fine, the usb_control_msg is likely the problem. Broken pipe is EPIPE. That means the device sent a STALL to your control message. If you don't know what a STALL is, check the USB specs. While the meaning of STALL varies from device to device and the situation, it usually means what you sent was wrong. I'd double check the request, requesttype, value and index arguments. I'd also double check the title_request buffer. JE |