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 ST Expansion SW Team

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.

Revision:
19:13d84b136a62
Parent:
17:46899fa3d9f2
Child:
20:31f727872290
--- a/Message.h	Thu Oct 27 07:39:26 2016 +0000
+++ b/Message.h	Fri Apr 28 12:13:51 2017 +0000
@@ -2,8 +2,8 @@
  ******************************************************************************
  * @file    Message.h
  * @author  ST / Central Labs
- * @version V1.0.0
- * @date    6 Nov 2015
+ * @version V2.0.0
+ * @date    28 Apr 2017
  * @brief   NDef Message class
  ******************************************************************************
  * @attention
@@ -55,7 +55,7 @@
 	 * Add a ndef record to this message.
 	 * @param r Record to add
 	 */
-	void addRecord(Record *r) {
+	void add_record(Record *r) {
 		mRecords.push_back(r);
 	}
 
@@ -63,7 +63,7 @@
 	 * Remove a ndef record to this message
 	 * @param r record to remove 
 	 */
-	void removeRecord(Record *r){
+	void remove_record(Record *r){
 		mRecords.erase( std::remove( mRecords.begin(), mRecords.end(), r ),
 			 mRecords.end() ); 
 	}
@@ -73,7 +73,7 @@
 	 * Add all the records in the list to this message.
 	 * @param addList List of records to add.
 	 */
-	void addRecords(const std::vector<Record*> &addList) {
+	void add_records(const std::vector<Record*> &addList) {
 		mRecords.insert(mRecords.end(), addList.begin(), addList.end());
 	}
 
@@ -92,7 +92,7 @@
 	 * Get the number of records in this message.
 	 * @return number of records in this message
 	 */
-	uint32_t getNRecords() const {
+	uint32_t get_N_records() const {
 		return mRecords.size();
 	}
 
@@ -100,7 +100,7 @@
 	 * Length in bytes needed to write this message.
 	 * @return number of bytes needed to write this message
 	 */
-	uint16_t getByteLength() const;
+	uint16_t get_byte_length() const;
 
 	/**
 	 * Write message in the provided buffer
@@ -117,14 +117,14 @@
 	 * @param bufferLength Buffer length.
 	 * @param[in,out] Message message that will contain the new records.
 	 */
-	static void parseMessage(const uint8_t * const buffer,
+	static void parse_message(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);
+	static void remove_and_delete_all_record(Message &msg);
 
 	virtual ~Message() {
 	}