disable device hotplug

This commit is contained in:
chrys 2018-05-13 21:46:51 +02:00
parent d0bdaea86e
commit c5e50b086b

View File

@ -54,10 +54,10 @@ class driver(inputDriver):
self.env['runtime']['debug'].writeDebugOut('InputDriver: ' + _evdevAvailableError,debug.debugLevel.ERROR) self.env['runtime']['debug'].writeDebugOut('InputDriver: ' + _evdevAvailableError,debug.debugLevel.ERROR)
return return
self.updateInputDevices() self.updateInputDevices()
if _udevAvailable: #if _udevAvailable:
self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev) # self.env['runtime']['processManager'].addCustomEventThread(self.plugInputDeviceWatchdogUdev)
else: #else:
self.env['runtime']['processManager'].addSimpleEventThread(fenrirEventType.PlugInputDevice, self.plugInputDeviceWatchdogTimer) # self.env['runtime']['processManager'].addSimpleEventThread(fenrirEventType.PlugInputDevice, self.plugInputDeviceWatchdogTimer)
self.env['runtime']['processManager'].addCustomEventThread(self.inputWatchdog) self.env['runtime']['processManager'].addCustomEventThread(self.inputWatchdog)
def plugInputDeviceWatchdogUdev(self,active , eventQueue): def plugInputDeviceWatchdogUdev(self,active , eventQueue):
context = pyudev.Context() context = pyudev.Context()
@ -67,8 +67,8 @@ class driver(inputDriver):
while active.value: while active.value:
devices = monitor.poll(2) devices = monitor.poll(2)
if devices: if devices:
while monitor.poll(0.2): while monitor.poll(0.1):
time.sleep(0.1) pass
eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None}) eventQueue.put({"Type":fenrirEventType.PlugInputDevice,"Data":None})
return time.time() return time.time()
def plugInputDeviceWatchdogTimer(self, active): def plugInputDeviceWatchdogTimer(self, active):