This application provides a set of demos with X-NUCLEO-NFC01A1 expansion board.

Dependencies:   NDefLib X_NUCLEO_NFC01A1 mbed

Fork of X-MBED-NFC1 by Giovanni Visentini

This application provides a set of demos with X-NUCLEO-NFC01A1 expansion board.

The available demos are:

  • SAMPLE_WRITE_URL: write a tag with the ST home page URL
  • SAMPLE_COUNT_CLICK: create a custom tag to count and report the user button clicks.
  • SAMPLE_WRITE_AND_CHANGE_ALL: write a tag with all the supported records and update the tag contents when the user button is pressed.
  • SAMPLE_LOCK_TAG_CONTENT: use the M24SR component API to set the NFC tag as read-only.

To enable the different demos comment/uncomment the SAMPLE_* macros provided in main.cpp .

Revision:
2:0648c1561eb2
Parent:
1:6d202b62ed68
--- a/Interfaces/Nfc_class.h	Fri Nov 27 15:10:25 2015 +0000
+++ b/Interfaces/Nfc_class.h	Tue Dec 01 08:30:54 2015 +0000
@@ -39,16 +39,6 @@
 
 /* Generated with Stm32CubeTOO -----------------------------------------------*/
 
-
-/* Revision ------------------------------------------------------------------*/
-/*
-	Repository:       http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev
-	Branch/Trunk/Tag: trunk
-	Based on:         X-CUBE-MEMS1/trunk/Drivers/BSP/Components/Common/nfc.h
-	Revision:         385
-*/
-
-
 /* Define to prevent from recursive inclusion --------------------------------*/
 
 #ifndef __NFC_CLASS_H
@@ -68,33 +58,91 @@
 {
 public:
 
+	/**
+	 * possible password to set
+	 */
 	typedef enum{
-		ReadPwd=READ_PWD,
-		WritePwd=WRITE_PWD,
-		I2CPwd=I2C_PWD,
+		ReadPwd=READ_PWD,  //!< password to use before read the tag
+		WritePwd=WRITE_PWD,//!< password to use before write the tag
+		I2CPwd=I2C_PWD,    //!< root password, used only thought nfc
 	}PasswordType_t;
 
-	/* ACTION 1 --------------------------------------------------------------*
-	 * Declare here the interface's methods.                                  *
-	 * They should be:                                                        *
-	 *   + Methods with the same name of the C component's virtual table      *
-	 *     (and extended virtual table, if any)'s functions, provided that    *
-	 *     the component's driver implements them (i.e.: the corresponding    *
-	 *     pointer to function is not "0").                                   *
-	 *                                                                        *
-	 * Example:                                                               *
-	 *    virtual int GetValue(float *pfData) = 0;                            *
-	 *------------------------------------------------------------------------*/
+
+	/**
+	 * open a i2c connection with the tag if an RF connection isn't already open
+	 * @return operation status
+	 */
 	virtual NFC_StatusTypeDef GetSession(void) = 0;
+	/**
+	 * force to open an i2c connection , abort the RF connection
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef KillSession(void) = 0;
+
+	/**
+	 * close an i2c connection
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef Deselect(void) = 0;
+
+	/**
+	 * Select the application file
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef SelectApplication(void) = 0;
+
+	/**
+	 * select the CC file
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef SelectCCfile(void) = 0;
+
+	/**
+	 * select the ndef file
+	 * @param NDEFfileId file id to open
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef SelectNDEFfile(uint16_t NDEFfileId) = 0;
+
+	/**
+	 * select the system file
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef SelectSystemfile(void) = 0;
+
+	/**
+	 * read data from the tag
+	 * @param Offset offset where start to read
+	 * @param NbByteToRead number of byte to read
+	 * @param[out] pBufferRead buffer where store the read data
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef ReadBinary(uint16_t Offset, uint8_t NbByteToRead, uint8_t *pBufferRead) = 0;
+
+	/**
+	 * write data to the tag
+	 * @param Offset offset where start to write
+	 * @param NbByteToWrite number of byte to write
+	 * @param pDataToWrite buffer to write
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef UpdateBinary(uint16_t Offset, uint8_t NbByteToWrite, uint8_t *pDataToWrite) = 0;
+
+	/**
+	 * check that the password is correct
+	 * @param uPwdId password type
+	 * @param NbPwdByte password size ( must be 0x10)
+	 * @param pPwd password buffer
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef Verify(PasswordType_t uPwdId, uint8_t NbPwdByte,const uint8_t *pPwd) = 0;
+
+	/**
+	 * change the pa
+	 * @param uPwdId
+	 * @param pPwd
+	 * @return
+	 */
 	virtual NFC_StatusTypeDef ChangeReferenceData(PasswordType_t uPwdId,const uint8_t *pPwd) = 0;
 	virtual NFC_StatusTypeDef EnableVerificationRequirement(PasswordType_t uReadOrWrite) = 0;
 	virtual NFC_StatusTypeDef DisableVerificationRequirement(PasswordType_t uReadOrWrite) = 0;