PORTS Forum
Ports and Interfaces => USB => Topic started by: coolsunny on July 11, 2013, 03:49:56 pm
-
I have a small windows application which runs fine on Windows 7 but having issues with WIN XP SP2. This application is a very basic one which keeps writing and reading packets continuously on HID channel.
I do see some issues with signal11 hid api on win xp and none of them resolved my issue.
http://github.com/signal11/hidapi .
After a minute or so, my application fails to read() and it fails to re-open.
The "res" and "bytes_read" are zero whenever it fails (int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds)
res = GetOverlappedResult(dev->device_handle, &dev->read_ol, &bytes_read, TRUE/*wait*/);
And ideally it should never call GetOverlappedResult() as it waits on waitobject. Also i do have some other third party softwares, which monitors these devices. Not sure how HID API (signal11) works in those situations.
Any thoughts are appreciated.
-
A protocol analyzer would show what is happening on the bus.
If Windows stops attempting to communicate, it likely tried three times and failed to get a valid response. The IN endpoint should return NAK or data on each received IN packet.
Use GetLastError and FormatMessage to find the error message for GetOverlappedResult.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms679360%28v=vs.85%29.aspx
-
I get "device disconnected" and debugging into the issue why it is disconnected.
-
Hi,
Did you ever figure out what was going on with this? I'm seeing a similar issue.
Thanks,
Scott