forked from don/NDEF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NdefMessage.h
41 lines (33 loc) · 1.08 KB
/
NdefMessage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef NdefMessage_h
#define NdefMessage_h
#include <Ndef.h>
#include <NdefRecord.h>
#define MAX_NDEF_RECORDS 4
class NdefMessage
{
public:
NdefMessage(void);
NdefMessage(const byte *data, const int numBytes);
NdefMessage(const NdefMessage& rhs);
~NdefMessage();
NdefMessage& operator=(const NdefMessage& rhs);
int getEncodedSize(); // need so we can pass array to encode
void encode(byte *data);
boolean addRecord(NdefRecord& record);
void addMimeMediaRecord(String mimeType, String payload);
void addMimeMediaRecord(String mimeType, byte *payload, int payloadLength);
void addTextRecord(String text);
void addTextRecord(String text, String encoding);
void addUriRecord(String uri);
void addEmptyRecord();
unsigned int getRecordCount();
NdefRecord getRecord(int index);
NdefRecord operator[](int index);
#ifdef NDEF_USE_SERIAL
void print();
#endif
private:
NdefRecord _records[MAX_NDEF_RECORDS];
unsigned int _recordCount;
};
#endif