diff --git a/playground/README.md b/playground/README.md new file mode 100644 index 0000000..d8c0928 --- /dev/null +++ b/playground/README.md @@ -0,0 +1 @@ +This directory contains files that may of may not be used in the project diff --git a/playground/usb_lookup.py b/playground/usb_lookup.py new file mode 100644 index 0000000..76f14d7 --- /dev/null +++ b/playground/usb_lookup.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from usb.core import find +import usb.control + + +def is_mass_storage(dev): + import usb.util + for cfg in dev: + if usb.util.find_descriptor(cfg, bInterfaceClass=8) is not None: + return True + + +for mass in find(find_all=True, custom_match=is_mass_storage): + print(mass)