mirror of
https://github.com/esphome/esphome.git
synced 2025-10-10 13:53:49 +01:00
Merge branch 'mdns_services_const' into integration
This commit is contained in:
@@ -25,7 +25,8 @@ void MDNSComponent::setup() {
|
|||||||
mdns_hostname_set(this->hostname_.c_str());
|
mdns_hostname_set(this->hostname_.c_str());
|
||||||
mdns_instance_name_set(this->hostname_.c_str());
|
mdns_instance_name_set(this->hostname_.c_str());
|
||||||
|
|
||||||
for (const auto &service : this->services_) {
|
for (uint8_t i = 0; i < this->services_count_; i++) {
|
||||||
|
const auto &service = this->services_[i];
|
||||||
std::vector<mdns_txt_item_t> txt_records;
|
std::vector<mdns_txt_item_t> txt_records;
|
||||||
for (const auto &record : service.txt_records) {
|
for (const auto &record : service.txt_records) {
|
||||||
mdns_txt_item_t it{};
|
mdns_txt_item_t it{};
|
||||||
|
@@ -16,7 +16,8 @@ void MDNSComponent::setup() {
|
|||||||
|
|
||||||
MDNS.begin(this->hostname_.c_str());
|
MDNS.begin(this->hostname_.c_str());
|
||||||
|
|
||||||
for (const auto &service : this->services_) {
|
for (uint8_t i = 0; i < this->services_count_; i++) {
|
||||||
|
const auto &service = this->services_[i];
|
||||||
// Strip the leading underscore from the proto and service_type. While it is
|
// Strip the leading underscore from the proto and service_type. While it is
|
||||||
// part of the wire protocol to have an underscore, and for example ESP-IDF
|
// part of the wire protocol to have an underscore, and for example ESP-IDF
|
||||||
// expects the underscore to be there, the ESP8266 implementation always adds
|
// expects the underscore to be there, the ESP8266 implementation always adds
|
||||||
|
@@ -16,7 +16,8 @@ void MDNSComponent::setup() {
|
|||||||
|
|
||||||
MDNS.begin(this->hostname_.c_str());
|
MDNS.begin(this->hostname_.c_str());
|
||||||
|
|
||||||
for (const auto &service : this->services_) {
|
for (uint8_t i = 0; i < this->services_count_; i++) {
|
||||||
|
const auto &service = this->services_[i];
|
||||||
// Strip the leading underscore from the proto and service_type. While it is
|
// Strip the leading underscore from the proto and service_type. While it is
|
||||||
// part of the wire protocol to have an underscore, and for example ESP-IDF
|
// part of the wire protocol to have an underscore, and for example ESP-IDF
|
||||||
// expects the underscore to be there, the ESP8266 implementation always adds
|
// expects the underscore to be there, the ESP8266 implementation always adds
|
||||||
|
@@ -16,7 +16,8 @@ void MDNSComponent::setup() {
|
|||||||
|
|
||||||
MDNS.begin(this->hostname_.c_str());
|
MDNS.begin(this->hostname_.c_str());
|
||||||
|
|
||||||
for (const auto &service : this->services_) {
|
for (uint8_t i = 0; i < this->services_count_; i++) {
|
||||||
|
const auto &service = this->services_[i];
|
||||||
// Strip the leading underscore from the proto and service_type. While it is
|
// Strip the leading underscore from the proto and service_type. While it is
|
||||||
// part of the wire protocol to have an underscore, and for example ESP-IDF
|
// part of the wire protocol to have an underscore, and for example ESP-IDF
|
||||||
// expects the underscore to be there, the ESP8266 implementation always adds
|
// expects the underscore to be there, the ESP8266 implementation always adds
|
||||||
|
@@ -143,7 +143,7 @@ void OpenThreadSrpComponent::setup() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use mdns services directly - they remain valid for the lifetime of the mdns component
|
// Get mdns services and copy their data (strings are copied with strdup below)
|
||||||
const auto &mdns_services = this->mdns_->get_services();
|
const auto &mdns_services = this->mdns_->get_services();
|
||||||
uint8_t mdns_count = this->mdns_->get_services_count();
|
uint8_t mdns_count = this->mdns_->get_services_count();
|
||||||
ESP_LOGD(TAG, "Setting up SRP services. count = %d\n", mdns_count);
|
ESP_LOGD(TAG, "Setting up SRP services. count = %d\n", mdns_count);
|
||||||
|
Reference in New Issue
Block a user