PN532 NFC library for Seeed Studio's NFC Shield
Fork of PN532 by
mac_link.cpp@9:85bfede025da, 2015-02-04 (annotated)
- Committer:
- r4z0r7o3
- Date:
- Wed Feb 04 16:24:30 2015 +0000
- Revision:
- 9:85bfede025da
- Parent:
- 3:4189a10038e6
Fixed missing return statement
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 | } |