Skip to content

Commit ca78dd4

Browse files
authored
Include MAC address in noise hello (esphome#8551)
1 parent 7edf458 commit ca78dd4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

esphome/components/api/api_frame_helper.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ APIError APINoiseFrameHelper::state_action_() {
311311
const std::string &name = App.get_name();
312312
const uint8_t *name_ptr = reinterpret_cast<const uint8_t *>(name.c_str());
313313
msg.insert(msg.end(), name_ptr, name_ptr + name.size() + 1);
314+
// node mac, terminated by null byte
315+
const std::string &mac = get_mac_address();
316+
const uint8_t *mac_ptr = reinterpret_cast<const uint8_t *>(mac.c_str());
317+
msg.insert(msg.end(), mac_ptr, mac_ptr + mac.size() + 1);
314318

315319
aerr = write_frame_(msg.data(), msg.size());
316320
if (aerr != APIError::OK)

0 commit comments

Comments
 (0)