locked
HidD_SetFeature and HidD_GetFeature returning failure for my HID Keyboard device? RRS feed

  • Question

  • Hello Everyone,

    I am developing an HID Keyboard to Turn ON/OFF the LED's in C++ and able to use Initialize, get the complete list of HID devices available and open the device with VID&PID using the HID windows Api's.

    I am trying to write the bit to turn on the LED using WriteFile API for the same device handle opened. But i am not able to write to the keyboard HID device and returning failure always.

    Also the HidD_GetFeature and HidD_SetFeature are failing.

    Flow i followed

    1. Initialize

    2. get list of HID devices  connected

    3. open Keyboard HID device

    (Failing from here)

    4. Set Feature report 

    5. get feature report

    6. write bit to LED

    i am developing in Windows 764bit macine, also i see Usage ID: 0x80, UsagePage: 0x01 while debugging.

    Can Anyone please help how can i set the bit to LED. Thanks in Advance..

    Note: The LED set is differernt Set. They are not (Capslock, numlock, scrolllock)

    --Ravi Raj Nukala


    Regards, Ravi Raj Nukala

    Saturday, September 24, 2016 6:01 AM

Answers

  • As I already told you, you can't access the keyboard this way from user mode. The kernel drivers prevent it. You need to split out the LEDs into a new top level collection in your hid descriptor

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Saturday, September 24, 2016 5:00 PM