Beispiel #1
0
 def __init__(self, cfg):
     self.iConfiguration = cfg.iConfiguration
     self.maxPower = cfg.bMaxPower << 2
     self.remoteWakeup = (cfg.bmAttributes >> 5) & 1
     self.selfPowered = (cfg.bmAttributes >> 6) & 1
     self.totalLength = cfg.wTotalLength
     self.value = cfg.bConfigurationValue
     self.interfaces = [
         list(g) for k, g in _interop._groupby(
             _interop._sorted([Interface(i) for i in cfg],
                              key=lambda i: i.interfaceNumber),
             lambda i: i.alternateSetting)
     ]
 def __init__(self, cfg):
     self.iConfiguration = cfg.iConfiguration
     self.maxPower = cfg.bMaxPower << 2
     self.remoteWakeup = (cfg.bmAttributes >> 5) & 1
     self.selfPowered = (cfg.bmAttributes >> 6) & 1
     self.totalLength = cfg.wTotalLength
     self.value = cfg.bConfigurationValue
     self.interfaces = [
         list(g)
         for k, g in _interop._groupby(
             _interop._sorted([Interface(i) for i in cfg], key=lambda i: i.interfaceNumber),
             lambda i: i.alternateSetting,
         )
     ]
Beispiel #3
0
def busses():
    r"""Return a tuple with the usb busses."""
    return (Bus(g) for k, g in _interop._groupby(
            _interop._sorted(core.find(find_all=True), key=lambda d: d.bus),
            lambda d: d.bus))
Beispiel #4
0
def busses():
    r"""Return a tuple with the usb busses."""
    return (Bus(g) for k, g in _interop._groupby(
            _interop._sorted(core.find(find_all=True), key=lambda d: d.bus),
            lambda d: d.bus))