Hi all,
I'm not sure how to work around an issue that I'm seeing on Linux. I have a library that will make use of a single piece of USB hardware. In order to talk with it, I'm using the HID API (
http://www.signal11.us/oss/hidapi/) which sits on top of libusb.
The hardware has multiple "channels" on it. Communication with the hardware is supposed to be done using bitfields. One doesn't open a handle to the individual "channels" but instead to the entire device. Instructing which channel performs whatever task is done through toggling the appropriate bits. The problem that I'm having is that each time a thread or process opens another handle to the hardware, the previous handle becomes unusable. In Windows this is accomplished by opening shared file handles. However, and I wished my Linux weren't so rusty, apparently shared file handles aren't done the same way (if at all) in Linux/UNIX.
What must I do in order to share access to this hardware across threads and processes (perhaps even share access within the same thread)?
Thanks,
Andy