signal11 / hidapi

A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
http://www.signal11.us/oss/hidapi/
Other
2.47k stars 901 forks source link

multiple thread pick up cross talk? #345

Open ulao opened 7 years ago

ulao commented 7 years ago

I'm not sure how this is even possible but was wondering if there is a solution here. I have four threads running on 4 identical devices where the USB ID's are the only thing that is not the same.

when I do HidApi.hid_get_feature_report(DeviceHandle, buffer, (uint)length); It just pics any of the USB traffic not the one that was created in the handle.

I could add private ushort _VendorID, _ProductID; to my class and check it in the hid_get_feature_report response but I do not know how to get the ID from the handle? Can I cast it to a struck of some kind?

also Why is it picking up the cross talk? I though the HID feature requests send the PID/VID for verification?

signal11 commented 7 years ago

Which OS?

I've never seen anything like this before.

ulao commented 7 years ago

windows 7 pro, ill try to get more detail.

ulao commented 7 years ago

Double check and this is the case. Though you may never have seen this because most people will never have 4 devices the same name with changing IDs. I wonder if there is a bug? Is there a way to get the ID from the hid_get_feature_report response, this could be an easy fix.