Optional keysUse 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();
Optional onCallback function that call on pairing passkey required.
Optional onCallback function that call on pairing failed internal. Some pairing error may caused internally when peripheral request regardless central side request.
Optional passkeyCallback 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();
Optional secureGenerated using TypeDoc
Pairing options