Thanks, that did it, I also added error message checking.
FINAL PROGRAM
class DelcomUSBDevice(object):
'''
Class for talking to Delcom Products generation 2 USB device
902670/902770
the 16 GPIO device
'''
# Device Constants
VENDOR_ID = 0x0FC5#: Delcom Product
Ed,
what happens if you just catch the exception from your detach command?
Eg.
try:
self.handle.detachKernelDriver(0)
except usb.USBError, err:
print >> sys.stderr, err
Otherwise, if the kernel driver is already detached, you will not claim
the interface.
Regards,
-Thomas
When I first run my program everything is OK. That is I can detach the
kernel interface and then claim the interface and then release
the
interface.
TERMINAL OUTPUT
e...@ed-desktop:~/Desktop$ sudo ./DelcomUSBDevice.py
Found Delcom Device