From 74e02504b470395bc3dd82e33439ac33de3f6081 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Mon, 6 Jan 2025 03:24:06 +1300 Subject: [PATCH] show bluetooth pin when available --- index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 25c4519..7875bfc 100644 --- a/index.html +++ b/index.html @@ -1759,16 +1759,16 @@ // start bluetooth pairing try { console.log("start bluetooth pairing"); - const pin = await rnode.startBluetoothPairing(); + await rnode.startBluetoothPairing(async (pin) => { + alert("Bluetooth Pairing Pin: " + pin); + await rnode.close(); + }); console.log("start bluetooth pairing: done"); } catch(error) { alert(error); } - alert("RNode should now be in Bluetooth Pairing mode. A pin will be shown on the screen when you pair with it from Android bluetooth settings."); - - // done - await rnode.close(); + alert("RNode is in pairing mode. Close this alert and then pair from Android bluetooth settings. A pin will be shown on screen."); }, async readAsBinaryString(blob) {