mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 04:34:43 +04:00
* Initial MFPlus draft * Proper detection (WIP) * Mifare Plus detection done * Bump F18 API * Alloc takes no arguments * Fixes from code review * Remove leftover logging * Remove stray reminder comment * Review changes and extra logging * Fix atqa detection * Fix incorrect comparison * ATQA byte swap fix * mf plus: code clean up * mf plus: remove unused code * mf plus: fix read fail event handling * mf plus: fix return error codes * mf plus: handle load and save errors * mf plus: assert -> check in public API funxtion * Bump API Symbols version * Fix wrong feature mask * Skylanders plugin separation * Fix navigation * Fix info box size Co-authored-by: gornekich <n.gorbadey@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
55 lines
1.4 KiB
C
55 lines
1.4 KiB
C
#pragma once
|
|
|
|
#include "mf_plus.h"
|
|
|
|
#include <lib/nfc/protocols/iso14443_4a/iso14443_4a.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief MIFARE Plus poller opaque type definition.
|
|
*/
|
|
typedef struct MfPlusPoller MfPlusPoller;
|
|
|
|
/**
|
|
* @brief Enumeration of possible MfPlus poller event types.
|
|
*/
|
|
|
|
typedef enum {
|
|
MfPlusPollerEventTypeReadSuccess, /**< Card was read successfully. */
|
|
MfPlusPollerEventTypeReadFailed, /**< Poller failed to read the card. */
|
|
} MfPlusPollerEventType;
|
|
|
|
/**
|
|
* @brief MIFARE Plus poller event data.
|
|
*/
|
|
typedef union {
|
|
MfPlusError error; /**< Error code indicating card reading fail reason. */
|
|
} MfPlusPollerEventData;
|
|
|
|
/**
|
|
* @brief MIFARE Plus poller event structure.
|
|
*
|
|
* Upon emission of an event, an instance of this struct will be passed to the callback.
|
|
*/
|
|
typedef struct {
|
|
MfPlusPollerEventType type; /**< Type of emitted event. */
|
|
MfPlusPollerEventData* data; /**< Pointer to event specific data. */
|
|
} MfPlusPollerEvent;
|
|
|
|
/**
|
|
* @brief Read MfPlus card version.
|
|
*
|
|
* Must ONLY be used inside the callback function.
|
|
*
|
|
* @param[in, out] instance pointer to the instance to be used in the transaction.
|
|
* @param[out] data pointer to the MfPlusVersion structure to be filled with version data.
|
|
* @return MfPlusErrorNone on success, an error code on failure.
|
|
*/
|
|
MfPlusError mf_plus_poller_read_version(MfPlusPoller* instance, MfPlusVersion* data);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif |