I am interfacing with a USB 2.0 device. When I read the data from the IN pipe the read takes 501ms to read < 4 bytes of data. Is this typical? Does anyone with good knowledge of the USB Host have an opinion as to if this is typical? I was expecting it be much faster.
Is there a way sink an event handler on the IN pipe so I do not have to poll it on an interval?
-AP
byte[] usbData = new byte[USB_Pipe_In.PipeEndpoint.wMaxPacketSize];
int count = 0;
//Read every USB_READ_INTERVAL
while (true)
{
Thread.Sleep(USB_READ_INTERVAL);
try
{
DateTime tis = DateTime.Now;
count = USB_Pipe_In.TransferData(usbData, 0, usbData.Length);
DateTime tie = DateTime.Now;
int diff = (tie - tis).Milliseconds;
Debug.Print("SPAN: " + diff.ToString());
}
catch (Exception ex)
{
Debug.Print(ex.Message + "\r\n" + ex.ToString());
}