Jan,
I made an attempt to modify all relevant descriptors. Here are the structures:
//USB Device Descriptor: 18-bytes
const unsigned char deviceDesc[]=
{0x12, // bLength = 18d
0x01, // bDeviceDescriptorType=1(defined by USB spec)
0x00, 0x02, // bcdUSB USB Version 2.0 (L-Byte/H-Byte)
0x00, // bDeviceClass
0x00, // bDeviceSubclass
0x00, // bDeviceProtocol
0x40, // bMaxPacketSize 64 Bytes
0xB3, 0x04, // idVendor(L-Byte/H-Byte)
0x0B, 0x31, // idProduct(L-Byte/H-Byte)
0x10, 0x01, // bcdDevice(L-Byte/H-Byte): device's release number
0, // iManufacturer String Index
0, // iProduct String Index
0, // iSerialNumber String Index
1}; // bNumberConfigurations
//Configuration Descriptors
const unsigned char cfgDesc[]=
{
// CONFIGURATION Descriptor
0x09, // bLength
0x02, // bDescriptorType = Config (constant)
0x29, 0x00, // wTotalLength(L/H)
0x01, // bNumInterfaces
0x01, // bConfigValue
0x00, // iConfiguration
0xA0, // bmAttributes;
0x32, // MaxPower is 200mA
// INTERFACE Descriptor
0x09, // length = 9
0x04, // type = IF; constant 4 for INTERFACE
0x00, // IF #0; Interface Identification #
0x00, // bAlternate Setting
0x02, // bNumber of Endpoints = 1 for 5515 mouse
0x03, // bInterfaceClass = HID
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0x00, // iInterface
// HID Descriptor
0x09, // length = 9
0x21, // bDescriptorType = HID
0x00, // bcdHID = HID Class Spec version
0x01, //
0x00, //
0x01, // bNumDescriptors = Number of Descriptors
0x22, // bDescriptorType = 34 (REPORT)
0x2F, // wDescriptorLength = 47
// 0x34, // wDescriptorLength = 52
// 0x2E, // wDescriptorLength = 46
0x00, //
// EndPoint_1_IN Descriptor
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x81, // bEndpointAddress and direction(IN)
0x03, // bmAttributes: B1B0->transfer-type: control=00; Iso=01; bulk=10; interrupt=11
0x40,0x00, // wMaxPacketSize(L/H)=4
0x0A, // bInterval: Max latency
// EndPoint_1_OUT Descriptor
0x07, // bLength
0x05, // bDescriptorType (Endpoint)
0x01, // bEndpointAddress and direction(OUT)
0x03, // bmAttributes: B1B0->transfer-type: control=00; Iso=01; bulk=10; interrupt=11
0x40,0x00, // wMaxPacketSize(L/H)=4
0x0A, // bInterval: Max latency
};
I did add the EndPoint_OUT Descriptor to the original code.
And here's the report descriptor:
Uint8 reportDesc[] =
{
0x06, 0xA0, 0xFF, // Usage page (vendor defined)
0x09, 0x01, // Usage ID (vendor defined)
0xA1, 0x01, // Collection (application)
// The Input report
0x09, 0x03, // Usage ID - vendor defined
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8 bits)
0x95, 0x02, // Report Count (2 fields)
0x81, 0x02, // Input (Data, Variable, Absolute)
// The Output report
0x09, 0x04, // Usage ID - vendor defined
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8 bits)
0x95, 0x02, // Report Count (2 fields)
0x91, 0x02, // Output (Data, Variable, Absolute)
// The Feature report
0x09, 0x05, // Usage ID - vendor defined
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8 bits)
0x95, 0x02, // Report Count (2 fields)
0xB1, 0x02, // Feature (Data, Variable, Absolute)
0xC0}; // end collection
Which should be very close to the code you gave us in your book.
USBlyzer shows the following analysis of the transactions, all of which look OK to me. But then again, I'm a rookie...

