NimBLE-Arduino 2.1.2
|
A representation of a BLE advertised device found by a scan. More...
#include <NimBLEAdvertisedDevice.h>
Public Member Functions | |
uint8_t | getAdvType () const |
Get the advertisement type. | |
uint8_t | getAdvFlags () const |
Get the advertisement flags. | |
uint16_t | getAppearance () const |
Get the appearance. | |
uint16_t | getAdvInterval () const |
Get the advertisement interval. | |
uint16_t | getMinInterval () const |
Get the preferred min connection interval. | |
uint16_t | getMaxInterval () const |
Get the preferred max connection interval. | |
uint8_t | getManufacturerDataCount () const |
Get the count of manufacturer data sets. | |
const NimBLEAddress & | getAddress () const |
Get the address of the advertising device. | |
std::string | getManufacturerData (uint8_t index=0) const |
Get the manufacturer data. | |
std::string | getURI () const |
Get the URI from the advertisement. | |
std::string | getPayloadByType (uint16_t type, uint8_t index=0) const |
Get the data from any type available in the advertisement. | |
std::string | getName () const |
Get the advertised name. | |
int8_t | getRSSI () const |
Get the RSSI. | |
NimBLEScan * | getScan () const |
Get the scan object that created this advertised device. | |
uint8_t | getServiceDataCount () const |
Get the count of advertised service data UUIDS. | |
std::string | getServiceData (uint8_t index=0) const |
Get the service data. | |
std::string | getServiceData (const NimBLEUUID &uuid) const |
Get the service data. | |
NimBLEUUID | getServiceDataUUID (uint8_t index=0) const |
Get the UUID of the service data at the index. | |
NimBLEUUID | getServiceUUID (uint8_t index=0) const |
Get the Service UUID. | |
uint8_t | getServiceUUIDCount () const |
Get the number of services advertised. | |
NimBLEAddress | getTargetAddress (uint8_t index=0) const |
Get the target address at the index. | |
uint8_t | getTargetAddressCount () const |
Get the number of target addresses. | |
int8_t | getTXPower () const |
Get the TX Power. | |
uint8_t | getAdvLength () const |
Get the length of the advertisement data in the payload. | |
uint8_t | getAddressType () const |
Get the advertised device address type. | |
bool | isAdvertisingService (const NimBLEUUID &uuid) const |
Check advertised services for existence of the required UUID. | |
bool | haveAppearance () const |
Does this advertisement have an appearance value? | |
bool | haveManufacturerData () const |
Does this advertisement have manufacturer data? | |
bool | haveName () const |
Does this advertisement have a name value? | |
bool | haveServiceData () const |
Does this advertisement have a service data value? | |
bool | haveServiceUUID () const |
Does this advertisement have a service UUID value? | |
bool | haveTXPower () const |
Does this advertisement have a transmission power value? | |
bool | haveConnParams () const |
Does this advertisement have preferred connection parameters? | |
bool | haveAdvInterval () const |
Does this advertisement have have the advertising interval? | |
bool | haveTargetAddress () const |
Does the advertisement contain a target address? | |
bool | haveURI () const |
Does this advertisement have a URI? | |
bool | haveType (uint16_t type) const |
Does this advertisement have a adv type type ? | |
std::string | toString () const |
Create a string representation of this device. | |
bool | isConnectable () const |
Check if this device is advertising as connectable. | |
bool | isScannable () const |
Check if this device is advertising as scannable. | |
bool | isLegacyAdvertisement () const |
Check if this advertisement is a legacy or extended type. | |
uint8_t | getSetId () const |
Get the set ID of the extended advertisement. | |
uint8_t | getPrimaryPhy () const |
Get the primary PHY used by this advertisement. | |
uint8_t | getSecondaryPhy () const |
Get the primary PHY used by this advertisement. | |
uint16_t | getPeriodicInterval () const |
Get the periodic interval of the advertisement. | |
const std::vector< uint8_t > & | getPayload () const |
Get the payload advertised by the device. | |
const std::vector< uint8_t >::const_iterator | begin () const |
Get the begin iterator for the payload. | |
const std::vector< uint8_t >::const_iterator | end () const |
Get the end iterator for the payload. | |
template<typename T > | |
T | getManufacturerData (bool skipSizeCheck=false) const |
A template to convert the service data to <type>. | |
template<typename T > | |
T | getServiceData (uint8_t index=0, bool skipSizeCheck=false) const |
A template to convert the service data to <type> . | |
template<typename T > | |
T | getServiceData (const NimBLEUUID &uuid, bool skipSizeCheck=false) const |
A template to convert the service data to <type> . | |
A representation of a BLE advertised device found by a scan.
When we perform a BLE scan, the result will be a set of devices that are advertising. This class provides a model of a detected device.
const std::vector< uint8_t >::const_iterator NimBLEAdvertisedDevice::begin | ( | ) | const |
Get the begin iterator for the payload.
const std::vector< uint8_t >::const_iterator NimBLEAdvertisedDevice::end | ( | ) | const |
Get the end iterator for the payload.
const NimBLEAddress & NimBLEAdvertisedDevice::getAddress | ( | ) | const |
Get the address of the advertising device.
uint8_t NimBLEAdvertisedDevice::getAddressType | ( | ) | const |
Get the advertised device address type.
uint8_t NimBLEAdvertisedDevice::getAdvFlags | ( | ) | const |
Get the advertisement flags.
uint16_t NimBLEAdvertisedDevice::getAdvInterval | ( | ) | const |
Get the advertisement interval.
uint8_t NimBLEAdvertisedDevice::getAdvLength | ( | ) | const |
Get the length of the advertisement data in the payload.
uint8_t NimBLEAdvertisedDevice::getAdvType | ( | ) | const |
Get the advertisement type.
uint16_t NimBLEAdvertisedDevice::getAppearance | ( | ) | const |
Get the appearance.
A BLE device can declare its own appearance. The appearance is how it would like to be shown to an end user typically in the form of an icon.
|
inline |
A template to convert the service data to <type>.
T | The type to convert the data to. |
[in] | skipSizeCheck | If true it will skip checking if the data size is less than sizeof(<type>) . |
sizeof(<type>)
.Use: getManufacturerData<type>(skipSizeCheck);
std::string NimBLEAdvertisedDevice::getManufacturerData | ( | uint8_t | index = 0 | ) | const |
Get the manufacturer data.
[in] | index | The index of the of the manufacturer data set to get. |
uint8_t NimBLEAdvertisedDevice::getManufacturerDataCount | ( | ) | const |
Get the count of manufacturer data sets.
uint16_t NimBLEAdvertisedDevice::getMaxInterval | ( | ) | const |
Get the preferred max connection interval.
uint16_t NimBLEAdvertisedDevice::getMinInterval | ( | ) | const |
Get the preferred min connection interval.
std::string NimBLEAdvertisedDevice::getName | ( | ) | const |
Get the advertised name.
const std::vector< uint8_t > & NimBLEAdvertisedDevice::getPayload | ( | ) | const |
Get the payload advertised by the device.
std::string NimBLEAdvertisedDevice::getPayloadByType | ( | uint16_t | type, |
uint8_t | index = 0 |
||
) | const |
Get the data from any type available in the advertisement.
[in] | type | The advertised data type BLE_HS_ADV_TYPE. |
[in] | index | The index of the data type. |
type
. uint16_t NimBLEAdvertisedDevice::getPeriodicInterval | ( | ) | const |
Get the periodic interval of the advertisement.
uint8_t NimBLEAdvertisedDevice::getPrimaryPhy | ( | ) | const |
Get the primary PHY used by this advertisement.
int8_t NimBLEAdvertisedDevice::getRSSI | ( | ) | const |
Get the RSSI.
NimBLEScan * NimBLEAdvertisedDevice::getScan | ( | ) | const |
Get the scan object that created this advertised device.
uint8_t NimBLEAdvertisedDevice::getSecondaryPhy | ( | ) | const |
Get the primary PHY used by this advertisement.
std::string NimBLEAdvertisedDevice::getServiceData | ( | const NimBLEUUID & | uuid | ) | const |
Get the service data.
[in] | uuid | The uuid of the service data requested. |
|
inline |
A template to convert the service data to <type>
.
T | The type to convert the data to. |
[in] | uuid | The uuid of the service data requested. |
[in] | skipSizeCheck | If true it will skip checking if the data size is less than sizeof(<type>) . |
sizeof(<type>)
.Use: getServiceData<type>(skipSizeCheck);
std::string NimBLEAdvertisedDevice::getServiceData | ( | uint8_t | index = 0 | ) | const |
Get the service data.
[in] | index | The index of the service data requested. |
|
inline |
A template to convert the service data to <type>
.
T | The type to convert the data to. |
[in] | index | The vector index of the service data requested. |
[in] | skipSizeCheck | If true it will skip checking if the data size is less than sizeof(<type>) . |
sizeof(<type>)
.Use: getServiceData<type>(skipSizeCheck);
uint8_t NimBLEAdvertisedDevice::getServiceDataCount | ( | ) | const |
Get the count of advertised service data UUIDS.
NimBLEUUID NimBLEAdvertisedDevice::getServiceDataUUID | ( | uint8_t | index = 0 | ) | const |
Get the UUID of the service data at the index.
[in] | index | The index of the service data UUID requested. |
NimBLEUUID NimBLEAdvertisedDevice::getServiceUUID | ( | uint8_t | index = 0 | ) | const |
Get the Service UUID.
[in] | index | The index of the service UUID requested. |
uint8_t NimBLEAdvertisedDevice::getServiceUUIDCount | ( | ) | const |
Get the number of services advertised.
uint8_t NimBLEAdvertisedDevice::getSetId | ( | ) | const |
Get the set ID of the extended advertisement.
NimBLEAddress NimBLEAdvertisedDevice::getTargetAddress | ( | uint8_t | index = 0 | ) | const |
Get the target address at the index.
[in] | index | The index of the target address. |
uint8_t NimBLEAdvertisedDevice::getTargetAddressCount | ( | ) | const |
Get the number of target addresses.
int8_t NimBLEAdvertisedDevice::getTXPower | ( | ) | const |
Get the TX Power.
std::string NimBLEAdvertisedDevice::getURI | ( | ) | const |
Get the URI from the advertisement.
bool NimBLEAdvertisedDevice::haveAdvInterval | ( | ) | const |
Does this advertisement have have the advertising interval?
bool NimBLEAdvertisedDevice::haveAppearance | ( | ) | const |
Does this advertisement have an appearance value?
bool NimBLEAdvertisedDevice::haveConnParams | ( | ) | const |
Does this advertisement have preferred connection parameters?
bool NimBLEAdvertisedDevice::haveManufacturerData | ( | ) | const |
Does this advertisement have manufacturer data?
bool NimBLEAdvertisedDevice::haveName | ( | ) | const |
Does this advertisement have a name value?
bool NimBLEAdvertisedDevice::haveServiceData | ( | ) | const |
Does this advertisement have a service data value?
bool NimBLEAdvertisedDevice::haveServiceUUID | ( | ) | const |
Does this advertisement have a service UUID value?
bool NimBLEAdvertisedDevice::haveTargetAddress | ( | ) | const |
Does the advertisement contain a target address?
bool NimBLEAdvertisedDevice::haveTXPower | ( | ) | const |
Does this advertisement have a transmission power value?
bool NimBLEAdvertisedDevice::haveType | ( | uint16_t | type | ) | const |
Does this advertisement have a adv type type
?
type
present. bool NimBLEAdvertisedDevice::haveURI | ( | ) | const |
Does this advertisement have a URI?
bool NimBLEAdvertisedDevice::isAdvertisingService | ( | const NimBLEUUID & | uuid | ) | const |
Check advertised services for existence of the required UUID.
[in] | uuid | The service uuid to look for in the advertisement. |
bool NimBLEAdvertisedDevice::isConnectable | ( | ) | const |
Check if this device is advertising as connectable.
bool NimBLEAdvertisedDevice::isLegacyAdvertisement | ( | ) | const |
Check if this advertisement is a legacy or extended type.
bool NimBLEAdvertisedDevice::isScannable | ( | ) | const |
Check if this device is advertising as scannable.
std::string NimBLEAdvertisedDevice::toString | ( | ) | const |
Create a string representation of this device.