xxxxx@prescott-instruments.com wrote:
What is the approach for bulk or interrupt if I go through that route.
I don’t understand what you’re asking. Have you looked at the USB
samples in the WDK? KMDF includes a continuous reader component for
bulk and interrupt pipes that does the work for you (see
WdfUsbTargetPipeConfigContinuousReader). You might even be able to use
UMDF for this.
Also, for knowledge sake, how will I deal this problem with isochronous.
What problem? The concept of a continuous reader is just about the same
for all three pipe types, except that isochronous URBs are formatted a
little differently.
Also, I thought that if I create a separate thread and send two URBs while I am waiting for the two URBs to be completed. I will prepare the next two URBs. And when the URBs gets completed then I will send the next two prepared URBs.
You do not need a separate thread. Create several URBs and submit them
all at once. In the completion routine, copy the data somewhere (a
circular buffer, maybe?) and resubmit the request again.
Even better, just use the KMDF continuous reader. It handles these
details for you.
Remember that USB is a scheduled bus – the host controller scheduled
the frame in advance, and submit it to the hardware as a batch. If you
do not have an empty request ready and waiting when the controller does
its scheduling, you will miss that frame.
Also, i have two applications which are running side by side. But need to get the same data from the usb driver. In other words, usb device data needs to be shared between applications. I can’t use COM server or any service application. Is it possible if I do it somehow at driver level.
Why can you not use a service application? That’s a much better
solution. NEVER do anything in kernel mode that does not absolutely
have to be in kernel mode. Just provide an interface DLL that hides all
of the internals, and have the applications use that DLL. That way, you
can change your mind partway through, and no one will know or care.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.