Mbed OS Reference
Loading...
Searching...
No Matches
RecordType Struct Reference

Encode a record type. More...

#include <Record.h>

Public Types

enum  tnf_t {
  empty = 0x00 , well_known_type = 0x01 , media_type = 0x02 , absolute_uri = 0x03 ,
  external_type = 0x04 , unknown = 0x05 , unchanged = 0x06
}
 Type name format of a record. More...
 

Public Member Functions

 RecordType ()
 Construct an unknown type.
 
 RecordType (tnf_t tnf)
 Construct a type with no value.
 
 RecordType (tnf_t tnf, const Span< const uint8_t > &value)
 Construct a RecordType from a type name format and its associated value.
 

Data Fields

tnf_t tnf
 Type name format of the record type.
 
Span< const uint8_t > value
 Value associated with the record type.
 

Detailed Description

Encode a record type.

A RecordType is composed of a type name format flag and an optional type value.

Definition at line 53 of file Record.h.

Member Enumeration Documentation

◆ tnf_t

enum tnf_t

Type name format of a record.

Enumerator
empty 

empty type; value must be empty.

empty

well_known_type 

Type defined by the NFC forum; value must be defined.

well_known_type

media_type 

Mime type; value must be defined.

media_type

absolute_uri 

Absolute URI; value must be defined.

absolute_uri

external_type 

Type defined by vendors; value must be defined.

external_type

unknown 

Unknown type; value must be empty.

unknown

unchanged 

Use for middle and terminating chunk record.

value must be empty. unchanged

Definition at line 57 of file Record.h.

Constructor & Destructor Documentation

◆ RecordType() [1/3]

Construct an unknown type.

Definition at line 98 of file Record.h.

◆ RecordType() [2/3]

RecordType ( tnf_t  tnf)

Construct a type with no value.

Note
Valid tnf are: empty, unknown and unchanged.
Parameters
tnfThe type name format of the type.

Definition at line 107 of file Record.h.

◆ RecordType() [3/3]

RecordType ( tnf_t  tnf,
const Span< const uint8_t > &  value 
)

Construct a RecordType from a type name format and its associated value.

Parameters
tnfThe type name format of the record type.
valueThe value associated with the tnf.

Definition at line 117 of file Record.h.

Field Documentation

◆ tnf

tnf_t tnf

Type name format of the record type.

Definition at line 124 of file Record.h.

◆ value

Span<const uint8_t> value

Value associated with the record type.

It can be empty.

Definition at line 129 of file Record.h.