@bitpoolos/edge-bacnet 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bacnet_client.js +650 -233
- package/bacnet_device.js +65 -16
- package/bacnet_gateway.html +242 -99
- package/bacnet_gateway.js +211 -27
- package/bacnet_object.js +1 -1
- package/bacnet_read.html +211 -133
- package/bacnet_read.js +24 -24
- package/bacnet_server.js +321 -0
- package/bacnet_write.html +24 -15
- package/bacnet_write.js +0 -2
- package/common.js +95 -9
- package/edge-bacnet-datastore.cfg +0 -0
- package/package.json +6 -4
- package/resources/confirmationservice.min.js +1 -0
- package/resources/confirmdialog.min.js +1 -0
- package/resources/fonts/primeicons.woff2 +0 -0
- package/resources/node-bacnet/CHANGELOG.md +481 -0
- package/resources/{bacstack → node-bacnet}/LICENSE.md +3 -1
- package/resources/node-bacnet/README.md +91 -0
- package/resources/node-bacnet/docs/Client.html +4422 -0
- package/resources/node-bacnet/docs/bacnet-icon-quad.png +0 -0
- package/resources/node-bacnet/docs/bacnet-icon-quad128.png +0 -0
- package/resources/node-bacnet/docs/bacnet-icon-quad64.png +0 -0
- package/resources/node-bacnet/docs/bacnet-icon-small.xcf +0 -0
- package/resources/node-bacnet/docs/bacnet-icon.xcf +0 -0
- package/resources/node-bacnet/docs/bacnet.html +7032 -0
- package/resources/node-bacnet/docs/client.js.html +1759 -0
- package/resources/node-bacnet/docs/enum.js.html +2530 -0
- package/resources/node-bacnet/docs/global.html +2068 -0
- package/resources/node-bacnet/docs/images/mocha-logo.svg +65 -0
- package/resources/node-bacnet/docs/index.html +283 -0
- package/resources/node-bacnet/docs/scripts/collapse.js +11 -0
- package/resources/node-bacnet/docs/scripts/jquery-3.1.1.min.js +4 -0
- package/resources/node-bacnet/docs/scripts/linenumber.js +26 -0
- package/resources/node-bacnet/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/resources/node-bacnet/docs/scripts/prettify/lang-css.js +2 -0
- package/resources/node-bacnet/docs/scripts/prettify/prettify.js +28 -0
- package/resources/node-bacnet/docs/scripts/search.js +47 -0
- package/resources/node-bacnet/docs/services_i-am.js.html +157 -0
- package/resources/node-bacnet/docs/services_time-sync.js.html +118 -0
- package/resources/node-bacnet/docs/services_who-is.js.html +138 -0
- package/resources/node-bacnet/docs/styles/jsdoc.css +683 -0
- package/resources/node-bacnet/docs/styles/prettify.css +82 -0
- package/resources/node-bacnet/examples/discover-devices.js +66 -0
- package/resources/node-bacnet/examples/read-device.js +510 -0
- package/resources/node-bacnet/examples/subscribe-cov.js +75 -0
- package/resources/{bacstack → node-bacnet}/index.js +3 -0
- package/resources/{bacstack → node-bacnet}/lib/apdu.js +56 -39
- package/resources/{bacstack → node-bacnet}/lib/asn1.js +550 -532
- package/resources/node-bacnet/lib/bvlc.js +90 -0
- package/resources/node-bacnet/lib/client.js +1695 -0
- package/resources/node-bacnet/lib/enum.js +2463 -0
- package/resources/node-bacnet/lib/npdu.js +123 -0
- package/resources/{bacstack → node-bacnet}/lib/services/add-list-element.js +12 -6
- package/resources/{bacstack → node-bacnet}/lib/services/alarm-acknowledge.js +3 -3
- package/resources/{bacstack → node-bacnet}/lib/services/alarm-summary.js +5 -4
- package/resources/{bacstack → node-bacnet}/lib/services/atomic-read-file.js +49 -26
- package/resources/{bacstack → node-bacnet}/lib/services/atomic-write-file.js +40 -23
- package/resources/{bacstack → node-bacnet}/lib/services/cov-notify.js +33 -17
- package/resources/{bacstack → node-bacnet}/lib/services/create-object.js +23 -13
- package/resources/{bacstack → node-bacnet}/lib/services/delete-object.js +7 -2
- package/resources/{bacstack → node-bacnet}/lib/services/device-communication-control.js +8 -3
- package/resources/{bacstack → node-bacnet}/lib/services/error.js +7 -0
- package/resources/{bacstack → node-bacnet}/lib/services/event-information.js +10 -9
- package/resources/{bacstack → node-bacnet}/lib/services/event-notify-data.js +38 -16
- package/resources/{bacstack → node-bacnet}/lib/services/get-enrollment-summary.js +24 -11
- package/resources/{bacstack → node-bacnet}/lib/services/get-event-information.js +28 -13
- package/resources/node-bacnet/lib/services/i-am.js +90 -0
- package/resources/{bacstack/lib/services/i-have-broadcast.js → node-bacnet/lib/services/i-have.js} +3 -2
- package/resources/{bacstack → node-bacnet}/lib/services/index.js +7 -4
- package/resources/{bacstack → node-bacnet}/lib/services/life-safety-operation.js +3 -2
- package/resources/{bacstack → node-bacnet}/lib/services/private-transfer.js +3 -2
- package/resources/{bacstack → node-bacnet}/lib/services/read-property-multiple.js +11 -6
- package/resources/{bacstack → node-bacnet}/lib/services/read-property.js +42 -24
- package/resources/{bacstack → node-bacnet}/lib/services/read-range.js +37 -27
- package/resources/node-bacnet/lib/services/register-foreign-device.js +18 -0
- package/resources/{bacstack → node-bacnet}/lib/services/reinitialize-device.js +9 -4
- package/resources/{bacstack → node-bacnet}/lib/services/subscribe-cov.js +9 -4
- package/resources/{bacstack → node-bacnet}/lib/services/subscribe-property.js +18 -8
- package/resources/{bacstack → node-bacnet}/lib/services/time-sync.js +28 -5
- package/resources/{bacstack → node-bacnet}/lib/services/who-has.js +3 -3
- package/resources/{bacstack → node-bacnet}/lib/services/who-is.js +42 -9
- package/resources/{bacstack → node-bacnet}/lib/services/write-property-multiple.js +33 -16
- package/resources/{bacstack → node-bacnet}/lib/services/write-property.js +23 -13
- package/resources/node-bacnet/lib/transport.js +82 -0
- package/resources/node-bacnet/package.json +92 -0
- package/resources/primeicons.css +90 -2
- package/resources/bacstack/.codeclimate.yml +0 -15
- package/resources/bacstack/.dockerignore +0 -5
- package/resources/bacstack/.editorconfig +0 -13
- package/resources/bacstack/.eslintrc.yml +0 -13
- package/resources/bacstack/.github/ISSUE_TEMPLATE.md +0 -26
- package/resources/bacstack/.github/PULL_REQUEST_TEMPLATE.md +0 -14
- package/resources/bacstack/.github/workflows/ci.yml +0 -39
- package/resources/bacstack/.jscsrc +0 -8
- package/resources/bacstack/.jshintrc +0 -50
- package/resources/bacstack/.travis.yml +0 -27
- package/resources/bacstack/CHANGELOG.md +0 -232
- package/resources/bacstack/CODE_OF_CONDUCT.md +0 -74
- package/resources/bacstack/CONTRIBUTING.md +0 -77
- package/resources/bacstack/Dockerfile +0 -15
- package/resources/bacstack/FAQ.md +0 -64
- package/resources/bacstack/README.md +0 -157
- package/resources/bacstack/docker-compose.yml +0 -9
- package/resources/bacstack/lib/adpu.js +0 -190
- package/resources/bacstack/lib/bvlc.js +0 -43
- package/resources/bacstack/lib/client.js +0 -1028
- package/resources/bacstack/lib/enum.js +0 -1314
- package/resources/bacstack/lib/npdu.js +0 -119
- package/resources/bacstack/lib/services/i-am-broadcast.js +0 -51
- package/resources/bacstack/lib/services.js +0 -1963
- package/resources/bacstack/lib/transport.js +0 -52
- package/resources/bacstack/package-lock.json +0 -7974
- package/resources/bacstack/package.json +0 -84
- package/resources/bacstack/test/compliance/who-is.spec.js +0 -37
- package/resources/bacstack/test/integration/acknowledge-alarm.spec.js +0 -14
- package/resources/bacstack/test/integration/add-list-element.spec.js +0 -16
- package/resources/bacstack/test/integration/confirmed-event-notification.spec.js +0 -30
- package/resources/bacstack/test/integration/confirmed-private-transfer.spec.js +0 -15
- package/resources/bacstack/test/integration/create-object.spec.js +0 -16
- package/resources/bacstack/test/integration/delete-object.spec.js +0 -14
- package/resources/bacstack/test/integration/device-communication-control.spec.js +0 -14
- package/resources/bacstack/test/integration/get-alarm-summary.spec.js +0 -14
- package/resources/bacstack/test/integration/get-enrollment-summary.spec.js +0 -15
- package/resources/bacstack/test/integration/get-event-information.spec.js +0 -14
- package/resources/bacstack/test/integration/read-file.spec.js +0 -14
- package/resources/bacstack/test/integration/read-property-multiple.spec.js +0 -110
- package/resources/bacstack/test/integration/read-property.spec.js +0 -14
- package/resources/bacstack/test/integration/read-range.spec.js +0 -14
- package/resources/bacstack/test/integration/reinitialize-sevice.spec.js +0 -14
- package/resources/bacstack/test/integration/remove-list-element.spec.js +0 -16
- package/resources/bacstack/test/integration/subscribe-cov.spec.js +0 -14
- package/resources/bacstack/test/integration/subscribe-property.spec.js +0 -14
- package/resources/bacstack/test/integration/time-sync-utc.spec.js +0 -10
- package/resources/bacstack/test/integration/time-sync.spec.js +0 -10
- package/resources/bacstack/test/integration/unconfirmed-event-notification.spec.js +0 -28
- package/resources/bacstack/test/integration/unconfirmed-private-transfer.spec.js +0 -11
- package/resources/bacstack/test/integration/utils.js +0 -30
- package/resources/bacstack/test/integration/who-is.spec.js +0 -17
- package/resources/bacstack/test/integration/write-file.spec.js +0 -14
- package/resources/bacstack/test/integration/write-property-multiple.spec.js +0 -19
- package/resources/bacstack/test/integration/write-property.spec.js +0 -14
- package/resources/bacstack/test/unit/apdu.spec.js +0 -162
- package/resources/bacstack/test/unit/asn1.spec.js +0 -39
- package/resources/bacstack/test/unit/bacnet-apdu.spec.js +0 -161
- package/resources/bacstack/test/unit/bacnet-asn1.spec.js +0 -32
- package/resources/bacstack/test/unit/bacnet-bvlc.spec.js +0 -57
- package/resources/bacstack/test/unit/bacnet-npdu.spec.js +0 -118
- package/resources/bacstack/test/unit/bacnet-services.spec.js +0 -2052
- package/resources/bacstack/test/unit/bvlc.spec.js +0 -58
- package/resources/bacstack/test/unit/npdu.spec.js +0 -119
- package/resources/bacstack/test/unit/service-add-list-element.spec.js +0 -24
- package/resources/bacstack/test/unit/service-alarm-acknowledge.spec.js +0 -71
- package/resources/bacstack/test/unit/service-alarm-summary.spec.js +0 -22
- package/resources/bacstack/test/unit/service-atomic-read-file.spec.js +0 -54
- package/resources/bacstack/test/unit/service-atomic-write-file.spec.js +0 -56
- package/resources/bacstack/test/unit/service-cov-notify.spec.js +0 -98
- package/resources/bacstack/test/unit/service-create-object.spec.js +0 -90
- package/resources/bacstack/test/unit/service-delete-object.spec.js +0 -17
- package/resources/bacstack/test/unit/service-device-communication-control.spec.js +0 -29
- package/resources/bacstack/test/unit/service-error.spec.js +0 -17
- package/resources/bacstack/test/unit/service-event-information.spec.js +0 -48
- package/resources/bacstack/test/unit/service-event-notify-data.spec.js +0 -310
- package/resources/bacstack/test/unit/service-get-enrollment-summary.spec.js +0 -45
- package/resources/bacstack/test/unit/service-get-event-information.spec.js +0 -62
- package/resources/bacstack/test/unit/service-i-am.spec.js +0 -19
- package/resources/bacstack/test/unit/service-i-have-broadcast.spec.js +0 -18
- package/resources/bacstack/test/unit/service-life-safety-operation.spec.js +0 -19
- package/resources/bacstack/test/unit/service-private-transfer.spec.js +0 -18
- package/resources/bacstack/test/unit/service-read-property-multiple.spec.js +0 -131
- package/resources/bacstack/test/unit/service-read-property.spec.js +0 -541
- package/resources/bacstack/test/unit/service-read-range.spec.js +0 -97
- package/resources/bacstack/test/unit/service-reinitialize-device.spec.js +0 -27
- package/resources/bacstack/test/unit/service-subscribe-cov.spec.js +0 -32
- package/resources/bacstack/test/unit/service-subscribe-property.spec.js +0 -50
- package/resources/bacstack/test/unit/service-time-sync.spec.js +0 -18
- package/resources/bacstack/test/unit/service-who-has.spec.js +0 -33
- package/resources/bacstack/test/unit/service-who-is.spec.js +0 -17
- package/resources/bacstack/test/unit/service-write-property-multiple.spec.js +0 -143
- package/resources/bacstack/test/unit/service-write-property.spec.js +0 -198
- package/resources/bacstack/test/unit/utils.js +0 -6
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_args": [
|
|
3
|
-
[
|
|
4
|
-
"bacstack@0.0.1-beta.13",
|
|
5
|
-
"C:\\Users\\akalabic\\Documents\\bitpool-bacnet-edge-gateway"
|
|
6
|
-
]
|
|
7
|
-
],
|
|
8
|
-
"_from": "bacstack@0.0.1-beta.13",
|
|
9
|
-
"_id": "bacstack@0.0.1-beta.13",
|
|
10
|
-
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512-jg1X/nZMEBGm2PL/HBmoBkjhE3FVabOp2XBkJm2Dj74VhxcZW2H5lSn9+JnhTf54HZyKC0kM6Ko3S9AsDPe8uQ==",
|
|
12
|
-
"_location": "/bacstack",
|
|
13
|
-
"_phantomChildren": {},
|
|
14
|
-
"_requested": {
|
|
15
|
-
"type": "version",
|
|
16
|
-
"registry": true,
|
|
17
|
-
"raw": "bacstack@0.0.1-beta.13",
|
|
18
|
-
"name": "bacstack",
|
|
19
|
-
"escapedName": "bacstack",
|
|
20
|
-
"rawSpec": "0.0.1-beta.13",
|
|
21
|
-
"saveSpec": null,
|
|
22
|
-
"fetchSpec": "0.0.1-beta.13"
|
|
23
|
-
},
|
|
24
|
-
"_requiredBy": [
|
|
25
|
-
"/"
|
|
26
|
-
],
|
|
27
|
-
"_resolved": "https://registry.npmjs.org/bacstack/-/bacstack-0.0.1-beta.13.tgz",
|
|
28
|
-
"_spec": "0.0.1-beta.13",
|
|
29
|
-
"_where": "C:\\Users\\akalabic\\Documents\\bitpool-bacnet-edge-gateway",
|
|
30
|
-
"author": {
|
|
31
|
-
"name": "Fabio Huser",
|
|
32
|
-
"email": "fabio@fh1.ch"
|
|
33
|
-
},
|
|
34
|
-
"bugs": {
|
|
35
|
-
"url": "https://github.com/fh1ch/node-bacstack/issues"
|
|
36
|
-
},
|
|
37
|
-
"commitlint": {
|
|
38
|
-
"extends": [
|
|
39
|
-
"@commitlint/config-conventional"
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"debug": "^3.1.0",
|
|
44
|
-
"iconv-lite": "^0.4.19"
|
|
45
|
-
},
|
|
46
|
-
"description": "A BACnet protocol stack written in pure JavaScript.",
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@commitlint/cli": "^5.2.5",
|
|
49
|
-
"@commitlint/config-conventional": "^5.2.3",
|
|
50
|
-
"@commitlint/travis-cli": "^5.2.5",
|
|
51
|
-
"chai": "^4.1.2",
|
|
52
|
-
"docdash": "^0.4.0",
|
|
53
|
-
"istanbul": "^0.4.5",
|
|
54
|
-
"jscs": "^3.0.7",
|
|
55
|
-
"jsdoc": "^3.5.5",
|
|
56
|
-
"jshint": "^2.9.5",
|
|
57
|
-
"mocha": "^4.0.1"
|
|
58
|
-
},
|
|
59
|
-
"engines": {
|
|
60
|
-
"node": ">= 0.12.0"
|
|
61
|
-
},
|
|
62
|
-
"homepage": "https://github.com/fh1ch/node-bacstack#readme",
|
|
63
|
-
"keywords": [
|
|
64
|
-
"bacnet",
|
|
65
|
-
"bacstack",
|
|
66
|
-
"building",
|
|
67
|
-
"automation"
|
|
68
|
-
],
|
|
69
|
-
"license": "MIT",
|
|
70
|
-
"main": "index.js",
|
|
71
|
-
"name": "bacstack",
|
|
72
|
-
"repository": {
|
|
73
|
-
"type": "git",
|
|
74
|
-
"url": "git+https://github.com/fh1ch/node-bacstack.git"
|
|
75
|
-
},
|
|
76
|
-
"scripts": {
|
|
77
|
-
"changelog": "commitlint --from=master",
|
|
78
|
-
"docs": "jsdoc -d ./docs -t node_modules/docdash ./lib ./index.js ./README.md",
|
|
79
|
-
"integration": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha -- test/integration/*.spec.js",
|
|
80
|
-
"lint": "jshint lib/ test/ index.js && jscs lib/ test/ index.js",
|
|
81
|
-
"test": "istanbul cover --dir reports/coverage node_modules/mocha/bin/_mocha -- test/unit/*.spec.js"
|
|
82
|
-
},
|
|
83
|
-
"version": "0.0.1-beta.13"
|
|
84
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const bacnet = require('../../');
|
|
4
|
-
|
|
5
|
-
describe('bacstack - whoIs compliance', () => {
|
|
6
|
-
let client;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => client = new bacnet({apduTimeout: 1000}));
|
|
9
|
-
afterEach(() => client.close());
|
|
10
|
-
|
|
11
|
-
it('should find the device simulator', (next) => {
|
|
12
|
-
client.on('iAm', (device) => {
|
|
13
|
-
expect(device.deviceId).toEqual(1234);
|
|
14
|
-
expect(device.maxApdu).toEqual(1476);
|
|
15
|
-
expect(device.segmentation).toEqual(bacnet.enum.Segmentation.NO_SEGMENTATION);
|
|
16
|
-
expect(device.vendorId).toEqual(260);
|
|
17
|
-
next();
|
|
18
|
-
});
|
|
19
|
-
client.whoIs();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should find the device simulator with provided min device ID', (next) => {
|
|
23
|
-
client.on('iAm', (device) => {
|
|
24
|
-
expect(device.deviceId).toEqual(1234);
|
|
25
|
-
next();
|
|
26
|
-
});
|
|
27
|
-
client.whoIs(1233);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it('should find the device simulator with provided min/max device ID and IP', (next) => {
|
|
31
|
-
client.on('iAm', (device) => {
|
|
32
|
-
expect(device.deviceId).toEqual(1234);
|
|
33
|
-
next();
|
|
34
|
-
});
|
|
35
|
-
client.whoIs(1233, 1235, 'bacnet-device');
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - acknowledgeAlarm integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.acknowledgeAlarm('127.0.0.1', {type: 2, instance: 3}, 2, 'Alarm Acknowledge Test', {value: new Date(), type: 2}, {value: new Date(), type: 2}, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - addListElement integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.addListElement('127.0.0.1', {type: 19, instance: 101}, {id: 80, index: 0}, [
|
|
8
|
-
{type: 1, value: true}
|
|
9
|
-
], function(err, value) {
|
|
10
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
11
|
-
expect(value).to.eql(undefined);
|
|
12
|
-
client.close();
|
|
13
|
-
next();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils');
|
|
4
|
-
|
|
5
|
-
describe('bacstack - confirmedEventNotification integration', () => {
|
|
6
|
-
it('should return a timeout error if no device is available', (next) => {
|
|
7
|
-
const client = new utils.bacnetClient({apduTimeout: 200});
|
|
8
|
-
const date = new Date();
|
|
9
|
-
date.setMilliseconds(880);
|
|
10
|
-
client.confirmedEventNotification('127.0.0.1', {
|
|
11
|
-
processId: 3,
|
|
12
|
-
initiatingObjectId: {},
|
|
13
|
-
eventObjectId: {},
|
|
14
|
-
timeStamp: {type: 2, value: date},
|
|
15
|
-
notificationClass: 9,
|
|
16
|
-
priority: 7,
|
|
17
|
-
eventType: 2,
|
|
18
|
-
messageText: 'Test1234$',
|
|
19
|
-
notifyType: 1,
|
|
20
|
-
changeOfValueTag: 0,
|
|
21
|
-
changeOfValueChangeValue: 90,
|
|
22
|
-
changeOfValueStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]}
|
|
23
|
-
}, (err, value) => {
|
|
24
|
-
expect(err.message).toEqual('ERR_TIMEOUT');
|
|
25
|
-
expect(value).toBeUndefined();
|
|
26
|
-
client.close();
|
|
27
|
-
next();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils');
|
|
4
|
-
|
|
5
|
-
describe('bacstack - confirmedPrivateTransfer integration', () => {
|
|
6
|
-
it('should return a timeout error if no device is available', (next) => {
|
|
7
|
-
const client = new utils.bacnetClient({apduTimeout: 200});
|
|
8
|
-
client.confirmedPrivateTransfer('127.0.0.1', 0, 8, [0x00, 0xaa, 0xfa, 0xb1, 0x00], (err, value) => {
|
|
9
|
-
expect(err.message).toEqual('ERR_TIMEOUT');
|
|
10
|
-
expect(value).toBeUndefined();
|
|
11
|
-
client.close();
|
|
12
|
-
next();
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - createObject integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.createObject('127.0.0.1', {type: 2, instance: 300}, [
|
|
8
|
-
{property: {id: 85, index: 1}, value: [{type: 1, value: true}]}
|
|
9
|
-
], function(err, value) {
|
|
10
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
11
|
-
expect(value).to.eql(undefined);
|
|
12
|
-
client.close();
|
|
13
|
-
next();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - deleteObject integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.deleteObject('127.0.0.1', {type: 2, instance: 15}, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - deviceCommunicationControl integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.deviceCommunicationControl('127.0.0.1', 60, 1, {password: 'Test1234'}, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - getAlarmSummary integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.getAlarmSummary('127.0.0.1', function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils');
|
|
4
|
-
|
|
5
|
-
describe('bacstack - getEnrollmentSummary integration', () => {
|
|
6
|
-
it('should return a timeout error if no device is available', (next) => {
|
|
7
|
-
const client = new utils.bacnetClient({apduTimeout: 200});
|
|
8
|
-
client.getEnrollmentSummary('127.0.0.1', 0, {notificationClassFilter: 5}, (err, value) => {
|
|
9
|
-
expect(err.message).toEqual('ERR_TIMEOUT');
|
|
10
|
-
expect(value).toBeUndefined();
|
|
11
|
-
client.close();
|
|
12
|
-
next();
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - getEventInformation integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.getEventInformation('127.0.0.1', {type: 5, instance: 33}, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - readFile integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.readFile('127.0.0.1', {type: 10, instance: 100}, 0, 100, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - readPropertyMultiple integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
var requestArray = [
|
|
8
|
-
{objectId: {type: 8, instance: 4194303}, properties: [{id: 8}]}
|
|
9
|
-
];
|
|
10
|
-
client.readPropertyMultiple('127.0.0.1', requestArray, function(err, value) {
|
|
11
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
12
|
-
expect(value).to.eql(undefined);
|
|
13
|
-
client.close();
|
|
14
|
-
next();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should successfully decode a structured view', function(next) {
|
|
19
|
-
var transport = utils.transportStub();
|
|
20
|
-
var client = utils.bacnetClient({transport: transport});
|
|
21
|
-
var data = Buffer.from('810a0109010030000e0c0740001f1e291c4e752900436f6c6c656374696f6e206f66206c69676874696e672070726573656e6365206465746563746f724f294b4ec40740001f4f294d4e7531005ac3a4686c657277656727466c6f6f72203427525365675456274c6774275073634f70274c6774507363446574436f6c4f294f4e911d4f29a84e751800372d42412d524453312d3034312d5342437631332e32304f29cf4e71004f29d04e91084f29d24e750c004c67745073634465745273750a00507363446574282a294f29d34e1c014000001c00c000004f2a13424e91004f2a134d4e91064f2a13a64e21004f2a13bd4e91004f2a13de4e8207808207004f2a13ee4e91294f1f', 'hex'); // jscs:ignore maximumLineLength
|
|
22
|
-
var requestArray = [
|
|
23
|
-
{objectId: {type: 8, instance: 4194303}, properties: [{id: 8}]}
|
|
24
|
-
];
|
|
25
|
-
client.readPropertyMultiple('127.0.0.1', requestArray, function(err, response) {
|
|
26
|
-
expect(err).to.equal(null);
|
|
27
|
-
var object = utils.propertyFormater(response.values[0].values);
|
|
28
|
-
expect(response.values[0].objectId).to.deep.equal({type: 29, instance: 31});
|
|
29
|
-
expect(object[28]).to.deep.equal([{value: 'Collection of lighting presence detector', type: 7, encoding: 0}]);
|
|
30
|
-
expect(object[75]).to.deep.equal([{value: {type: 29, instance: 31}, type: 12}]);
|
|
31
|
-
expect(object[77]).to.deep.equal([{value: 'Zählerweg\'Floor 4\'RSegTV\'Lgt\'PscOp\'LgtPscDetCol', type: 7, encoding: 0}]);
|
|
32
|
-
expect(object[79]).to.deep.equal([{value: 29, type: 9}]);
|
|
33
|
-
expect(object[168]).to.deep.equal([{value: '7-BA-RDS1-041-SBCv13.20', type: 7, encoding: 0}]);
|
|
34
|
-
expect(object[207]).to.deep.equal([{value: '', type: 7, encoding: 0}]);
|
|
35
|
-
expect(object[208]).to.deep.equal([{value: 8, type: 9}]);
|
|
36
|
-
expect(object[210]).to.deep.equal([
|
|
37
|
-
{value: 'LgtPscDetRs', type: 7, encoding: 0},
|
|
38
|
-
{value: 'PscDet(*)', type: 7, encoding: 0}
|
|
39
|
-
]);
|
|
40
|
-
expect(object[211]).to.deep.equal([
|
|
41
|
-
{value: {value: {type: 5, instance: 0}, type: 12}, type: 118},
|
|
42
|
-
{value: {value: {type: 3, instance: 0}, type: 12}, type: 118}
|
|
43
|
-
]);
|
|
44
|
-
expect(object[4930]).to.deep.equal([{value: 0, type: 9}]);
|
|
45
|
-
expect(object[4941]).to.deep.equal([{value: 6, type: 9}]);
|
|
46
|
-
expect(object[5030]).to.deep.equal([{value: 0, type: 2}]);
|
|
47
|
-
expect(object[5053]).to.deep.equal([{value: 0, type: 9}]);
|
|
48
|
-
expect(object[5086]).to.deep.equal([
|
|
49
|
-
{value: {value: [1], bitsUsed: 1}, type: 8},
|
|
50
|
-
{value: {value: [0], bitsUsed: 1}, type: 8}
|
|
51
|
-
]);
|
|
52
|
-
expect(object[5102]).to.deep.equal([{value: 41, type: 9}]);
|
|
53
|
-
client.close();
|
|
54
|
-
next();
|
|
55
|
-
});
|
|
56
|
-
transport.handler(data, '127.0.0.1');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should successfully decode a value object', function(next) {
|
|
60
|
-
var transport = utils.transportStub();
|
|
61
|
-
var client = utils.bacnetClient({transport: transport});
|
|
62
|
-
var data = Buffer.from('810a01eb010030000e0c04c0000a1e291c4e75070053656e736f724f29244e91004f294a4e21084f294b4ec404c0000a4f294d4e7525005ac3a4686c657277656727466c6f6f722034275253656754562753656e4465762753656e4f294f4e91134f29514e104f29554e21014f29674e91004f296e4e750c004f7065726174696f6e616c750f004465766963652073746f70706564751400446576696365206e6f742061737369676e6564750f00446576696365206d697373696e67751300436f6e6669677572696e6720646576696365750700556e75736564751f004d697373696e67206f722077726f6e6720636f6e66696775726174696f6e750a00536561726368696e674f296f4e8204004f29a84e751800372d42412d524453312d3032342d5342437631332e32304f2a13424e91004f2a134d4e91054f2a13884e91004f2a13894e91004f2a13af4e750800302e322e3234394f2a13df4e750e00355747313235382d32444231324f2a13e44e750b00504c2d313a444c3d313b4f2a13e64e21034f2a13ec4e750d003030303130303433656464634f2a13ed4e752d00504c3a4444543d303538362e303030312e30302e30312e30303b46573d302e312e31333b4d4f44453d504c3b4f2a13ee4e91184f2a13ef4e71004f2a13f04e91004f2a13f34e21014f1f', 'hex'); // jscs:ignore maximumLineLength
|
|
63
|
-
var requestArray = [
|
|
64
|
-
{objectId: {type: 8, instance: 4194303}, properties: [{id: 8}]}
|
|
65
|
-
];
|
|
66
|
-
client.readPropertyMultiple('127.0.0.1', requestArray, function(err, response) {
|
|
67
|
-
expect(err).to.equal(null);
|
|
68
|
-
expect(response.values[0].objectId).to.deep.equal({type: 19, instance: 10});
|
|
69
|
-
var object = utils.propertyFormater(response.values[0].values);
|
|
70
|
-
expect(object[28]).to.deep.equal([{value: 'Sensor', type: 7, encoding: 0}]);
|
|
71
|
-
expect(object[36]).to.deep.equal([{value: 0, type: 9}]);
|
|
72
|
-
expect(object[74]).to.deep.equal([{value: 8, type: 2}]);
|
|
73
|
-
expect(object[75]).to.deep.equal([{value: {type: 19, instance: 10}, type: 12}]);
|
|
74
|
-
expect(object[77]).to.deep.equal([{value: 'Zählerweg\'Floor 4\'RSegTV\'SenDev\'Sen', type: 7, encoding: 0}]);
|
|
75
|
-
expect(object[79]).to.deep.equal([{value: 19, type: 9}]);
|
|
76
|
-
expect(object[81]).to.deep.equal([{value: false, type: 1}]);
|
|
77
|
-
expect(object[85]).to.deep.equal([{value: 1, type: 2}]);
|
|
78
|
-
expect(object[103]).to.deep.equal([{value: 0, type: 9}]);
|
|
79
|
-
expect(object[110]).to.deep.equal([
|
|
80
|
-
{value: 'Operational', type: 7, encoding: 0},
|
|
81
|
-
{value: 'Device stopped', type: 7, encoding: 0},
|
|
82
|
-
{value: 'Device not assigned', type: 7, encoding: 0},
|
|
83
|
-
{value: 'Device missing', type: 7, encoding: 0},
|
|
84
|
-
{value: 'Configuring device', type: 7, encoding: 0},
|
|
85
|
-
{value: 'Unused', type: 7, encoding: 0},
|
|
86
|
-
{value: 'Missing or wrong configuration', type: 7, encoding: 0},
|
|
87
|
-
{value: 'Searching', type: 7, encoding: 0}
|
|
88
|
-
]);
|
|
89
|
-
expect(object[111]).to.deep.equal([{value: {value: [0], bitsUsed: 4}, type: 8}]);
|
|
90
|
-
expect(object[168]).to.deep.equal([{value: '7-BA-RDS1-024-SBCv13.20', type: 7, encoding: 0}]);
|
|
91
|
-
expect(object[4930]).to.deep.equal([{value: 0, type: 9}]);
|
|
92
|
-
expect(object[4941]).to.deep.equal([{value: 5, type: 9}]);
|
|
93
|
-
expect(object[5000]).to.deep.equal([{value: 0, type: 9}]);
|
|
94
|
-
expect(object[5001]).to.deep.equal([{value: 0, type: 9}]);
|
|
95
|
-
expect(object[5039]).to.deep.equal([{value: '0.2.249', type: 7, encoding: 0}]);
|
|
96
|
-
expect(object[5087]).to.deep.equal([{value: '5WG1258-2DB12', type: 7, encoding: 0}]);
|
|
97
|
-
expect(object[5092]).to.deep.equal([{value: 'PL-1:DL=1;', type: 7, encoding: 0}]);
|
|
98
|
-
expect(object[5094]).to.deep.equal([{value: 3, type: 2}]);
|
|
99
|
-
expect(object[5100]).to.deep.equal([{value: '00010043eddc', type: 7, encoding: 0}]);
|
|
100
|
-
expect(object[5101]).to.deep.equal([{value: 'PL:DDT=0586.0001.00.01.00;FW=0.1.13;MODE=PL;', type: 7, encoding: 0}]);
|
|
101
|
-
expect(object[5102]).to.deep.equal([{value: 24, type: 9}]);
|
|
102
|
-
expect(object[5103]).to.deep.equal([{value: '', type: 7, encoding: 0}]);
|
|
103
|
-
expect(object[5104]).to.deep.equal([{value: 0, type: 9}]);
|
|
104
|
-
expect(object[5107]).to.deep.equal([{value: 1, type: 2}]);
|
|
105
|
-
client.close();
|
|
106
|
-
next();
|
|
107
|
-
});
|
|
108
|
-
transport.handler(data, '127.0.0.1');
|
|
109
|
-
});
|
|
110
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - readProperty integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.readProperty('127.0.0.1', {type: 8, instance: 44301}, 28, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - readRange integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.readRange('127.0.0.1', {type: 20, instance: 0}, 0, 200, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - reinitializeDevice integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.reinitializeDevice('127.0.0.1', 1, {password: 'Test1234'}, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - removeListElement integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.removeListElement('127.0.0.1', {type: 19, instance: 100}, {id: 80, index: 0}, [
|
|
8
|
-
{type: 1, value: true}
|
|
9
|
-
], function(err, value) {
|
|
10
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
11
|
-
expect(value).to.eql(undefined);
|
|
12
|
-
client.close();
|
|
13
|
-
next();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - subscribeCOV integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.subscribeCOV('127.0.0.1', {type: 5, instance: 3}, 7, false, false, 0, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - subscribeProperty integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.subscribeProperty('127.0.0.1', {type: 5, instance: 33}, {id: 80, index: 0}, 8, false, false, function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - timeSyncUTC integration', function() {
|
|
5
|
-
it('should send a time UTC sync package', function() {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.timeSyncUTC('127.0.0.1', new Date());
|
|
8
|
-
client.close();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - timeSync integration', function() {
|
|
5
|
-
it('should send a time sync package', function() {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.timeSync('127.0.0.1', new Date());
|
|
8
|
-
client.close();
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils');
|
|
4
|
-
|
|
5
|
-
describe('bacstack - unconfirmedEventNotification integration', () => {
|
|
6
|
-
it('should correctly send a telegram', () => {
|
|
7
|
-
const client = new utils.bacnetClient({apduTimeout: 200});
|
|
8
|
-
const date = new Date();
|
|
9
|
-
date.setMilliseconds(880);
|
|
10
|
-
client.unconfirmedEventNotification('127.0.0.1', {
|
|
11
|
-
processId: 3,
|
|
12
|
-
initiatingObjectId: {type: 60, instance: 12},
|
|
13
|
-
eventObjectId: {type: 61, instance: 1121},
|
|
14
|
-
timeStamp: {type: 2, value: date},
|
|
15
|
-
notificationClass: 9,
|
|
16
|
-
priority: 7,
|
|
17
|
-
eventType: 0,
|
|
18
|
-
messageText: 'Test1234$',
|
|
19
|
-
notifyType: 1,
|
|
20
|
-
ackRequired: true,
|
|
21
|
-
fromState: 5,
|
|
22
|
-
toState: 6,
|
|
23
|
-
changeOfBitstringReferencedBitString: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]},
|
|
24
|
-
changeOfBitstringStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]}
|
|
25
|
-
});
|
|
26
|
-
client.close();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const utils = require('./utils');
|
|
4
|
-
|
|
5
|
-
describe('bacstack - unconfirmedPrivateTransfer integration', () => {
|
|
6
|
-
it('should correctly send a telegram', () => {
|
|
7
|
-
const client = new utils.bacnetClient({apduTimeout: 200});
|
|
8
|
-
client.unconfirmedPrivateTransfer('127.0.0.1', 0, 7, [0x00, 0xaa, 0xfa, 0xb1, 0x00]);
|
|
9
|
-
client.close();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
var bacnet = require('../../');
|
|
2
|
-
|
|
3
|
-
module.exports.bacnetClient = bacnet;
|
|
4
|
-
|
|
5
|
-
module.exports.transportStub = function() {
|
|
6
|
-
var self = this;
|
|
7
|
-
self.handler = function() {};
|
|
8
|
-
self.setMessageHandler = function(handler) {
|
|
9
|
-
self.handler = handler;
|
|
10
|
-
};
|
|
11
|
-
self.setErrorHandler = function(handler) {};
|
|
12
|
-
self.getBroadcastAddress = function() {
|
|
13
|
-
return '255.255.255.255';
|
|
14
|
-
};
|
|
15
|
-
self.getMaxPayload = function() {
|
|
16
|
-
return 1482;
|
|
17
|
-
};
|
|
18
|
-
self.send = function() {};
|
|
19
|
-
self.open = function() {};
|
|
20
|
-
self.close = function() {};
|
|
21
|
-
return self;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
module.exports.propertyFormater = function(object) {
|
|
25
|
-
var converted = {};
|
|
26
|
-
object.forEach(function(property) {
|
|
27
|
-
converted[property.id] = property.value;
|
|
28
|
-
});
|
|
29
|
-
return converted;
|
|
30
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - whoIs integration', function() {
|
|
5
|
-
it('should not invoke a event if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.on('iAm', function(address, deviceId, maxAdpu, segmentation, vendorId) {
|
|
8
|
-
client.close();
|
|
9
|
-
next(new Error('Unallowed Callback'));
|
|
10
|
-
});
|
|
11
|
-
setTimeout(function() {
|
|
12
|
-
client.close();
|
|
13
|
-
next();
|
|
14
|
-
}, 300);
|
|
15
|
-
client.whoIs();
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var expect = require('chai').expect;
|
|
2
|
-
var utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
describe('bacstack - writeFile integration', function() {
|
|
5
|
-
it('should return a timeout error if no device is available', function(next) {
|
|
6
|
-
var client = new utils.bacnetClient({adpuTimeout: 200});
|
|
7
|
-
client.writeFile('127.0.0.1', {type: 10, instance: 2}, 0, 4, [5, 6, 7 , 8], function(err, value) {
|
|
8
|
-
expect(err.message).to.eql('ERR_TIMEOUT');
|
|
9
|
-
expect(value).to.eql(undefined);
|
|
10
|
-
client.close();
|
|
11
|
-
next();
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
});
|