MCPcopy Create free account
hub / github.com/LabPy/lantz / __init__

Method __init__

lantz/drivers/legacy/usbtmc.py:120–134  ·  view source on GitHub ↗
(self, vendor=None, product=None, serial_number=None, **kwargs)

Source from the content-addressed store, hash-verified

118 find_devices = staticmethod(find_tmc_devices)
119
120 def __init__(self, vendor=None, product=None, serial_number=None, **kwargs):
121 super().__init__(vendor, product, serial_number, **kwargs)
122 self.usb_intr_in = find_endpoint(self.usb_intf, usb.ENDPOINT_IN, usb.ENDPOINT_TYPE_INTERRUPT)
123 self.log_debug('EP Address: intr={}'.format(self.usb_intr_in.bEndpointAddress))
124
125 self.usb_dev.reset()
126
127 time.sleep(0.01)
128
129 self._get_capabilities()
130
131 self._btag = 0
132
133 if not (self.usb_recv_ep and self.usb_send_ep):
134 raise InstrumentError("TMC device must have both Bulk-In and Bulk-out endpoints.")
135
136 def _get_capabilities(self):
137 cap = self.usb_dev.ctrl_transfer(

Callers

nothing calls this directly

Calls 5

_get_capabilitiesMethod · 0.95
find_endpointFunction · 0.90
InstrumentErrorClass · 0.90
log_debugMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected