13 static const char *
const TAG =
"esp32_ble.advertising";
28 this->
advertising_data_.flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT);
69 if (num_services == 0) {
76 for (
int i = 0; i < num_services; i++) {
90 ESP_LOGE(TAG,
"esp_ble_gap_config_adv_data failed (Advertising): %s", esp_err_to_name(err));
104 ESP_LOGE(TAG,
"esp_ble_gap_config_adv_data failed (Scan response): %s", esp_err_to_name(err));
116 ESP_LOGE(TAG,
"esp_ble_gap_start_advertising failed: %s", esp_err_to_name(err));
132 esp_err_t err = esp_ble_gap_stop_advertising();
134 ESP_LOGE(TAG,
"esp_ble_gap_stop_advertising failed: %d", err);
146 const uint32_t now =
millis();
BLEAdvertising(uint32_t advertising_cycle_time)
void set_service_data(const std::vector< uint8_t > &data)
std::vector< std::function< void(bool)> > raw_advertisements_callbacks_
esp_ble_adv_params_t advertising_params_
void set_manufacturer_data(const std::vector< uint8_t > &data)
uint32_t IRAM_ATTR HOT millis()
void register_raw_advertisement_callback(std::function< void(bool)> &&callback)
uint32_t last_advertisement_time_
esp_ble_adv_data_t advertising_data_
void remove_service_uuid(ESPBTUUID uuid)
int8_t current_adv_index_
const uint32_t advertising_cycle_time_
esp_ble_adv_data_t scan_response_data_
Implementation of SPI Controller mode.
void add_service_uuid(ESPBTUUID uuid)
std::vector< ESPBTUUID > advertising_uuids_
ESPBTUUID as_128bit() const
esp_err_t services_advertisement_()
esp_bt_uuid_t get_uuid() const