Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some example/skeleton code, might be syntax errors
- Loading branch information
Showing
2 changed files
with
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,29 @@ | ||
var wireless = require('wireless'); | ||
|
||
wireless.configure({ | ||
scan: 'cat examples/iwlist-wlan0-scan.txt', | ||
status: 'cat examples/iwconfig-wlan0.txt', | ||
}); | ||
|
||
wireless.on('appear', function(error, network) { | ||
if (error) { | ||
console.log("There was an error when a network appeared"); | ||
throw error; | ||
} | ||
console.log("New Network: " + network.ssid); | ||
} | ||
|
||
wireless.on('disappear', function(error, network) { | ||
if (error) { | ||
console.log("There was an error when a network disappeared"); | ||
throw error; | ||
} | ||
console.log("Bye Network: " + network.ssid); | ||
} | ||
|
||
wireless.start(function() { | ||
var ssid = wireless.list()[5]; | ||
wireless.join(ssid, null, function() { | ||
console.log("I've connected to the fifth network!"); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.