ESPHome
2026.11.0b6
Loading...
Searching...
No Matches
esphome
components
nfc
ndef_record_uri.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
esphome/core/helpers.h
"
4
#include "
esphome/core/log.h
"
5
#include "
ndef_record.h
"
6
7
#include <vector>
8
9
namespace
esphome::nfc
{
10
11
class
NdefRecordUri
:
public
NdefRecord
{
12
public
:
13
NdefRecordUri
() {};
14
NdefRecordUri
(
const
std::vector<uint8_t> &payload);
15
NdefRecordUri
(
const
std::string &uri) {
16
this->
tnf_
= TNF_WELL_KNOWN;
17
this->
type_
=
"U"
;
18
this->
uri_
= uri;
19
};
20
NdefRecordUri
(
const
std::string &uri,
const
std::string &
id
) {
21
this->
tnf_
= TNF_WELL_KNOWN;
22
this->
type_
=
"U"
;
23
this->
uri_
= uri;
24
this->
id_
=
id
;
25
};
26
NdefRecordUri
(
const
NdefRecordUri
&) =
default
;
27
std::unique_ptr<NdefRecord>
clone
()
const override
{
return
make_unique<NdefRecordUri>(*
this
); };
28
29
void
set_uri
(
const
std::string &uri) { this->
uri_
= uri; };
30
31
std::vector<uint8_t>
get_encoded_payload
()
override
;
32
const
std::string &
get_payload
()
const override
{
return
this->
uri_
; };
33
34
protected
:
35
std::string
uri_
;
36
};
37
38
}
// namespace esphome::nfc
esphome::nfc::NdefRecord
Definition
ndef_record.h:19
esphome::nfc::NdefRecord::id_
std::string id_
Definition
ndef_record.h:51
esphome::nfc::NdefRecord::tnf_
uint8_t tnf_
Definition
ndef_record.h:49
esphome::nfc::NdefRecord::type_
std::string type_
Definition
ndef_record.h:50
esphome::nfc::NdefRecordUri
Definition
ndef_record_uri.h:11
esphome::nfc::NdefRecordUri::NdefRecordUri
NdefRecordUri(const std::string &uri, const std::string &id)
Definition
ndef_record_uri.h:20
esphome::nfc::NdefRecordUri::get_payload
const std::string & get_payload() const override
Definition
ndef_record_uri.h:32
esphome::nfc::NdefRecordUri::NdefRecordUri
NdefRecordUri(const std::string &uri)
Definition
ndef_record_uri.h:15
esphome::nfc::NdefRecordUri::uri_
std::string uri_
Definition
ndef_record_uri.h:35
esphome::nfc::NdefRecordUri::NdefRecordUri
NdefRecordUri(const NdefRecordUri &)=default
esphome::nfc::NdefRecordUri::get_encoded_payload
std::vector< uint8_t > get_encoded_payload() override
Definition
ndef_record_uri.cpp:38
esphome::nfc::NdefRecordUri::set_uri
void set_uri(const std::string &uri)
Definition
ndef_record_uri.h:29
esphome::nfc::NdefRecordUri::clone
std::unique_ptr< NdefRecord > clone() const override
Definition
ndef_record_uri.h:27
esphome::nfc::NdefRecordUri::NdefRecordUri
NdefRecordUri()
Definition
ndef_record_uri.h:13
id
uint16_t id
Definition
dns_server_esp32_idf.cpp:0
helpers.h
log.h
esphome::nfc
Definition
automation.cpp:4
ndef_record.h
Generated by
1.12.0