industrialNETworXnetx

Rainer Versteeg

Rainer Versteeg

| 12.12.2008 | 17:54 | 1 reply

Configuration descriptor of libusb0.dll

Hi,

Have someone use the libusb0.dll with the NETX ?

Can somebody told me how the configuration descriptor of the libusb0.dll is ?

The descriptor is a structure like this:

const unsigned char Configuration_Descriptor[] =
{
        0x09,                                   // length of desc 
        0x02,                                   // descriptor type 
        0x3e, 0x00,                             // total length of returned data 
        0x01,                                   // number of interfaces 
        0x01,                                   // number of this configuration 
        0x04,                                   // index of config StringDescriptor 
        0xc0,                                   // attribute (self powered, no wakeup-support) 
        0x00,                                   // max power (in 2mA units)

// interface 0 descriptor
0x09, // length of desc
0x04, // descriptor type = interface descriptor
0x00, // interface number
0x00, // alternate setting
0x01, // number of (non-zero) EPs
0x02, // interface class
0x02, // interface subclass
0x01, // interface protocol
0x00, // interface StringDescriptor index

// something
0x05, // length of desc
0x24, // descriptor type = CS_INTERFACE
0x00, // subtype = Header Functional Descriptor
0x01, 0x01, // USB CDC Version 01.01

// something
0x05, // length of desc
0x24, // descriptor type = CS_INTERFACE
0x01, // subtype = Call Management Descriptor
0x00, // no call management
0x01, // ignored for 'no call management'

// something
0x04, // length of desc
0x24, // descriptor type = CS_INTERFACE
0x02, // subtype = Abstract Control Management Descriptor
0x02, // set features, see 'usbcdc11.pdf', page47

// endpoint 1 descriptor
0x07, // length
0x05, // descriptor type = endpoint descriptor
0x81, // endpoint 0x01
0x03, // interrupt
Usb_Ep1_PacketSize, 0x00, // max packet size
0xff, // polling interval

// interface 1 descriptor
0x09, // length of desc
0x04, // descriptor type = interface descriptor
0x01, // interface number
0x00, // alternate setting
0x02, // number of (non-zero) EPs
0x0a, // interface class for CDC data channel
0x00, // interface subclass
0x00, // interface protocol
0x00, // interface StringDescriptor index

// endpoint 2 descriptor
0x07, // length
0x05, // descriptor type = endpoint descriptor
0x83, // endpoint 0x83
0x02, // bulk endpoint
Usb_Ep2_PacketSize, 0x00, // max packet size
0x01, // polling interval (ignored for bulk)

// endpoint 3 descriptor
0x07, // length
0x05, // descriptor type = endpoint descriptor
0x02, // endpoint 0x02
0x02, // bulk endpoint
Usb_Ep3_PacketSize, 0x00, // max packet size
0x01 // polling interval (ignored for bulk)
};

Br,
Rainer

M T

M T

Hilscher Gesellschaft für Systemautomation mbH

| 12.12.2008 | 19:27

The Endpoint configuration descriptor has nothing to do with libusb. Libusb is just a wrapper for accessing USB Devices and does not have an own USB configuration descriptor. You will need to know the vendor / device id from the device descriptor of the netX to find the device via libusb nothing else.

Probably the USB Specification is a good place to look for information on USB descriptors and how to handle them.

Regards

MT

Login