• Public
  • Public/Protected
  • All

Interface BleScanSetting


  • BleScanSetting



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