PN532 NFC library for Seeed Studio's NFC Shield

Fork of PN532 by Yihui Xiong

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mac_link.cpp Source File

mac_link.cpp

00001 
00002 #include "mac_link.h"
00003 #include "PN532_debug.h"
00004 
00005 int8_t MACLink::activateAsTarget(uint16_t timeout)
00006 {
00007     pn532.begin();
00008     pn532.SAMConfig();
00009     return pn532.tgInitAsTarget(timeout);
00010 }
00011 
00012 bool MACLink::write(const uint8_t *header, uint8_t hlen, const uint8_t *body, uint8_t blen)
00013 {
00014     return pn532.tgSetData(header, hlen, body, blen);
00015 }
00016 
00017 int16_t MACLink::read(uint8_t *buf, uint8_t len)
00018 {
00019     return pn532.tgGetData(buf, len);
00020 }