Interface BleConnectSetting

connect setting

Hierarchy

  • BleConnectSetting

Properties

autoDiscovery?: boolean

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();
connectionParameterUpdateAccept?: boolean
forceConnect?: boolean

Force Connect

If you want to try to connect even when the connected flag is true.

Default: true

mtuRequest?: null | number

Request mtu value.

If you want to try exchange specific mtu value, set this value. If set null, skip mtu exchange sequence.

Default : 256

pairingOption?: BlePairingOptions

Pairing Option

keys: Key acquired when pairing previously. onPairedCallback: A function that contains keys called when pairing is successful.

retry?: number
usePyh1m?: boolean

PHY used for connection

It was May connect using that PHY

Default : true

usePyh2m?: boolean

PHY used for connection

It was May connect using that PHY

Default : true

usePyhCoded?: boolean

PHY used for connection

It was May connect using that PHY

Default : true

waitUntilPairing?: boolean

Generated using TypeDoc