Extend nfc ndef records with Text (#2191)

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
This commit is contained in:
JonasEr
2021-09-26 23:38:08 +03:00
committed by GitHub
parent 0d0954d74b
commit 4c390d9f9f
8 changed files with 264 additions and 123 deletions
+3 -1
View File
@@ -5,6 +5,8 @@
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#include "ndef_record.h"
#include "ndef_record_text.h"
#include "ndef_record_uri.h"
namespace esphome {
namespace nfc {
@@ -18,7 +20,7 @@ class NdefMessage {
NdefMessage(const NdefMessage &msg) {
records_.reserve(msg.records_.size());
for (const auto &r : msg.records_) {
records_.emplace_back(make_unique<NdefRecord>(*r));
records_.emplace_back(r->clone());
}
}