mirror of
https://github.com/esphome/esphome.git
synced 2025-09-11 15:52:20 +01:00
Add manufacturer data config to BLE server (#5251)
This commit is contained in:
@@ -68,6 +68,7 @@ void BLEServer::loop() {
|
||||
if (this->device_information_service_->is_running()) {
|
||||
this->state_ = RUNNING;
|
||||
this->can_proceed_ = true;
|
||||
this->restart_advertising_();
|
||||
ESP_LOGD(TAG, "BLE server setup successfully");
|
||||
} else if (!this->device_information_service_->is_starting()) {
|
||||
this->device_information_service_->start();
|
||||
@@ -77,6 +78,13 @@ void BLEServer::loop() {
|
||||
}
|
||||
}
|
||||
|
||||
void BLEServer::restart_advertising_() {
|
||||
if (this->state_ == RUNNING) {
|
||||
esp32_ble::global_ble->get_advertising()->set_manufacturer_data(this->manufacturer_data_);
|
||||
esp32_ble::global_ble->get_advertising()->start();
|
||||
}
|
||||
}
|
||||
|
||||
bool BLEServer::create_device_characteristics_() {
|
||||
if (this->model_.has_value()) {
|
||||
BLECharacteristic *model =
|
||||
|
Reference in New Issue
Block a user