FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update endpoint selection · python-ivi/python-usbtmc@6e48498 · GitHub

This repository was archived by the owner on Feb 2, 2026. It is now read-only.
/ python-usbtmc Public archive

Commit 6e48498

Browse files
committed
Update endpoint selection
1 parent c68f1ec commit 6e48498

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎usbtmc/usbtmc.py‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,16 @@ def open(self):
310310

311311
# find endpoints
312312
for ep in self.iface:
313-
ep_at = ep.bmAttributes
314-
ep_dir = ep.bEndpointAddress & usb.ENDPOINT_DIR_MASK
315-
ep_type = ep_at & usb.ENDPOINT_TYPE_MASK
313+
ep_dir = usb.util.endpoint_direction(ep.bEndpointAddress)
314+
ep_type = usb.util.endpoint_type(ep.bmAttributes)
316315

317-
if (ep_type == usb.ENDPOINT_TYPE_BULK):
318-
if (ep_dir == usb.ENDPOINT_IN):
316+
if (ep_type == usb.util.ENDPOINT_TYPE_BULK):
317+
if (ep_dir == usb.util.ENDPOINT_IN):
319318
self.bulk_in_ep = ep
320-
elif (ep_dir == usb.ENDPOINT_OUT):
319+
elif (ep_dir == usb.util.ENDPOINT_OUT):
321320
self.bulk_out_ep = ep
322-
elif (ep_type == usb.ENDPOINT_TYPE_INTERRUPT):
323-
if (ep_dir == usb.ENDPOINT_IN):
321+
elif (ep_type == usb.util.ENDPOINT_TYPE_INTR):
322+
if (ep_dir == usb.util.ENDPOINT_IN):
324323
self.interrupt_in_ep = ep
325324

326325
if self.bulk_in_ep is None or self.bulk_out_ep is None:

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL