-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implemented more BACNET functions
- Loading branch information
Showing
13 changed files
with
335 additions
and
30 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,16 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - addListElement integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.addListElement('127.0.0.1', {type: 19, instance: 101}, {propertyIdentifier: 80, propertyArrayIndex: 0}, [ | ||
{type: 1, value: true} | ||
], function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,16 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - createObject integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.createObject('127.0.0.1', {type: 2, instance: 300}, [ | ||
{property: {propertyIdentifier: 85, propertyArrayIndex: 1}, value: [{type: 1, value: true}]} | ||
], function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,14 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - deleteObject integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.deleteObject('127.0.0.1', {type: 2, instance: 15}, function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,14 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - readFile integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.readFile('127.0.0.1', {type: 10, instance: 100}, 0, 100, function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,14 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - readRange integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.readRange('127.0.0.1', {type: 20, instance: 0}, 0, 200, function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,16 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - removeListElement integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.removeListElement('127.0.0.1', {type: 19, instance: 100}, {propertyIdentifier: 80, propertyArrayIndex: 0}, [ | ||
{type: 1, value: true} | ||
], function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,14 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - subscribeCOV integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.subscribeCOV('127.0.0.1', {type: 5, instance: 3}, 7, false, false, 0, function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,14 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - subscribeProperty integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.subscribeProperty('127.0.0.1', {type: 5, instance: 33}, {propertyIdentifier: 80, propertyArrayIndex: 0}, 8, false, false, function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
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,14 @@ | ||
var expect = require('chai').expect; | ||
var utils = require('./utils'); | ||
|
||
describe('bacstack - writeFile integration', function() { | ||
it('should return a timeout error if no device is available', function(next) { | ||
var client = new utils.bacnetClient({adpuTimeout: 200}); | ||
client.writeFile('127.0.0.1', {type: 10, instance: 2}, 0, 4, [5, 6, 7 , 8], function(err, value) { | ||
expect(err).to.eql(new Error('ERR_TIMEOUT')); | ||
expect(value).to.eql(undefined); | ||
client.close(); | ||
next(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.