@halsystems/red-bacnet 1.0.20 → 1.0.21

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 ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## [1.0.21]
4
+ ### Fixed
5
+ - Fixed discovering points failed when using BACnet router IP to ms/tp
6
+
7
+ ## [1.0.20]
8
+ ### Fixed
9
+ - Fixed failure to parse bacnet result with multiple property ids
@@ -1428,7 +1428,7 @@ class Client extends events_1.EventEmitter {
1428
1428
  if (receiver && receiver.forwardedFrom) {
1429
1429
  // Remote node address given, forward to BBMD
1430
1430
  baBvlc.encode(buffer.buffer, baEnum.BvlcResultPurpose.FORWARDED_NPDU, buffer.offset, receiver.forwardedFrom);
1431
- } else if (receiver && receiver.address) {
1431
+ } else if (receiver && receiver.address || (receiver && receiver.ip)) {
1432
1432
  // Specific address, unicast
1433
1433
  baBvlc.encode(buffer.buffer, baEnum.BvlcResultPurpose.ORIGINAL_UNICAST_NPDU, buffer.offset);
1434
1434
  } else {
@@ -1438,7 +1438,7 @@ class Client extends events_1.EventEmitter {
1438
1438
  this._transport.send(
1439
1439
  buffer.buffer,
1440
1440
  buffer.offset,
1441
- (receiver && receiver.address) || null
1441
+ (receiver && receiver.address) || (receiver && receiver.ip) || null
1442
1442
  );
1443
1443
  }
1444
1444
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halsystems/red-bacnet",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "NodeRED BACnet IP client",
5
5
  "email": "open_source@halsystems.com.au",
6
6
  "repository": {
@@ -1,32 +0,0 @@
1
- <script type="text/javascript">
2
- RED.nodes.registerType('play', {
3
- category: 'redbacnet',
4
- color: '#b5e6ff',
5
- defaults: {
6
- name: { value: "" },
7
- //client: { type: "bacnet-client", required: true },
8
- },
9
- inputs: 1,
10
- outputs: 1,
11
- icon: "hal-systems.png",
12
- label: function () {
13
- return this.name || "play";
14
- }
15
- });
16
- </script>
17
-
18
- <script type="text/html" data-template-name="play">
19
- <div class="form-row">
20
- <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
21
- <input type="text" id="node-input-name" placeholder="Name">
22
- </div>
23
- <!--
24
- <div class="form-row">
25
- <label for="node-input-client"><i class="fa fa-tag"></i> Client</label>
26
- <input type="text" id="node-input-client">
27
- </div> -->
28
- </script>
29
-
30
- <script type="text/html" data-help-name="play">
31
- <p>This is Jason playground</p>
32
- </script>
@@ -1,49 +0,0 @@
1
- 'use strict';
2
- require('./_alias.js');
3
-
4
-
5
- // ---------------------------- functions ----------------------------
6
-
7
-
8
- // ---------------------------- module ----------------------------
9
- module.exports = function (RED) {
10
- class Play {
11
- constructor(config) {
12
- RED.nodes.createNode(this, config);
13
-
14
- this.name = config.name;
15
- this.client = RED.nodes.getNode(config.client);
16
-
17
- // events
18
- this.#subscribeListeners();
19
- }
20
-
21
- #subscribeListeners() {
22
- /**
23
- * @param {Object} msg - The message object.
24
- * @param {any} msg.payload - The payload of the message.
25
- */
26
- // @ts-ignore
27
- this.on('input', function (msg) {
28
- // msg.payload = msg.payload.toUpperCase();
29
- let count = 0
30
- const loopWithTimeout = () => {
31
- if (count < 10) {
32
- this.status({ fill: "yellow", shape: "dot", text: `count: ${count}` });
33
- count++;
34
- setTimeout(loopWithTimeout, 1000); // Schedule the next iteration after 1 second
35
- } else {
36
- this.status({ fill: "green", shape: "dot", text: "completed" });
37
- }
38
- msg.payload = count;
39
- this.send(msg);
40
- };
41
-
42
- loopWithTimeout();
43
- });
44
- }
45
- }
46
-
47
- // ----- register node -----
48
- RED.nodes.registerType("play", Play);
49
- }