Utility library to read and write Ndef messages from/to a Type4 NFC tag
Dependents: NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more
Fork of NDefLib by
NDEF NFC library
This library provides an abstract API to create NDEF formatted messages and records and to read/write them from/to a Type4 NFC Tag.
Implementations
At the moment, the NDEF API is implemented by X_NUCLEO_NFC01A1 and X_NUCLEO_NFC02A1 Dynamic NFC Tag libraries respectively driving the X-NUCLEO-NFC01A1 and X-NUCLEO-NFC02A1 boards.
Diff: Message.h
- Revision:
- 17:46899fa3d9f2
- Parent:
- 15:01fc5a4b8366
- Child:
- 19:13d84b136a62
--- a/Message.h Tue Feb 02 16:04:15 2016 +0000 +++ b/Message.h Wed Aug 31 08:32:13 2016 +0000 @@ -38,6 +38,7 @@ #ifndef NDEFLIB_MESSAGE_H_ #define NDEFLIB_MESSAGE_H_ +#include <algorithm> #include <vector> #include "Record.h" @@ -59,6 +60,16 @@ } /** + * Remove a ndef record to this message + * @param r record to remove + */ + void removeRecord(Record *r){ + mRecords.erase( std::remove( mRecords.begin(), mRecords.end(), r ), + mRecords.end() ); + } + + + /** * Add all the records in the list to this message. * @param addList List of records to add. */ @@ -109,6 +120,12 @@ static void parseMessage(const uint8_t * const buffer, const uint16_t bufferLength, Message *message); + /** + * Remove all the recrods from the mesasge and delete it + * @param msg Message with the records to delete + */ + static void removeAndDeleteAllRecord(Message &msg); + virtual ~Message() { }