I'm using hidapi for accessing a HID device (which is not a mouse or a keyboard). The oldest OS version to be supported is 10.6, I'm currently using Mac OX X 10.6.8. If my Mac OS X executable is running with normal user rights it can enumerate the devices, identify the device to be used by it's vendor and product ID and open it like this:
IOHIDDeviceRef os_dev = ...
IOReturn ret = IOHIDDeviceOpen(os_dev, kIOHIDOptionsTypeNone);
if (ret == kIOReturnSuccess) { ... } // here I get kIOReturnNotPrivileged for daemon
Actually the executable should run as daemon, but then IOHIDDeviceOpen
fails with kIOReturnNotPrivileged
. For Linux I circumvented a similar problem with a hotplug script fire by an udev rule and thus changed the rights for the newly connected (matching) devices.
I would like to stick to the daemon user. How can I achieve this?