ESPHome  2024.10.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::esp32_ble::BLEAdvertising Class Reference

#include <ble_advertising.h>

Public Member Functions

 BLEAdvertising (uint32_t advertising_cycle_time)
 
void loop ()
 
void add_service_uuid (ESPBTUUID uuid)
 
void remove_service_uuid (ESPBTUUID uuid)
 
void set_scan_response (bool scan_response)
 
void set_min_preferred_interval (uint16_t interval)
 
void set_manufacturer_data (const std::vector< uint8_t > &data)
 
void set_service_data (const std::vector< uint8_t > &data)
 
void register_raw_advertisement_callback (std::function< void(bool)> &&callback)
 
void start ()
 
void stop ()
 

Protected Member Functions

esp_err_t services_advertisement_ ()
 

Protected Attributes

bool scan_response_
 
esp_ble_adv_data_t advertising_data_
 
esp_ble_adv_data_t scan_response_data_
 
esp_ble_adv_params_t advertising_params_
 
std::vector< ESPBTUUIDadvertising_uuids_
 
std::vector< std::function< void(bool)> > raw_advertisements_callbacks_
 
const uint32_t advertising_cycle_time_
 
uint32_t last_advertisement_time_ {0}
 
int8_t current_adv_index_ {-1}
 

Detailed Description

Definition at line 24 of file ble_advertising.h.

Constructor & Destructor Documentation

◆ BLEAdvertising()

esphome::esp32_ble::BLEAdvertising::BLEAdvertising ( uint32_t  advertising_cycle_time)

Definition at line 15 of file ble_advertising.cpp.

Member Function Documentation

◆ add_service_uuid()

void esphome::esp32_ble::BLEAdvertising::add_service_uuid ( ESPBTUUID  uuid)

Definition at line 39 of file ble_advertising.cpp.

◆ loop()

void esphome::esp32_ble::BLEAdvertising::loop ( )

Definition at line 142 of file ble_advertising.cpp.

◆ register_raw_advertisement_callback()

void esphome::esp32_ble::BLEAdvertising::register_raw_advertisement_callback ( std::function< void(bool)> &&  callback)

Definition at line 158 of file ble_advertising.cpp.

◆ remove_service_uuid()

void esphome::esp32_ble::BLEAdvertising::remove_service_uuid ( ESPBTUUID  uuid)

Definition at line 40 of file ble_advertising.cpp.

◆ services_advertisement_()

esp_err_t esphome::esp32_ble::BLEAdvertising::services_advertisement_ ( )
protected

Definition at line 67 of file ble_advertising.cpp.

◆ set_manufacturer_data()

void esphome::esp32_ble::BLEAdvertising::set_manufacturer_data ( const std::vector< uint8_t > &  data)

Definition at line 56 of file ble_advertising.cpp.

◆ set_min_preferred_interval()

void esphome::esp32_ble::BLEAdvertising::set_min_preferred_interval ( uint16_t  interval)
inline

Definition at line 33 of file ble_advertising.h.

◆ set_scan_response()

void esphome::esp32_ble::BLEAdvertising::set_scan_response ( bool  scan_response)
inline

Definition at line 32 of file ble_advertising.h.

◆ set_service_data()

void esphome::esp32_ble::BLEAdvertising::set_service_data ( const std::vector< uint8_t > &  data)

Definition at line 45 of file ble_advertising.cpp.

◆ start()

void esphome::esp32_ble::BLEAdvertising::start ( )

Definition at line 123 of file ble_advertising.cpp.

◆ stop()

void esphome::esp32_ble::BLEAdvertising::stop ( )

Definition at line 131 of file ble_advertising.cpp.

Field Documentation

◆ advertising_cycle_time_

const uint32_t esphome::esp32_ble::BLEAdvertising::advertising_cycle_time_
protected

Definition at line 52 of file ble_advertising.h.

◆ advertising_data_

esp_ble_adv_data_t esphome::esp32_ble::BLEAdvertising::advertising_data_
protected

Definition at line 45 of file ble_advertising.h.

◆ advertising_params_

esp_ble_adv_params_t esphome::esp32_ble::BLEAdvertising::advertising_params_
protected

Definition at line 47 of file ble_advertising.h.

◆ advertising_uuids_

std::vector<ESPBTUUID> esphome::esp32_ble::BLEAdvertising::advertising_uuids_
protected

Definition at line 48 of file ble_advertising.h.

◆ current_adv_index_

int8_t esphome::esp32_ble::BLEAdvertising::current_adv_index_ {-1}
protected

Definition at line 54 of file ble_advertising.h.

◆ last_advertisement_time_

uint32_t esphome::esp32_ble::BLEAdvertising::last_advertisement_time_ {0}
protected

Definition at line 53 of file ble_advertising.h.

◆ raw_advertisements_callbacks_

std::vector<std::function<void(bool)> > esphome::esp32_ble::BLEAdvertising::raw_advertisements_callbacks_
protected

Definition at line 50 of file ble_advertising.h.

◆ scan_response_

bool esphome::esp32_ble::BLEAdvertising::scan_response_
protected

Definition at line 44 of file ble_advertising.h.

◆ scan_response_data_

esp_ble_adv_data_t esphome::esp32_ble::BLEAdvertising::scan_response_data_
protected

Definition at line 46 of file ble_advertising.h.


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