40 uint8_t *response, uint8_t &responseLen)
42 uint16_t len =
static_cast<uint16_t
>(responseLen);
44 responseLen =
static_cast<uint8_t
>((len >
static_cast<uint16_t
>(UINT8_MAX))
45 ?
static_cast<uint16_t
>(UINT8_MAX) : len);
50 uint8_t *response, uint16_t &responseLen)
64 bool result = (version != 0U);
static const uint32_t PN532_FW_VER_SHIFT
static const uint32_t PN532_FW_IC_SHIFT
static const uint32_t PN532_BYTE_MASK
static const uint32_t PN532_FW_REV_SHIFT
CW_NfcTransport adapter wrapping the ESP-IDF PN532 NFC driver.
bool begin() override
Configure the PN532 SAM and prepare it to accept card commands.
bool inListPassiveTarget() override
Scan for a passive ISO 14443-A card.
pn532_t * m_dev
PN532 device handle (not owned; must outlive this object).
Pn532NfcTransport(pn532_t *dev, CW_Logger &logger)
Construct the transport adapter.
bool sendAPDULarge(const uint8_t *apdu, uint8_t apduLen, uint8_t *response, uint16_t &responseLen) override
Exchange one ISO-DEP APDU with the selected card (large response).
void resetReader() override
Release the currently selected NFC target.
bool printFirmwareVersion() override
Query and log the PN532 firmware version.
CW_Logger & m_logger
Logger for printFirmwareVersion output.
bool sendAPDU(const uint8_t *apdu, uint8_t apduLen, uint8_t *response, uint8_t &responseLen) override
Exchange one ISO-DEP APDU with the selected card (short response).
uint32_t pn532_read_passive_target_id(pn532_t *dev, uint8_t cardbaudrate)
Scan for a passive ISO 14443-A card and return its UID.
bool pn532_send_apdu(pn532_t *dev, const uint8_t *apdu, uint8_t apdu_len, uint8_t *response, uint16_t *response_len)
Exchange a single ISO-DEP APDU with the currently selected card.
uint32_t pn532_get_firmware_version(pn532_t *dev)
Query the PN532 firmware version.
bool pn532_sam_config(pn532_t *dev)
Configure the PN532's Security Access Module (SAM).
#define PN532_MIFARE_ISO14443A
Baud-rate selector for ISO 14443-A (Mifare) cards passed to pn532_read_passive_target_id.
bool pn532_release_target(pn532_t *dev)
Release the currently selected NFC target.
Opaque-like runtime state for a single PN532 instance.