cryptnox-sdk-cpp 1.0.0
Platform-independent C++ core SDK for Cryptnox Hardware Wallet
Loading...
Searching...
No Matches
CW_NfcTransport Class Referenceabstract

Abstract interface for NFC transport operations. More...

#include <CW_NfcTransport.h>

Public Member Functions

virtual bool begin ()=0
 Initialize the NFC transport hardware.
virtual bool inListPassiveTarget ()=0
 Detect the presence of a passive ISO-DEP NFC target.
virtual bool sendAPDU (const uint8_t *apdu, uint8_t apduLen, uint8_t *response, uint8_t &responseLen)=0
 Send an APDU command to the card and receive the response.
virtual bool sendAPDULarge (const uint8_t *apdu, uint8_t apduLen, uint8_t *response, uint16_t &responseLen)
 Send an APDU and receive a response that may exceed 255 bytes.
virtual void resetReader ()=0
 Reset the NFC reader/field for the next card detection cycle.
virtual bool printFirmwareVersion ()=0
 Print NFC module firmware version information to the logger.
virtual ~CW_NfcTransport ()

Detailed Description

Abstract interface for NFC transport operations.

Defines the hardware-agnostic contract for NFC communication so that CW_SecureChannel and CryptnoxWallet remain independent of the physical NFC module (PN532, PN7150, etc.).

Definition at line 40 of file CW_NfcTransport.h.

Constructor & Destructor Documentation

◆ ~CW_NfcTransport()

virtual CW_NfcTransport::~CW_NfcTransport ( )
inlinevirtual

Definition at line 103 of file CW_NfcTransport.h.

Member Function Documentation

◆ begin()

virtual bool CW_NfcTransport::begin ( )
pure virtual

Initialize the NFC transport hardware.

Returns
true if initialization succeeded, false otherwise.

◆ inListPassiveTarget()

virtual bool CW_NfcTransport::inListPassiveTarget ( )
pure virtual

Detect the presence of a passive ISO-DEP NFC target.

Returns
true if a card is detected, false otherwise.

◆ printFirmwareVersion()

virtual bool CW_NfcTransport::printFirmwareVersion ( )
pure virtual

Print NFC module firmware version information to the logger.

Returns
true if firmware info was retrieved successfully, false otherwise.

◆ resetReader()

virtual void CW_NfcTransport::resetReader ( )
pure virtual

Reset the NFC reader/field for the next card detection cycle.

◆ sendAPDU()

virtual bool CW_NfcTransport::sendAPDU ( const uint8_t * apdu,
uint8_t apduLen,
uint8_t * response,
uint8_t & responseLen )
pure virtual

Send an APDU command to the card and receive the response.

Parameters
[in]apduAPDU command bytes.
[in]apduLenLength of the APDU command.
[out]responseBuffer to receive the card response.
[out]responseLenActual number of bytes written to response.
Returns
true if the exchange succeeded, false otherwise.

Referenced by sendAPDULarge().

◆ sendAPDULarge()

virtual bool CW_NfcTransport::sendAPDULarge ( const uint8_t * apdu,
uint8_t apduLen,
uint8_t * response,
uint16_t & responseLen )
inlinevirtual

Send an APDU and receive a response that may exceed 255 bytes.

Used for APDUs whose DataOut can be larger than a uint8_t can express (e.g. GET_MANUFACTURER_CERTIFICATE returns up to 415 bytes). Implementations that cannot deliver more than 255 bytes may delegate to sendAPDU; the default below does exactly that.

Parameters
[in]apduAPDU command bytes.
[in]apduLenLength of the APDU command.
[out]responseBuffer to receive the card response.
[in,out]responseLenOn entry: capacity of response. On exit: actual bytes written.
Returns
true if the exchange succeeded, false otherwise.

Definition at line 81 of file CW_NfcTransport.h.

References sendAPDU().


The documentation for this class was generated from the following file: