diff --git a/build/meshtastic.js b/build/meshtastic.js index efe6c92aabbdf2251f822ccbc13ad5b1385ca7a3..05d7bc182ca6d7e14f6d7ac4ec57f6c3e2595c7c 100644 --- a/build/meshtastic.js +++ b/build/meshtastic.js @@ -16754,7 +16754,13 @@ }); this.write(toRadio); } - /** Return data about the given node number from our node DB, or undefined if we don't got none. */ + /** + * Return data about the given node number from our node DB, or undefined if we don't got none. + * + * I'm making this a method instead of just making this.nodeInfo public on purpose. + * At the moment, the node DB is held in memory. We might want to put it on disk or elsewhere later. + * This way, we can make that change without breaking stuff. + */ }, { key: "getNodeInfo", value: function getNodeInfo(nodeNum) { @@ -16811,6 +16817,7 @@ _this2.host = host; _this2.port = port; _this2.socket = new js.global.Socket(); + js.setInterval(_this2.sendHeartbeat, 3e4, _this2); return _this2; } _inherits(SocketDevice2, _Device); diff --git a/package-lock.json b/package-lock.json index cb48a4879fea74d3a5534793602bea401b6abe85..1a54a971df16f6c3addad5d0e05ef3cdf00f49ba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "meshtastic", + "name": "@sota/meshtastic", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "meshtastic", + "name": "@sota/meshtastic", "version": "1.0.0", "license": "MIT", "dependencies": { @@ -2191,7 +2191,7 @@ }, "node_modules/@swag/ts4s": { "version": "1.0.0", - "resolved": "git+https://gitlab.synchro.net/swag/ts4s.git#b23fb7e7fda1968e30dc15b752d6b49d9f4885f9", + "resolved": "git+https://gitlab.synchro.net/swag/ts4s.git#d6f7d9527957e16c731e4c8f021aa461a449811f", "dev": true, "license": "MIT", "dependencies": { diff --git a/src/lib/socket-device.ts b/src/lib/socket-device.ts index 940a0be6f773d787dd41d639cf417058f7a58a48..c5afdb81aa65d1d6b3d58ae83062aa33d9868485 100644 --- a/src/lib/socket-device.ts +++ b/src/lib/socket-device.ts @@ -26,6 +26,7 @@ export default class SocketDevice extends Device { this.host = host; this.port = port; this.socket = new js.global.Socket(); + js.setInterval(this.sendHeartbeat, 30000, this); } /**