M5Unit-NFC 0.1.0 git rev:93745b5
Loading...
Searching...
No Matches
m5::nfc::isodep::IsoDEP Class Reference

ISO Data Exchange Protocol. More...

#include <isoDEP.hpp>

Public Member Functions

 IsoDEP (NFCLayerInterface &layer)
 Constructor with NFC layer.
 
 IsoDEP (NFCLayerInterface &layer, const config_t &c)
 Constructor with NFC layer and configuration.
 
config_t config () const
 Get configuration.
 
void config (const config_t &cfg)
 Set configuration.
 
bool transceiveINF (uint8_t *rx_inf, uint16_t &rx_inf_len, const uint8_t *tx_inf, const uint16_t tx_inf_len, RxInfo *info=nullptr, const policy_t *override_policy=nullptr)
 Transceive INF.
 
bool transceiveAPDU (uint8_t *rx, uint16_t &rx_len, const uint8_t *cmd, const uint16_t cmd_len, const policy_t *override_policy=nullptr)
 Transceive APDU.
 
bool transceive (uint8_t *rx, uint16_t &rx_len, const uint8_t *tx, const uint16_t tx_len, const uint32_t timeout_ms)
 Transceive normal.
 

Detailed Description

ISO Data Exchange Protocol.

Constructor & Destructor Documentation

◆ IsoDEP() [1/2]

m5::nfc::isodep::IsoDEP::IsoDEP ( NFCLayerInterface & layer)
inlineexplicit

Constructor with NFC layer.

Parameters
layerNFC layer interface

◆ IsoDEP() [2/2]

m5::nfc::isodep::IsoDEP::IsoDEP ( NFCLayerInterface & layer,
const config_t & c )
inline

Constructor with NFC layer and configuration.

Parameters
layerNFC layer interface
cISO-DEP configuration

Member Function Documentation

◆ config() [1/2]

config_t m5::nfc::isodep::IsoDEP::config ( ) const
inline

Get configuration.

Returns
Current ISO-DEP configuration

◆ config() [2/2]

void m5::nfc::isodep::IsoDEP::config ( const config_t & cfg)
inline

Set configuration.

Parameters
cfgNew ISO-DEP configuration
Note
Resets the ISO-DEP block number

◆ transceive()

bool m5::nfc::isodep::IsoDEP::transceive ( uint8_t * rx,
uint16_t & rx_len,
const uint8_t * tx,
const uint16_t tx_len,
const uint32_t timeout_ms )

Transceive normal.

Parameters
[out]rxReceive buffer
[in,out]rx_lenIn: capacity of rx, Out: received length
txTransmit buffer
tx_lenTransmit length
timeout_msTimeout in milliseconds
Returns
True if succeeded

◆ transceiveAPDU()

bool m5::nfc::isodep::IsoDEP::transceiveAPDU ( uint8_t * rx,
uint16_t & rx_len,
const uint8_t * cmd,
const uint16_t cmd_len,
const policy_t * override_policy = nullptr )

Transceive APDU.

Parameters
[out]rxReceive buffer (response + SW)
[in,out]rx_lenIn: capacity of rx, Out: received length
cmdCommand APDU
cmd_lenCommand APDU length
override_policyOptional per-call timeout/retry override (nullptr uses config values)
Returns
True if succeeded
Note
override_policy is forwarded to the underlying transceiveINF for this exchange only

◆ transceiveINF()

bool m5::nfc::isodep::IsoDEP::transceiveINF ( uint8_t * rx_inf,
uint16_t & rx_inf_len,
const uint8_t * tx_inf,
const uint16_t tx_inf_len,
RxInfo * info = nullptr,
const policy_t * override_policy = nullptr )

Transceive INF.

Parameters
[out]rx_infReceive INF buffer
[in,out]rx_inf_lenIn: capacity of rx_inf, Out: received INF length
tx_infTransmit INF buffer
tx_inf_lenTransmit INF length
[out]infoOptional receive information (chaining/WTX)
override_policyOptional per-call timeout/retry override (nullptr uses config values)
Returns
True if succeeded
Note
override_policy applies to this exchange only; it does not persist and does not reset the block number