show bluetooth pin when available

This commit is contained in:
liamcottle
2025-01-06 03:24:06 +13:00
parent 1007e2ebd5
commit 74e02504b4

View File

@@ -1759,16 +1759,16 @@
// start bluetooth pairing // start bluetooth pairing
try { try {
console.log("start bluetooth pairing"); 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"); console.log("start bluetooth pairing: done");
} catch(error) { } catch(error) {
alert(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."); alert("RNode is in pairing mode. Close this alert and then pair from Android bluetooth settings. A pin will be shown on screen.");
// done
await rnode.close();
}, },
async readAsBinaryString(blob) { async readAsBinaryString(blob) {