SDK
23.9.2
For IoT System Software Development
|
Perform and manage BLE advertising. More...
#include <BLEAdvertising.hpp>
Public Member Functions | |
BLEAdvertising () | |
Construct a default advertising object. More... | |
void | addServiceUUID (BLEUUID serviceUUID) |
Add a service uuid to exposed list of services. More... | |
void | addServiceUUID (const char *serviceUUID) |
Add a service uuid to exposed list of services. More... | |
void | start () |
Start advertising. Start advertising. More... | |
void | stop () |
Stop advertising. Stop advertising. More... | |
void | setAppearance (uint16_t appearance) |
Set the device appearance in the advertising data. The appearance attribute is of type 0x19. The codes for distinct appearances can be found here: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml. More... | |
void | setMaxInterval (uint16_t maxinterval) |
Set the maximum interval. More... | |
void | setMinInterval (uint16_t mininterval) |
Set the minimum interval. More... | |
uint32_t | setMaxIntervalMicros (uint32_t usec) |
Set the maximum interval in unit of usec. More... | |
uint32_t | setMinIntervalMicros (uint32_t usec) |
Set the minimum interval in unit of usec. More... | |
void | setAdvertisementData (BLEAdvertisementData &advertisementData) |
Set the advertisement data that is to be published in a regular advertisement. More... | |
void | setScanFilter (bool scanRequertWhitelistOnly, bool connectWhitelistOnly) |
Set the filtering for the scan filter. More... | |
void | setScanResponseData (BLEAdvertisementData &advertisementData) |
Set the advertisement data that is to be published in a scan response. More... | |
void | setMinPreferred (uint16_t) |
void | setMaxPreferred (uint16_t) |
void | setScanResponse (bool) |
Perform and manage BLE advertising.
A BLE server will want to perform advertising in order to make itself known to BLE clients.
BLEAdvertising::BLEAdvertising | ( | ) |
Construct a default advertising object.
void BLEAdvertising::addServiceUUID | ( | BLEUUID | serviceUUID | ) |
void BLEAdvertising::addServiceUUID | ( | const char * | serviceUUID | ) |
Add a service uuid to exposed list of services.
[in] | serviceUUID | The string representation of the service to expose. |
void BLEAdvertising::setAdvertisementData | ( | BLEAdvertisementData & | advertisementData | ) |
Set the advertisement data that is to be published in a regular advertisement.
[in] | advertisementData | The data to be advertised. |
void BLEAdvertising::setAppearance | ( | uint16_t | appearance | ) |
Set the device appearance in the advertising data. The appearance attribute is of type 0x19. The codes for distinct appearances can be found here: https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml.
[in] | appearance | The appearance of the device in the advertising data. |
void BLEAdvertising::setMaxInterval | ( | uint16_t | maxinterval | ) |
Set the maximum interval.
The unit is hardware dependent.
Try setMaxIntervalMicros() to set the interval in unit of usec.
uint32_t BLEAdvertising::setMaxIntervalMicros | ( | uint32_t | usec | ) |
Set the maximum interval in unit of usec.
void BLEAdvertising::setMinInterval | ( | uint16_t | mininterval | ) |
Set the minimum interval.
The unit is hardware dependent.
Try setMixIntervalMicros() to set the interval in unit of usec.
uint32_t BLEAdvertising::setMinIntervalMicros | ( | uint32_t | usec | ) |
Set the minimum interval in unit of usec.
void BLEAdvertising::setScanFilter | ( | bool | scanRequertWhitelistOnly, |
bool | connectWhitelistOnly | ||
) |
Set the filtering for the scan filter.
[in] | scanRequestWhitelistOnly | If true, only allow scan requests from those on the white list. |
[in] | connectWhitelistOnly | If true, only allow connections from those on the white list. |
void BLEAdvertising::setScanResponseData | ( | BLEAdvertisementData & | advertisementData | ) |
Set the advertisement data that is to be published in a scan response.
[in] | advertisementData | The data to be advertised. |
void BLEAdvertising::start | ( | ) |
Start advertising. Start advertising.
void BLEAdvertising::stop | ( | ) |
Stop advertising. Stop advertising.