LEER TAG
Dependents: NFC_HTM_READ EMULAR_TAGS Escribir_tag NFC_HTM_READ-WRITE
NdefMessage.h@1:a549ef8b142a, 2015-04-24 (annotated)
- Committer:
- mauroar211
- Date:
- Fri Apr 24 19:02:44 2015 +0000
- Revision:
- 1:a549ef8b142a
- Parent:
- 0:b805b487fbef
SE RESTAURARON LOS ARCHIVO DE LA LIBRER?A;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mauroar211 | 0:b805b487fbef | 1 | #ifndef NdefMessage_h |
mauroar211 | 0:b805b487fbef | 2 | #define NdefMessage_h |
mauroar211 | 0:b805b487fbef | 3 | |
mauroar211 | 0:b805b487fbef | 4 | #include <Ndef.h> |
mauroar211 | 0:b805b487fbef | 5 | #include <NdefRecord.h> |
mauroar211 | 0:b805b487fbef | 6 | |
mauroar211 | 0:b805b487fbef | 7 | #define MAX_NDEF_RECORDS 4 |
mauroar211 | 0:b805b487fbef | 8 | |
mauroar211 | 0:b805b487fbef | 9 | class NdefMessage |
mauroar211 | 0:b805b487fbef | 10 | { |
mauroar211 | 0:b805b487fbef | 11 | public: |
mauroar211 | 0:b805b487fbef | 12 | NdefMessage(void); |
mauroar211 | 0:b805b487fbef | 13 | NdefMessage(const uint8_t *data, const int numuint8_ts); |
mauroar211 | 0:b805b487fbef | 14 | NdefMessage(const NdefMessage& rhs); |
mauroar211 | 0:b805b487fbef | 15 | ~NdefMessage(); |
mauroar211 | 0:b805b487fbef | 16 | NdefMessage& operator=(const NdefMessage& rhs); |
mauroar211 | 0:b805b487fbef | 17 | |
mauroar211 | 0:b805b487fbef | 18 | int getEncodedSize(); // need so we can pass array to encode |
mauroar211 | 0:b805b487fbef | 19 | void encode(uint8_t *data); |
mauroar211 | 0:b805b487fbef | 20 | |
mauroar211 | 0:b805b487fbef | 21 | bool addRecord(NdefRecord& record); |
mauroar211 | 0:b805b487fbef | 22 | void addMimeMediaRecord(string mimeType, string payload); |
mauroar211 | 0:b805b487fbef | 23 | void addMimeMediaRecord(string mimeType, uint8_t *payload, int payloadLength); |
mauroar211 | 0:b805b487fbef | 24 | void addTextRecord(string text); |
mauroar211 | 0:b805b487fbef | 25 | void addTextRecord(string text, string encoding); |
mauroar211 | 0:b805b487fbef | 26 | void addUriRecord(string uri); |
mauroar211 | 0:b805b487fbef | 27 | void addEmptyRecord(); |
mauroar211 | 0:b805b487fbef | 28 | |
mauroar211 | 0:b805b487fbef | 29 | unsigned int getRecordCount(); |
mauroar211 | 0:b805b487fbef | 30 | NdefRecord getRecord(int index); |
mauroar211 | 0:b805b487fbef | 31 | NdefRecord operator[](int index); |
mauroar211 | 0:b805b487fbef | 32 | |
mauroar211 | 0:b805b487fbef | 33 | void print(); |
mauroar211 | 0:b805b487fbef | 34 | private: |
mauroar211 | 0:b805b487fbef | 35 | NdefRecord _records[MAX_NDEF_RECORDS]; |
mauroar211 | 0:b805b487fbef | 36 | unsigned int _recordCount; |
mauroar211 | 0:b805b487fbef | 37 | }; |
mauroar211 | 0:b805b487fbef | 38 | |
mauroar211 | 0:b805b487fbef | 39 | #endif |