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

Method _find_endpoints

lantz/drivers/legacy/usb.py:342–354  ·  view source on GitHub ↗
(self, interface, setting)

Source from the content-addressed store, hash-verified

340 return self.usb_dev.get_active_configuration()[self.INTERFACE]
341
342 def _find_endpoints(self, interface, setting):
343 recv, send = setting
344 if recv is None:
345 recv = find_endpoint(interface, usb.ENDPOINT_IN, usb.ENDPOINT_TYPE_BULK)
346 else:
347 recv = usb_find_desc(interface, bEndpointAddress=recv)
348
349 if send is None:
350 send = find_endpoint(interface, usb.ENDPOINT_OUT, usb.ENDPOINT_TYPE_BULK)
351 else:
352 send = usb_find_desc(interface, bEndpointAddress=send)
353
354 return recv, send
355
356 def send(self, data):
357 """Send raw bytes to the instrument.

Callers 1

__init__Method · 0.95

Calls 1

find_endpointFunction · 0.85

Tested by

no test coverage detected