diff --git a/esphome/core/helpers.cpp b/esphome/core/helpers.cpp index de673c4052..14810f477e 100644 --- a/esphome/core/helpers.cpp +++ b/esphome/core/helpers.cpp @@ -646,6 +646,13 @@ void get_mac_address_into_buffer(std::span buf) { format_mac_addr_lower_no_sep(mac, buf.data()); } +const char *get_mac_address_pretty_into_buffer(std::span buf) { + uint8_t mac[6]; + get_mac_address_raw(mac); + format_mac_addr_upper(mac, buf.data()); + return buf.data(); +} + #ifndef USE_ESP32 bool has_custom_mac_address() { return false; } #endif diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index a05a1817b9..615c7778aa 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -1125,12 +1125,7 @@ void get_mac_address_into_buffer(std::span buf); /// Get the device MAC address into the given buffer, in colon-separated uppercase hex notation. /// Buffer must be exactly 18 bytes (17 for "XX:XX:XX:XX:XX:XX" + null terminator). /// Returns pointer to the buffer for convenience. -inline const char *get_mac_address_pretty_into_buffer(std::span buf) { - uint8_t mac[6]; - get_mac_address_raw(mac); - format_mac_addr_upper(mac, buf.data()); - return buf.data(); -} +const char *get_mac_address_pretty_into_buffer(std::span buf); #ifdef USE_ESP32 /// Set the MAC address to use from the provided byte array (6 bytes).