ESPHome 2026.5.1
Loading...
Searching...
No Matches
mdns_host.cpp
Go to the documentation of this file.
2#if defined(USE_HOST) && defined(USE_MDNS)
3
8#include "esphome/core/log.h"
9#include "mdns_component.h"
10
11namespace esphome::mdns {
12
14#ifdef USE_MDNS_STORE_SERVICES
15#ifdef USE_API
17 char *mac_ptr = this->mac_address_;
19 char *cfg_ptr = this->config_hash_str_;
20#else
21 char *mac_ptr = nullptr;
22 char *cfg_ptr = nullptr;
23#endif
24 this->compile_records_(this->services_, mac_ptr, cfg_ptr);
25#endif
26 // Host platform doesn't have actual mDNS implementation
27}
28
30
31} // namespace esphome::mdns
32
33#endif
uint32_t get_config_hash()
Get the config hash as a 32-bit integer.
char config_hash_str_[CONFIG_HASH_STR_SIZE]
Fixed buffer for config hash hex string (only needed when services are stored)
void compile_records_(StaticVector< MDNSService, MDNS_SERVICE_COUNT > &services, char *mac_address_buf, char *config_hash_buf)
char mac_address_[MAC_ADDRESS_BUFFER_SIZE]
Fixed buffer for MAC address (only needed when services are stored)
StaticVector< MDNSService, MDNS_SERVICE_COUNT > services_
void get_mac_address_into_buffer(std::span< char, MAC_ADDRESS_BUFFER_SIZE > buf)
Get the device MAC address into the given buffer, in lowercase hex notation.
Definition helpers.cpp:745
char * format_hex_to(char *buffer, size_t buffer_size, const uint8_t *data, size_t length)
Format byte array as lowercase hex to buffer (base implementation).
Definition helpers.cpp:335
Application App
Global storage of Application pointer - only one Application can exist.