Utility library to read and write Ndef messages from/to a Type4 NFC tag
Dependents: NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more
Fork of NDefLib by
NDEF NFC library
This library provides an abstract API to create NDEF formatted messages and records and to read/write them from/to a Type4 NFC Tag.
Implementations
At the moment, the NDEF API is implemented by X_NUCLEO_NFC01A1 and X_NUCLEO_NFC02A1 Dynamic NFC Tag libraries respectively driving the X-NUCLEO-NFC01A1 and X-NUCLEO-NFC02A1 boards.
Message.h@0:04b82ae7aa43, 2015-11-19 (annotated)
- Committer:
- giovannivisentini
- Date:
- Thu Nov 19 08:49:47 2015 +0000
- Revision:
- 0:04b82ae7aa43
- Child:
- 1:a0eeb478a45a
First Version, the tag is only write
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
giovannivisentini | 0:04b82ae7aa43 | 1 | /* |
giovannivisentini | 0:04b82ae7aa43 | 2 | * Message.h |
giovannivisentini | 0:04b82ae7aa43 | 3 | * |
giovannivisentini | 0:04b82ae7aa43 | 4 | * Created on: Nov 6, 2015 |
giovannivisentini | 0:04b82ae7aa43 | 5 | * Author: giovanni visentini |
giovannivisentini | 0:04b82ae7aa43 | 6 | */ |
giovannivisentini | 0:04b82ae7aa43 | 7 | |
giovannivisentini | 0:04b82ae7aa43 | 8 | #ifndef NDEFLIB_MESSAGE_H_ |
giovannivisentini | 0:04b82ae7aa43 | 9 | #define NDEFLIB_MESSAGE_H_ |
giovannivisentini | 0:04b82ae7aa43 | 10 | |
giovannivisentini | 0:04b82ae7aa43 | 11 | #include <vector> |
giovannivisentini | 0:04b82ae7aa43 | 12 | |
giovannivisentini | 0:04b82ae7aa43 | 13 | #include "Record.h" |
giovannivisentini | 0:04b82ae7aa43 | 14 | |
giovannivisentini | 0:04b82ae7aa43 | 15 | namespace NDefLib { |
giovannivisentini | 0:04b82ae7aa43 | 16 | |
giovannivisentini | 0:04b82ae7aa43 | 17 | class Message { |
giovannivisentini | 0:04b82ae7aa43 | 18 | public: |
giovannivisentini | 0:04b82ae7aa43 | 19 | Message(){} |
giovannivisentini | 0:04b82ae7aa43 | 20 | |
giovannivisentini | 0:04b82ae7aa43 | 21 | void addRecord(Record *r){ |
giovannivisentini | 0:04b82ae7aa43 | 22 | mRecords.push_back(r); |
giovannivisentini | 0:04b82ae7aa43 | 23 | } |
giovannivisentini | 0:04b82ae7aa43 | 24 | |
giovannivisentini | 0:04b82ae7aa43 | 25 | uint16_t getByteLenght()const; |
giovannivisentini | 0:04b82ae7aa43 | 26 | uint16_t write(uint8_t *buffer); |
giovannivisentini | 0:04b82ae7aa43 | 27 | |
giovannivisentini | 0:04b82ae7aa43 | 28 | static void parseMessage(uint8_t *buffer,std::vector<Record*> *parsedRecords); |
giovannivisentini | 0:04b82ae7aa43 | 29 | |
giovannivisentini | 0:04b82ae7aa43 | 30 | virtual ~Message(){} |
giovannivisentini | 0:04b82ae7aa43 | 31 | private: |
giovannivisentini | 0:04b82ae7aa43 | 32 | std::vector<Record*> mRecords; |
giovannivisentini | 0:04b82ae7aa43 | 33 | }; |
giovannivisentini | 0:04b82ae7aa43 | 34 | |
giovannivisentini | 0:04b82ae7aa43 | 35 | } /* namespace NDefLib */ |
giovannivisentini | 0:04b82ae7aa43 | 36 | |
giovannivisentini | 0:04b82ae7aa43 | 37 | #endif /* NDEFLIB_MESSAGE_H_ */ |