-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d3d86f
commit 0180536
Showing
99 changed files
with
5,972 additions
and
1,527 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
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,56 @@ | ||
#!/usr/bin/python | ||
|
||
#============================ adjust path ===================================== | ||
|
||
import sys | ||
import os | ||
if __name__ == "__main__": | ||
here = sys.path[0] | ||
sys.path.insert(0, os.path.join(here, '..', '..','libs')) | ||
sys.path.insert(0, os.path.join(here, '..', '..','external_libs')) | ||
|
||
#============================ imports ========================================= | ||
|
||
# SmartMeshSDK | ||
from SmartMeshSDK import sdk_version | ||
from SmartMeshSDK.utils import SerialScanner | ||
|
||
# DustCli | ||
from dustCli import DustCli | ||
|
||
#============================ defines ========================================= | ||
|
||
#============================ classes ========================================= | ||
|
||
class FindManager(object): | ||
def __init__(self): | ||
self.serialScanner = SerialScanner.SerialScanner() | ||
self.serialScanner.availableManagerNotifier( | ||
cb = self._availablemanagers_cb, | ||
) | ||
def _availablemanagers_cb(self,serialport): | ||
print "manager available on port {0}".format(serialport) | ||
|
||
#============================ CLI handlers ==================================== | ||
|
||
def quit_clicb(): | ||
print "bye, bye!" | ||
sys.exit(0) | ||
|
||
#============================ main ============================================ | ||
|
||
def main(): | ||
|
||
# main app | ||
findManager = FindManager() | ||
|
||
# CLI interface | ||
cli = DustCli.DustCli( | ||
quit_cb = quit_clicb, | ||
versions = { | ||
'SmartMesh SDK': sdk_version.VERSION, | ||
}, | ||
) | ||
|
||
if __name__=='__main__': | ||
main() |
Oops, something went wrong.