node-red-contrib-ax25 1.0.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/.eslintignore +5 -0
- package/.prettierignore +7 -0
- package/ARCHITECTURE.md +174 -0
- package/CONTEXT.md +90 -0
- package/MESSAGES.md +314 -0
- package/README.md +317 -0
- package/examples/beacons.json +130 -0
- package/examples/beacons.png +0 -0
- package/examples/bye_subflow.json +107 -0
- package/examples/bye_subflow.png +0 -0
- package/examples/delete_all_my_messages.json +491 -0
- package/examples/delete_all_my_messages.png +0 -0
- package/examples/get_message_list_subflow.json +129 -0
- package/examples/get_message_list_subflow.png +0 -0
- package/examples/send_message_subflow.json +367 -0
- package/examples/send_message_subflow.png +0 -0
- package/examples/send_test_message.json +643 -0
- package/examples/send_test_message.png +0 -0
- package/jsconfig.json +37 -0
- package/lib/agwpe-client-transport.js +99 -0
- package/lib/agwpe-frame-builder.js +176 -0
- package/lib/agwpe-frame-pretty.js +107 -0
- package/lib/ax25-codec.js +382 -0
- package/lib/frame-router.js +95 -0
- package/lib/frame-segmentation.js +53 -0
- package/lib/message-utils.js +59 -0
- package/lib/runtime-store.js +94 -0
- package/lib/session-registry.js +142 -0
- package/local/buffer_compare.json +135 -0
- package/local/debug-d-frame.js +84 -0
- package/local/raw-out-test.json +128 -0
- package/nodes/agwpe-client.html +70 -0
- package/nodes/agwpe-client.js +771 -0
- package/nodes/agwpe-client.js.bak +871 -0
- package/nodes/connect.html +128 -0
- package/nodes/connect.js +450 -0
- package/nodes/decode.html +83 -0
- package/nodes/decode.js +56 -0
- package/nodes/disconnect.html +55 -0
- package/nodes/disconnect.js +47 -0
- package/nodes/encode.html +117 -0
- package/nodes/encode.js +164 -0
- package/nodes/monitor-in.html +48 -0
- package/nodes/monitor-in.js +42 -0
- package/nodes/raw-in.html +50 -0
- package/nodes/raw-in.js +72 -0
- package/nodes/raw-out.html +76 -0
- package/nodes/raw-out.js +144 -0
- package/nodes/send.html +91 -0
- package/nodes/send.js +373 -0
- package/nodes/ui-in.html +64 -0
- package/nodes/ui-in.js +68 -0
- package/nodes/ui-out.html +80 -0
- package/nodes/ui-out.js +133 -0
- package/package.json +47 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { nowTimestamp, makeMessageId } = require("./message-utils");
|
|
4
|
+
|
|
5
|
+
function SessionRegistry() {
|
|
6
|
+
this.byInstance = new Map();
|
|
7
|
+
this.byServerSession = new Map();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
SessionRegistry.prototype._instanceMap = function (instanceId) {
|
|
11
|
+
if (!this.byInstance.has(instanceId)) {
|
|
12
|
+
this.byInstance.set(instanceId, new Map());
|
|
13
|
+
}
|
|
14
|
+
return this.byInstance.get(instanceId);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
SessionRegistry.prototype.create = function (instanceId, input) {
|
|
18
|
+
const payload = input || {};
|
|
19
|
+
const store = this._instanceMap(instanceId);
|
|
20
|
+
const sessionId = payload.sessionId || makeMessageId("sess");
|
|
21
|
+
|
|
22
|
+
if (store.has(sessionId)) {
|
|
23
|
+
throw new Error("SESSION_ID_CONFLICT");
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const now = nowTimestamp();
|
|
27
|
+
const session = {
|
|
28
|
+
sessionId,
|
|
29
|
+
instanceId,
|
|
30
|
+
sourceCallsign: payload.sourceCallsign || payload.source || "",
|
|
31
|
+
destinationCallsign: payload.destinationCallsign || payload.destination || "",
|
|
32
|
+
state: payload.state || "connecting",
|
|
33
|
+
createdAt: now,
|
|
34
|
+
updatedAt: now,
|
|
35
|
+
lastActivityAt: null,
|
|
36
|
+
mode: payload.mode || "binary",
|
|
37
|
+
timeoutMs: payload.timeoutMs || null,
|
|
38
|
+
serverSessionId: payload.serverSessionId || null,
|
|
39
|
+
metadata: payload.metadata || {}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
store.set(sessionId, session);
|
|
43
|
+
if (session.serverSessionId !== null && session.serverSessionId !== undefined) {
|
|
44
|
+
this.byServerSession.set(instanceId + ":" + String(session.serverSessionId), sessionId);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return Object.assign({}, session);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
SessionRegistry.prototype.get = function (instanceId, sessionId) {
|
|
51
|
+
const store = this.byInstance.get(instanceId);
|
|
52
|
+
if (!store || !store.has(sessionId)) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return Object.assign({}, store.get(sessionId));
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
SessionRegistry.prototype.list = function (instanceId) {
|
|
59
|
+
const store = this.byInstance.get(instanceId);
|
|
60
|
+
if (!store) {
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
return Array.from(store.values()).map(function (item) {
|
|
64
|
+
return Object.assign({}, item);
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
SessionRegistry.prototype.update = function (instanceId, sessionId, patch) {
|
|
69
|
+
const store = this.byInstance.get(instanceId);
|
|
70
|
+
if (!store || !store.has(sessionId)) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const current = store.get(sessionId);
|
|
74
|
+
const next = Object.assign({}, current, patch || {}, { updatedAt: nowTimestamp() });
|
|
75
|
+
store.set(sessionId, next);
|
|
76
|
+
return Object.assign({}, next);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
SessionRegistry.prototype.bindServerSessionId = function (instanceId, sessionId, serverSessionId) {
|
|
80
|
+
const store = this.byInstance.get(instanceId);
|
|
81
|
+
if (!store || !store.has(sessionId)) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const key = instanceId + ":" + String(serverSessionId);
|
|
86
|
+
const previousSessionId = this.byServerSession.get(key);
|
|
87
|
+
if (previousSessionId && previousSessionId !== sessionId) {
|
|
88
|
+
this.byServerSession.delete(key);
|
|
89
|
+
return {
|
|
90
|
+
collision: true,
|
|
91
|
+
previousSessionId,
|
|
92
|
+
serverSessionId
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
this.byServerSession.set(key, sessionId);
|
|
97
|
+
return {
|
|
98
|
+
collision: false,
|
|
99
|
+
sessionId,
|
|
100
|
+
serverSessionId
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
SessionRegistry.prototype.resolveByServerSessionId = function (instanceId, serverSessionId) {
|
|
105
|
+
const key = instanceId + ":" + String(serverSessionId);
|
|
106
|
+
const sessionId = this.byServerSession.get(key);
|
|
107
|
+
if (!sessionId) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
return this.get(instanceId, sessionId);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
SessionRegistry.prototype.remove = function (instanceId, sessionId) {
|
|
114
|
+
const store = this.byInstance.get(instanceId);
|
|
115
|
+
if (!store || !store.has(sessionId)) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const value = store.get(sessionId);
|
|
120
|
+
if (value && value.serverSessionId !== null && value.serverSessionId !== undefined) {
|
|
121
|
+
this.byServerSession.delete(instanceId + ":" + String(value.serverSessionId));
|
|
122
|
+
}
|
|
123
|
+
store.delete(sessionId);
|
|
124
|
+
return true;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
SessionRegistry.prototype.clearInstance = function (instanceId) {
|
|
128
|
+
const store = this.byInstance.get(instanceId);
|
|
129
|
+
if (!store) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
store.forEach(
|
|
133
|
+
function (value) {
|
|
134
|
+
if (value.serverSessionId !== null && value.serverSessionId !== undefined) {
|
|
135
|
+
this.byServerSession.delete(instanceId + ":" + String(value.serverSessionId));
|
|
136
|
+
}
|
|
137
|
+
}.bind(this)
|
|
138
|
+
);
|
|
139
|
+
this.byInstance.delete(instanceId);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
module.exports = SessionRegistry;
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
]
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
}))));
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
]
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script type="text/javascript">
|
|
2
|
+
RED.nodes.registerType("agwpe-client", {
|
|
3
|
+
category: "config",
|
|
4
|
+
defaults: {
|
|
5
|
+
name: { value: "" },
|
|
6
|
+
host: { value: "127.0.0.1" },
|
|
7
|
+
port: { value: 8000 },
|
|
8
|
+
callsigns: { value: "" },
|
|
9
|
+
username: { value: "" },
|
|
10
|
+
password: { value: "" },
|
|
11
|
+
monitor: { value: false },
|
|
12
|
+
raw: { value: false },
|
|
13
|
+
reconnect: { value: true },
|
|
14
|
+
reconnectDelay: { value: 5000 }
|
|
15
|
+
},
|
|
16
|
+
label: function () {
|
|
17
|
+
return this.name || (this.host ? this.host + ":" + this.port : "agwpe-client");
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script type="text/html" data-template-name="agwpe-client">
|
|
23
|
+
<div class="form-row">
|
|
24
|
+
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
25
|
+
<input type="text" id="node-config-input-name" placeholder="AGWPE Client" />
|
|
26
|
+
</div>
|
|
27
|
+
<div class="form-row">
|
|
28
|
+
<label for="node-config-input-host"><i class="fa fa-globe"></i> Host</label>
|
|
29
|
+
<input type="text" id="node-config-input-host" placeholder="127.0.0.1" />
|
|
30
|
+
</div>
|
|
31
|
+
<div class="form-row">
|
|
32
|
+
<label for="node-config-input-port"><i class="fa fa-plug"></i> Port</label>
|
|
33
|
+
<input type="number" id="node-config-input-port" placeholder="8000" min="1" max="65535" />
|
|
34
|
+
</div>
|
|
35
|
+
<div class="form-row">
|
|
36
|
+
<label for="node-config-input-callsigns"><i class="fa fa-list"></i> Callsigns</label>
|
|
37
|
+
<input type="text" id="node-config-input-callsigns" placeholder="N0CALL or N0CALL,N0CALL-1" />
|
|
38
|
+
</div>
|
|
39
|
+
<div class="form-row">
|
|
40
|
+
<label for="node-config-input-username"><i class="fa fa-user"></i> Username</label>
|
|
41
|
+
<input type="text" id="node-config-input-username" placeholder="optional" />
|
|
42
|
+
</div>
|
|
43
|
+
<div class="form-row">
|
|
44
|
+
<label for="node-config-input-password"><i class="fa fa-lock"></i> Password</label>
|
|
45
|
+
<input type="password" id="node-config-input-password" placeholder="optional" />
|
|
46
|
+
</div>
|
|
47
|
+
<div class="form-row">
|
|
48
|
+
<label for="node-config-input-monitor"><i class="fa fa-eye"></i> Monitor Mode</label>
|
|
49
|
+
<input type="checkbox" id="node-config-input-monitor" style="display:inline-block; width:auto; vertical-align:middle;" />
|
|
50
|
+
</div>
|
|
51
|
+
<div class="form-row">
|
|
52
|
+
<label for="node-config-input-raw"><i class="fa fa-random"></i> Raw Mode</label>
|
|
53
|
+
<input type="checkbox" id="node-config-input-raw" style="display:inline-block; width:auto; vertical-align:middle;" />
|
|
54
|
+
</div>
|
|
55
|
+
<div class="form-row">
|
|
56
|
+
<label for="node-config-input-reconnect"><i class="fa fa-refresh"></i> Auto-Reconnect</label>
|
|
57
|
+
<input type="checkbox" id="node-config-input-reconnect" style="display:inline-block; width:auto; vertical-align:middle;" />
|
|
58
|
+
</div>
|
|
59
|
+
<div class="form-row">
|
|
60
|
+
<label for="node-config-input-reconnectDelay"><i class="fa fa-clock-o"></i> Reconnect Delay (ms)</label>
|
|
61
|
+
<input type="number" id="node-config-input-reconnectDelay" placeholder="5000" min="100" />
|
|
62
|
+
</div>
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<script type="text/html" data-help-name="agwpe-client">
|
|
66
|
+
<p>Configuration node for an AGWPE/FLDIGI TNC connection. Connects automatically on deploy and reconnects when the connection drops.</p>
|
|
67
|
+
<p>Set the host, port, and optional callsign registrations. Enable <strong>Monitor Mode</strong> to receive all-traffic monitor frames; enable <strong>Raw Mode</strong> to receive raw AX.25 frames.</p>
|
|
68
|
+
<p>When <strong>Auto-Reconnect</strong> is checked (default), the node waits <em>Reconnect Delay</em> milliseconds before retrying after a lost connection.</p>
|
|
69
|
+
<p>Consumer nodes (connect, send, monitor-in, raw-in, raw-out, ui-in, ui-out) reference this node via their <em>Client</em> drop-down.</p>
|
|
70
|
+
</script>
|