From 3a78f64a6dd5d7689e6e9e7f312e4d223a169eb2 Mon Sep 17 00:00:00 2001 From: echicken <echicken@bbs.electronicchicken.com> Date: Fri, 26 Apr 2024 14:59:14 +0000 Subject: [PATCH] test --- src/lib/socket-device.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/socket-device.ts b/src/lib/socket-device.ts index e748856..e9b3220 100644 --- a/src/lib/socket-device.ts +++ b/src/lib/socket-device.ts @@ -27,7 +27,13 @@ export default class SocketDevice extends Device { this.host = host; this.port = port; this.socket = new js.global.Socket(); - js.setInterval(() => this.getChannel(0, (mp: protobuf.Mesh.MeshPacket): boolean => true), 30000, this); + function hb(this: Device) { + this.getChannel(0, (mp: protobuf.Mesh.MeshPacket): boolean => { + js.global.writeln(JSON.stringify(mp)); + return true; + }); + } + js.setInterval(hb.bind(this), 30000, this); } /** -- GitLab