Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of PN532 by
MifareUltralight.h@5:51f820fbd18a, 2014-10-07 (annotated)
- Committer:
- icefeet
- Date:
- Tue Oct 07 15:09:46 2014 +0000
- Revision:
- 5:51f820fbd18a
- Parent:
- 3:4189a10038e6
Added support for Ultralight Write
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 |
