ESP32  1.0.4
BLEScanResults クラス

The result of having performed a scan. When a scan completes, we have a set of found devices. Each device is described by a BLEAdvertisedDevice object. The number of items in the set is given by getCount(). We can retrieve a device by calling getDevice() passing in the index (starting at 0) of the desired device. [詳解]

#include <BLEScan.h>

公開メンバ関数

void dump ()
 Dump the scan results to the log. [詳解]
 
int getCount ()
 Return the count of devices found in the last scan. [詳解]
 
BLEAdvertisedDevice getDevice (uint32_t i)
 Return the specified device at the given index. The index should be between 0 and getCount()-1. [詳解]
 

詳解

The result of having performed a scan. When a scan completes, we have a set of found devices. Each device is described by a BLEAdvertisedDevice object. The number of items in the set is given by getCount(). We can retrieve a device by calling getDevice() passing in the index (starting at 0) of the desired device.

BLEScan.h33 行目に定義があります。

関数詳解

◆ dump()

void BLEScanResults::dump ( )

Dump the scan results to the log.

BLEScan.cpp277 行目に定義があります。

277  {
278  log_v(">> Dump scan results:");
279  for (int i=0; i<getCount(); i++) {
280  log_d("- %s", getDevice(i).toString().c_str());
281  }
282 } // dump
#define log_d(format,...)
Definition: esp32-hal-log.h:92
BLEAdvertisedDevice getDevice(uint32_t i)
Return the specified device at the given index. The index should be between 0 and getCount()-1.
Definition: BLEScan.cpp:300
int getCount()
Return the count of devices found in the last scan.
Definition: BLEScan.cpp:289
#define log_v(format,...)
Definition: esp32-hal-log.h:84

◆ getCount()

int BLEScanResults::getCount ( )

Return the count of devices found in the last scan.

戻り値
The number of devices found in the last scan.

BLEScan.cpp289 行目に定義があります。

289  {
290  return m_vectorAdvertisedDevices.size();
291 } // getCount

◆ getDevice()

BLEAdvertisedDevice BLEScanResults::getDevice ( uint32_t  i)

Return the specified device at the given index. The index should be between 0 and getCount()-1.

引数
[in]iThe index of the device.
戻り値
The device at the specified index.

BLEScan.cpp300 行目に定義があります。

300  {
301  uint32_t x = 0;
302  BLEAdvertisedDevice dev = *m_vectorAdvertisedDevices.begin()->second;
303  for (auto it = m_vectorAdvertisedDevices.begin(); it != m_vectorAdvertisedDevices.end(); it++) {
304  dev = *it->second;
305  if (x==i) break;
306  x++;
307  }
308  return dev;
309 }
__uint32_t uint32_t
Definition: stdint.h:45
A representation of a BLE advertised device found by a scan.

このクラス詳解は次のファイルから抽出されました: