18#ifndef NFC_NDEF_RECORD_H_
19#define NFC_NDEF_RECORD_H_
23#include "platform/Span.h"
39 static const uint8_t message_begin_bit = (1 << 7);
40 static const uint8_t message_end_bit = (1 << 6);
41 static const uint8_t chunk_flag_bit = (1 << 5);
42 static const uint8_t short_record_bit = (1 << 4);
43 static const uint8_t id_length_bit = (1 << 3);
44 static const uint8_t tnf_bits = (1 << 0) | (1 << 1) | (1 << 2);
Span< const uint8_t > RecordPayload
Definition of a Record payload.
Span< const uint8_t > RecordID
Definition of a Record IR.
Nonowning view to a sequence of contiguous elements.
Record()
Construct an empty record.
Record(RecordType type, const RecordPayload &payload, const RecordID &id, bool chunk, bool last_record)
Construct a record from its type, payload and id.
bool last_record
If true, this record is the last one of the payload containing it.
RecordPayload payload
Value of the payload.
RecordID id
ID of the record.
RecordType type
Type of the record.
bool chunk
If true, this record is a chunked record.
Span< const uint8_t > value
Value associated with the record type.
RecordType(tnf_t tnf)
Construct a type with no value.
tnf_t tnf
Type name format of the record type.
RecordType()
Construct an unknown type.
tnf_t
Type name format of a record.
@ unchanged
Use for middle and terminating chunk record.
@ unknown
Unknown type; value must be empty.
@ well_known_type
Type defined by the NFC forum; value must be defined.
@ media_type
Mime type; value must be defined.
@ external_type
Type defined by vendors; value must be defined.
@ absolute_uri
Absolute URI; value must be defined.
@ empty
empty type; value must be empty.
RecordType(tnf_t tnf, const Span< const uint8_t > &value)
Construct a RecordType from a type name format and its associated value.