some additional fixes
Fork of PN532 by
MifareClassic.h@10:5e24ab94fcc4, 2016-06-02 (annotated)
- Committer:
- vilesovds
- Date:
- Thu Jun 02 16:23:37 2016 +0000
- Revision:
- 10:5e24ab94fcc4
- Parent:
- 3:4189a10038e6
fixed NfcTag::getUid
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 3:4189a10038e6 | 1 | #ifndef MifareClassic_h |
yihui | 3:4189a10038e6 | 2 | #define MifareClassic_h |
yihui | 3:4189a10038e6 | 3 | |
yihui | 3:4189a10038e6 | 4 | #include <PN532.h> |
yihui | 3:4189a10038e6 | 5 | #include <Ndef.h> |
yihui | 3:4189a10038e6 | 6 | #include <NfcTag.h> |
yihui | 3:4189a10038e6 | 7 | |
yihui | 3:4189a10038e6 | 8 | class MifareClassic |
yihui | 3:4189a10038e6 | 9 | { |
yihui | 3:4189a10038e6 | 10 | public: |
yihui | 3:4189a10038e6 | 11 | MifareClassic(PN532& nfcShield); |
yihui | 3:4189a10038e6 | 12 | ~MifareClassic(); |
yihui | 3:4189a10038e6 | 13 | NfcTag read(uint8_t *uid, unsigned int uidLength); |
yihui | 3:4189a10038e6 | 14 | bool write(NdefMessage& ndefMessage, uint8_t *uid, unsigned int uidLength); |
yihui | 3:4189a10038e6 | 15 | private: |
yihui | 3:4189a10038e6 | 16 | PN532* _nfcShield; |
yihui | 3:4189a10038e6 | 17 | int getBufferSize(int messageLength); |
yihui | 3:4189a10038e6 | 18 | int getNdefStartIndex(uint8_t *data); |
yihui | 3:4189a10038e6 | 19 | bool decodeTlv(uint8_t *data, int &messageLength, int &messageStartIndex); |
yihui | 3:4189a10038e6 | 20 | }; |
yihui | 3:4189a10038e6 | 21 | |
yihui | 3:4189a10038e6 | 22 | #endif |