isReady method

  1. @override
bool isReady(
  1. int attemptCount
)
override

The implementation is protocol based. Just check if the PN532 is ready based on the used protocol (if an irqPin) was specified the PN532BaseProtocol will use the irqPin instead of this function!

The parameter attemptCount will provide you with a count that reflects how often this function was already called in this waitReady cycle. Starting with 0!

Implementation

@override
bool isReady(int attemptCount) {
  if (attemptCount == 0) {
    pn532StatusList = [pn532SpiStartRead, 0x00];
  }

  pn532StatusList = readWriteHelper(pn532StatusList);

  return pn532StatusList[1] == pn532SpiReady;
}