Hello Everyone,
We are having a device which complies with USB HID class specification, which also has five endpoints to exchange datas with host.
To be frank, we are using florian C# hid lib for building the host application.
http://www.florian-leitner.de/index.php/2007/08/03/hid-usb-driver-library/. We are successful in enumeration and device connection but data loss is happening in the communication.
Let me explain you the scenario, device is programmed in such a way that it has to send the data packets of length 64 in bytes and the 1st byte of data packet contains information about the packet number[0-255] and the rest 63 bytes used for communication
payload. The device does the process of adding the packet number in the data packet and store them in to endpoints in serial fashion.
Now the same information has to be read in the host side. We are calling the Readfile API of kerner32.dll inorder to collect the data from the device. Here comes the challenges. The moment device connected to the PC it starts transmitting the data
packets to the PC. So, when we call the Readfile API there comes the packet shuffling.
Lets say we are reading from the Endpoint0 [EP0], the packet number may be 160 and next reading from EP1, the packet number was 161, from EP2 the paket number was 162, from EP3 the packet number was 163 but the EP4th reading gave us surprise.
It read 174th packet.
Its like 160,161,162,163,174 and next sequence can be 165,166,167,168,179.
But the same code without modification, reads sequentialy. Like 0,1,2,3,4 and next sequence was 5,6,7,8,9.
Can anyone tell us why this uncertainty and what could be approximate root cause for not getting read the packet number sequentialy?
Thanks and Regards,
Yashath
解决方案But the same code without modification, reads sequentialy. Like 0,1,2,3,4 and next sequence was 5,6,7,8,9.
What does it mean 'modification' ?? What did you modify in code ?