Can the I2C touch device on windows 8 receive command through HidD_Set RRS feed

  • Question

  • From Windows 8, it starts to support i2c hid device by hidi2c.sys driver.

    With our company's touch screen by i2c bus, I did the same procedure to send vendor command, just like hid-usb device.

    The ReportID value is coming from cap structure. Those commands are success and get the correct hid associated information. 

    So the Write report id is coming from correct procedure.  

    if(HidD_GetPreparsedData(hHidDev, &pPreData) == FALSE) {

    DBGPRINT("[TPAPI] HidD_GetPreparsedData fail !!");

    goto ReleaseAllResource;


    if(HidP_GetCaps(pPreData, &cap) != HIDP_STATUS_SUCCESS) {

    DBGPRINT("[TPAPI] HidP_GetCaps fail !!");

    goto ReleaseAllResource;


    I try WriteFile with 1st byte  = Report ID, it always get a error code 87 "ERROR_INVALID_PARAMETER"

    if ( WriteFile(hHidDev, SendBuf, OutputReportByteLength, &nWriteByte, 0) == FALSE) {

    dwErrCode = GetLastError();

    DBGPRINT("WriteFile Fail! ErrCode = %d", dwErrCode);


    else {

    DBGPRINT("WriteFile Success.");


    Is there any sample code to control I2C HID device?


    Caro Lin 

    • Edited by caro-lin Thursday, October 25, 2012 1:16 AM
    Wednesday, October 24, 2012 1:03 PM

All replies

  • It shouldn't matter if its HID-I2C or HID-USB as far as the WriteFile is concerned. Did you make sure that you have the same report descriptor in both cases ?
    Friday, October 26, 2012 11:49 PM