Tinkerforge/brickd — pull request #4 by tewdreyer (2012-08-07 12:40:35+00:00)
Title: libusb: getDeviceList(): skip any device that throws an error

hi guys..

i ran into another error thrown by libusb while running brickd. this time LIBUSB_ERROR_IO is thrown while a mobile phone is connected to the computer.

```
$> brickd nodaemon
2012-08-03 12:29:02 Could not enumerate USB devices
Traceback (most recent call last):
File "/project/azubi/tinkerforge/share/brickd/usb_notifier.py", line 72, in find_all_devices
for device in self.context.getDeviceList(True):
File "/project/azubi/tinkerforge/share/brickd/libusb/usb1.py", line 1494, in wrapper
return func(self, *args, **kw)
File "/project/azubi/tinkerforge/share/brickd/libusb/usb1.py", line 1573, in getDeviceList
device = USBDevice(self, libusb_device_p(device_p.contents))
File "/project/azubi/tinkerforge/share/brickd/libusb/usb1.py", line 1290, in __init__
raise libusb1.USBError(result)
USBError: LIBUSB_ERROR_IO [-1]
```

this patch extends the last implementation of getDeviceList() by catching all LIBUSB\_ERROR\_\* while instantiating the connected usb devices and skipping those that fail with an error.

please review that patch and perhaps integrate it.

best regards
tobi