Forked from LibPN532

Dependents:   NFC_Secure_Access NFC_Secure_Access

Fork of LibPN532 by dotnfc Tang

Committer:
udareaniket
Date:
Sun Apr 22 23:29:20 2018 +0000
Revision:
2:9a2ab3fa7862
Parent:
0:db8030e71f55
Initial commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dotnfc 0:db8030e71f55 1
dotnfc 0:db8030e71f55 2 #include "mac_link.h"
dotnfc 0:db8030e71f55 3 #include "PN532_debug.h"
dotnfc 0:db8030e71f55 4
dotnfc 0:db8030e71f55 5 int8_t MACLink::activateAsTarget(uint16_t timeout)
dotnfc 0:db8030e71f55 6 {
dotnfc 0:db8030e71f55 7 pn532.begin();
dotnfc 0:db8030e71f55 8 pn532.SAMConfig();
dotnfc 0:db8030e71f55 9 return pn532.tgInitAsTarget(timeout);
dotnfc 0:db8030e71f55 10 }
dotnfc 0:db8030e71f55 11
dotnfc 0:db8030e71f55 12 bool MACLink::write(const uint8_t *header, uint8_t hlen, const uint8_t *body, uint8_t blen)
dotnfc 0:db8030e71f55 13 {
dotnfc 0:db8030e71f55 14 return pn532.tgSetData(header, hlen, body, blen);
dotnfc 0:db8030e71f55 15 }
dotnfc 0:db8030e71f55 16
dotnfc 0:db8030e71f55 17 int16_t MACLink::read(uint8_t *buf, uint8_t len)
dotnfc 0:db8030e71f55 18 {
dotnfc 0:db8030e71f55 19 return pn532.tgGetData(buf, len);
dotnfc 0:db8030e71f55 20 }