From 1a29d82a501518ffb63f06f0ce6716ed7de386de Mon Sep 17 00:00:00 2001 From: Determinant Date: Sat, 17 Aug 2024 18:40:42 -0700 Subject: ... --- xplane.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xplane.mjs') diff --git a/xplane.mjs b/xplane.mjs index 5f94625..d105fd4 100644 --- a/xplane.mjs +++ b/xplane.mjs @@ -6,7 +6,7 @@ export class XPlane { this.subscribed = []; this.xplaneAddr = xplaneAddr; this.xplanePort = xplanePort; - this.socket.on("message", (msg, rinfo) => { + this.socket.on("message", async (msg, rinfo) => { if (msg.subarray(0, 5).toString() != "RREF,") { console.info("dropping unrelated message"); return; @@ -24,7 +24,7 @@ export class XPlane { } const v = msg.readFloatLE(9 + i * 8); //console.info(`${this.subscribed[idx].ref} = ${v}`); - this.subscribed[idx].handler(v); + await this.subscribed[idx].handler(v); } }); this.socket.bind(0); -- cgit v1.2.3-70-g09d2