-
Notifications
You must be signed in to change notification settings - Fork 97
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 #42 from Trakkasure/bugfix/fix-close-channel
- Loading branch information
Showing
9 changed files
with
509 additions
and
259 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,11 +1,11 @@ | ||
{ | ||
"sourceMaps": false, | ||
"presets": ['es2015','stage-1'] | ||
, "plugins": [ | ||
["transform-replace-object-assign", "simple-assign"] | ||
, "transform-dev-warning" | ||
, "add-module-exports" | ||
, "transform-decorators-legacy" | ||
, "transform-private-properties" | ||
] | ||
"presets": ['es2015','stage-1'] | ||
, "plugins": [ | ||
["transform-replace-object-assign", "simple-assign"] | ||
, "transform-dev-warning" | ||
, "add-module-exports" | ||
, "transform-decorators-legacy" | ||
, "transform-private-properties" | ||
] | ||
} |
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,23 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"no-const-assign": "warn", | ||
"no-this-before-super": "warn", | ||
"no-undef": "warn", | ||
"no-unreachable": "warn", | ||
"no-unused-vars": "warn", | ||
"constructor-super": "warn", | ||
"valid-typeof": "warn" | ||
} | ||
} |
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,32 @@ | ||
|
||
var MikroNode = require('../src'); | ||
// Create API instance to a host. | ||
var device = new MikroNode('10.10.10.10'); | ||
device.setDebug(MikroNode.DEBUG); | ||
|
||
// Connect to MikroTik device | ||
device.connect('admin','password').then(conn=>{ | ||
// When all channels are marked done, close the connection. | ||
console.log('connected'); | ||
|
||
conn.closeOnDone(true); | ||
|
||
var channel1=conn.openChannel(); | ||
channel1.closeOnDone(true); | ||
|
||
console.log('going write 1'); | ||
|
||
// get only a count of the addresses. | ||
channel1.write('/interface/set',{ | ||
'name':'ether1', | ||
'disabled': 'yes' | ||
}).then(data=>{ | ||
console.log("Done"); | ||
}).catch(error=>{ | ||
console.log("Error result ",error); | ||
}); | ||
console.log('Wrote'); | ||
} | ||
).catch(error=>{ | ||
console.log("Error logging in ",error); | ||
}); |
Oops, something went wrong.