diff --git a/index.html b/index.html
index 2b38d8b..57ef7cc 100644
--- a/index.html
+++ b/index.html
@@ -1750,11 +1750,12 @@
console.log("start bluetooth pairing");
const pin = await rnode.startBluetoothPairing();
console.log("start bluetooth pairing: done");
- alert(`Bluetooth Pairing Pin: ${pin}`);
} 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();
diff --git a/js/rnode.js b/js/rnode.js
index 9ce3d7a..9fe0233 100644
--- a/js/rnode.js
+++ b/js/rnode.js
@@ -544,28 +544,30 @@ class RNode {
0x02, // enable pairing
]);
- // attempt to get bluetooth pairing pin
- try {
+ // todo: listen for packets, pin will be available once user has initiated pairing from Android device
- // read response from device
- const [ command, ...pinBytes ] = await this.readFromSerialPort(5000);
- if(command !== this.CMD_BT_PIN){
- throw `unexpected command response: ${command}`;
- }
-
- // convert 4 bytes to 32bit integer
- const pin = pinBytes[0] << 24 | pinBytes[1] << 16 | pinBytes[2] << 8 | pinBytes[3];
-
- // todo: remove logs
- console.log(pinBytes);
- console.log(pin);
-
- // todo: convert to string
- return pin;
-
- } catch(error) {
- throw `failed to get bluetooth pin: ${error}`;
- }
+ // // attempt to get bluetooth pairing pin
+ // try {
+ //
+ // // read response from device
+ // const [ command, ...pinBytes ] = await this.readFromSerialPort(5000);
+ // if(command !== this.CMD_BT_PIN){
+ // throw `unexpected command response: ${command}`;
+ // }
+ //
+ // // convert 4 bytes to 32bit integer
+ // const pin = pinBytes[0] << 24 | pinBytes[1] << 16 | pinBytes[2] << 8 | pinBytes[3];
+ //
+ // // todo: remove logs
+ // console.log(pinBytes);
+ // console.log(pin);
+ //
+ // // todo: convert to string
+ // return pin;
+ //
+ // } catch(error) {
+ // throw `failed to get bluetooth pin: ${error}`;
+ // }
}