This was a copy and paste job from our embedded code that I wrote a few
years ago and has been working with very few issues. Not had change to
double check it against the specs but its my first job on Monday
static const BYTE Virtual_Com_Port_ConfigDescriptor =
{
//Configuation Descriptor
0x09, // bLength: Configuation Descriptor
size
USB_CONFIGURATION_DESCRIPTOR_TYPE, // bDescriptorType: Configuration
0x43, 0x00, // wTotalLength:no of returned
bytes
0x02, // bNumInterfaces: 2 interface
0x01, // bConfigurationValue: Configuration
value
0x00, // iConfiguration: Index of string
descriptor describing the configuration
0xC0, // bmAttributes: self powered , does
not support remote wake up
0x00, // MaxPower 0 mA
//Interface Descriptor
0x09, // bLength: Interface Descriptor size
USB_INTERFACE_DESCRIPTOR_TYPE, // bDescriptorType: Interface
0x00, // bInterfaceNumber: Number of this
Interface
0x00, // bAlternateSetting: Alternate
setting
0x01, // bNumEndpoints: One endpoints used
USB_DEVICE_CLASS_COMMUNICATIONS, // bInterfaceClass: Communication
Interface Class
0x02, // bInterfaceSubClass: Abstract
Control Model
0x01, // bInterfaceProtocol: Common AT
commands
0x00, // iInterface:
//Header Functional Descriptor
0x05, // bLength: Endpoint Descriptor size
0x24, // bDescriptorType: CS_INTERFACE
0x00, // bDescriptorSubtype: Header Func
Desc
0x10, // bcdCDC: spec release number
0x01,
//Call Managment Functional Descriptor
0x05, // bFunctionLength
0x24, // bDescriptorType: CS_INTERFACE
0x01, // bDescriptorSubtype: Call
Management Func Desc
0x00, // bmCapabilities: D0+D1
0x01, // bDataInterface: 1
//ACM Functional Descriptor
0x04, // bFunctionLength
0x24, // bDescriptorType: CS_INTERFACE
0x02, // bDescriptorSubtype: Abstract
Control Management desc
0x02, // bmCapabilities
//Union Functional Descriptor
0x05, // bFunctionLength
0x24, // bDescriptorType: CS_INTERFACE
0x06, // bDescriptorSubtype: Union func
desc
0x00, // bMasterInterface: Communication
class interface
0x01, // bSlaveInterface0: Data Class
Interface
//Endpoint 2 Descriptor
0x07, // bLength: Endpoint Descriptor size
USB_ENDPOINT_DESCRIPTOR_TYPE, // bDescriptorType: Endpoint
0x82, // bEndpointAddress: (IN2)
0x03, // bmAttributes: Interrupt
0x08, 0x00, // wMaxPacketSize:
0xFF, // bInterval:
//Data class interface descriptor
0x09, // bLength: Endpoint Descriptor size
USB_INTERFACE_DESCRIPTOR_TYPE, // bDescriptorType:
0x01, // bInterfaceNumber: Number of this
Interface
0x00, // bAlternateSetting: Alternate
setting
0x02, // bNumEndpoints: Two endpoints used
0x0A, // bInterfaceClass: DATA_INTERFACE
0x00, // bInterfaceSubClass:
0x00, // bInterfaceProtocol:
0x00, // iInterface:
//Endpoint 3 Descriptor
0x07, // bLength: Endpoint Descriptor size
USB_ENDPOINT_DESCRIPTOR_TYPE, // bDescriptorType: Endpoint
0x03, // bEndpointAddress: (OUT3)
0x02, // bmAttributes: Bulk
0x08, 0x00, // wMaxPacketSize:
0x00, // bInterval: ignore for Bulk
transfer
//Endpoint 1 Descriptor
0x07, // bLength: Endpoint Descriptor size
USB_ENDPOINT_DESCRIPTOR_TYPE, // bDescriptorType: Endpoint
0x81, // bEndpointAddress: (IN1)
0x02, // bmAttributes: Bulk
0x08, 0x00, // wMaxPacketSize:
0x00 // bInterval
};
On 10 September 2010 17:35, wrote:
> Alex Brown wrote:
>
> > I might be fishing in the dark here.
> >
> > should I have more than one pipe for this device?
> >
> > At the select configuration stage I am only setting up
> > one pipe. so I have two pipes. EP0 and EP!
>
> You may want to post the config descriptor that you’re feeding usbser, but
> you can’t be too far off because the driver is starting…
>
> You should have four “pipes” total:
>
> 1) The control endpoint
> 2) The interrupt endpoint for async serial notifications
> 3) The bulk IN endpoint for receiving data from the “device”
> 4) The bulk OUT endpoint for sending data to the “device”
>
> For 1) you get that for free, but 2), 3), and 4) all need to be present in
> your config descriptor, and they need unique PipeHandle’s.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>