Use pairing keys
// Javascript Example
const keys = "xxxxx";
await obniz.ble.initWait({});
obniz.ble.scan.onfind = function(peripheral){
if(peripheral.localName == "my peripheral"){
await peripheral.connectWait({keys});// pairing with stored keys.
}
}
await obniz.ble.scan.startWait();
Callback function that call on pairing passkey required.
Callback function that call on pairing failed internal. Some pairing error may caused internally when peripheral request regardless central side request.
Callback function that call on pairing passkey required.
// Javascript Example
const keys = "xxxxx";
await obniz.ble.initWait({});
obniz.ble.scan.onfind = function(peripheral){
if(peripheral.localName == "my peripheral"){
await peripheral.connectWait({ passkeyCallback: async () => {
return 123456;
}});
}
}
await obniz.ble.scan.startWait();
Generated using TypeDoc
Pairing options