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:
- 27:3881985097bb
- Parent:
- 24:9f98eafa2d39
- Child:
- 29:7a2dfd06cb29
--- a/m24sr/NDefNfcTagM24SR.h Wed Feb 03 09:01:05 2016 +0000
+++ b/m24sr/NDefNfcTagM24SR.h Fri Sep 30 12:33:20 2016 +0000
@@ -2,8 +2,8 @@
******************************************************************************
* @file Type4NfcTagM24SR.h
* @author ST Central Labs
- * @version V1.0.0
- * @date 05 Nov 2015
+ * @version V1.1.0
+ * @date 30 Set 2016
* @brief M24SR specific NDefLib derived class
******************************************************************************
* @attention
@@ -43,7 +43,7 @@
#include "NDefLib/NDefNfcTag.h"
-#include "Nfc_class.h"
+#include "m24sr_class.h"
/**
* Helper class to use the NDefLib
@@ -56,7 +56,7 @@
*
* @param device device to use
*/
- NDefNfcTagM24SR(Nfc &device) :
+ NDefNfcTagM24SR(M24SR &device):
NDefLib::NDefNfcTag(),
mDevice(device),mIsSessionOpen(false),
mMaxReadBytes(0xFF), mMaxWriteBytes(0xFF),
@@ -91,7 +91,7 @@
private:
- Nfc &mDevice;
+ M24SR &mDevice;
/**
* true if the session is open
@@ -112,16 +112,16 @@
* Class containing the callback needed to open a session and read the max
* read/write size
*/
- class OpenSessionCallBack: public Nfc::Callbacks{
+ class OpenSessionCallBack: public M24SR::Callbacks{
public:
OpenSessionCallBack(NDefNfcTagM24SR &sender);
- virtual void onSessionOpen(Nfc *nfc,NFC_StatusTypeDef status);
- virtual void onSelectedApplication(Nfc *nfc,NFC_StatusTypeDef status);
- virtual void onSelectedCCFile(Nfc *nfc,NFC_StatusTypeDef status);
- virtual void onReadByte(Nfc *nfc,NFC_StatusTypeDef status,uint16_t offset,
+ virtual void onSessionOpen(M24SR *nfc,M24SR::StatusTypeDef status);
+ virtual void onSelectedApplication(M24SR *nfc,M24SR::StatusTypeDef status);
+ virtual void onSelectedCCFile(M24SR *nfc,M24SR::StatusTypeDef status);
+ virtual void onReadByte(M24SR *nfc,M24SR::StatusTypeDef status,uint16_t offset,
uint8_t *readByte, uint16_t nReadByte);
- virtual void onSelectedNDEFFile(Nfc *nfc,NFC_StatusTypeDef status);
+ virtual void onSelectedNDEFFile(M24SR *nfc,M24SR::StatusTypeDef status);
private:
/**
@@ -146,14 +146,14 @@
/**
* Class containing the callback needed to close a session
*/
- class CloseSessionCallBack : public Nfc::Callbacks{
+ class CloseSessionCallBack : public M24SR::Callbacks{
public:
CloseSessionCallBack(NDefNfcTagM24SR &sender):
mSender(sender){}
- virtual void onDeselect(Nfc *nfc,NFC_StatusTypeDef status){
+ virtual void onDeselect(M24SR *nfc,M24SR::StatusTypeDef status){
(void)nfc;
- if(status==NFC_SUCCESS){
+ if(status==M24SR::M24SR_SUCCESS){
mSender.mIsSessionOpen=false;
mSender.mCallBack->onSessionClose(&mSender,true);
}else{
@@ -174,7 +174,7 @@
/**
* Class containing the callback needed to write a buffer
*/
- class WriteByteCallback : public Nfc::Callbacks{
+ class WriteByteCallback : public M24SR::Callbacks{
public:
/**
@@ -205,7 +205,7 @@
mCallbackParam = param;
}
- virtual void onUpdatedBinary(Nfc *nfc,NFC_StatusTypeDef status,
+ virtual void onUpdatedBinary(M24SR *nfc,M24SR::StatusTypeDef status,
uint16_t startOffset,uint8_t *writeByte,uint16_t nWriteByte);
@@ -233,7 +233,7 @@
/**
* Class containing the callback needed to read a buffer
*/
- class ReadByteCallback : public Nfc::Callbacks{
+ class ReadByteCallback : public M24SR::Callbacks{
public:
/**
@@ -264,7 +264,7 @@
mCallbackParam = param;
}
- virtual void onReadByte(Nfc *nfc,NFC_StatusTypeDef status,
+ virtual void onReadByte(M24SR *nfc,M24SR::StatusTypeDef status,
uint16_t offset,uint8_t *readByte, uint16_t nReadByte);

X-NUCLEO-NFC01A1 Dynamic NFC Tag