cryptnox-sdk-esp32 1.0.0
ESP32 SDK for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
Pn532NfcTransport.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: LGPL-3.0-or-later
3 * Copyright (c) 2026 Cryptnox SA
4 */
5
49
50#pragma once
51
52#include "CW_NfcTransport.h"
53#include "CW_Logger.h"
54
55extern "C" {
56#include "pn532.h"
57}
58
80class Pn532NfcTransport : public CW_NfcTransport {
81public:
89 Pn532NfcTransport(pn532_t *dev, CW_Logger &logger);
90
100 bool begin() override;
101
111 bool inListPassiveTarget() override;
112
130 bool sendAPDU(const uint8_t *apdu, uint8_t apduLen,
131 uint8_t *response, uint8_t &responseLen) override;
132
150 bool sendAPDULarge(const uint8_t *apdu, uint8_t apduLen,
151 uint8_t *response, uint16_t &responseLen) override;
152
159 void resetReader() override;
160
170 bool printFirmwareVersion() override;
171
173 ~Pn532NfcTransport() override {}
174
175private:
177 CW_Logger &m_logger;
178};
~Pn532NfcTransport() override
Default destructor.
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).
Low-level PN532 NFC controller driver for ESP-IDF (SPI and I²C).
Opaque-like runtime state for a single PN532 instance.
Definition pn532.h:141