Hi Jan,
thank you for your reply. I am using your C# hid example and modified it to start a reading thread:
while (boRunWorker)
{
if ((fileStreamDeviceData.Read(inputReportBuffer, 0, inputReportBuffer.Length) > 0))
{
objArray[1] = inputReportBuffer; // set received data
BeginInvoke(updel, objArray);
}
Thread.Sleep(20); // switch between threads
}
Now I think it is working, I have changed the MainForm updating routine from a MethodInvoker call to an BeginInvoke delegate routine. Or would it be better to start reading only when the thread has received some data from the device and not calling Read in loops (using asynchronousread -> Beginread?)?
But I have also another problem to send multiple bytes to my device (STM32 Microcontroller). To prepare my device I'll have to send multiple small packages of 4 bytes. I have modified the send routine not to wait for an input report. Sending one after another package stopps after sending some reports (4 bytes) calling fileStreamDeviceData.Write(outputReportBuffer, 0, outputReportBuffer.Length); for the next package. Setting some breakpoints before sending a new report prevents the windows program from getting stuck. So i have added some Thread.Sleep(); calls but it doesn't work at all. I guess that the previous send process is not completed, but how could I check if this is the problem and how could I solve that.
Thank you
Dominik!