Interface BleScanSetting

Hierarchy

  • BleScanSetting

Properties

activeScan?: boolean

(obnizOS 3 or later only)

Active scan or Passive Scan

Default is true : activeScan.

duplicate?: boolean

(obnizOS 3 or later only)

Specifying onfind will be called or not when an advertisement received from already known peripheral. Default is false : never called again.

duration?: null | number

Timeout seconds of scanning. Default is 30 seconds.

If set null, scan don't stop automatically.

filterOnDevice?: boolean

(obnizOS >= 3.2.0 only)

filters are apply on obniz device

True: filter on device and JavaScript.
False : filter on JavaScript only.

Default is false : filter on JavaScript only.

// Javascript Example
var target = {
localName: "obniz-BLE", //scan only has localName "obniz-BLE"
};

var setting = {
duration : 10, //scan duration time in seconds. default is 30 sec.
filterOnDevice: true
}

await obniz.ble.initWait();
await obniz.ble.scan.startWait(target, setting);
usePhy1m?: boolean

(ESP32 C3 or ESP32 S3)

True: Scan phy
False : Do not scan phy

Default is true : Scan phy

// Javascript Example
var target = {
localName: "obniz-BLE", //scan only has localName "obniz-BLE"
};

var setting = {
usePhy1m : false,
usePhyCoded: true
}

await obniz.ble.initWait();
await obniz.ble.scan.startWait(target, setting);
usePhyCoded?: boolean
waitBothAdvertisementAndScanResponse?: boolean

If only one of advertisement and scanResponse is coming, wait until both come.

True : wait for other data come until 10 seconds False : don't wait and notify immediately. some parameters will be null.

default : true

Generated using TypeDoc