diff --git a/esphome/components/nfc/ndef_record_uri.cpp b/esphome/components/nfc/ndef_record_uri.cpp index 8fd043a1de..9064f04f29 100644 --- a/esphome/components/nfc/ndef_record_uri.cpp +++ b/esphome/components/nfc/ndef_record_uri.cpp @@ -21,7 +21,7 @@ NdefRecordUri::NdefRecordUri(const std::vector &payload) { this->tnf_ = TNF_WELL_KNOWN; this->type_ = "U"; - this->set_URI(uri); + this->set_uri(uri); } std::vector NdefRecordUri::get_encoded_payload() { @@ -31,7 +31,7 @@ std::vector NdefRecordUri::get_encoded_payload() { uint8_t payload_prefix_length = 0x00; for (uint8_t i = 1; i < PAYLOAD_IDENTIFIERS_COUNT; i++) { std::string prefix = PAYLOAD_IDENTIFIERS[i]; - if (this->URI_.substr(0, prefix.length()).find(prefix) != std::string::npos) { + if (this->uri_.substr(0, prefix.length()).find(prefix) != std::string::npos) { payload_prefix = i; payload_prefix_length = prefix.length(); break; @@ -40,7 +40,7 @@ std::vector NdefRecordUri::get_encoded_payload() { data.push_back(payload_prefix); - data.insert(data.end(), this->URI_.begin() + payload_prefix_length, this->URI_.end()); + data.insert(data.end(), this->uri_.begin() + payload_prefix_length, this->uri_.end()); return data; } diff --git a/esphome/components/nfc/ndef_record_uri.h b/esphome/components/nfc/ndef_record_uri.h index 75f9e19ee0..4c21724c5c 100644 --- a/esphome/components/nfc/ndef_record_uri.h +++ b/esphome/components/nfc/ndef_record_uri.h @@ -49,27 +49,27 @@ class NdefRecordUri : public NdefRecord { public: NdefRecordUri(){}; NdefRecordUri(const std::vector &payload); - NdefRecordUri(const std::string &URI) { + NdefRecordUri(const std::string &uri) { this->tnf_ = TNF_WELL_KNOWN; this->type_ = "U"; - this->URI_ = URI; + this->uri_ = uri; }; - NdefRecordUri(const std::string &URI, const std::string &id) { + NdefRecordUri(const std::string &uri, const std::string &id) { this->tnf_ = TNF_WELL_KNOWN; this->type_ = "U"; - this->URI_ = URI; + this->uri_ = uri; this->id_ = id; }; NdefRecordUri(const NdefRecordUri &) = default; std::unique_ptr clone() const override { return make_unique(*this); }; - void set_URI(const std::string &URI) { this->URI_ = URI; }; + void set_uri(const std::string &uri) { this->uri_ = uri; }; std::vector get_encoded_payload() override; - const std::string &get_payload() const override { return this->URI_; }; + const std::string &get_payload() const override { return this->uri_; }; protected: - std::string URI_; + std::string uri_; }; } // namespace nfc