aboutsummaryrefslogtreecommitdiff
path: root/xplane.mjs
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2024-08-17 18:40:42 -0700
committerDeterminant <[email protected]>2024-08-17 18:40:42 -0700
commit1a29d82a501518ffb63f06f0ce6716ed7de386de (patch)
tree6204749964376cc934161dbb4e2ac480b405c61b /xplane.mjs
parentf3b2a64641d0d137b26ed16601123edd20bec0ae (diff)
...
Diffstat (limited to 'xplane.mjs')
-rw-r--r--xplane.mjs4
1 files changed, 2 insertions, 2 deletions
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);