[nfc] Use stack-based hex formatting in pn7150/pn7160 components

This commit is contained in:
J. Nick Koston
2026-01-12 00:23:09 -10:00
parent 40b278f485
commit 51dfb3af5e
2 changed files with 2 additions and 4 deletions

View File

@@ -6,8 +6,7 @@ namespace nfc {
void NfcOnTagTrigger::process(const std::unique_ptr<NfcTag> &tag) {
char uid_buf[FORMAT_UID_BUFFER_SIZE];
format_uid_to(uid_buf, tag->get_uid());
this->trigger(std::string(uid_buf), *tag);
this->trigger(std::string(format_uid_to(uid_buf, tag->get_uid())), *tag);
}
} // namespace nfc

View File

@@ -26,8 +26,7 @@ void NfcTagBinarySensor::dump_config() {
}
if (!this->uid_.empty()) {
char uid_buf[FORMAT_BYTES_BUFFER_SIZE];
format_bytes_to(uid_buf, this->uid_);
ESP_LOGCONFIG(TAG, " Tag UID: %s", uid_buf);
ESP_LOGCONFIG(TAG, " Tag UID: %s", format_bytes_to(uid_buf, this->uid_));
}
}