PN532
Dependents: PN532_GPIO PN532_ReadUid EX_encoder_PID_QianYuyangV4
Fork of LibPN532 by
PN532/mac_link.cpp@3:685e0bf1409d, 2018-01-15 (annotated)
- Committer:
- zhangyx
- Date:
- Mon Jan 15 17:12:41 2018 +0000
- Revision:
- 3:685e0bf1409d
- Parent:
- 0:db8030e71f55
disable debug message
Who changed what in which revision?
User | Revision | Line number | New 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 | } |