On Sat, Feb 16, 2013 at 4:18 PM, Wim De Kimpe
<wim.deki...@medecbenelux.be> wrote:
> Hello Xiaofan
>
> Here's the output:
>
> Bus 002 Device 015: ID 04d8:ff99 Microchip Technology, Inc.
> Couldn't open device, some information will be missing
> Device Descriptor:
>   bLength                18
>   bDescriptorType         1
>   bcdUSB               1.01
>   bDeviceClass            0 (Defined at Interface level)
>   bDeviceSubClass         0
>   bDeviceProtocol         0
>   bMaxPacketSize0         8
>   idVendor           0x04d8 Microchip Technology, Inc.
>   idProduct          0xff99
>   bcdDevice            0.00
>   iManufacturer           1
>   iProduct                2
>   iSerial                 0
>   bNumConfigurations      1
>   Configuration Descriptor:
>     bLength                 9
>     bDescriptorType         2
>     wTotalLength           32
>     bNumInterfaces          1
>     bConfigurationValue     1
>     iConfiguration          0
>     bmAttributes         0x40
>       (Missing must-be-set bit!)
>       Self Powered
>     MaxPower              448mA
>     Interface Descriptor:
>       bLength                 9
>       bDescriptorType         4
>       bInterfaceNumber        0
>       bAlternateSetting       0
>       bNumEndpoints           2
>       bInterfaceClass         0 (Defined at Interface level)
>       bInterfaceSubClass      0
>       bInterfaceProtocol      0
>       iInterface              0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x01  EP 1 OUT
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>       Endpoint Descriptor:
>         bLength                 7
>         bDescriptorType         5
>         bEndpointAddress     0x82  EP 2 IN
>         bmAttributes            2
>           Transfer Type            Bulk
>           Synch Type               None
>           Usage Type               Data
>         wMaxPacketSize     0x0040  1x 64 bytes
>         bInterval               0
>
> So from this you can see that my initial statement about EP1
> and EP2 was wrong, the In/out was the other way around, and the
> EP 2 address is 0x82.
> Question: is there a way of not using the address, but using the
> Endpoint name ( EP1,EP2)? Or does this not make any sense at all?

It does not make sense. Please refer to Tim's answer to you.
EP1 IN (0x81) and EP1 OUT (0x01) are different endpoint.
EP2 IN (0x82) and EP2 OUT (0x02) are different endpoint.

> I have been doing some more experiments. Apparently, if I increase
> the nTimeout to 2000, and I use libusb_bulk_transfer
> then I can also communicate with the device in Linux.

>From the lsusb output, you can see your device is using
bulk endpoint, not interrupt endpoint. So you need to
use libusb_bulk_transfer. As for the timeout, it is quite
common to use something like 2000ms or even 5000ms
since the typical OS (Linux, Windows and Mac OS X)
is not an RTOS. Usually you should not hit that kind of
timeout though.

> So I do not know exactly what this is caused by. From the
> documentation, I also do not understand clearly what the
> difference between the bulk and the interrupt transfer is.

The libusbx documentation will not tell you this. Rather you
need to learn some ABCs of USB. Then you can tell the
difference between control, bulk, interrupt and isochronous
transfer.
Ref: http://www.usbmadesimple.co.uk/

If you want to read in more details, then the USB 2.0 spec
is a good one to read (at least some parts of it).
URL: http://www.usb.org

If you use Microchip USB MCUs, then Microchip offers
quite some USB related documentation as well.


-- 
Xiaofan

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to