ST / NDefLib

Dependents:   NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more

Fork of NDefLib by ST Expansion SW Team

Embed: (wiki syntax)

« Back to documentation index

EmptyRecord Class Reference

EmptyRecord Class Reference

Define an empty Record. More...

#include <EmptyRecord.h>

Inherits NDefLib::Record.

Public Types

enum  RecordType_t {
  TYPE_UNKNOWN, TYPE_TEXT, TYPE_AAR, TYPE_MIME,
  TYPE_URI, TYPE_URI_MAIL, TYPE_URI_SMS, TYPE_URI_GEOLOCATION,
  TYPE_MIME_VCARD, TYPE_WIFI_CONF
}
 

Enum used to identify the record type.

More...

Public Member Functions

virtual uint16_t write (uint8_t *buffer)
 Write the 3 bytes used to define an empty record.
void set_as_first_record ()
 Set the record as the first record in the message.
void set_as_last_record ()
 Set the record as the last record in the message.
bool is_last_record () const
 Check if it is the last record in the message.
bool is_first_record () const
 Check if it is the first record in the message.
void set_as_middle_record ()
 Set the record as generic (not the first one and not the last one)
bool is_middle_record () const
 Check if the record is in the middle of a chain.
virtual RecordType_t get_type () const
 Get tag type.
const RecordHeaderget_header () const
 Get the record header.
virtual uint16_t get_byte_length ()
 Number of bytes needed to store this record.

Detailed Description

Define an empty Record.

Definition at line 48 of file EmptyRecord.h.


Member Enumeration Documentation

enum RecordType_t [inherited]

Enum used to identify the record type.

Enumerator:
TYPE_UNKNOWN 

UNKNOWN record.

TYPE_TEXT 

TEXT.

TYPE_AAR 

Android Archive record.

TYPE_MIME 

generic MIME type

TYPE_URI 

generic URI

TYPE_URI_MAIL 

Email URI record.

TYPE_URI_SMS 

SMS URI record.

TYPE_URI_GEOLOCATION 

position URI record

TYPE_MIME_VCARD 

VCard record.

TYPE_WIFI_CONF 

Wifi configuration.

Definition at line 56 of file Record.h.


Member Function Documentation

virtual uint16_t get_byte_length (  ) [virtual, inherited]

Number of bytes needed to store this record.

Returns:
size of the header + size of the record content

Reimplemented in RecordURI, RecordVCard, and RecordWifiConf.

Definition at line 140 of file Record.h.

const RecordHeader& get_header (  ) const [inherited]

Get the record header.

Returns:
record header

Definition at line 132 of file Record.h.

virtual RecordType_t get_type (  ) const [virtual, inherited]

Get tag type.

This method should be overridden to return a valid type.
Returns:
tag type

Reimplemented in RecordAAR, RecordGeo, RecordMail, RecordMimeType, RecordSMS, RecordText, RecordURI, RecordVCard, and RecordWifiConf.

Definition at line 123 of file Record.h.

bool is_first_record (  ) const [inherited]

Check if it is the first record in the message.

Returns:
true if it is the fist record in the message

Definition at line 98 of file Record.h.

bool is_last_record (  ) const [inherited]

Check if it is the last record in the message.

Returns:
true if it is the last record in the message

Definition at line 90 of file Record.h.

bool is_middle_record (  ) const [inherited]

Check if the record is in the middle of a chain.

Returns:
true if is not the fist or the last one

Definition at line 114 of file Record.h.

void set_as_first_record (  ) [inherited]

Set the record as the first record in the message.

Definition at line 75 of file Record.h.

void set_as_last_record (  ) [inherited]

Set the record as the last record in the message.

Definition at line 82 of file Record.h.

void set_as_middle_record (  ) [inherited]

Set the record as generic (not the first one and not the last one)

Definition at line 105 of file Record.h.

virtual uint16_t write ( uint8_t *  buffer ) [virtual]

Write the 3 bytes used to define an empty record.

Parameters:
[out]bufferBuffer to write the record into.
Returns:
number of write bytes

Implements Record.

Definition at line 64 of file EmptyRecord.h.