Mistake on this page?
Report an issue in GitHub or email us
Data Structures | Public Types | Public Member Functions
MessageParser Class Reference

Event driven NDEF Message parser. More...

#include <MessageParser.h>

Data Structures

struct  Delegate
 Report parsing event to the application. More...
 

Public Types

Public Member Functions

 MessageParser ()
 Construct a message parser. More...
 
void set_delegate (Delegate *delegate)
 Set the handler that processes parsing events. More...
 
void parse (const Span< const uint8_t > &data_buffer)
 Parse an NDEF Message. More...
 

Detailed Description

Event driven NDEF Message parser.

Definition at line 38 of file MessageParser.h.

Member Enumeration Documentation

enum error_t

Error that can be reported by the parsing operation.

Enumerator
INVALID_MESSAGE_START 

The message doesn't start with a message start tag.

INSUFICIENT_DATA 

There is not enough data left to pursue parsing of the message.

INVALID_TYPE_NAME_FORMAT 

The type name of a record is invalid.

INVALID_EMPTY_RECORD 

An empty record is malformed.

INVALID_UNKNOWN_TYPE_LENGTH 

Record of unknown type embed a type length different than 0.

INVALID_UNCHANGED_TYPE 

Record of unchanged type contains a type.

CHUNK_RECORD_NOT_SUPPORTED 

Chunk record encountered.

MISSING_MESSAGE_END 

Message is not properly closed.

MISSING_TYPE_VALUE 

Type is missing in a record expecting a type (well known type, media type, absolute uri or external type).

Definition at line 43 of file MessageParser.h.

Constructor & Destructor Documentation

Construct a message parser.

Member Function Documentation

void parse ( const Span< const uint8_t > &  data_buffer)

Parse an NDEF Message.

Records and errors are reported to the handler registered with set_event_handler.

Parameters
data_bufferThe data buffer that contains the NDEF message.
void set_delegate ( Delegate delegate)

Set the handler that processes parsing events.

Parameters
delegateThe parsing event handler.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.