NDEF TLV container.
More...
#include <ndef_tlv.hpp>
|
|
using | container_type = std::vector<Record> |
| |
|
|
| TLV (const Tag t) |
| |
|
Tag | tag () const |
| | Tag.
|
| |
|
bool | isTerminatorTLV () const |
| | Is termibator.
|
| |
|
bool | isMessageTLV () const |
| | Is Message?
|
| |
|
bool | isNullTLV () const |
| | Is Null TLV?
|
| |
| const container_type & | records () const |
| | Get the records.
|
| |
| const std::vector< uint8_t > & | payload () const |
| | Get the payload.
|
| |
| std::vector< uint8_t > & | payload () |
| | Get the payload.
|
| |
|
uint32_t | required () const |
| | Size required for encoding.
|
| |
| bool | push_back (const Record &r) |
| | Push back the record.
|
| |
|
void | pop_back () |
| | Removes the last record.
|
| |
| uint32_t | encode (uint8_t *buf, const uint32_t blen) const |
| | Encode.
|
| |
| uint32_t | decode (const uint8_t *buf, const uint32_t len) |
| | Decode.
|
| |
| void | clear () |
| | Clear internal buffers.
|
| |
|
void | dump () |
| |
|
|
static const TLV | Terminator |
| | Terminator instance.
|
| |
◆ clear()
| void m5::nfc::ndef::TLV::clear |
( |
| ) |
|
Clear internal buffers.
- Warning
- Keep the tag
◆ decode()
| uint32_t m5::nfc::ndef::TLV::decode |
( |
const uint8_t * | buf, |
|
|
const uint32_t | len ) |
Decode.
- Parameters
-
| buf | Pointer of the TLV |
| len | Buffer length |
- Return values
-
| > | 0 Decoded length |
| == | 0 Error |
◆ encode()
| uint32_t m5::nfc::ndef::TLV::encode |
( |
uint8_t * | buf, |
|
|
const uint32_t | blen ) const |
Encode.
- Parameters
-
| [out] | buf | Buffer |
| blen | Buffer size |
- Return values
-
| > | 0 Encoded length |
| == | 0 Error |
◆ payload() [1/2]
| std::vector< uint8_t > & m5::nfc::ndef::TLV::payload |
( |
| ) |
|
|
inline |
Get the payload.
- Precondition
- Tag must NOT be Message
◆ payload() [2/2]
| const std::vector< uint8_t > & m5::nfc::ndef::TLV::payload |
( |
| ) |
const |
|
inline |
Get the payload.
- Precondition
- Tag must NOT be Message
◆ push_back()
| bool m5::nfc::ndef::TLV::push_back |
( |
const Record & | r | ) |
|
Push back the record.
- Parameters
-
- Returns
- True if successful
- Note
- A copy of the Record is inserted at the end
◆ records()
| const container_type & m5::nfc::ndef::TLV::records |
( |
| ) |
const |
|
inline |
Get the records.
- Precondition
- Tag must be Message