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
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 .
Type4NfcTagSTM24SR.h
- Committer:
- giovannivisentini
- Date:
- 2015-11-19
- Revision:
- 0:674813bd5ec9
- Child:
- 1:6d202b62ed68
File content as of revision 0:674813bd5ec9:
/*
* Type4NfcTagSTM24SR.h
*
* Created on: Nov 5, 2015
* Author: giovanni visentini
*/
#ifndef TYPE4NFCTAGSTM24SR_H_
#define TYPE4NFCTAGSTM24SR_H_
#include <stdint.h>
#include "m24sr/m24sr_class.h"
#include "Type4NfcTag.h"
class Type4NfcTagSTM24SR: public Type4NfcTag {
public:
Type4NfcTagSTM24SR(M24SR &device):mDevice(device),mSessionIsOpen(false),
mMaxReadBytes(0xFF),mMaxWriteBytes(0xFF){}
virtual bool openSession(bool force=false);
virtual bool closeSession();
virtual bool read(void*){return false;};
virtual ~Type4NfcTagSTM24SR(){};
protected:
virtual bool writeByte(uint8_t *buffer,uint16_t lenght);
private:
M24SR &mDevice;
bool mSessionIsOpen;
uint16_t mMaxReadBytes;
uint16_t mMaxWriteBytes;
};
#endif /* TYPE4NFCTAGSTM24SR_H_ */
