diff --git a/src/lib/socket-device.ts b/src/lib/socket-device.ts index e7488568f85ad9be8e7236426097c45d9d05fb49..e9b322070270434c5b0e470b61ee39b9d56b9d23 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); } /**