Extended advertising class.
More...
#include <NimBLEExtAdvertising.h>
|
|
| NimBLEExtAdvertising () |
| | Constructor.
|
| |
|
| ~NimBLEExtAdvertising () |
| | Destructor: deletes callback instances if requested.
|
| |
| bool | start (uint8_t instId, int duration=0, int maxEvents=0) |
| | Start extended advertising.
|
| |
| bool | setInstanceData (uint8_t instId, NimBLEExtAdvertisement &adv) |
| | Register the extended advertisement data.
|
| |
| bool | setScanResponseData (uint8_t instId, NimBLEExtAdvertisement &data) |
| | Set the scan response data for a legacy advertisement.
|
| |
| bool | removeInstance (uint8_t instId) |
| | Stop and remove this instance data from the advertisement set.
|
| |
| bool | removeAll () |
| | Stop and remove all advertising instance data.
|
| |
| bool | stop (uint8_t instId) |
| | Stop advertising this instance data.
|
| |
| bool | stop () |
| | Stop all advertisements.
|
| |
| bool | isActive (uint8_t instId) |
| | Check if currently advertising.
|
| |
| bool | isAdvertising () |
| | Check if any instances are currently advertising.
|
| |
| void | setCallbacks (NimBLEExtAdvertisingCallbacks *callbacks, bool deleteCallbacks=true) |
| | Set a callback to call when the advertisement stops.
|
| |
Extended advertising class.
◆ isActive()
| bool NimBLEExtAdvertising::isActive |
( |
uint8_t |
instId | ) |
|
Check if currently advertising.
- Parameters
-
| [in] | instId | The instance ID of the advertised data to get the status of. |
- Returns
- True if advertising is active.
◆ isAdvertising()
| bool NimBLEExtAdvertising::isAdvertising |
( |
| ) |
|
Check if any instances are currently advertising.
- Returns
- True if any instance is active.
◆ removeAll()
| bool NimBLEExtAdvertising::removeAll |
( |
| ) |
|
Stop and remove all advertising instance data.
- Returns
- True if successful.
◆ removeInstance()
| bool NimBLEExtAdvertising::removeInstance |
( |
uint8_t |
instId | ) |
|
Stop and remove this instance data from the advertisement set.
- Parameters
-
| [in] | instId | The extended advertisement instance to stop advertising. |
- Returns
- True if successful.
◆ setCallbacks()
Set a callback to call when the advertisement stops.
- Parameters
-
| [in] | pCallbacks | A pointer to a callback to be invoked when an advertisement stops. |
| [in] | deleteCallbacks | if true callback class will be deleted when advertising is destructed. |
◆ setInstanceData()
Register the extended advertisement data.
- Parameters
-
| [in] | instId | The extended advertisement instance ID to assign to this data. |
| [in] | adv | The extended advertisement instance with the data to set. |
- Returns
- True if advertising started successfully.
◆ setScanResponseData()
Set the scan response data for a legacy advertisement.
- Parameters
-
| [in] | instId | The extended advertisement instance ID to assign to this data. |
| [in] | data | A reference to a NimBLEExtAdvertisement that contains the data. |
◆ start()
| bool NimBLEExtAdvertising::start |
( |
uint8_t |
instId, |
|
|
int |
duration = 0, |
|
|
int |
maxEvents = 0 |
|
) |
| |
Start extended advertising.
- Parameters
-
| [in] | instId | The extended advertisement instance ID to start. |
| [in] | duration | How long to advertise for in milliseconds, 0 = forever (default). |
| [in] | maxEvents | Maximum number of advertisement events to send, 0 = no limit (default). |
- Returns
- True if advertising started successfully.
◆ stop() [1/2]
| bool NimBLEExtAdvertising::stop |
( |
| ) |
|
Stop all advertisements.
- Returns
- True if successful.
◆ stop() [2/2]
| bool NimBLEExtAdvertising::stop |
( |
uint8_t |
instId | ) |
|
Stop advertising this instance data.
- Parameters
-
| [in] | instId | The extended advertisement instance to stop advertising. |
- Returns
- True if successful.