Generic library for working with PN532-like chips
Fork of PN532 by
MifareUltralight.h@11:5b8afec8bee6, 2015-02-04 (annotated)
- Committer:
- r4z0r7o3
- Date:
- Wed Feb 04 19:26:03 2015 +0000
- Revision:
- 11:5b8afec8bee6
- Parent:
- 5:51f820fbd18a
Fix missing space in tag print()
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); |
icefeet | 5:51f820fbd18a | 14 | bool write(NdefMessage& ndefMessage, uint8_t *uid, unsigned int uidLength); |
yihui | 3:4189a10038e6 | 15 | private: |
yihui | 3:4189a10038e6 | 16 | PN532* nfc; |
yihui | 3:4189a10038e6 | 17 | unsigned int tagCapacity; |
yihui | 3:4189a10038e6 | 18 | unsigned int messageLength; |
yihui | 3:4189a10038e6 | 19 | unsigned int bufferSize; |
yihui | 3:4189a10038e6 | 20 | unsigned int ndefStartIndex; |
yihui | 3:4189a10038e6 | 21 | bool isUnformatted(); |
yihui | 3:4189a10038e6 | 22 | void readCapabilityContainer(); |
yihui | 3:4189a10038e6 | 23 | void findNdefMessage(); |
yihui | 3:4189a10038e6 | 24 | void calculateBufferSize(); |
yihui | 3:4189a10038e6 | 25 | }; |
yihui | 3:4189a10038e6 | 26 | |
yihui | 3:4189a10038e6 | 27 | #endif |