@bitpoolos/edge-bacnet 1.2.8 → 1.3.1
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/CHANGELOG.md +105 -0
- package/README.md +23 -2
- package/bacnet_client.js +843 -803
- package/bacnet_device.js +132 -60
- package/bacnet_gateway.html +92 -76
- package/bacnet_gateway.js +161 -46
- package/bacnet_read.html +1048 -598
- package/bacnet_read.js +68 -84
- package/bacnet_server.js +270 -205
- package/bacnet_write.html +329 -24
- package/common.js +23 -5
- package/package.json +2 -2
- package/resources/bitArray.js +167 -0
- package/resources/node-bacstack-ts/dist/lib/asn1.js +16 -5
- package/resources/node-bacstack-ts/dist/lib/client.js +6 -7
- package/resources/style.css +321 -0
- package/treeBuilder.js +545 -0
package/bacnet_read.js
CHANGED
|
@@ -5,96 +5,80 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
module.exports = function (RED) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
const http = require("http");
|
|
9
|
+
const { ReadCommandConfig } = require('./common');
|
|
10
|
+
const baEnum = require('./resources/node-bacstack-ts/dist/index.js').enum;
|
|
11
|
+
|
|
12
|
+
function BitpoolBacnetReadDevice(config) {
|
|
13
|
+
RED.nodes.createNode(this, config);
|
|
14
|
+
var node = this;
|
|
15
|
+
|
|
16
|
+
this.json = config.json;
|
|
17
|
+
this.mqtt = config.mqtt;
|
|
18
|
+
this.roundDecimal = config.roundDecimal;
|
|
19
|
+
this.pointsToRead = config.pointsToRead;
|
|
20
|
+
this.readDevices = config.readDevices;
|
|
21
|
+
this.id = config.id;
|
|
22
|
+
this.nodeName = config.name;
|
|
23
|
+
|
|
24
|
+
this.object_property_simplePayload = config.object_property_simplePayload;
|
|
25
|
+
this.object_property_fullObject = config.object_property_fullObject;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
this.object_props = getObjectProps(this);
|
|
30
|
+
|
|
31
|
+
function getObjectProps(node) {
|
|
32
|
+
var propArr = [];
|
|
33
|
+
if (node.object_property_simplePayload == true) {
|
|
34
|
+
propArr.push({ id: baEnum.PropertyIdentifier.PRESENT_VALUE });
|
|
35
|
+
}
|
|
36
|
+
if (node.object_property_fullObject == true) {
|
|
37
|
+
propArr.push(
|
|
38
|
+
{ id: baEnum.PropertyIdentifier.PRESENT_VALUE },
|
|
39
|
+
{ id: baEnum.PropertyIdentifier.DESCRIPTION },
|
|
40
|
+
{ id: baEnum.PropertyIdentifier.STATUS_FLAGS },
|
|
41
|
+
{ id: baEnum.PropertyIdentifier.RELIABILITY },
|
|
42
|
+
{ id: baEnum.PropertyIdentifier.OUT_OF_SERVICE },
|
|
43
|
+
{ id: baEnum.PropertyIdentifier.UNITS }
|
|
44
|
+
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//add object name for every request as its used in formatting
|
|
49
|
+
propArr.push({ id: baEnum.PropertyIdentifier.OBJECT_NAME });
|
|
50
|
+
|
|
51
|
+
return propArr;
|
|
52
|
+
};
|
|
30
53
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
node.on('input', function (msg) {
|
|
55
|
+
node.status({ fill: "blue", shape: "dot", text: "Reading values" });
|
|
56
|
+
|
|
57
|
+
let readConfig = new ReadCommandConfig(node.pointsToRead, node.object_props, node.roundDecimal);
|
|
58
|
+
let output = {
|
|
59
|
+
type: "Read",
|
|
60
|
+
id: node.id,
|
|
61
|
+
readNodeName: node.nodeName,
|
|
62
|
+
options: readConfig,
|
|
63
|
+
objectPropertyType: {
|
|
64
|
+
simplePayload: node.object_property_simplePayload,
|
|
65
|
+
fullObject: node.object_property_fullObject
|
|
66
|
+
},
|
|
67
|
+
outputType: {
|
|
68
|
+
json: node.json,
|
|
69
|
+
mqtt: node.mqtt
|
|
46
70
|
}
|
|
47
|
-
|
|
48
|
-
//add object name for every request as its used in formatting
|
|
49
|
-
propArr.push({ id: baEnum.PropertyIdentifier.OBJECT_NAME});
|
|
50
|
-
|
|
51
|
-
return propArr;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
//send point list status for device priority queue
|
|
55
|
-
let headers = {
|
|
56
|
-
'Content-Type' : "application/json"
|
|
57
71
|
};
|
|
58
72
|
|
|
59
|
-
|
|
60
|
-
rejectUnauthorized: false
|
|
61
|
-
});
|
|
73
|
+
node.send(output);
|
|
62
74
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
75
|
+
setTimeout(() => {
|
|
76
|
+
node.status({});
|
|
77
|
+
}, 3000);
|
|
67
78
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
node.on('input', function(msg) {
|
|
71
|
-
node.status({ fill: "blue", shape: "dot", text: "Reading values" });
|
|
72
|
-
|
|
73
|
-
let readConfig = new ReadCommandConfig(node.pointsToRead, node.object_props, node.roundDecimal);
|
|
74
|
-
let output = {
|
|
75
|
-
type: "Read",
|
|
76
|
-
id: node.id,
|
|
77
|
-
readNodeName: node.nodeName,
|
|
78
|
-
options: readConfig,
|
|
79
|
-
objectPropertyType: {
|
|
80
|
-
simplePayload: node.object_property_simplePayload,
|
|
81
|
-
fullObject: node.object_property_fullObject
|
|
82
|
-
},
|
|
83
|
-
outputType: {
|
|
84
|
-
json: node.json,
|
|
85
|
-
mqtt: node.mqtt
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
node.send(output);
|
|
90
|
-
|
|
91
|
-
setTimeout(() => {
|
|
92
|
-
node.status({});
|
|
93
|
-
}, 3000);
|
|
94
|
-
|
|
95
|
-
});
|
|
79
|
+
});
|
|
96
80
|
|
|
97
|
-
|
|
81
|
+
};
|
|
98
82
|
|
|
99
|
-
|
|
83
|
+
RED.nodes.registerType('Bacnet-Discovery', BitpoolBacnetReadDevice);
|
|
100
84
|
};
|