Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more
Fork of NDefLib by
Message Class Reference
Class containing a list of Record. More...
#include <Message.h>
Public Member Functions | |
| void | add_record (Record *r) |
| Add a ndef record to this message. | |
| void | remove_record (Record *r) |
| Remove a ndef record to this message. | |
| void | add_records (const std::vector< Record * > &addList) |
| Add all the records in the list to this message. | |
| Record * | operator[] (const uint32_t index) const |
| Get the specific record contained by this message, NULL if not a valid index. | |
| uint32_t | get_N_records () const |
| Get the number of records in this message. | |
| uint16_t | get_byte_length () const |
| Length in bytes needed to write this message. | |
| uint16_t | write (uint8_t *buffer) const |
| Write message in the provided buffer. | |
Static Public Member Functions | |
| static void | parse_message (const uint8_t *const buffer, const uint16_t bufferLength, Message *message) |
| Create a set of records from a raw buffer adding them to a message object. | |
| static void | remove_and_delete_all_record (Message &msg) |
| Remove all the recrods from the mesasge and delete it. | |
Detailed Description
Class containing a list of Record.
Definition at line 51 of file Message.h.
Member Function Documentation
| void add_record | ( | Record * | r ) |
| void add_records | ( | const std::vector< Record * > & | addList ) |
| uint16_t get_byte_length | ( | ) | const |
Length in bytes needed to write this message.
- Returns:
- number of bytes needed to write this message
Definition at line 48 of file Message.cpp.
| uint32_t get_N_records | ( | ) | const |
| Record* operator[] | ( | const uint32_t | index ) | const |
| void parse_message | ( | const uint8_t *const | buffer, |
| const uint16_t | bufferLength, | ||
| Message * | message | ||
| ) | [static] |
Create a set of records from a raw buffer adding them to a message object.
- Message buffer must NOT contain the buffer length in the first two bytes.
- Parameters:
-
buffer Buffer containing the message record. bufferLength Buffer length. [in,out] Message message that will contain the new records.
Definition at line 96 of file Message.cpp.
| void remove_and_delete_all_record | ( | Message & | msg ) | [static] |
Remove all the recrods from the mesasge and delete it.
- Parameters:
-
msg Message with the records to delete
Definition at line 120 of file Message.cpp.
| void remove_record | ( | Record * | r ) |
| uint16_t write | ( | uint8_t * | buffer ) | const |
Write message in the provided buffer.
- The first 2 bytes contain the NDEF message length.
- Parameters:
-
[out] buffer Buffer the message must be written into.
- Returns:
- number of bytes written
Definition at line 65 of file Message.cpp.
Generated on Tue Jul 12 2022 14:14:49 by
1.7.2
