After the manually created READ request is sent to the target device, the data obtained remains unchanged

32 Views Asked by At

I am still working on developing a USB HID filter driver (gamepad) using the **WDF **framework. In this filter driver, I have created a queue of type **WDF_IO_QUEUE_DISPATCH_TYPE **with **WdfIoQueueDispatchParallel **dispatching and implemented the dispatch function EvtIoRead. Additionally, I have created a timer that sends a Read request to the target device every 30ms. Before sending the request, I have set the completion routine for the request, which saves the data from the Read buffer to a local buffer (referred to as 'MyBuffer').

Now, I conducted an experiment:

If I copy the data from MyBuffer to the output buffer of the request in EvtIoRead, and then complete the request, I noticed that regardless of how I rotate the X-axis of the device, the data in **MyBuffer **remains unchanged (as observed in the output). I modified the source code again so that **EvtIoRead **forwards the data without any processing. With this modification, when I rotate the X-axis of the device, the data in **MyBuffer **changes, and the output values are correct. I'm not sure if my modification in the first scenario complies with the specifications. Furthermore, using the first approach results in an increased frequency of receiving Read requests, which even caused lag in the virtual machine. Is it necessary to add a delay in this case?

I hope to get the correct output data in the first way, or the reasons why the first way is not possible and the solution

0

There are 0 best solutions below