Skip to content

BLEScan

Perform and manage BLE scans.

詳細情報

メンバー

setActiveScan()

Should we perform an active or passive scan? The default is a passive scan. An active scan means that we will wish a scan response.

void BLEScan::setActiveScan(bool active)

引数

  • bool active If true, we perform an active scan otherwise a passive scan.

setAdvertisedDeviceCallbacks()

Set the call backs to be invoked.

void BLEScan::setAdvertisedDeviceCallbacks(BLEAdvertisedDeviceCallbacks *pAdvertisedDeviceCallbacks, bool wantDuplicates=false)

引数

  • BLEAdvertisedDeviceCallbacks* pAdvertisedDeviceCallbacks Call backs to be invoked.
  • bool wantDuplicates True if we wish to be called back with duplicates. Default is false.

setInterval()

Set the interval to scan.

void BLEScan::setInterval(uint16_t intervalMSecs)

引数

  • uint16_t intervalMSecs

setWindow()

Set the window to actively scan.

void BLEScan::setWindow(uint16_t windowMSecs)

引数

  • uint16_t windowMSecs How long to actively scan.

start()

Start scanning.

bool BLEScan::start(uint32_t duration, void(*scanCompleteCB)(BLEScanResults), bool is_continue=false)

引数

  • uint32_t duration The duration in seconds for which to scan.
  • BLEScanResultsvoid(*)() scanCompleteCB A function to be called when scanning has completed.
  • bool is_continue

戻り値

bool True if scan started or false if there was an error.

start()

Start scanning and block until scanning has been completed.

BLEScanResults BLEScan::start(uint32_t duration, bool is_continue=false)

引数

  • uint32_t duration The duration in seconds for which to scan.
  • bool is_continue

戻り値

BLEScanResults The .

stop()

Stop an in progress scan.

void BLEScan::stop()

erase()

void BLEScan::erase(BLEAddress address)

引数

  • BLEAddress address

getResults()

BLEScanResults BLEScan::getResults()

戻り値

BLEScanResults

clearResults()

void BLEScan::clearResults()