I am new to USB usage in my application on Mac. When I log the result of IOHIDManagerOpen(x,y) function call on my application I get error code -536870201. I have found in the following post (Keystrokes are not blocked when using kIOHIDOptionsTypeSeizeDevice and are still passed to the OS) that -536870207 is translated to kIOReturnNotPrivileged. How can I translate my error code and understand the cause of an error?
Code that I am running:
manager = std::make_unique<CoreFoundationReference<IOHIDManagerRef>>(
IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone));
IOHIDManagerSetDeviceMatching(manager->Get(), nullptr);
IOHIDManagerRegisterDeviceMatchingCallback(
manager->Get(), &MacHidDeviceManager::OnDeviceMatched, this);
IOHIDManagerRegisterDeviceRemovalCallback(
manager->Get(), &MacHidDeviceManager::OnDeviceRemoved, this);
IOHIDManagerScheduleWithRunLoop(
manager->Get(), CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
auto ioResult = IOHIDManagerOpen(manager->Get(), kIOHIDOptionsTypeNone);
if (ioResult != kIOReturnSuccess) {
throw UsbInterfaceException("DeviceManager::DeviceManager", "Cannot open IO device manager, error: {}", ioResult);
}