Get Descriptor
This request returns the specified descriptor if the descriptor exists.
Offset Field Size Value Description
0 bmRequestType 1 80h
4..0: Recipient ...00000 Device
6..5: Type .00..... Standard
7: Direction 1....... Device-to-Host
1 bRequest 1 06h Get Descriptor
2 wValue.LowByte 1 00h
3 wValue.HiByte 1 01h Device Descriptor
4 wIndex 2 0000h
6 wLength 2 0012h Descriptor Length
Device Descriptor
Offset Field Size Value Description
0 bLength 1 12h
1 bDescriptorType 1 01h Device
2 bcdUSB 2 0200h USB Spec 2.0
4 bDeviceClass 1 00h Class info in Ifc Descriptors
5 bDeviceSubClass 1 00h
6 bDeviceProtocol 1 00h
7 bMaxPacketSize0 1 40h 64 bytes
8 idVendor 2 04B3h IBM Corp.
10 idProduct 2 310Bh
12 bcdDevice 2 0110h 1.10
14 iManufacturer 1 00h
15 iProduct 1 00h
16 iSerialNumber 1 00h
17 bNumConfigurations 1 01h
Get Descriptor
This request returns the specified descriptor if the descriptor exists.
Offset Field Size Value Description
0 bmRequestType 1 80h
4..0: Recipient ...00000 Device
6..5: Type .00..... Standard
7: Direction 1....... Device-to-Host
1 bRequest 1 06h Get Descriptor
2 wValue.LowByte 1 00h Descriptor Index
3 wValue.HiByte 1 02h Configuration Descriptor
4 wIndex 2 0000h
6 wLength 2 0009h Descriptor Length
Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 0029h
4 bNumInterfaces 1 01h
5 bConfigurationValue 1 01h
6 iConfiguration 1 00h
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
4..0: Reserved ...00000
5: Remote Wakeup ..1..... Yes
6: Self Powered .0...... No, Bus Powered
7: Reserved (set to one)
(bus-powered for 1.0) 1.......
8 bMaxPower 1 32h 100 mA
Get Descriptor
This request returns the specified descriptor if the descriptor exists.
Offset Field Size Value Description
0 bmRequestType 1 80h
4..0: Recipient ...00000 Device
6..5: Type .00..... Standard
7: Direction 1....... Device-to-Host
1 bRequest 1 06h Get Descriptor
2 wValue.LowByte 1 00h Descriptor Index
3 wValue.HiByte 1 02h Configuration Descriptor
4 wIndex 2 0000h
6 wLength 2 0009h Descriptor Length
Configuration Descriptor 1 Bus Powered, 100 mA
Offset Field Size Value Description
0 bLength 1 09h
1 bDescriptorType 1 02h Configuration
2 wTotalLength 2 0029h
4 bNumInterfaces 1 01h
5 bConfigurationValue 1 01h
6 iConfiguration 1 00h
7 bmAttributes 1 A0h Bus Powered, Remote Wakeup
4..0: Reserved ...00000
5: Remote Wakeup ..1..... Yes
6: Self Powered .0...... No, Bus Powered
7: Reserved (set to one)
(bus-powered for 1.0) 1.......
8 bMaxPower 1 32h 100 mA
Set Idle
Silences a particular report on the interrupt in pipe until a new event occurs or the specified amount of time passes.
Offset Field Size Value Description
0 bmRequestType 1 21h
4..0: Recipient ...00001 Interface
6..5: Type .01..... Class
7: Direction 0....... Host-to-Device
1 bRequest 1 0Ah Set Idle
2 wValue.LowByte 1 00h Report ID
3 wValue.HiByte 1 00h Infinite Idle Rate
4 wIndex 2 0000h Interface
6 wLength 2 0000h
And then the report descriptor
Get Descriptor
This request returns the specified descriptor if the descriptor exists.
Offset Field Size Value Description
0 bmRequestType 1 81h
4..0: Recipient ...00001 Interface
6..5: Type .00..... Standard
7: Direction 1....... Device-to-Host
1 bRequest 1 06h Get Descriptor
2 wValue.LowByte 1 00h
3 wValue.HiByte 1 22h Report Descriptor
4 wIndex 2 0000h Interface
6 wLength 2 006Fh Descriptor Length
Interface 0 HID Report Descriptor Vendor-Defined 1
Item Tag (Value) Raw Data
Usage Page (Vendor-Defined 161) 06 A0 FF
Usage (Vendor-Defined 1) 09 01
Collection (Application) A1 01
Usage (Vendor-Defined 3) 09 03
Logical Minimum (0) 15 00
Logical Maximum (255) 26 FF 00
Report Size (8) 75 08
Report Count (2) 95 02
Input (Data,Var,Abs,NWrp,Lin,Pref,NNul,Bit) 81 02
Usage (Vendor-Defined 4) 09 04
Logical Minimum (0) 15 00
Logical Maximum (255) 26 FF 00
Report Size (8) 75 08
Report Count (2) 95 02
Output (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) 91 02
Usage (Vendor-Defined 5) 09 05
Logical Minimum (0) 15 00
Logical Maximum (255) 26 FF 00
Report Size (8) 75 08
Report Count (2) 95 02
Feature (Data,Var,Abs,NWrp,Lin,Pref,NNul,NVol,Bit) B1 02
End Collection C0
The problem happens after this when the host appears to attempt to "start" the device, the promptly "removes" the device.
Any further thoughts would be appreciated....
thx
MikeH