NFC library using PN532 to read/write NDEF Messages to NFC tags
Dependents: Seeed_NFC_Shield_write Nucleo_test_nfc
Fork of PN532 by
mac_link.cpp@6:26c1b3b6c192, 2014-03-25 (annotated)
- Committer:
- screamer
- Date:
- Tue Mar 25 16:48:10 2014 +0000
- Revision:
- 6:26c1b3b6c192
- Parent:
- 3:4189a10038e6
Fixed compile warnings
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yihui | 3:4189a10038e6 | 1 | |
yihui | 3:4189a10038e6 | 2 | #include "mac_link.h" |
yihui | 3:4189a10038e6 | 3 | #include "PN532_debug.h" |
yihui | 3:4189a10038e6 | 4 | |
yihui | 3:4189a10038e6 | 5 | int8_t MACLink::activateAsTarget(uint16_t timeout) |
yihui | 3:4189a10038e6 | 6 | { |
yihui | 3:4189a10038e6 | 7 | pn532.begin(); |
yihui | 3:4189a10038e6 | 8 | pn532.SAMConfig(); |
yihui | 3:4189a10038e6 | 9 | return pn532.tgInitAsTarget(timeout); |
yihui | 3:4189a10038e6 | 10 | } |
yihui | 3:4189a10038e6 | 11 | |
yihui | 3:4189a10038e6 | 12 | bool MACLink::write(const uint8_t *header, uint8_t hlen, const uint8_t *body, uint8_t blen) |
yihui | 3:4189a10038e6 | 13 | { |
yihui | 3:4189a10038e6 | 14 | return pn532.tgSetData(header, hlen, body, blen); |
yihui | 3:4189a10038e6 | 15 | } |
yihui | 3:4189a10038e6 | 16 | |
yihui | 3:4189a10038e6 | 17 | int16_t MACLink::read(uint8_t *buf, uint8_t len) |
yihui | 3:4189a10038e6 | 18 | { |
yihui | 3:4189a10038e6 | 19 | return pn532.tgGetData(buf, len); |
yihui | 3:4189a10038e6 | 20 | } |