Author Topic: Precisions on signification of some Caps definitions  (Read 11696 times)

gbr

  • Member
  • ***
  • Posts: 23
Precisions on signification of some Caps definitions
« on: November 29, 2010, 06:27:23 am »
Hello Jan,
Could you please enlight me on the following

A/
From the HIDP_CAPS Structure

InputReportByteLength
Specifies the maximum size, in bytes, of all the input reports (including the report ID, if report IDs are used, which is prepended to the report data).

OutputReportByteLength
Specifies the maximum size, in bytes, of all the output reports (including the report ID, if report IDs are used, which is prepended to the report data).

FeatureReportByteLength
Specifies the maximum length, in bytes, of all the feature reports (including the report ID, if report IDs are used, which is prepended to the report data).

My question
Does it mean:
1/  that the specific buffer size MUST be equal to the SUM of all the reports sizes.    ?
2   that the specific buffer size MUST at least be equal to the LARGEST report size.  ?

I have used in the past a Buffer containing the SUM and addressed the pointers to the correct place in the buffer , but I only have used it for  INPuts .
 B/How

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Precisions on signification of some Caps definitions
« Reply #1 on: November 29, 2010, 10:00:15 am »
the specific buffer size MUST at least be equal to the LARGEST report size.

Jan

gbr

  • Member
  • ***
  • Posts: 23
Re: Precisions on signification of some Caps definitions
« Reply #2 on: November 29, 2010, 12:20:35 pm »
Thank you Jan ,that sorts out something.

Now I am trying to modify the VB6 program you kindly publish on your web site to send specific requests to my device (a joystick includng FFB(Joysick working but FFB is the big hurdle))
There are some 14 output reports in the descriptor + 3 feature reports
This will serve as an addition to my debugging tools.

If the Caps specify that the output  is 0x10 (the maximum lenght of report ID 1 (01 +15 data bytes)),
trying to send a report ID 2 with 6 bytes (ID +5 bytes,specified in the report descriptor)
It only works when I set  the amount of bytes to write  to 16 although the report only needs 6 bytes

The question is :
Is it normal ?
If it is the firmware can take care of that


I have a second question if I may?
Input report work well for ID 1 only it shows the different values of my axis and buttons pushed.
How can I request an INpUT report different than 01 from the VB tester?
or is it because of the firmware ?

Thank you for your help

gb




Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Precisions on signification of some Caps definitions
« Reply #3 on: November 29, 2010, 09:03:11 pm »
The host sends the report, not necessarily the entire buffer.

To specify which Input report you want, use control transfers. I don't remember offhand if my VB6 example supports using control transfers. My .NET examples do.

Jan

gbr

  • Member
  • ***
  • Posts: 23
Re: Precisions on signification of some Caps definitions
« Reply #4 on: November 30, 2010, 12:04:07 am »
Thank you very much Jan,it gives me a bit more focus to where I must concentrate.
I'll look into the example

gbr

  • Member
  • ***
  • Posts: 23
Re: Precisions on signification of some Caps definitions
« Reply #5 on: November 30, 2010, 12:03:31 pm »
Hello Jan,
An update...It could help somebody ...who knows

I did not find yet how to request a specific Report ID by the Host,BUT

Your WriteReport from the VB6 program does a perfect job of sending Reports to the device
Having set the Output report lenght to the size of the largest report
I then put in the prep buffer :
ID Number FIRST then the relevant bytes (the unwanted ones are discarded by the system)
The important thing is to let the sending of nb of bytes from the CAPS even if less are needed

I receive them in the device (right number of byte in the report)
(tested with HHD software)
So that is a step forward
Nxt is control request (IN by EP0) for wich I must find a function to implement

 Then features IN/OUT

gb 

gbr

  • Member
  • ***
  • Posts: 23
Re: Precisions on signification of some Caps definitions
« Reply #6 on: December 09, 2010, 03:08:32 pm »
Hello Jan,
I finally got to comunicate With IL2(flight sim) and am now able to receive the spring signal fonction of the speed of the aircraft.

Force feed back is barely talked about on the internet.It is difficult to unserstand

I had to modify the base program to be able to handle all requests.

All my positive results are due to your book on USB, your advises and your VB6 Host that I modified to be able to handle all requests from the host.
I also made some special tools for the job thanks again to your comprehensive documentation.
I thank you for all that.

Best regards
gb

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Precisions on signification of some Caps definitions
« Reply #7 on: December 09, 2010, 05:22:07 pm »
You're welcome! Good to hear you were successful.

Jan