Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BleConnectSetting

connect setting

Hierarchy

  • BleConnectSetting

Index

Properties

Optional autoDiscovery

autoDiscovery: undefined | false | true

Auto discovery on connection established.

true : auto discover services/characteristics/descriptors on connection established. false : don't discover automatically. Please manually.

Default is true;

If set false, you should manually discover services/characteristics/descriptors;

// Javascript Example
await obniz.ble.initWait({});
obniz.ble.scan.onfind = function(peripheral){
  if(peripheral.localName == "my peripheral"){
     await peripheral.connectWait({autoDiscovery:false});
     console.log("success");
     await peripheral.discoverAllServicesWait(); //manually discover
     let service = peripheral.getService("1800");

  }
}
await obniz.ble.scan.startWait();

Optional pairingOption

pairingOption: BlePairingOptions

Piring Option

true : auto discover services/characteristics/descriptors on connection established. false : don't discover automatically. Please manually.

Default is true;

If set false, you should manually discover services/characteristics/descriptors;

// Javascript Example
await obniz.ble.initWait({});
obniz.ble.scan.onfind = function(peripheral){
  if(peripheral.localName == "my peripheral"){
     await peripheral.connectWait({autoDiscovery:false});
     console.log("success");
     await peripheral.discoverAllServicesWait(); //manually discover
     let service = peripheral.getService("1800");

  }
}
await obniz.ble.scan.startWait();

Generated using TypeDoc