mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-27 23:33:53 +03:00
1a40fae003
* mf desfire: remove unused type * mf desfire: continue reading after failed get free mem cmd * mf desfire: fix processing read master key settings command * mf desfire: don't read applications if they are auth protected * mf desfire: handle multiple rights * mf desfire: fix PVS warnings * mf desfire: fix print format * mf desfire: fix logs * mf classic: add send frame functions to poller * unit tests: add test from mfc crypto frame exchange * mf classic: add documentation * mf classic: fix incorrect name * target: fix api version
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
#pragma once
|
|
|
|
#include "mf_desfire_poller.h"
|
|
|
|
#include <lib/nfc/protocols/iso14443_4a/iso14443_4a_poller_i.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
MfDesfirePollerStateIdle,
|
|
MfDesfirePollerStateReadVersion,
|
|
MfDesfirePollerStateReadFreeMemory,
|
|
MfDesfirePollerStateReadMasterKeySettings,
|
|
MfDesfirePollerStateReadMasterKeyVersion,
|
|
MfDesfirePollerStateReadApplicationIds,
|
|
MfDesfirePollerStateReadApplications,
|
|
MfDesfirePollerStateReadFailed,
|
|
MfDesfirePollerStateReadSuccess,
|
|
|
|
MfDesfirePollerStateNum,
|
|
} MfDesfirePollerState;
|
|
|
|
typedef enum {
|
|
MfDesfirePollerSessionStateIdle,
|
|
MfDesfirePollerSessionStateActive,
|
|
MfDesfirePollerSessionStateStopRequest,
|
|
} MfDesfirePollerSessionState;
|
|
|
|
struct MfDesfirePoller {
|
|
Iso14443_4aPoller* iso14443_4a_poller;
|
|
MfDesfirePollerSessionState session_state;
|
|
MfDesfirePollerState state;
|
|
MfDesfireError error;
|
|
MfDesfireData* data;
|
|
BitBuffer* tx_buffer;
|
|
BitBuffer* rx_buffer;
|
|
BitBuffer* input_buffer;
|
|
BitBuffer* result_buffer;
|
|
MfDesfirePollerEventData mf_desfire_event_data;
|
|
MfDesfirePollerEvent mf_desfire_event;
|
|
NfcGenericEvent general_event;
|
|
NfcGenericCallback callback;
|
|
void* context;
|
|
};
|
|
|
|
MfDesfireError mf_desfire_process_error(Iso14443_4aError error);
|
|
|
|
MfDesfireError mf_desfire_process_status_code(uint8_t status_code);
|
|
|
|
const MfDesfireData* mf_desfire_poller_get_data(MfDesfirePoller* instance);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|