Send USB interrupt transfers from a WinUSB desktop app

I’m looking for a code to receive data from OSRfX2 in manner of interrupt transfer and continuously in 1ms intervals, Microsoft express this method with UWP, but I want to write in desktop App. Thank you in advance if share your experience.

??

Let me translate that into USB: You want to receive data that’s sent by the OSR USBFX2 device on the Interrupt IN Endpoint… and you expect that data to arrive in something like 1ms intervals.

Is that correct?

What do you plan to use as the driver (since you referenced “desktop App”? It’s the DRIVER that reads from Endpoints.

Or, use WinUsb… Call WinUSB_ReadPipe on the interrupt endpoint. I bet you could even send multiple of these reads asynchronously, using OVERLAPPED I/O.

1 Like

Remember that the responsibilities are distributed here. It is up to the DESCRIPTOR to determine the packet size and the transfer interval. The driver doesn’t have a say in that. The driver submits a buffer to be filled, and the host controller driver will submit read requests at the interval in the descriptors. You just have to make sure you submit enough requests that the queue never runs dry.

2 Likes

I apologize for asking my question badly.
I give an example, in the standard interface of the serial port in visual studio, we actually have a COM that sits between the serial port driver and our application.
In application we can put a (mySerialPort.DataReceived + = new SerialDataReceivedEventHandler (DataReceivedHandler):wink: call back event handler to fire as soon as it receives a character from our callback serial port and get the characters from the buffer. The question is, I do not know how that COM standard interface polls the serial driver? Does it create an endless loop to ReadRequest with the Windows API read method? And I really know that a ContinuoesRead mechanism is active in the driver and it consequently reads from the in endpoint and puts it in I/O Queue.

So, this is really a user-mode question? You’re asking about the C#/.NET class Serial.Io.Ports?

You’re asking about the C#/.NET class Serial.Io.Ports?

…the source code for which is on GitHub? So, you can, you know… just look it up?

1 Like

@“Peter_Viscarola_(OSR)”
Thanks