Author Topic: SIGNAL11 HID read API failing on Windows XP  (Read 6970 times)

coolsunny

  • Member
  • ***
  • Posts: 14
SIGNAL11 HID read API failing on Windows XP
« 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.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: SIGNAL11 HID read API failing on Windows XP
« Reply #1 on: July 11, 2013, 09:10:16 pm »
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

coolsunny

  • Member
  • ***
  • Posts: 14
Re: SIGNAL11 HID read API failing on Windows XP
« Reply #2 on: July 12, 2013, 12:26:37 pm »
I get "device disconnected" and debugging into the issue why it is disconnected.

swt2c

  • Member
  • ***
  • Posts: 7
Re: SIGNAL11 HID read API failing on Windows XP
« Reply #3 on: December 09, 2013, 07:37:32 pm »
Hi,

Did you ever figure out what was going on with this?  I'm seeing a similar issue.

Thanks,
Scott