|
From: Jens T. T. <jt...@to...> - 2009-04-23 20:07:10
|
Hi Alan,
On Thu, Apr 23, 2009 at 03:51:47PM -0400, Alan Stern wrote:
> On Thu, 23 Apr 2009, Jens Thoms Toerring wrote:
> > j) On trying to read the reply the device is supposed to send
> >
> > libusb_bulk_transfer( udev, 8, readbuf, 64, &cnt, 0 );
>
> If you're trying to read from an endpoint then the address should have
> the 0x80 bit set. So instead of 8, you probably want to say 0x88.
> Otherwise you're telling the system that you want to write, not read!
> The reason your program failed is because it tried to read from an OUT
> endpoint. A non-existent OUT endpoint, in fact, as you can see from
> the lsusb output. There is no endpoint with address 8 listed.
> The old libusb would silently make corrections like this for you. The
> newer version doesn't.
Ok, I see. I obviously already had misunderstood what I was
doing wih libusb-0.1, taking "endpoint address" for being a
synonym for the "endpoint number"... That hopefully will take
care of the problem. Thank you so much!
> > usb 1-3: new high speed USB device using ehci_hcd and address 17
> > usb 1-3: config 1 interface 0 altsetting 0 bulk endpoint 0x2 has invalid maxpacket 64
> > usb 1-3: config 1 interface 0 altsetting 0 bulk endpoint 0x4 has invalid maxpacket 64
> > usb 1-3: config 1 interface 0 altsetting 0 bulk endpoint 0x86 has invalid maxpacket 64
> > usb 1-3: config 1 interface 0 altsetting 0 bulk endpoint 0x88 has invalid maxpacket 64
>
> Those are just warnings, not errors. They shouldn't affect the
> operation of your program.
Good to know - it got me a bit worried;-)
> > Finally one more question out of mere curiosity: how does one
> > deduce from the device data if a configuration is low, full or
> > high speed?
>
> Do you mean the current configuration, as presented by libusb? That
> always corresponds to the device's current connect speed -- in general
> you can't deduce the speed merely from the data in the configuration
> itself.
>
> Which reduces the problem to determining the current connect speed. I
> don't know if libusb-1.0 makes that information available or not.
>
> > Is all one can go by the maximum packet size or is
> > this information somewhere in the output of lsusb and I'm just
> > too stupid to figure it out?
>
> You can guess from the maxpacket sizes, but you won't always be right.
> For example, the sizes in your lsusb output would lead one to guess
> that the connection was full speed, but in fact it was high speed and
> the sizes were buggy.
>
> lsusb does not tell you what speed the current connection is. You have
> to get the speed from somewhere else, such as sysfs. Look in
>
> /sys/bus/usb/devices/.../speed
>
> where you have to fill in the "..." with the appropriate device name.
> Or you can look in /proc/bus/usb/devices (not all distributions make
> that file available, so you may have to do "mount -t usbfs none
> /proc/bus/usb" first.)
Thanks, I hope I am understanding a bit more now!
Thank you very much for your kind help!
Best regards, Jens
--
\ Jens Thoms Toerring ________ jt...@to...
\_______________________________ http://toerring.de
|