def rebind_devices(self): with open('/sys/bus/usb/drivers_autoprobe', 'wt') as f_out: f_out.write("1") # If the flag_remain_seen is set then rebind all the still connected # devices that were connected during the usb-inhibit process if not self.flag_remain_seen: for dev in self.busID_key_map.keys(): print("Rebind devie: {}".format(dev)) usb_on.usb_enable(dev)
def bind_driver(self, bus_id, dev_id): print(self.connected_devices) if bus_id not in self.connected_devices.keys(): return False if self.connected_devices[bus_id][1] == dev_id: usb_on.usb_enable(bus_id) return True return False
def bind_driver(self, bus_id, dev_id): print (self.connected_devices) if bus_id not in self.connected_devices.keys(): return False if self.connected_devices[bus_id][1] == dev_id: usb_on.usb_enable(bus_id) return True return False