PN532 class

Constructors

PN532({required PN532BaseProtocol pn532ProtocolImpl})
This is the basic implementation of all the functions of the PN532. Also the protocol unspecific communication with PN532 is implemented within this class. CAUTION: I only test getFirmwareVersion() and readPassivTargetId()!

Properties

hashCode int
The hash code for this object.
no setterinherited
pn532ProtocolImpl PN532BaseProtocol
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

callPN532Function(int command, {List<int> parameters = const [], int responseLength = 0, int timeout = pn532StandardTimeout}) List<int>
Send the command and given parameters to the PN532 and only wait timeout ms for the PN532 to say it's ready.
dispose() → void
getFirmwareVersion({int timeout = pn532StandardTimeout}) int
Checks the firmware version of the PN532 chip and returns the chip's firmware version as an int
getPassivTargetId({int cardBaudrate = pn532MifareIso14443A, int timeout = pn532StandardTimeout}) List<int>
Before you read MiFare-Cards you should call the setSamConfiguration function to configure the PN532 properly!
mifareClassicAuthenticateBlock(List<Uint8> uid, Uint8 blockNumber, Uint8 keyNumber, List<Uint8> key) → void
Authenticate specified block number for a MiFare classic card. uid: A byte array with the UID of the card. block_number: The block to authenticate. key_number: The key type (like MIFARE_CMD_AUTH_A or MIFARE_CMD_AUTH_B). A byte array with the key data.
mifareClassicReadBlock(Uint8 blockNumber) List<int>
Read a block of data from the card. Block number should be the block to read.
mifareClassicWriteBlock(Uint8 blockNumber, List<int> data) → void
Write a block of data to the card. Block number should be the block to write and data should be a byte array of length 16 with the data to write.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ntag2xxReadBlock(Uint8 blockNumber) List<int>
Read a block of data from the card. Block number should be the block to read. Returns List<int> of length 4 if the block is successfully read.
ntag2xxWriteBlock(Uint8 blockNumber, List<int> data) → void
Write a block of data to the card. Block number should be the block to write and data should be a byte array of length 4 with the data to write.
readResponse(int length) List<int>
setSamConfiguration({int mode = 1, int timeout = 20, int irqPin = 1}) → void
Send SAM configuration command with configuration for: mode is default = 1, normal mode timeout is default = 20, timeout 50ms * 20 = 1 second (PN532 timeout calculation) irqPin is default = 1, use IRQ pin if possible (not listened to in this driver)
toString() String
A string representation of this object.
inherited
writeCommand(List<int> commands) → void

Operators

operator ==(Object other) bool
The equality operator.
inherited