Fix/macos hid open nonexclusive
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <hidapi_darwin.h>
|
||||
#endif
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -1353,6 +1357,15 @@ void DetectionManager::BackgroundHIDInit()
|
||||
|
||||
LOG_DEBUG("[%s] Initializing HID interfaces: %s", DETECTIONMANAGER, ((hid_status == 0) ? "Success" : "Failed"));
|
||||
|
||||
#ifdef __APPLE__
|
||||
/*-----------------------------------------------------*\
|
||||
| hidapi defaults macOS opens to exclusive (seize) |
|
||||
| mode: privileged, and a second open of a held device |
|
||||
| fails. Shared matches Linux and Windows. |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_darwin_set_open_exclusive(0);
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#ifdef __GLIBC__
|
||||
/*-----------------------------------------------------*\
|
||||
|
||||
Reference in New Issue
Block a user