Nol.A SDK Library  24.11.0
For IoT System Software Development
Public Member Functions | List of all members
BLEAdvertising Class Reference

Perform and manage BLE advertising. More...

#include <BLEAdvertising.hpp>

Public Member Functions

 BLEAdvertising ()
 Construct a default advertising object.
 
void addServiceUUID (BLEUUID serviceUUID)
 
void addServiceUUID (const char *serviceUUID)
 
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)
 

Detailed Description

Perform and manage BLE advertising.

A BLE server will want to perform advertising in order to make itself known to BLE clients.

Member Function Documentation

◆ setAdvertisementData()

void BLEAdvertising::setAdvertisementData ( BLEAdvertisementData advertisementData)

Set the advertisement data that is to be published in a regular advertisement.

Parameters
[in]advertisementDataThe data to be advertised.

◆ setAppearance()

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.

Parameters
[in]appearanceThe appearance of the device in the advertising data.
Returns
N/A.

◆ setMaxInterval()

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.

◆ setMaxIntervalMicros()

uint32_t BLEAdvertising::setMaxIntervalMicros ( uint32_t  usec)

Set the maximum interval in unit of usec.

Returns
The actual configured interval value.

◆ setMinInterval()

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.

◆ setMinIntervalMicros()

uint32_t BLEAdvertising::setMinIntervalMicros ( uint32_t  usec)

Set the minimum interval in unit of usec.

Returns
The actual configured interval value.

◆ setScanFilter()

void BLEAdvertising::setScanFilter ( bool  scanRequertWhitelistOnly,
bool  connectWhitelistOnly 
)

Set the filtering for the scan filter.

Parameters
[in]scanRequestWhitelistOnlyIf true, only allow scan requests from those on the white list.
[in]connectWhitelistOnlyIf true, only allow connections from those on the white list.

◆ setScanResponseData()

void BLEAdvertising::setScanResponseData ( BLEAdvertisementData advertisementData)

Set the advertisement data that is to be published in a scan response.

Parameters
[in]advertisementDataThe data to be advertised.

◆ start()

void BLEAdvertising::start ( )

Start advertising. Start advertising.

Returns
N/A.

◆ stop()

void BLEAdvertising::stop ( )

Stop advertising. Stop advertising.

Returns
N/A.

The documentation for this class was generated from the following file: