-
Notifications
You must be signed in to change notification settings - Fork 145
/
NfcTag.h
36 lines (33 loc) · 1.03 KB
/
NfcTag.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef NfcTag_h
#define NfcTag_h
#include <inttypes.h>
#include <Arduino.h>
#include <NdefMessage.h>
class NfcTag
{
public:
NfcTag();
NfcTag(byte *uid, unsigned int uidLength);
NfcTag(byte *uid, unsigned int uidLength, String tagType);
NfcTag(byte *uid, unsigned int uidLength, String tagType, NdefMessage& ndefMessage);
NfcTag(byte *uid, unsigned int uidLength, String tagType, const byte *ndefData, const int ndefDataLength);
~NfcTag(void);
NfcTag& operator=(const NfcTag& rhs);
uint8_t getUidLength();
void getUid(byte *uid, unsigned int uidLength);
String getUidString();
String getTagType();
boolean hasNdefMessage();
NdefMessage getNdefMessage();
#ifdef NDEF_USE_SERIAL
void print();
#endif
private:
byte *_uid;
unsigned int _uidLength;
String _tagType; // Mifare Classic, NFC Forum Type {1,2,3,4}, Unknown
NdefMessage* _ndefMessage;
// TODO capacity
// TODO isFormatted
};
#endif