def _find_interface(self, dev, setting): interfaces = find_interfaces(dev, bInterfaceClass=0xFE, bInterfaceSubClass=3) if not interfaces: raise InstrumentError('USB TMC interface not found.') elif len(interfaces) > 1: self.log_warning('More than one interface found, selecting first.') return interfaces[0]
def _find_interface(self, dev, setting): interfaces = find_interfaces(dev, bInterfaceClass=0xFE, bInterfaceSubClass=3) if not interfaces: raise errors.InstrumentError('USB TMC interface not found.') elif len(interfaces) > 1: self.log_warning('More than one interface found, selecting first.') return interfaces[0]
def is_usbtmc(dev): if custom_match and not custom_match(dev): return False return bool( find_interfaces(dev, bInterfaceClass=0xfe, bInterfaceSubClass=3))
def is_usbtmc(dev): if custom_match and not custom_match(dev): return False return bool(find_interfaces(dev, bInterfaceClass=0xfe, bInterfaceSubClass=3))