forked from zigbeer/cc-znp
-
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.
* setup eslint * update travis scripts * fix typo
- Loading branch information
Showing
10 changed files
with
688 additions
and
563 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "open-zigbee" | ||
} |
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,4 +1,8 @@ | ||
language: node_js | ||
|
||
node_js: | ||
- "lts/*" | ||
- "lts/*" | ||
|
||
script: | ||
- npm test | ||
- npm run lint |
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,34 +1,29 @@ | ||
var ccznp = require('../index.js'); | ||
const ccznp = require('../index.js'); | ||
|
||
var spCfg = { | ||
path: "/dev/ttyUSB0", | ||
const spCfg = { | ||
path: '/dev/ttyUSB0', | ||
options: { | ||
baudrate: 115200, | ||
rtscts: true | ||
} | ||
rtscts: true, | ||
}, | ||
}; | ||
|
||
ccznp.on('ready', function () { | ||
ccznp.sysRequest('ping', {}, function (err, result) { | ||
if (err) | ||
console.log(err); | ||
else | ||
console.log(result); | ||
ccznp.on('ready', function() { | ||
ccznp.sysRequest('ping', {}, function(err, result) { | ||
if (err) console.log(err); | ||
else console.log(result); | ||
}); | ||
|
||
ccznp.sysRequest('version', {}, function (err, result) { | ||
if (err) | ||
console.log(err); | ||
else | ||
console.log(result); | ||
ccznp.sysRequest('version', {}, function(err, result) { | ||
if (err) console.log(err); | ||
else console.log(result); | ||
}); | ||
}); | ||
|
||
ccznp.on('AREQ', function(result) { | ||
console.log(result); | ||
}); | ||
|
||
ccznp.init(spCfg, function (err) { | ||
if (err) | ||
console.log(err); | ||
}); | ||
ccznp.init(spCfg, function(err) { | ||
if (err) console.log(err); | ||
}); |
Oops, something went wrong.