USB2Driver fixes #1
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into the following two exceptions when trying to run 01-reset.py (having modified it to use USB2Driver). My changes allow the script to run - it still hangs indefinitely on antnode.start() but I assume that's unrelated.
Traceback (most recent call last):
File "01-reset.py", line 25, in
antnode.start()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/node.py", line 158, in start
self.driver.open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 61, in open
self._open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 194, in _open
alternate_setting = usb.control.get_interface(dev, interface_number)
AttributeError: 'module' object has no attribute 'control'
Traceback (most recent call last):
File "01-reset.py", line 25, in
antnode.start()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/node.py", line 158, in start
self.driver.open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 62, in open
self._open()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ant-develop-py2.7.egg/ant/core/driver.py", line 198, in _open
AlternateSetting = alternate_setting
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/util.py", line 176, in find_descriptor
return _interop._next(desc_iter(k, v))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/_interop.py", line 60, in _next
return next(iter)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/util.py", line 164, in desc_iter
map(lambda i: getattr(d, i), k)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/usb/util.py", line 164, in
map(lambda i: getattr(d, i), k)
AttributeError: 'Interface' object has no attribute 'AlternateSetting'