ESPHome  2024.9.2
Public Member Functions | Protected Attributes
esphome::nfc::NdefRecord Class Reference

#include <ndef_record.h>

Inheritance diagram for esphome::nfc::NdefRecord:
esphome::nfc::NdefRecordText esphome::nfc::NdefRecordUri

Public Member Functions

 NdefRecord ()
 
 NdefRecord (std::vector< uint8_t > payload_data)
 
void set_tnf (uint8_t tnf)
 
void set_type (const std::string &type)
 
void set_payload (const std::string &payload)
 
void set_id (const std::string &id)
 
 NdefRecord (const NdefRecord &)=default
 
virtual ~NdefRecord ()
 
virtual std::unique_ptr< NdefRecordclone () const
 
uint32_t get_encoded_size ()
 
std::vector< uint8_t > encode (bool first, bool last)
 
uint8_t create_flag_byte (bool first, bool last, size_t payload_size)
 
const std::string & get_type () const
 
const std::string & get_id () const
 
virtual const std::string & get_payload () const
 
virtual std::vector< uint8_t > get_encoded_payload ()
 

Protected Attributes

uint8_t tnf_
 
std::string type_
 
std::string id_
 
std::string payload_
 

Detailed Description

Definition at line 20 of file ndef_record.h.

Constructor & Destructor Documentation

◆ NdefRecord() [1/3]

esphome::nfc::NdefRecord::NdefRecord ( )
inline

Definition at line 22 of file ndef_record.h.

◆ NdefRecord() [2/3]

esphome::nfc::NdefRecord::NdefRecord ( std::vector< uint8_t >  payload_data)

Definition at line 8 of file ndef_record.cpp.

◆ NdefRecord() [3/3]

esphome::nfc::NdefRecord::NdefRecord ( const NdefRecord )
default

◆ ~NdefRecord()

virtual esphome::nfc::NdefRecord::~NdefRecord ( )
inlinevirtual

Definition at line 29 of file ndef_record.h.

Member Function Documentation

◆ clone()

virtual std::unique_ptr<NdefRecord> esphome::nfc::NdefRecord::clone ( ) const
inlinevirtual

Reimplemented in esphome::nfc::NdefRecordUri, and esphome::nfc::NdefRecordText.

Definition at line 30 of file ndef_record.h.

◆ create_flag_byte()

uint8_t esphome::nfc::NdefRecord::create_flag_byte ( bool  first,
bool  last,
size_t  payload_size 
)

Definition at line 47 of file ndef_record.cpp.

◆ encode()

std::vector< uint8_t > esphome::nfc::NdefRecord::encode ( bool  first,
bool  last 
)

Definition at line 12 of file ndef_record.cpp.

◆ get_encoded_payload()

virtual std::vector<uint8_t> esphome::nfc::NdefRecord::get_encoded_payload ( )
inlinevirtual

Reimplemented in esphome::nfc::NdefRecordUri, and esphome::nfc::NdefRecordText.

Definition at line 44 of file ndef_record.h.

◆ get_encoded_size()

uint32_t esphome::nfc::NdefRecord::get_encoded_size ( )

◆ get_id()

const std::string& esphome::nfc::NdefRecord::get_id ( ) const
inline

Definition at line 41 of file ndef_record.h.

◆ get_payload()

virtual const std::string& esphome::nfc::NdefRecord::get_payload ( ) const
inlinevirtual

Reimplemented in esphome::nfc::NdefRecordUri, and esphome::nfc::NdefRecordText.

Definition at line 42 of file ndef_record.h.

◆ get_type()

const std::string& esphome::nfc::NdefRecord::get_type ( ) const
inline

Definition at line 40 of file ndef_record.h.

◆ set_id()

void esphome::nfc::NdefRecord::set_id ( const std::string &  id)
inline

Definition at line 27 of file ndef_record.h.

◆ set_payload()

void esphome::nfc::NdefRecord::set_payload ( const std::string &  payload)
inline

Definition at line 26 of file ndef_record.h.

◆ set_tnf()

void esphome::nfc::NdefRecord::set_tnf ( uint8_t  tnf)
inline

Definition at line 24 of file ndef_record.h.

◆ set_type()

void esphome::nfc::NdefRecord::set_type ( const std::string &  type)
inline

Definition at line 25 of file ndef_record.h.

Field Documentation

◆ id_

std::string esphome::nfc::NdefRecord::id_
protected

Definition at line 52 of file ndef_record.h.

◆ payload_

std::string esphome::nfc::NdefRecord::payload_
protected

Definition at line 53 of file ndef_record.h.

◆ tnf_

uint8_t esphome::nfc::NdefRecord::tnf_
protected

Definition at line 47 of file ndef_record.h.

◆ type_

std::string esphome::nfc::NdefRecord::type_
protected

Definition at line 51 of file ndef_record.h.


The documentation for this class was generated from the following files: