1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-15 23:30:28 +01:00

Include MAC address in noise hello (#8551)

This commit is contained in:
J. Nick Koston 2025-04-12 09:16:14 -10:00 committed by GitHub
parent 7edf458898
commit ca78dd44b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -311,6 +311,10 @@ APIError APINoiseFrameHelper::state_action_() {
const std::string &name = App.get_name();
const uint8_t *name_ptr = reinterpret_cast<const uint8_t *>(name.c_str());
msg.insert(msg.end(), name_ptr, name_ptr + name.size() + 1);
// node mac, terminated by null byte
const std::string &mac = get_mac_address();
const uint8_t *mac_ptr = reinterpret_cast<const uint8_t *>(mac.c_str());
msg.insert(msg.end(), mac_ptr, mac_ptr + mac.size() + 1);
aerr = write_frame_(msg.data(), msg.size());
if (aerr != APIError::OK)