Menu

#41 Endpoint 6 not functioning correctly

v2.2.8
open
nobody
None
5
2015-02-06
2013-07-17
No

I have an instrument that uses endpoints 1, 2, and 6. Endpoint 1 and 2 function perfectly but endpoint 6 has problems. It will not trigger an endpoint data received event. When using the endpoint read function it returns a time out exception and reports 0 bytes read, however the data from the endpoint has been moved into the buffer correctly.

Data from the instrument is split between end points 2 and 6 the first 2048 data bytes are on endpoint 6 and the remaining on endpoint 2

USB.EpAW = USB.Device.OpenEndpointWriter(WriteEndpointID.Ep01, EndpointType.Control);
USB.EpAR = USB.Device.OpenEndpointReader(ReadEndpointID.Ep01, 6000);
USB.EpBR = USB.Device.OpenEndpointReader(ReadEndpointID.Ep02, 6000);
USB.EpCR = USB.Device.OpenEndpointReader(ReadEndpointID.Ep06, 6000);

//Endpoint 2 works correctly - event driven
Application.DoEvents();
NT = DateTime.Now.TimeOfDay.TotalMilliseconds + UsbAll[0].ITime + MainForm.IV.ScanDelay;
while (NT - DateTime.Now.TimeOfDay.TotalMilliseconds > 0 && UsbAll[0].EpBCnt < 5632)
{
Application.DoEvents();
}
// Endpoint 6 will not trigger a data received event.
// EC returns time out exception. Bread = 0. UsbAll[0].EpCBuffer contains correct data from // endpoint 6.
EC = UsbAll[0].EpCR.Read(UsbAll[0].EpCBuffer, 1, out Bread);

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.