ESPHome  2024.10.2
Public Member Functions | Protected Attributes
esphome::nfc::NdefMessage Class Reference

#include <ndef_message.h>

Public Member Functions

 NdefMessage ()=default
 
 NdefMessage (std::vector< uint8_t > &data)
 
 NdefMessage (const NdefMessage &msg)
 
const std::vector< std::shared_ptr< NdefRecord > > & get_records ()
 
bool add_record (std::unique_ptr< NdefRecord > record)
 
bool add_text_record (const std::string &text)
 
bool add_text_record (const std::string &text, const std::string &encoding)
 
bool add_uri_record (const std::string &uri)
 
std::vector< uint8_t > encode ()
 

Protected Attributes

std::vector< std::shared_ptr< NdefRecord > > records_
 

Detailed Description

Definition at line 17 of file ndef_message.h.

Constructor & Destructor Documentation

◆ NdefMessage() [1/3]

esphome::nfc::NdefMessage::NdefMessage ( )
default

◆ NdefMessage() [2/3]

esphome::nfc::NdefMessage::NdefMessage ( std::vector< uint8_t > &  data)

Definition at line 9 of file ndef_message.cpp.

◆ NdefMessage() [3/3]

esphome::nfc::NdefMessage::NdefMessage ( const NdefMessage msg)
inline

Definition at line 21 of file ndef_message.h.

Member Function Documentation

◆ add_record()

bool esphome::nfc::NdefMessage::add_record ( std::unique_ptr< NdefRecord record)

Definition at line 82 of file ndef_message.cpp.

◆ add_text_record() [1/2]

bool esphome::nfc::NdefMessage::add_text_record ( const std::string &  text)

Definition at line 91 of file ndef_message.cpp.

◆ add_text_record() [2/2]

bool esphome::nfc::NdefMessage::add_text_record ( const std::string &  text,
const std::string &  encoding 
)

Definition at line 93 of file ndef_message.cpp.

◆ add_uri_record()

bool esphome::nfc::NdefMessage::add_uri_record ( const std::string &  uri)

Definition at line 97 of file ndef_message.cpp.

◆ encode()

std::vector< uint8_t > esphome::nfc::NdefMessage::encode ( )

Definition at line 99 of file ndef_message.cpp.

◆ get_records()

const std::vector<std::shared_ptr<NdefRecord> >& esphome::nfc::NdefMessage::get_records ( )
inline

Definition at line 28 of file ndef_message.h.

Field Documentation

◆ records_

std::vector<std::shared_ptr<NdefRecord> > esphome::nfc::NdefMessage::records_
protected

Definition at line 38 of file ndef_message.h.


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