def refresh(self): """ Search for connected USB4Butia boards and open it """ devices_ports = [] devices = com_usb.find() for dev in devices: n = dev.get_address() if not (n == None): devices_ports.append(n) if not (n in self._b_ports): b = Baseboard(dev) try: b.open_baseboard() self._bb.append(b) self._b_ports.append(n) except Exception, err: self._debug('ERROR:usb4butia:refresh', err)
def create_all(self): b = Baseboard(None) listi = [ 'admin', 'pnp', 'port', 'ax', 'button', 'hackp', 'motors', 'butia', 'led' ] listi = listi + ['grey', 'light', 'res', 'volt', 'temp', 'distanc'] listi = listi + [ 'modActA', 'modActB', 'modActC', 'modSenA', 'modSenB', 'modSenC' ] for i, m in enumerate(listi): b.listi[i] = m hotplug = {2: 'modSenA', 4: 'grey', 5: 'distanc'} for m in hotplug: b.add_device( m, Device(b, hotplug[m], m, self._drivers_loaded[hotplug[m]])) openables = {0: 'admin', 7: 'pnp'} for m in openables: b.add_device( m, Device(b, openables[m], m, self._drivers_loaded[openables[m]], True)) self._bb.append(b)