PN532 NFC library for Seeed Studio's NFC Shield
Fork of PN532 by
mac_link.cpp@3:4189a10038e6, 2013-11-21 (annotated)
- Committer:
- yihui
- Date:
- Thu Nov 21 04:30:49 2013 +0000
- Revision:
- 3:4189a10038e6
sync with https://github.com/Seeed-Studio/PN532/releases/tag/v0.9.
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 | } |