1
0
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:
Clyde Stubbs
2023-08-18 06:05:25 +10:00
committed by GitHub
parent c11c4dad2f
commit 164d05fdce
7 changed files with 50 additions and 16 deletions

View File

@@ -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 =