Generic library for working with PN532-like chips

Fork of PN532 by Seeed

Committer:
r4z0r7o3
Date:
Wed Feb 04 19:26:03 2015 +0000
Revision:
11:5b8afec8bee6
Parent:
3:4189a10038e6
Fix missing space in tag print()

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yihui 3:4189a10038e6 1 #ifndef NdefMessage_h
yihui 3:4189a10038e6 2 #define NdefMessage_h
yihui 3:4189a10038e6 3
yihui 3:4189a10038e6 4 #include <Ndef.h>
yihui 3:4189a10038e6 5 #include <NdefRecord.h>
yihui 3:4189a10038e6 6
yihui 3:4189a10038e6 7 #define MAX_NDEF_RECORDS 4
yihui 3:4189a10038e6 8
yihui 3:4189a10038e6 9 class NdefMessage
yihui 3:4189a10038e6 10 {
yihui 3:4189a10038e6 11 public:
yihui 3:4189a10038e6 12 NdefMessage(void);
yihui 3:4189a10038e6 13 NdefMessage(const uint8_t *data, const int numuint8_ts);
yihui 3:4189a10038e6 14 NdefMessage(const NdefMessage& rhs);
yihui 3:4189a10038e6 15 ~NdefMessage();
yihui 3:4189a10038e6 16 NdefMessage& operator=(const NdefMessage& rhs);
yihui 3:4189a10038e6 17
yihui 3:4189a10038e6 18 int getEncodedSize(); // need so we can pass array to encode
yihui 3:4189a10038e6 19 void encode(uint8_t *data);
yihui 3:4189a10038e6 20
yihui 3:4189a10038e6 21 bool addRecord(NdefRecord& record);
yihui 3:4189a10038e6 22 void addMimeMediaRecord(string mimeType, string payload);
yihui 3:4189a10038e6 23 void addMimeMediaRecord(string mimeType, uint8_t *payload, int payloadLength);
yihui 3:4189a10038e6 24 void addTextRecord(string text);
yihui 3:4189a10038e6 25 void addTextRecord(string text, string encoding);
yihui 3:4189a10038e6 26 void addUriRecord(string uri);
yihui 3:4189a10038e6 27 void addEmptyRecord();
yihui 3:4189a10038e6 28
yihui 3:4189a10038e6 29 unsigned int getRecordCount();
yihui 3:4189a10038e6 30 NdefRecord getRecord(int index);
yihui 3:4189a10038e6 31 NdefRecord operator[](int index);
yihui 3:4189a10038e6 32
yihui 3:4189a10038e6 33 void print();
yihui 3:4189a10038e6 34 private:
yihui 3:4189a10038e6 35 NdefRecord _records[MAX_NDEF_RECORDS];
yihui 3:4189a10038e6 36 unsigned int _recordCount;
yihui 3:4189a10038e6 37 };
yihui 3:4189a10038e6 38
yihui 3:4189a10038e6 39 #endif