forked from giovortu/node-flashair-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Able to generate a working flashair ini file
- Loading branch information
Francois-Xavier Kowalski
committed
Mar 18, 2017
1 parent
5b28fde
commit ad20b83
Showing
8 changed files
with
187 additions
and
140 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,31 @@ | ||
#!/usr/bin/env node | ||
|
||
var FlashAir = require('../lib') | ||
var argv = require('minimist')(process.argv.slice(2)) | ||
var flashair = new FlashAir('flashair', 'IPT') | ||
try { | ||
if (argv._[0] === 'config') { | ||
var homeNet = { | ||
ssid: argv['home-ssid'], | ||
key: argv['home-key'] | ||
} | ||
var flashairNet = { | ||
ssid: argv['card-ssid'], | ||
key: argv['card-key'] | ||
} | ||
flashair.ini.runInPassThroughMode(homeNet, flashairNet).save() | ||
} else if (argv._[0] === 'ls') { | ||
flashair.command.getFileList(argv._[1] || '/', function (err, data) { | ||
if (err) { | ||
console.console.error(err) | ||
} else { | ||
console.log('data:', data) | ||
} | ||
}) | ||
} else { | ||
throw new Error('unknown cli command "' + argv._[0] + '"') | ||
} | ||
} catch (e) { | ||
console.error('***', e.toString()) | ||
process.exit(1) | ||
} |
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
Oops, something went wrong.