-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from DanAnkers/develop
USB2 Stick Driver
- Loading branch information
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
Interrogate stick for supported capabilities. | ||
""" | ||
|
||
import sys | ||
|
||
from ant.core import driver | ||
from ant.core import node | ||
|
||
from config import * | ||
|
||
# Initialize | ||
stick = driver.USB2Driver(SERIAL, log=LOG, debug=DEBUG) | ||
antnode = node.Node(stick) | ||
antnode.start() | ||
|
||
# Interrogate stick | ||
# Note: This method will return immediately, as the stick's capabilities are | ||
# interrogated on node initialization (node.start()) in order to set proper | ||
# internal Node instance state. | ||
capabilities = antnode.getCapabilities() | ||
|
||
print 'Maximum channels:', capabilities[0] | ||
print 'Maximum network keys:', capabilities[1] | ||
print 'Standard options: %X' % capabilities[2][0] | ||
print 'Advanced options: %X' % capabilities[2][1] | ||
|
||
# Shutdown | ||
antnode.stop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,7 @@ def read(fname): | |
install_requires=[ | ||
'distribute', | ||
'pyserial', | ||
'pyusb', | ||
'msgpack-python' | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters