Author Topic: Question - HidD_SetNumInputBuffers  (Read 5105 times)

DavidClarke

  • Member
  • ***
  • Posts: 24
Question - HidD_SetNumInputBuffers
« on: May 26, 2019, 11:33:50 am »
Hi
I can't see any difference in my program if I set HidD_SetNumInputBuffers = 2 or 512.  The data in is only 17 bytes and I pickup the data very fast.  HidD_SetNumInputBuffers is where you set the max size of the circular receive buffer?  So in my case HidD_SetNumInputBuffers(2) is 2*17?  What is the per buffer byte capacity?

Similar question with the ReadFile ReadBuffer - I have tried 17 to 512 and see no difference.

I am thinking you might say - "If you don't check for inbound data (in reports) very frequently then you need a bigger HidD_SetNumInputBuffers setting.  AND if you need that you might benefit from having a bigger ReadFile ReadBuffer so you can grab more than 1 input report at a time."

If I have, let's say, 8 input reports in the circular buffer and I only call ReadFile with ReadBuffer = to 1 in report (17 bytes in my case) then I will need to call ReadFile 7 more times to empty the circular buffer?  OR call FlushBuffer to empty the buffer??

Is there a default value for the number of Hid NumInput Buffers?  If yes how does one find out what the value is?
« Last Edit: May 26, 2019, 11:47:13 am by DavidClarke »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Question - HidD_SetNumInputBuffers
« Reply #1 on: May 26, 2019, 11:58:06 am »
Yes - if you don't check for Input reports frequently, you may need a bigger HidD_SetNumInputBuffers setting.  AND if you need that, you MUST HAVE a bigger ReadFile ReadBuffer so you can grab more than 1 input report at a time.

Use HidD_GetNumInputBuffers to get the current value.

DavidClarke

  • Member
  • ***
  • Posts: 24
Re: Question - HidD_SetNumInputBuffers
« Reply #2 on: May 26, 2019, 01:11:14 pm »
Thanks!