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: Record.h
- Revision:
- 19:13d84b136a62
- Parent:
- 18:cf1dd5c931c2
diff -r cf1dd5c931c2 -r 13d84b136a62 Record.h --- a/Record.h Thu Oct 27 07:39:26 2016 +0000 +++ b/Record.h Fri Apr 28 12:13:51 2017 +0000 @@ -2,8 +2,8 @@ ****************************************************************************** * @file Record.h * @author ST / Central Labs - * @version V1.0.0 - * @date 30 Nov 2015 + * @version V2.0.0 + * @date 28 Apr 2017 * @brief Generic Record class ****************************************************************************** * @attention @@ -72,47 +72,47 @@ /** * Set the record as the first record in the message. */ - void setAsFirstRecord() { - mRecordHeader.setMB(true); + void set_as_first_record() { + mRecordHeader.set_MB(true); } /** * Set the record as the last record in the message. */ - void setAsLastRecord() { - mRecordHeader.setME(true); + void set_as_last_record() { + mRecordHeader.set_ME(true); } /** * Check if it is the last record in the message. * @return true if it is the last record in the message */ - bool isLastRecord() const { - return mRecordHeader.getME(); + bool is_last_record() const { + return mRecordHeader.get_ME(); } /** * Check if it is the first record in the message. * @return true if it is the fist record in the message */ - bool isFirstRecord() const { - return mRecordHeader.getMB(); + bool is_first_record() const { + return mRecordHeader.get_MB(); } /** * Set the record as generic (not the first one and not the last one) */ - void setAsMiddleRecord() { - mRecordHeader.setMB(false); - mRecordHeader.setME(false); + void set_as_middle_record() { + mRecordHeader.set_MB(false); + mRecordHeader.set_ME(false); } /** * Check if the record is in the middle of a chain. * @return true if is not the fist or the last one */ - bool isMiddleRecord() const{ - return ! (mRecordHeader.getMB() || mRecordHeader.getME()); + bool is_middle_record() const{ + return ! (mRecordHeader.get_MB() || mRecordHeader.get_ME()); } /** @@ -120,7 +120,7 @@ * @par This method should be overridden to return a valid type. * @return tag type */ - virtual RecordType_t getType() const { + virtual RecordType_t get_type() const { return TYPE_UNKNOWN; } //getType @@ -129,7 +129,7 @@ * Get the record header. * @return record header */ - const RecordHeader& getHeader() const{ + const RecordHeader& get_header() const{ return mRecordHeader; } @@ -137,8 +137,8 @@ * Number of bytes needed to store this record. * @return size of the header + size of the record content */ - virtual uint16_t getByteLength() { - return mRecordHeader.getRecordLength(); + virtual uint16_t get_byte_length() { + return mRecordHeader.get_record_length(); } /**