Firmware library for the X-NUCLEO-NFC01A1 Dynamic NFC Tag board.
Dependencies: M24SR
Dependents: NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more
Fork of X_NUCLEO_NFC01A1 by
X-NUCLEO-NFC01A1 Dynamic NFC Tag Expansion Board Firmware Package
Introduction
This firmware package includes Components Device Drivers, Board Support Package and example applications for STMicroelectronics X-NUCLEO-NFC01A1 Dynamic NFC Tag Expansion Board based on M24SR.
Firmware Library
Class X_NUCLEO_NFC01A1 is intended to represent the Dynamic NFC Tag Expansion Board with the same name.
It provides an API to access to the M24SR component and to the three onboard LEDs.
It is intentionally implemented as a singleton because only one X_NUCLEO_NFC01A1 at a time might be deployed in a HW component stack.
The library also provides an implementation of the NDEF library API for M24SR, providing an simple way to read/write NDEF formatted messages from/to the M24SR dynamic NFC tag.
Example applications
1. Hello World
2. Asynchronous Hello World
Diff: m24sr/NDefNfcTagM24SR.h
- Revision:
- 9:9f2e2e68d695
- Parent:
- 8:5e637c71cbb3
- Child:
- 12:d1f5eaa85deb
--- a/m24sr/NDefNfcTagM24SR.h Mon Jan 11 13:06:23 2016 +0000
+++ b/m24sr/NDefNfcTagM24SR.h Thu Jan 14 07:54:59 2016 +0000
@@ -2,11 +2,13 @@
******************************************************************************
* @file Type4NfcTagM24SR.h
* @author ST Central Labs
+ * @version V1.0.0
* @date 05 Nov 2015
- * @brief wrapper class for use the NDefLib library for write/read ndef message
+ * @brief M24SR specific NDefLib derived class
******************************************************************************
+ * @attention
*
- * COPYRIGHT(c) 2015 STMicroelectronics
+ * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -42,13 +44,13 @@
class M24SR;
/**
- * implement the abstract method for use the NDefLib */
+ * Implement all NDefLib abstract methods. */
class NDefNfcTagM24SR: public NDefLib::NDefNfcTag {
public:
/**
- * create the object
- * @param device device where write the Ndef tags
+ * Create the object.
+ * @param Device device to write the Ndef tags into.
*/
NDefNfcTagM24SR(M24SR &device) :
mDevice(device), mMaxReadBytes(0xFF), mMaxWriteBytes(
@@ -56,22 +58,22 @@
}
/**
- * open the communication with the nfc tag
- * \par when override this method call this implementation as last action for set the session opened
- * @param force force to open a communication
+ * Open the communication session with the nfc tag.
+ * @par This method should be called at the end of an overriding implementation, just before returning.
+ * @param Force force to open a communication.
* @return true if success
*/
virtual bool openSession(bool force = false);
/**
- * close the communication with the nfc tag
- * \par when override this method call this implementation as last action for set the session closed
+ * Close the communication with the nfc tag.
+ * @par This method should be called at the end of an overriding implementation, just before returning.
* @return true if success
*/
virtual bool closeSession();
/**
- * close the open session
+ * Close the open session.
*/
virtual ~NDefNfcTagM24SR() {
if(isSessionOpen())
@@ -83,19 +85,19 @@
protected:
/**
- * write a sequence of byte in the NDEF file
- * @param buffer buffer to write
- * @param length number of byte to write
- * @param offset offset where start to write
+ * Write a sequence of bytes to the NDEF file.
+ * @param buffer Buffer to write.
+ * @param length Number of bytes to write.
+ * @param offset Write offset in bytes.
* @return true if success
*/
virtual bool writeByte(const uint8_t *buffer, const uint16_t length, uint16_t offset);
/**
- * read a sequence of byte from the NDEF file
- * @param byteOffset offset were start read
- * @param byteLength number of byte to read
- * @param[out] buffer buffer where store the data read
+ * Read a sequence of bytes from the NDEF file.
+ * @param byteOffset Read offsetin bytes.
+ * @param byteLength Number of bytes to read.
+ * @param[out] buffer Buffer to store the read data into.
* @return true if success
*/
virtual bool readByte(const uint16_t byteOffset, const uint16_t byteLength,
@@ -106,12 +108,12 @@
M24SR &mDevice;
/**
- * max length for a read operation
+ * Max length for a read operation
*/
uint16_t mMaxReadBytes;
/**
- * max length for a write operation
+ * Max length for a write operation
*/
uint16_t mMaxWriteBytes;
};

X-NUCLEO-NFC01A1 Dynamic NFC Tag