PORTS Forum

Ports and Interfaces => USB => Topic started by: AshAll on May 16, 2011, 07:43:59 pm

Title: How to avoid reading old report through HidD_GetInputReport
Post by: AshAll on May 16, 2011, 07:43:59 pm
Hello everybody,

When requesting a new report, HidD_GetInputReport keep getting the old report which is troublesome because some of my requsts are same repeated command, this causes my program to exit before really get things done first.

I feel this maybe a question that has been asked before, Please help!

Ashall
Title: Re: How to avoid reading old report through HidD_GetInputReport
Post by: Jan Axelson on May 16, 2011, 08:25:52 pm
Make the ReadFile buffer big enough to hold all available reports and discard the older ones.

Jan
Title: Re: How to avoid reading old report through HidD_GetInputReport
Post by: AshAll on May 16, 2011, 08:32:52 pm
Hi, Jan,

Thanks for comment.

I am not using ReadFile, but using HidD_SetOutputReport. I find HidD_SetOutputReport always can return successfully, but could hold the old data. I feel though this might be normal?

Thanks again!

Ashall
Title: Re: How to avoid reading old report through HidD_GetInputReport
Post by: Jan Axelson on May 17, 2011, 10:22:49 am
Yes, you'll get the oldest report first.

Jan