PN532 NFC shield of Adafruit based on PN532 of Seeed.

Fork of PN532 by Seeed

Embed: (wiki syntax)

« Back to documentation index

MACLink Class Reference

MACLink Class Reference

The MACLink class. More...

#include <mac_link.h>

Public Member Functions

int8_t activateAsTarget (uint16_t timeout=0)
 Activate PN532 as a target.
bool write (const uint8_t *header, uint8_t hlen, const uint8_t *body=0, uint8_t blen=0)
 write a PDU packet, the packet should be less than (255 - 2) bytes
int16_t read (uint8_t *buf, uint8_t len)
 read a PDU packet, the packet will be less than (255 - 2) bytes

Detailed Description

The MACLink class.

Definition at line 11 of file mac_link.h.


Member Function Documentation

int8_t activateAsTarget ( uint16_t  timeout = 0 )

Activate PN532 as a target.

Parameters:
timeoutmax time to wait, 0 means no timeout
Returns:
> 0 success = 0 timeout < 0 failed

Definition at line 5 of file mac_link.cpp.

int16_t read ( uint8_t *  buf,
uint8_t  len 
)

read a PDU packet, the packet will be less than (255 - 2) bytes

Parameters:
bufthe buffer to contain the PDU packet
lenlenght of the buffer
Returns:
>=0 length of the PDU packet <0 failed

Definition at line 17 of file mac_link.cpp.

bool write ( const uint8_t *  header,
uint8_t  hlen,
const uint8_t *  body = 0,
uint8_t  blen = 0 
)

write a PDU packet, the packet should be less than (255 - 2) bytes

Parameters:
headerpacket header
hlenlength of header
bodypacket body
blenlength of body
Returns:
true success false failed

Definition at line 12 of file mac_link.cpp.