@bitpoolos/edge-bacnet 1.6.6 → 1.6.8
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 +27 -0
- package/bacnet_client.js +230 -82
- package/bacnet_device.js +27 -0
- package/bacnet_gateway.html +82 -0
- package/bacnet_gateway.js +3 -1
- package/bacnet_write.html +2 -1
- package/common.js +8 -1
- package/package.json +4 -2
- package/resources/node-bacstack-ts/dist/lib/asn1.js +2 -2
- package/resources/node-bacstack-ts/dist/lib/client.js +198 -72
- package/resources/node-bacstack-ts/dist/lib/npdu.js +1 -1
- package/resources/style.css +7 -2
- package/treeBuilder.js +6 -0
package/bacnet_write.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
color: "#00aeef",
|
|
9
9
|
defaults: {
|
|
10
10
|
name: { value: "" },
|
|
11
|
-
applicationTag: { value: "
|
|
11
|
+
applicationTag: { value: "-1" },
|
|
12
12
|
priority: { value: "16" },
|
|
13
13
|
pointsToWrite: { value: [] },
|
|
14
14
|
writeDevices: { value: [] },
|
|
@@ -943,6 +943,7 @@
|
|
|
943
943
|
><i class="icon-tag"></i><span data-i18n="bitpool-bacnet.label.applicationTag"></span> Application Tag</label
|
|
944
944
|
>
|
|
945
945
|
<select id="node-input-applicationTag">
|
|
946
|
+
<option value="-1">AUTO</option>
|
|
946
947
|
<option value="0">NULL</option>
|
|
947
948
|
<option value="1">BOOLEAN</option>
|
|
948
949
|
<option value="2">UNSIGNED_INT</option>
|
package/common.js
CHANGED
|
@@ -67,7 +67,8 @@ class BacnetClientConfig {
|
|
|
67
67
|
cacheFileEnabled,
|
|
68
68
|
sanitise_device_schedule,
|
|
69
69
|
portRangeMatrix,
|
|
70
|
-
enable_device_discovery
|
|
70
|
+
enable_device_discovery,
|
|
71
|
+
maxConcurrentRequests
|
|
71
72
|
) {
|
|
72
73
|
this.apduTimeout = apduTimeout;
|
|
73
74
|
this.localIpAdrress = localIpAdrress;
|
|
@@ -87,6 +88,12 @@ class BacnetClientConfig {
|
|
|
87
88
|
this.sanitise_device_schedule = sanitise_device_schedule;
|
|
88
89
|
this.portRangeMatrix = this.generatePortRangeArray(portRangeMatrix);
|
|
89
90
|
this.enable_device_discovery = enable_device_discovery;
|
|
91
|
+
// Clamp maxConcurrentRequests between 1 and 250
|
|
92
|
+
// BACnet protocol limits invoke IDs to 256, so 250 is the safe maximum
|
|
93
|
+
let clampedMaxConcurrent = parseInt(maxConcurrentRequests) || 250;
|
|
94
|
+
if (clampedMaxConcurrent < 1) clampedMaxConcurrent = 1;
|
|
95
|
+
if (clampedMaxConcurrent > 250) clampedMaxConcurrent = 250;
|
|
96
|
+
this.maxConcurrentRequests = clampedMaxConcurrent;
|
|
90
97
|
}
|
|
91
98
|
|
|
92
99
|
generatePortRangeArray(rangeMatrix) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitpoolos/edge-bacnet",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.8",
|
|
4
4
|
"description": "A bacnet gateway for node-red",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@plus4nodered/ts-node-bacnet": "^1.0.0-beta.2",
|
|
@@ -26,13 +26,15 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
|
+
"BACnet",
|
|
29
30
|
"node-red",
|
|
30
31
|
"bitpool",
|
|
31
32
|
"bitpoolos",
|
|
32
33
|
"edge",
|
|
33
34
|
"big data",
|
|
34
35
|
"iot",
|
|
35
|
-
"
|
|
36
|
+
"building automation",
|
|
37
|
+
"bms"
|
|
36
38
|
],
|
|
37
39
|
"engines": {
|
|
38
40
|
"node": ">=12.0.0"
|
|
@@ -73,7 +73,7 @@ const encodeBacnetDouble = (buffer, value) => {
|
|
|
73
73
|
};
|
|
74
74
|
const decodeUnsigned = (buffer, offset, length) => ({
|
|
75
75
|
len: length,
|
|
76
|
-
value: buffer.readUIntBE(offset, length)
|
|
76
|
+
value: length === 0 ? 0 : buffer.readUIntBE(offset, length)
|
|
77
77
|
});
|
|
78
78
|
exports.decodeUnsigned = decodeUnsigned;
|
|
79
79
|
const decodeEnumerated = (buffer, offset, lenValue) => {
|
|
@@ -815,7 +815,7 @@ const decodeReadAccessResult = (buffer, offset, apduLen) => {
|
|
|
815
815
|
exports.decodeReadAccessResult = decodeReadAccessResult;
|
|
816
816
|
const decodeSigned = (buffer, offset, length) => ({
|
|
817
817
|
len: length,
|
|
818
|
-
value: buffer.readIntBE(offset, length)
|
|
818
|
+
value: length === 0 ? 0 : buffer.readIntBE(offset, length)
|
|
819
819
|
});
|
|
820
820
|
exports.decodeSigned = decodeSigned;
|
|
821
821
|
const decodeReal = (buffer, offset) => ({
|