node-red-contrib-ax25 1.0.1 → 1.0.2

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.
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("connect", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  client: { value: "", type: "agwpe-client", required: true },
package/nodes/decode.html CHANGED
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("decode", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  name: { value: "" },
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("disconnect", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  name: { value: "" }
package/nodes/encode.html CHANGED
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("encode", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  name: { value: "" },
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("monitor-in", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  client: { value: "", type: "agwpe-client", required: true },
package/nodes/raw-in.html CHANGED
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("raw-in", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  client: { value: "", type: "agwpe-client", required: true },
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("raw-out", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  client: { value: "", type: "agwpe-client", required: true },
package/nodes/send.html CHANGED
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("send", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  name: { value: "" },
package/nodes/ui-in.html CHANGED
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("ui-in", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  client: { value: "", type: "agwpe-client", required: true },
package/nodes/ui-out.html CHANGED
@@ -1,6 +1,6 @@
1
1
  <script type="text/javascript">
2
2
  RED.nodes.registerType("ui-out", {
3
- category: "agwpe",
3
+ category: "ax25",
4
4
  color: "#d4edda",
5
5
  defaults: {
6
6
  client: { value: "", type: "agwpe-client", required: true },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-ax25",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Node-RED nodes for AX.25 connectivity and tooling",
5
5
  "main": "nodes/agwpe-client.js",
6
6
  "license": "MIT",
@@ -1,135 +0,0 @@
1
- [
2
- {
3
- "id": "5b244fa604fea472",
4
- "type": "debug",
5
- "z": "efec118fdfbb44e1",
6
- "name": "debug 4",
7
- "active": false,
8
- "tosidebar": true,
9
- "console": false,
10
- "tostatus": false,
11
- "complete": "true",
12
- "targetType": "full",
13
- "statusVal": "",
14
- "statusType": "auto",
15
- "x": 380,
16
- "y": 480,
17
- "wires": []
18
- },
19
- {
20
- "id": "21825cd2b6399cdb",
21
- "type": "raw-in",
22
- "z": "efec118fdfbb44e1",
23
- "name": "",
24
- "x": 170,
25
- "y": 480,
26
- "wires": [
27
- [
28
- "5b244fa604fea472",
29
- "7c55133426e0bf75",
30
- "fa0970eb0abcbd27"
31
- ]
32
- ]
33
- },
34
- {
35
- "id": "7c55133426e0bf75",
36
- "type": "decode",
37
- "z": "efec118fdfbb44e1",
38
- "name": "",
39
- "x": 380,
40
- "y": 540,
41
- "wires": [
42
- [
43
- "716c85ad8fa5ab9e",
44
- "16f45c05ab12108d"
45
- ]
46
- ]
47
- },
48
- {
49
- "id": "665950798e589835",
50
- "type": "debug",
51
- "z": "efec118fdfbb44e1",
52
- "name": "debug 5",
53
- "active": false,
54
- "tosidebar": true,
55
- "console": false,
56
- "tostatus": false,
57
- "complete": "true",
58
- "targetType": "full",
59
- "statusVal": "",
60
- "statusType": "auto",
61
- "x": 740,
62
- "y": 540,
63
- "wires": []
64
- },
65
- {
66
- "id": "716c85ad8fa5ab9e",
67
- "type": "function",
68
- "z": "efec118fdfbb44e1",
69
- "name": "function 2",
70
- "func": "msg.data = String.fromCharCode(...msg.payload);\nreturn msg;",
71
- "outputs": 1,
72
- "timeout": 0,
73
- "noerr": 0,
74
- "initialize": "",
75
- "finalize": "",
76
- "libs": [],
77
- "x": 560,
78
- "y": 540,
79
- "wires": [
80
- [
81
- "665950798e589835"
82
- ]
83
- ]
84
- },
85
- {
86
- "id": "16f45c05ab12108d",
87
- "type": "encode",
88
- "z": "efec118fdfbb44e1",
89
- "name": "",
90
- "x": 560,
91
- "y": 600,
92
- "wires": [
93
- [
94
- "fa0970eb0abcbd27"
95
- ]
96
- ]
97
- },
98
- {
99
- "id": "d12d061e1569391f",
100
- "type": "debug",
101
- "z": "efec118fdfbb44e1",
102
- "name": "debug 6",
103
- "active": true,
104
- "tosidebar": true,
105
- "console": false,
106
- "tostatus": false,
107
- "complete": "true",
108
- "targetType": "full",
109
- "statusVal": "",
110
- "statusType": "auto",
111
- "x": 760,
112
- "y": 680,
113
- "wires": []
114
- },
115
- {
116
- "id": "fa0970eb0abcbd27",
117
- "type": "function",
118
- "z": "efec118fdfbb44e1",
119
- "name": "function 3",
120
- "func": "if (msg.event === 'raw') {\n flow.set('raw', msg.payload);\n}\n\nif (msg.event === 'encoded') {\n const raw = flow.get('raw');\n const encoded = msg.payload;\n\n // Find differing indices\n const maxLen = Math.max(raw.length, encoded.length);\n const diffs = [];\n for (let i = 0; i < maxLen; i++) {\n if (raw[i] !== encoded[i]) {\n diffs.push({ index: i, raw: raw[i], encoded: encoded[i] });\n }\n }\n\n if (diffs.length > 0) {\n node.warn(`Buffer mismatch!`);\n node.warn(`raw: ${JSON.stringify(raw)}`);\n node.warn(`encoded: ${JSON.stringify(encoded)}`);\n node.warn(`diffs: ${JSON.stringify(diffs)}`);\n\n msg.payload = {\n raw,\n encoded,\n diffs\n };\n return msg;\n }\n}",
121
- "outputs": 1,
122
- "timeout": 0,
123
- "noerr": 0,
124
- "initialize": "",
125
- "finalize": "",
126
- "libs": [],
127
- "x": 580,
128
- "y": 680,
129
- "wires": [
130
- [
131
- "d12d061e1569391f"
132
- ]
133
- ]
134
- }
135
- ]
@@ -1,84 +0,0 @@
1
- "use strict";
2
- const { makeDataFrame } = require("../lib/agwpe-frame-builder");
3
- const agwpeClientModule = require("../nodes/agwpe-client");
4
- const connInModule = require("../nodes/conn-in");
5
- const store = require("../lib/runtime-store");
6
- const EventEmitter = require("events");
7
-
8
- const flowData = {};
9
- function makeRED() {
10
- const types = {};
11
- const RED = {
12
- nodes: {
13
- createNode(node, config) {
14
- const ee = new EventEmitter();
15
- node.on = ee.on.bind(ee);
16
- node.emit = ee.emit.bind(ee);
17
- node.status = () => {};
18
- node._sent = [];
19
- node._errors = [];
20
- node.send = m => node._sent.push(m);
21
- node.error = () => {};
22
- node.warn = m => console.log("WARN:", m);
23
- node.log = m => console.log("LOG:", m);
24
- node.context = () => ({
25
- flow: {
26
- get: k => flowData[k] || null,
27
- set: (k, v) => { flowData[k] = v; }
28
- }
29
- });
30
- },
31
- registerType(t, ctor) { types[t] = ctor; }
32
- },
33
- _instantiate(type, config) {
34
- const n = { id: config.id || type, _flowId: config._flowId || "flow-1", _sent: [], _errors: [] };
35
- types[type].call(n, config);
36
- return n;
37
- }
38
- };
39
- return RED;
40
- }
41
-
42
- const RED = makeRED();
43
- agwpeClientModule(RED);
44
- connInModule(RED);
45
-
46
- const mockTransport = new EventEmitter();
47
- mockTransport.sendFrame = (f, cb) => { if (cb) cb(); };
48
-
49
- const flowId = "flow-1";
50
- const client = RED._instantiate("agwpe-client", { id: "client-1", _flowId: flowId });
51
- const connIn = RED._instantiate("conn-in", { id: "conn-in-1", _flowId: flowId });
52
-
53
- // Open
54
- client.emit("input", { command: "open", host: "127.0.0.1", port: 8000, callsigns: ["N1CALL"], _testTransport: mockTransport });
55
- console.log("client sent after open:", JSON.stringify(client._sent.map(m => m.event)));
56
-
57
- // Connect
58
- client.emit("input", { command: "connect", source: "N1CALL", destination: "N1CALL-1", sessionId: "s1" });
59
- console.log("client sent after connect:", JSON.stringify(client._sent.map(m => m.event)));
60
- console.log("connIn sent after connect:", JSON.stringify(connIn._sent.map(m => m.event)));
61
-
62
- // Check session in registry
63
- const ctx = store.getInstance("client-1");
64
- if (ctx) {
65
- const sessions = ctx.registry.list("client-1");
66
- console.log("sessions in registry:", JSON.stringify(sessions.map(s => ({
67
- sessionId: s.sessionId, state: s.state,
68
- src: s.sourceCallsign, dst: s.destinationCallsign
69
- }))));
70
- console.log("router instances:", Array.from(ctx.router.instances.keys()));
71
- console.log("bus listeners conn-data:", ctx.bus.listenerCount("conn-data"));
72
- console.log("bus listeners conn-lifecycle:", ctx.bus.listenerCount("conn-lifecycle"));
73
- } else {
74
- console.log("ERROR: no context in store for client-1");
75
- }
76
-
77
- // Fire a D frame
78
- const dFrame = makeDataFrame("N1CALL-1", "N1CALL", Buffer.from("BBS READY>"));
79
- console.log("\nEmitting D frame on mockTransport...");
80
- mockTransport.emit("frame", dFrame);
81
-
82
- console.log("connIn sent after D frame:", JSON.stringify(connIn._sent.map(m => ({
83
- event: m.event, hasPayload: m.payload != null, payloadType: m.payload ? typeof m.payload : "none"
84
- }))));
@@ -1,128 +0,0 @@
1
- [
2
- {
3
- "id": "1faf64b0a23c2b10",
4
- "type": "inject",
5
- "z": "efec118fdfbb44e1",
6
- "name": "",
7
- "props": [
8
- {
9
- "p": "payload"
10
- }
11
- ],
12
- "repeat": "",
13
- "crontab": "",
14
- "once": false,
15
- "onceDelay": 0.1,
16
- "topic": "",
17
- "payload": "Test Frame",
18
- "payloadType": "str",
19
- "x": 165,
20
- "y": 540,
21
- "wires": [
22
- [
23
- "e70c9de10439d31f"
24
- ]
25
- ],
26
- "l": false
27
- },
28
- {
29
- "id": "e70c9de10439d31f",
30
- "type": "encode",
31
- "z": "efec118fdfbb44e1",
32
- "name": "",
33
- "source": "N1CALL-7",
34
- "destination": "TEST",
35
- "digipeaters": "",
36
- "control": 3,
37
- "pid": 240,
38
- "frameType": "U",
39
- "payload": "",
40
- "x": 320,
41
- "y": 540,
42
- "wires": [
43
- [
44
- "c3cecbe84e55b30f",
45
- "e8d5bbd844110be9",
46
- "b304e6d9f1e00d48"
47
- ]
48
- ]
49
- },
50
- {
51
- "id": "c3cecbe84e55b30f",
52
- "type": "raw-out",
53
- "z": "efec118fdfbb44e1",
54
- "name": "",
55
- "x": 500,
56
- "y": 540,
57
- "wires": [
58
- [
59
- "15ab7cb28d409d6e"
60
- ]
61
- ]
62
- },
63
- {
64
- "id": "15ab7cb28d409d6e",
65
- "type": "debug",
66
- "z": "efec118fdfbb44e1",
67
- "name": "debug 4",
68
- "active": true,
69
- "tosidebar": true,
70
- "console": false,
71
- "tostatus": false,
72
- "complete": "true",
73
- "targetType": "full",
74
- "statusVal": "",
75
- "statusType": "auto",
76
- "x": 680,
77
- "y": 540,
78
- "wires": []
79
- },
80
- {
81
- "id": "e8d5bbd844110be9",
82
- "type": "debug",
83
- "z": "efec118fdfbb44e1",
84
- "name": "debug 5",
85
- "active": false,
86
- "tosidebar": true,
87
- "console": false,
88
- "tostatus": false,
89
- "complete": "true",
90
- "targetType": "full",
91
- "statusVal": "",
92
- "statusType": "auto",
93
- "x": 500,
94
- "y": 480,
95
- "wires": []
96
- },
97
- {
98
- "id": "b304e6d9f1e00d48",
99
- "type": "decode",
100
- "z": "efec118fdfbb44e1",
101
- "name": "",
102
- "payloadOutput": "string",
103
- "x": 500,
104
- "y": 600,
105
- "wires": [
106
- [
107
- "b4244f4d5601b40f"
108
- ]
109
- ]
110
- },
111
- {
112
- "id": "b4244f4d5601b40f",
113
- "type": "debug",
114
- "z": "efec118fdfbb44e1",
115
- "name": "debug 6",
116
- "active": true,
117
- "tosidebar": true,
118
- "console": false,
119
- "tostatus": false,
120
- "complete": "true",
121
- "targetType": "full",
122
- "statusVal": "",
123
- "statusType": "auto",
124
- "x": 680,
125
- "y": 600,
126
- "wires": []
127
- }
128
- ]