NFC: Refactor common NXP Native command handling

This commit is contained in:
Willy-JL
2025-03-22 11:36:34 +00:00
parent 1f8cfcc669
commit 118e745368
16 changed files with 287 additions and 325 deletions

View File

@@ -3,6 +3,7 @@
#include "mf_desfire.h"
#include <lib/nfc/protocols/iso14443_4a/iso14443_4a_poller.h>
#include <lib/nfc/helpers/nxp_native_command_mode.h>
#ifdef __cplusplus
extern "C" {
@@ -39,24 +40,14 @@ typedef struct {
} MfDesfirePollerEvent;
/**
* @brief Enumeration of possible MfDesfire poller command modes.
*/
typedef enum {
MfDesfirePollerCommandModeNative, /**< Native MfDesfire commands. */
MfDesfirePollerCommandModeIsoWrapped, /**< ISO 7816-wrapped commands. */
MfDesfirePollerCommandModeMAX,
} MfDesfirePollerCommandMode;
/**
* @brief Change MfDesfire command mode used in poller mode.
* @brief Change command mode used in poller mode.
*
* @param[in, out] instance pointer to the instance to affect.
* @param[in] command_mode command mode to use in further communication with the card.
*/
void mf_desfire_poller_set_command_mode(
MfDesfirePoller* instance,
MfDesfirePollerCommandMode command_mode);
NxpNativeCommandMode command_mode);
/**
* @brief Transmit and receive MfDesfire chunks in poller mode.