Skip to content

Commit

Permalink
Add script that find mass storage devices on a computer
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed May 18, 2015
1 parent 5d419f7 commit b2447d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions playground/README.md
@@ -0,0 +1 @@
This directory contains files that may of may not be used in the project
16 changes: 16 additions & 0 deletions 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)

0 comments on commit b2447d9

Please sign in to comment.