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

Generated using TypeDoc