mirror of
https://github.com/liberatedsystems/openCom-Companion.git
synced 2024-11-25 23:00:36 +01:00
Added RNode hotplug support on Android
This commit is contained in:
parent
085438e812
commit
1b5480a5ae
@ -946,11 +946,25 @@ class SidebandCore():
|
||||
|
||||
def _service_jobs(self):
|
||||
if self.is_service:
|
||||
last_usb_discovery = time.time()
|
||||
while True:
|
||||
time.sleep(SidebandCore.SERVICE_JOB_INTERVAL)
|
||||
now = time.time()
|
||||
if self.getstate("wants.announce"):
|
||||
self.lxmf_announce()
|
||||
|
||||
if (now - last_usb_discovery > 5):
|
||||
if self.interface_rnode != None and not self.interface_rnode.online:
|
||||
self.owner_app.discover_usb_devices()
|
||||
last_usb_discovery = time.time()
|
||||
|
||||
if hasattr(self.owner_app, "usb_devices") and self.owner_app.usb_devices != None:
|
||||
if len(self.owner_app.usb_devices) > 0:
|
||||
target_device = self.owner_app.usb_devices[0]
|
||||
if self.interface_rnode.port != target_device["port"]:
|
||||
RNS.log("Updating RNode device to "+str(target_device))
|
||||
self.interface_rnode.port = target_device["port"]
|
||||
|
||||
def _periodic_jobs(self):
|
||||
if self.is_service or self.is_standalone:
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user