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:
- 20:31f727872290
- Parent:
- 19:13d84b136a62
--- a/Message.h Fri Apr 28 12:13:51 2017 +0000 +++ b/Message.h Wed Jul 12 12:33:42 2017 +0000 @@ -64,8 +64,7 @@ * @param r record to remove */ void remove_record(Record *r){ - mRecords.erase( std::remove( mRecords.begin(), mRecords.end(), r ), - mRecords.end() ); + mRecords.erase( std::remove( mRecords.begin(), mRecords.end(), r ), mRecords.end() ); } @@ -83,8 +82,10 @@ * @return a Record object if present, otherwise NULL */ Record* operator[](const uint32_t index)const{ - if (index >= mRecords.size()) + if (index >= mRecords.size()) { return NULL; + } + return mRecords[index]; } @@ -118,7 +119,7 @@ * @param[in,out] Message message that will contain the new records. */ static void parse_message(const uint8_t * const buffer, - const uint16_t bufferLength, Message *message); + const uint16_t bufferLength, Message *message); /** * Remove all the recrods from the mesasge and delete it