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:
- 29:7a2dfd06cb29
- Parent:
- 27:3881985097bb
- Child:
- 33:e6b7e74be1d5
--- a/m24sr/NDefNfcTagM24SR.h Thu Oct 27 07:38:00 2016 +0000
+++ b/m24sr/NDefNfcTagM24SR.h Fri Apr 28 12:14:12 2017 +0000
@@ -2,8 +2,8 @@
******************************************************************************
* @file Type4NfcTagM24SR.h
* @author ST Central Labs
- * @version V1.1.0
- * @date 30 Set 2016
+ * @version V2.0.0
+ * @date 28 Apr 2017
* @brief M24SR specific NDefLib derived class
******************************************************************************
* @attention
@@ -43,7 +43,7 @@
#include "NDefLib/NDefNfcTag.h"
-#include "m24sr_class.h"
+#include "M24SR.h"
/**
* Helper class to use the NDefLib
@@ -65,11 +65,11 @@
mWriteByteCallback(*this),
mReadByteCallback(*this){}
- virtual bool openSession(bool force = false);
+ virtual bool open_session(bool force = false);
- virtual bool closeSession();
+ virtual bool close_session();
- virtual bool isSessionOpen(){
+ virtual bool is_session_open(){
return mIsSessionOpen;
}
@@ -77,8 +77,8 @@
* Close the open session.
*/
virtual ~NDefNfcTagM24SR(){
- if(isSessionOpen())
- closeSession();
+ if(is_session_open())
+ close_session();
}//~NDefNfcTagM24SR
protected:
@@ -116,12 +116,12 @@
public:
OpenSessionCallBack(NDefNfcTagM24SR &sender);
- 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,
+ virtual void on_session_open(M24SR *nfc,M24SR::StatusTypeDef status);
+ virtual void on_selected_application(M24SR *nfc,M24SR::StatusTypeDef status);
+ virtual void on_selected_CC_file(M24SR *nfc,M24SR::StatusTypeDef status);
+ virtual void on_read_byte(M24SR *nfc,M24SR::StatusTypeDef status,uint16_t offset,
uint8_t *readByte, uint16_t nReadByte);
- virtual void onSelectedNDEFFile(M24SR *nfc,M24SR::StatusTypeDef status);
+ virtual void on_selected_NDEF_file(M24SR *nfc,M24SR::StatusTypeDef status);
private:
/**
@@ -151,13 +151,13 @@
CloseSessionCallBack(NDefNfcTagM24SR &sender):
mSender(sender){}
- virtual void onDeselect(M24SR *nfc,M24SR::StatusTypeDef status){
+ virtual void on_deselect(M24SR *nfc,M24SR::StatusTypeDef status){
(void)nfc;
if(status==M24SR::M24SR_SUCCESS){
mSender.mIsSessionOpen=false;
- mSender.mCallBack->onSessionClose(&mSender,true);
+ mSender.mCallBack->on_session_close(&mSender,true);
}else{
- mSender.mCallBack->onSessionClose(&mSender,false);
+ mSender.mCallBack->on_session_close(&mSender,false);
}//if-else
}
private:
@@ -196,7 +196,7 @@
* @param callback Function to call when the write ends.
* @param param Parameter to pass to the callback function.
*/
- void setTask(const uint8_t *buffer,uint16_t nByte,
+ void set_task(const uint8_t *buffer,uint16_t nByte,
byteOperationCallback_t callback,CallbackStatus_t *param){
mByteToWrite=buffer;
mNByteToWrite=nByte;
@@ -205,7 +205,7 @@
mCallbackParam = param;
}
- virtual void onUpdatedBinary(M24SR *nfc,M24SR::StatusTypeDef status,
+ virtual void on_updated_binary(M24SR *nfc,M24SR::StatusTypeDef status,
uint16_t startOffset,uint8_t *writeByte,uint16_t nWriteByte);
@@ -255,7 +255,7 @@
* @param callback Function to call when the read ends
* @param param Parameter to pass to the callback function
*/
- void setTask(uint8_t *buffer,uint16_t nByte,
+ void set_task(uint8_t *buffer,uint16_t nByte,
byteOperationCallback_t callback,CallbackStatus_t *param){
mBuffer=buffer;
mNByteToRead=nByte;
@@ -264,7 +264,7 @@
mCallbackParam = param;
}
- virtual void onReadByte(M24SR *nfc,M24SR::StatusTypeDef status,
+ virtual void on_read_byte(M24SR *nfc,M24SR::StatusTypeDef status,
uint16_t offset,uint8_t *readByte, uint16_t nReadByte);

X-NUCLEO-NFC01A1 Dynamic NFC Tag