Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BleScanSetting

Hierarchy

  • BleScanSetting

Index

Properties

Optional activeScan

activeScan: undefined | false | true

(obnizOS 3 or later only)

Active scan or Passive Scan

Default is true : activeScan.

Optional duplicate

duplicate: undefined | false | true

(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.

Optional duration

duration: number | null

Timeout seconds of scanning. Default is 30 seconds.

If set null, scan don't stop automatically.

Optional filterOnDevice

filterOnDevice: undefined | false | true

(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);

Optional usePhy1m

usePhy1m: undefined | false | true

(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);

Optional usePhyCoded

usePhyCoded: undefined | false | true

Optional waitBothAdvertisementAndScanResponse

waitBothAdvertisementAndScanResponse: undefined | false | true

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