Class NDEFRecordType

Class Documentation

class NDEFRecordType

Public Types

enum TypeID

Type Name Format Field types

Represents 3-bit value describing record type, sets expectation for structure/content of record

Values:

Empty = 0x00

Record does not contain any information.

WellKnown = 0x01

Well Known Data Type - Data is defined by Record Type Definition (RTD) specification from NFC Forum.

MIMEMedia = 0x02

MIME Media - Data is one of the data types normally found in internet communications defined in RFC 2046.

AbsoluteURI = 0x03

Absolute Uniform Resource Identifier - Pointer to a resource following the RFC 3986 syntax.

External = 0x04

User-defined data that relies on the format specified by the RTD specification.

Unknown = 0x05

Unknown data type - Type length must be set to 0

Unchanged = 0x06

Indicates this payload is a part of a chunked record, with the type unchanged from the first chunk.

Invalid = 0x07

Invalid value, used for from_byte() helper. Value 0x07 is reserved by the NFC Forum.

Public Functions

NDEFRecordType(TypeID id = TypeID::Empty, const std::string &name = "")
constexpr bool operator==(const NDEFRecordType &rhs) const
constexpr bool operator!=(const NDEFRecordType &rhs) const
constexpr TypeID id() const

Gets record type variant

Return

TypeID variant of tnf member

std::string name() const

Gets record type name

Return

string record type

Public Static Functions

NDEFRecordType from_bytes(std::vector<uint8_t> bytes, size_t offset = 0)

Creates an NDEFRecordType object from a vector of bytes starting at offset.

Return

type value matching value, ::TypeID::Invalid if value does not match any TypeID Name Format field

Parameters
  • bytes: vector of octets (bytes) of data to create RecordHeader object from

  • offset: offset within values vector to start from

static NDEFRecordType from_bytes(uint8_t bytes[], size_t len, size_t offset = 0)

Return

type value matching value, #TypeID::Invalid if value does not match any TypeID Name Format field

Parameters
  • bytes: array of octets (bytes) of data to create RecordHeader object from

  • len: number of values in data array

  • offset: offset within values vector to start from

NDEFRecordType text_record_type()
NDEFRecordType uri_record_type()
NDEFRecordType invalid_record_type()