to colorize a colorful pixel with a simple touch using nfc technology
Dependencies: Chainable_RGB_LED mbed
use Arch, NFC Shield and Grove - Chainable RGB LED to DIY a touch pixel. Then use an Android with NFC support to colorize it.
The project is on https://github.com/Seeed-Studio/TouchPixel
nfc/NfcTag.h@0:88960f3eeb2c, 2013-12-27 (annotated)
- Committer:
- yihui
- Date:
- Fri Dec 27 01:46:32 2013 +0000
- Revision:
- 0:88960f3eeb2c
initial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 0:88960f3eeb2c | 1 | #ifndef NfcTag_h |
yihui | 0:88960f3eeb2c | 2 | #define NfcTag_h |
yihui | 0:88960f3eeb2c | 3 | |
yihui | 0:88960f3eeb2c | 4 | #include <stdint.h> |
yihui | 0:88960f3eeb2c | 5 | #include <NdefMessage.h> |
yihui | 0:88960f3eeb2c | 6 | |
yihui | 0:88960f3eeb2c | 7 | class NfcTag |
yihui | 0:88960f3eeb2c | 8 | { |
yihui | 0:88960f3eeb2c | 9 | public: |
yihui | 0:88960f3eeb2c | 10 | NfcTag(); |
yihui | 0:88960f3eeb2c | 11 | NfcTag(uint8_t *uid, unsigned int uidLength); |
yihui | 0:88960f3eeb2c | 12 | NfcTag(uint8_t *uid, unsigned int uidLength, string tagType); |
yihui | 0:88960f3eeb2c | 13 | NfcTag(uint8_t *uid, unsigned int uidLength, string tagType, NdefMessage& ndefMessage); |
yihui | 0:88960f3eeb2c | 14 | NfcTag(uint8_t *uid, unsigned int uidLength, string tagType, const uint8_t *ndefData, const int ndefDataLength); |
yihui | 0:88960f3eeb2c | 15 | ~NfcTag(void); |
yihui | 0:88960f3eeb2c | 16 | NfcTag& operator=(const NfcTag& rhs); |
yihui | 0:88960f3eeb2c | 17 | uint8_t getUidLength(); |
yihui | 0:88960f3eeb2c | 18 | void getUid(uint8_t *uid, unsigned int uidLength); |
yihui | 0:88960f3eeb2c | 19 | string getUidString(); |
yihui | 0:88960f3eeb2c | 20 | string getTagType(); |
yihui | 0:88960f3eeb2c | 21 | bool hasNdefMessage(); |
yihui | 0:88960f3eeb2c | 22 | NdefMessage getNdefMessage(); |
yihui | 0:88960f3eeb2c | 23 | void print(); |
yihui | 0:88960f3eeb2c | 24 | private: |
yihui | 0:88960f3eeb2c | 25 | uint8_t *_uid; |
yihui | 0:88960f3eeb2c | 26 | unsigned int _uidLength; |
yihui | 0:88960f3eeb2c | 27 | string _tagType; // Mifare Classic, NFC Forum Type {1,2,3,4}, Unknown |
yihui | 0:88960f3eeb2c | 28 | NdefMessage* _ndefMessage; |
yihui | 0:88960f3eeb2c | 29 | // TODO capacity |
yihui | 0:88960f3eeb2c | 30 | // TODO isFormatted |
yihui | 0:88960f3eeb2c | 31 | }; |
yihui | 0:88960f3eeb2c | 32 | |
yihui | 0:88960f3eeb2c | 33 | #endif |