GetReport and SetReport for HID?

Status
Not open for further replies.

Adriano

Member
Hi,
I am trying to make a HID device. I can send and receive a buffer array without problems with my teensy3 and a c++ program on windows.

Now I was trying to use the GetReport and SetReport (maybe also GetFeature and SetFeature, later). But I don't know if it is possible.

I changed the code in usb_desc.c:
Code:
#ifdef RAWHID_INTERFACE
static uint8_t rawhid_report_desc[] = {
        0x06, LSB(RAWHID_USAGE_PAGE), MSB(RAWHID_USAGE_PAGE),
        0x0A, LSB(RAWHID_USAGE), MSB(RAWHID_USAGE),
        0xA1, 0x01,                             // Collection 0x01
        0x75, 0x08,                             // report size = 8 bits
        0x15, 0x00,                             // logical minimum = 0
        0x26, 0xFF, 0x00,                       // logical maximum = 255
        0x95, RAWHID_TX_SIZE,                   // report count
        0x09, 0x01,                             // usage
        [B]0x85, 0x50,         // Report ID (50)[/B]
        0x81, 0x02,                             // Input (array)
        0x95, RAWHID_RX_SIZE,                   // report count
        0x09, 0x02,                             // usage
        [B]0x85, 0x51          // Report ID (51)[/B]
        0x91, 0x02,                             // Output (array)
        0xC0                                    // end collection
};
#endif

I can compile and execute it. But when I try to play around with SimpleHIDWrite (http://www.lvr.com/hidpage.htm), I can only write to the USB-device, not use the GetReport function.

If I try to get a report after setting the right report ID, I get this error:
0x1F: A device attached to the system is not functioning.
The same if I try to set a report on the right ID:
0x79: The semaphore timeout period has expired.

I don't need GetReport and SetReport, I can solve it sending and receiving the normal RAW-data. But if GetReport is supported, I could write the code with a more elegant solution :p

Thank you,
Adriano
 
Status
Not open for further replies.
Back
Top