Author Topic: control trasfers on xinput  (Read 3551 times)

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
control trasfers on xinput
« on: August 11, 2023, 06:20:22 pm »
I was wondering if anyone here knows if the xinput driver supports control transfers. This may sound vague but need to see if anyone out there can help before I go in to too much details.

history: I made a popular HID usb adapter that uses the control set / get transfers. I ended up going to a new chip and ported all my code over and added support for xinput ( vie a hard jumper).  I had to make a new descriptor for this and I'm not sure how to set up, or if it is even possible to use control transfers. I could open up another pipe as a pass-tru to the control transfer functions but I'd hope I could just  let the application support the device in the same way it did the hid. I'm not sure that will work.

by control transfers I referring specifically to HID_REQ_GetReport and HID_REQ_SetReport and how the descriptor will define what each set and get does.


for HI I have something like the below where "get pad data" is a function I can access from my application.

   0x09,0x01, // USAGE (Vendor Usage 1)
   0xa1, 0x01,                    // COLLECTION (Application)
   0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
   0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
   0x75, 0x08,                    //   REPORT_SIZE (8)
 
 
       //get pad data
      0x85, 0x10,                    //   REPORT_ID (16)
      0x95, 0x0D,                    //   REPORT_COUNT (13) one less then rid
      0x09, 0x00,                    //   USAGE (Undefined)
      0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)

can I do that in the ximput descriptor somehow so that the same Rid works with it?


more detail provide if requested of course.

« Last Edit: August 11, 2023, 06:28:26 pm by ulao »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research

ulao

  • Frequent Contributor
  • ****
  • Posts: 172
Re: control trasfers on xinput
« Reply #2 on: August 12, 2023, 11:05:35 am »
There is no doubt that xinput and hid are not the same, but control transfers are not specific to HID are they? the xinput uses the set get in the same way
XInputSetState function (xinput.h)
XInputGetState function (xinput.h)
I even use it in the same functions in my firmware. but I'm just not finding a definitive answer if the control transfers from application can reach xinput.


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: control trasfers on xinput
« Reply #3 on: August 12, 2023, 02:57:46 pm »
Control transfers aren't specific to HID, but the class-specific HID control transfers are specific to HID. That said, I don't know the answer to your question.