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
NfcTag.h@11:e7bbcfa61859, 2016-11-17 (annotated)
- Committer:
- dwini
- Date:
- Thu Nov 17 11:32:02 2016 +0000
- Revision:
- 11:e7bbcfa61859
- Parent:
- 3:4189a10038e6
Fix use of DMSG instead of printf
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| yihui | 3:4189a10038e6 | 1 | #ifndef NfcTag_h |
| yihui | 3:4189a10038e6 | 2 | #define NfcTag_h |
| yihui | 3:4189a10038e6 | 3 | |
| yihui | 3:4189a10038e6 | 4 | #include <stdint.h> |
| yihui | 3:4189a10038e6 | 5 | #include <NdefMessage.h> |
| yihui | 3:4189a10038e6 | 6 | |
| yihui | 3:4189a10038e6 | 7 | class NfcTag |
| yihui | 3:4189a10038e6 | 8 | { |
| yihui | 3:4189a10038e6 | 9 | public: |
| yihui | 3:4189a10038e6 | 10 | NfcTag(); |
| yihui | 3:4189a10038e6 | 11 | NfcTag(uint8_t *uid, unsigned int uidLength); |
| yihui | 3:4189a10038e6 | 12 | NfcTag(uint8_t *uid, unsigned int uidLength, string tagType); |
| yihui | 3:4189a10038e6 | 13 | NfcTag(uint8_t *uid, unsigned int uidLength, string tagType, NdefMessage& ndefMessage); |
| yihui | 3:4189a10038e6 | 14 | NfcTag(uint8_t *uid, unsigned int uidLength, string tagType, const uint8_t *ndefData, const int ndefDataLength); |
| yihui | 3:4189a10038e6 | 15 | ~NfcTag(void); |
| yihui | 3:4189a10038e6 | 16 | NfcTag& operator=(const NfcTag& rhs); |
| yihui | 3:4189a10038e6 | 17 | uint8_t getUidLength(); |
| yihui | 3:4189a10038e6 | 18 | void getUid(uint8_t *uid, unsigned int uidLength); |
| yihui | 3:4189a10038e6 | 19 | string getUidString(); |
| yihui | 3:4189a10038e6 | 20 | string getTagType(); |
| yihui | 3:4189a10038e6 | 21 | bool hasNdefMessage(); |
| yihui | 3:4189a10038e6 | 22 | NdefMessage getNdefMessage(); |
| yihui | 3:4189a10038e6 | 23 | void print(); |
| yihui | 3:4189a10038e6 | 24 | private: |
| yihui | 3:4189a10038e6 | 25 | uint8_t *_uid; |
| yihui | 3:4189a10038e6 | 26 | unsigned int _uidLength; |
| yihui | 3:4189a10038e6 | 27 | string _tagType; // Mifare Classic, NFC Forum Type {1,2,3,4}, Unknown |
| yihui | 3:4189a10038e6 | 28 | NdefMessage* _ndefMessage; |
| yihui | 3:4189a10038e6 | 29 | // TODO capacity |
| yihui | 3:4189a10038e6 | 30 | // TODO isFormatted |
| yihui | 3:4189a10038e6 | 31 | }; |
| yihui | 3:4189a10038e6 | 32 | |
| yihui | 3:4189a10038e6 | 33 | #endif |
