diff --git a/ResourceManager.cpp b/ResourceManager.cpp index 5f383ee7..484465cf 100644 --- a/ResourceManager.cpp +++ b/ResourceManager.cpp @@ -358,6 +358,13 @@ void ResourceManager::Cleanup() delete bus; } + /*-------------------------------------------------*\ + | Cleanup HID interface | + \*-------------------------------------------------*/ + int hid_status = hid_exit(); + + LOG_DEBUG("Closing HID interfaces: %s", ((hid_status == 0) ? "Success" : "Failed")); + if(DetectDevicesThread) { DetectDevicesThread->join(); @@ -448,6 +455,13 @@ void ResourceManager::DetectDevicesThreadFunction() \*-------------------------------------------------*/ detector_settings = settings_manager->GetSettings("Detectors"); + /*-------------------------------------------------*\ + | Initialize HID interface for detection | + \*-------------------------------------------------*/ + int hid_status = hid_init(); + + LOG_NOTICE("Initializing HID interfaces: %s", ((hid_status == 0) ? "Success" : "Failed")); + /*-------------------------------------------------*\ | Check HID safe mode setting | \*-------------------------------------------------*/