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 .

Committer:
giovannivisentini
Date:
Thu Nov 19 08:50:18 2015 +0000
Revision:
0:674813bd5ec9
Child:
1:6d202b62ed68
first commit,

Who changed what in which revision?

UserRevisionLine numberNew contents of line
giovannivisentini 0:674813bd5ec9 1 /*
giovannivisentini 0:674813bd5ec9 2 * Type4NfcTagSTM24SR.h
giovannivisentini 0:674813bd5ec9 3 *
giovannivisentini 0:674813bd5ec9 4 * Created on: Nov 5, 2015
giovannivisentini 0:674813bd5ec9 5 * Author: giovanni visentini
giovannivisentini 0:674813bd5ec9 6 */
giovannivisentini 0:674813bd5ec9 7
giovannivisentini 0:674813bd5ec9 8 #ifndef TYPE4NFCTAGSTM24SR_H_
giovannivisentini 0:674813bd5ec9 9 #define TYPE4NFCTAGSTM24SR_H_
giovannivisentini 0:674813bd5ec9 10 #include <stdint.h>
giovannivisentini 0:674813bd5ec9 11 #include "m24sr/m24sr_class.h"
giovannivisentini 0:674813bd5ec9 12
giovannivisentini 0:674813bd5ec9 13 #include "Type4NfcTag.h"
giovannivisentini 0:674813bd5ec9 14
giovannivisentini 0:674813bd5ec9 15 class Type4NfcTagSTM24SR: public Type4NfcTag {
giovannivisentini 0:674813bd5ec9 16
giovannivisentini 0:674813bd5ec9 17 public:
giovannivisentini 0:674813bd5ec9 18 Type4NfcTagSTM24SR(M24SR &device):mDevice(device),mSessionIsOpen(false),
giovannivisentini 0:674813bd5ec9 19 mMaxReadBytes(0xFF),mMaxWriteBytes(0xFF){}
giovannivisentini 0:674813bd5ec9 20
giovannivisentini 0:674813bd5ec9 21 virtual bool openSession(bool force=false);
giovannivisentini 0:674813bd5ec9 22 virtual bool closeSession();
giovannivisentini 0:674813bd5ec9 23
giovannivisentini 0:674813bd5ec9 24 virtual bool read(void*){return false;};
giovannivisentini 0:674813bd5ec9 25 virtual ~Type4NfcTagSTM24SR(){};
giovannivisentini 0:674813bd5ec9 26
giovannivisentini 0:674813bd5ec9 27 protected:
giovannivisentini 0:674813bd5ec9 28 virtual bool writeByte(uint8_t *buffer,uint16_t lenght);
giovannivisentini 0:674813bd5ec9 29
giovannivisentini 0:674813bd5ec9 30 private:
giovannivisentini 0:674813bd5ec9 31
giovannivisentini 0:674813bd5ec9 32 M24SR &mDevice;
giovannivisentini 0:674813bd5ec9 33 bool mSessionIsOpen;
giovannivisentini 0:674813bd5ec9 34 uint16_t mMaxReadBytes;
giovannivisentini 0:674813bd5ec9 35 uint16_t mMaxWriteBytes;
giovannivisentini 0:674813bd5ec9 36 };
giovannivisentini 0:674813bd5ec9 37
giovannivisentini 0:674813bd5ec9 38 #endif /* TYPE4NFCTAGSTM24SR_H_ */
giovannivisentini 0:674813bd5ec9 39