esp-nimble-cpp
1.3.2
|
A representation of a BLE advertised device found by a scan. More...
Public Member Functions | |
NimBLEAdvertisedDevice () | |
Constructor. | |
NimBLEAddress | getAddress () |
Get the address of the advertising device. More... | |
uint8_t | getAdvType () |
Get the advertisement type. More... | |
uint16_t | getAppearance () |
Get the appearance. More... | |
uint16_t | getAdvInterval () |
Get the advertisement interval. More... | |
uint16_t | getMinInterval () |
Get the preferred min connection interval. More... | |
uint16_t | getMaxInterval () |
Get the preferred max connection interval. More... | |
std::string | getManufacturerData () |
Get the manufacturer data. More... | |
std::string | getURI () |
Get the URI from the advertisement. More... | |
template<typename T > | |
T | getManufacturerData (bool skipSizeCheck=false) |
A template to convert the service data to <type>. More... | |
std::string | getName () |
Get the advertised name. More... | |
int | getRSSI () |
Get the RSSI. More... | |
NimBLEScan * | getScan () |
Get the scan object that created this advertised device. More... | |
size_t | getServiceDataCount () |
Get the count of advertised service data UUIDS. More... | |
std::string | getServiceData (uint8_t index=0) |
Get the service data. More... | |
std::string | getServiceData (const NimBLEUUID &uuid) |
Get the service data. More... | |
template<typename T > | |
T | getServiceData (uint8_t index=0, bool skipSizeCheck=false) |
A template to convert the service data to <type> . More... | |
template<typename T > | |
T | getServiceData (const NimBLEUUID &uuid, bool skipSizeCheck=false) |
A template to convert the service data to <type> . More... | |
NimBLEUUID | getServiceDataUUID (uint8_t index=0) |
Get the UUID of the serice data at the index. More... | |
NimBLEUUID | getServiceUUID (uint8_t index=0) |
Get the Service UUID. More... | |
size_t | getServiceUUIDCount () |
Get the number of services advertised. More... | |
NimBLEAddress | getTargetAddress (uint8_t index=0) |
Get the target address at the index. More... | |
size_t | getTargetAddressCount () |
Get the number of target addresses. More... | |
int8_t | getTXPower () |
Get the TX Power. More... | |
uint8_t * | getPayload () |
Get the payload advertised by the device. More... | |
uint8_t | getAdvLength () |
Get the length of the advertisement data in the payload. More... | |
size_t | getPayloadLength () |
Get the length of the payload advertised by the device. More... | |
uint8_t | getAddressType () |
Get the advertised device address type. More... | |
time_t | getTimestamp () |
Get the timeStamp of when the device last advertised. More... | |
bool | isAdvertisingService (const NimBLEUUID &uuid) |
Check advertised services for existance of the required UUID. More... | |
bool | haveAppearance () |
Does this advertisement have an appearance value? More... | |
bool | haveManufacturerData () |
Does this advertisement have manufacturer data? More... | |
bool | haveName () |
Does this advertisement have a name value? More... | |
bool | haveRSSI () |
Does this advertisement have a signal strength value? More... | |
bool | haveServiceData () |
Does this advertisement have a service data value? More... | |
bool | haveServiceUUID () |
Does this advertisement have a service UUID value? More... | |
bool | haveTXPower () |
Does this advertisement have a transmission power value? More... | |
bool | haveConnParams () |
Does this advertisement have preferred connection parameters? More... | |
bool | haveAdvInterval () |
Does this advertisement have have the advertising interval? More... | |
bool | haveTargetAddress () |
Does the advertisement contain a target address? More... | |
bool | haveURI () |
Does this advertisement have a URI? More... | |
std::string | toString () |
Create a string representation of this device. More... | |
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.
NimBLEAddress NimBLEAdvertisedDevice::getAddress | ( | ) |
Get the address of the advertising device.
uint8_t NimBLEAdvertisedDevice::getAddressType | ( | ) |
Get the advertised device address type.
uint16_t NimBLEAdvertisedDevice::getAdvInterval | ( | ) |
Get the advertisement interval.
uint8_t NimBLEAdvertisedDevice::getAdvLength | ( | ) |
Get the length of the advertisement data in the payload.
uint8_t NimBLEAdvertisedDevice::getAdvType | ( | ) |
Get the advertisement type.
uint16_t NimBLEAdvertisedDevice::getAppearance | ( | ) |
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 typcially in the form of an icon.
std::string NimBLEAdvertisedDevice::getManufacturerData | ( | ) |
Get the manufacturer data.
|
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);
uint16_t NimBLEAdvertisedDevice::getMaxInterval | ( | ) |
Get the preferred max connection interval.
uint16_t NimBLEAdvertisedDevice::getMinInterval | ( | ) |
Get the preferred min connection interval.
std::string NimBLEAdvertisedDevice::getName | ( | ) |
Get the advertised name.
uint8_t * NimBLEAdvertisedDevice::getPayload | ( | ) |
Get the payload advertised by the device.
size_t NimBLEAdvertisedDevice::getPayloadLength | ( | ) |
Get the length of the payload advertised by the device.
int NimBLEAdvertisedDevice::getRSSI | ( | ) |
Get the RSSI.
NimBLEScan * NimBLEAdvertisedDevice::getScan | ( | ) |
Get the scan object that created this advertised device.
std::string NimBLEAdvertisedDevice::getServiceData | ( | const NimBLEUUID & | uuid | ) |
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 | ) |
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);
size_t NimBLEAdvertisedDevice::getServiceDataCount | ( | ) |
Get the count of advertised service data UUIDS.
NimBLEUUID NimBLEAdvertisedDevice::getServiceDataUUID | ( | uint8_t | index = 0 | ) |
Get the UUID of the serice data at the index.
[in] | index | The index of the service data UUID requested. |
NimBLEUUID NimBLEAdvertisedDevice::getServiceUUID | ( | uint8_t | index = 0 | ) |
Get the Service UUID.
[in] | index | The index of the service UUID requested. |
size_t NimBLEAdvertisedDevice::getServiceUUIDCount | ( | ) |
Get the number of services advertised.
NimBLEAddress NimBLEAdvertisedDevice::getTargetAddress | ( | uint8_t | index = 0 | ) |
Get the target address at the index.
[in] | index | The index of the target address. |
size_t NimBLEAdvertisedDevice::getTargetAddressCount | ( | ) |
Get the number of target addresses.
time_t NimBLEAdvertisedDevice::getTimestamp | ( | ) |
Get the timeStamp of when the device last advertised.
int8_t NimBLEAdvertisedDevice::getTXPower | ( | ) |
Get the TX Power.
std::string NimBLEAdvertisedDevice::getURI | ( | ) |
Get the URI from the advertisement.
bool NimBLEAdvertisedDevice::haveAdvInterval | ( | ) |
Does this advertisement have have the advertising interval?
bool NimBLEAdvertisedDevice::haveAppearance | ( | ) |
Does this advertisement have an appearance value?
bool NimBLEAdvertisedDevice::haveConnParams | ( | ) |
Does this advertisement have preferred connection parameters?
bool NimBLEAdvertisedDevice::haveManufacturerData | ( | ) |
Does this advertisement have manufacturer data?
bool NimBLEAdvertisedDevice::haveName | ( | ) |
Does this advertisement have a name value?
bool NimBLEAdvertisedDevice::haveRSSI | ( | ) |
Does this advertisement have a signal strength value?
bool NimBLEAdvertisedDevice::haveServiceData | ( | ) |
Does this advertisement have a service data value?
bool NimBLEAdvertisedDevice::haveServiceUUID | ( | ) |
Does this advertisement have a service UUID value?
bool NimBLEAdvertisedDevice::haveTargetAddress | ( | ) |
Does the advertisement contain a target address?
bool NimBLEAdvertisedDevice::haveTXPower | ( | ) |
Does this advertisement have a transmission power value?
bool NimBLEAdvertisedDevice::haveURI | ( | ) |
Does this advertisement have a URI?
bool NimBLEAdvertisedDevice::isAdvertisingService | ( | const NimBLEUUID & | uuid | ) |
Check advertised services for existance of the required UUID.
[in] | uuid | The service uuid to look for in the advertisement. |
std::string NimBLEAdvertisedDevice::toString | ( | ) |
Create a string representation of this device.