Interface BlePairingOptions

Pairing options

Hierarchy

  • SmpEncryptOptions
    • BlePairingOptions

Properties

keys?: string

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();
onPairedCallback?: ((keys) => void)

Type declaration

    • (keys): void
    • Callback function that call on pairing passkey required.

      Parameters

      • keys: string

      Returns void

onPairingFailed?: ((e) => void)

Type declaration

    • (e): void
    • Callback function that call on pairing failed internal. Some pairing error may caused internally when peripheral request regardless central side request.

      Parameters

      • e: Error

      Returns void

passkeyCallback?: (() => Promise<number>)

Type declaration

    • (): Promise<number>
    • 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();

      Returns Promise<number>

secureConnection?: boolean

Generated using TypeDoc