PN532 customized
Fork of PN532 by
MifareUltralight.h@10:2fcf2448d199, 2016-02-11 (annotated)
- Committer:
- stanvn
- Date:
- Thu Feb 11 11:56:00 2016 +0000
- Revision:
- 10:2fcf2448d199
- Parent:
- 3:4189a10038e6
Working code for reading type-a and type-b cards
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 3:4189a10038e6 | 1 | #ifndef MifareUltralight_h |
yihui | 3:4189a10038e6 | 2 | #define MifareUltralight_h |
yihui | 3:4189a10038e6 | 3 | |
yihui | 3:4189a10038e6 | 4 | #include <PN532.h> |
yihui | 3:4189a10038e6 | 5 | #include <NfcTag.h> |
yihui | 3:4189a10038e6 | 6 | #include <Ndef.h> |
yihui | 3:4189a10038e6 | 7 | |
yihui | 3:4189a10038e6 | 8 | class MifareUltralight |
yihui | 3:4189a10038e6 | 9 | { |
yihui | 3:4189a10038e6 | 10 | public: |
yihui | 3:4189a10038e6 | 11 | MifareUltralight(PN532& nfcShield); |
yihui | 3:4189a10038e6 | 12 | ~MifareUltralight(); |
yihui | 3:4189a10038e6 | 13 | NfcTag read(uint8_t *uid, unsigned int uidLength); |
yihui | 3:4189a10038e6 | 14 | private: |
yihui | 3:4189a10038e6 | 15 | PN532* nfc; |
yihui | 3:4189a10038e6 | 16 | unsigned int tagCapacity; |
yihui | 3:4189a10038e6 | 17 | unsigned int messageLength; |
yihui | 3:4189a10038e6 | 18 | unsigned int bufferSize; |
yihui | 3:4189a10038e6 | 19 | unsigned int ndefStartIndex; |
yihui | 3:4189a10038e6 | 20 | bool isUnformatted(); |
yihui | 3:4189a10038e6 | 21 | void readCapabilityContainer(); |
yihui | 3:4189a10038e6 | 22 | void findNdefMessage(); |
yihui | 3:4189a10038e6 | 23 | void calculateBufferSize(); |
yihui | 3:4189a10038e6 | 24 | }; |
yihui | 3:4189a10038e6 | 25 | |
yihui | 3:4189a10038e6 | 26 | #endif |