Mbed OS Reference
|
Event driven NDEF Message parser. More...
#include <MessageParser.h>
Data Structures | |
struct | Delegate |
Report parsing event to the application. More... | |
Public Types | |
enum | error_t { INVALID_MESSAGE_START , INSUFICIENT_DATA , INVALID_TYPE_NAME_FORMAT , INVALID_EMPTY_RECORD , INVALID_UNKNOWN_TYPE_LENGTH , INVALID_UNCHANGED_TYPE , CHUNK_RECORD_NOT_SUPPORTED , MISSING_MESSAGE_END , MISSING_TYPE_VALUE } |
Error that can be reported by the parsing operation. More... | |
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... | |
Event driven NDEF Message parser.
Definition at line 38 of file MessageParser.h.
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.
MessageParser | ( | ) |
Construct a message parser.
void set_delegate | ( | Delegate * | delegate | ) |
Set the handler that processes parsing events.
delegate | The parsing event handler. |
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.
data_buffer | The data buffer that contains the NDEF message. |