Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/silhouette.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ def usbscan(self):

def connect(self):
self.dev = self.usbscan()

# detach kernel driver if possible
if self.dev.is_kernel_driver_active(0):
try:
self.dev.detach_kernel_driver(0)
print "kernel driver detached"
except usb.core.USBError as e:
msg = "Could not detach kernel driver: %s" % str(e)
raise SilhouetteException, msg

self.dev.reset()

# set the active configuration. With no arguments, the first
Expand Down