summaryrefslogtreecommitdiffhomepage
path: root/main.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'main.mjs')
-rw-r--r--main.mjs8
1 files changed, 5 insertions, 3 deletions
diff --git a/main.mjs b/main.mjs
index 04d7c02..5900c6d 100644
--- a/main.mjs
+++ b/main.mjs
@@ -52,7 +52,7 @@ class Dispatcher {
for (let chunk of data) {
console.log(`Sending chunk: ${Array.from(chunk).map(b => b.toString(16).padStart(2, '0')).join(' ')}`)
await this.#characteristic.writeValueWithResponse(chunk)
- await delay(500)
+ await Clock.delay(500)
}
}
@@ -239,8 +239,10 @@ class RequestIdentityCommand extends Command {
}
}
-async function delay(ms) {
- return new Promise(resolve => setTimeout(resolve, ms))
+class Clock {
+ static delay(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms))
+ }
}
class IncomingMessageHandler {