unleashed-firmware/lib/nfc/protocols/emv/emv_poller_i.h

54 lines
1.1 KiB
C
Raw Normal View History

2024-01-10 18:48:55 +03:00
#pragma once
#include "emv_poller.h"
#include <lib/nfc/protocols/iso14443_4a/iso14443_4a_poller_i.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
EmvPollerStateIdle,
EmvPollerStateSelectPPSE,
EmvPollerStateSelectApplication,
EmvPollerStateGetProcessingOptions,
EmvPollerStateReadFiles,
EmvPollerStateReadExtra,
2024-01-10 18:48:55 +03:00
EmvPollerStateReadFailed,
EmvPollerStateReadSuccess,
EmvPollerStateNum,
} EmvPollerState;
typedef enum {
EmvPollerSessionStateIdle,
EmvPollerSessionStateActive,
EmvPollerSessionStateStopRequest,
} EmvPollerSessionState;
struct EmvPoller {
Iso14443_4aPoller* iso14443_4a_poller;
EmvPollerSessionState session_state;
EmvPollerState state;
EmvError error;
EmvData* data;
BitBuffer* tx_buffer;
BitBuffer* rx_buffer;
BitBuffer* input_buffer;
BitBuffer* result_buffer;
EmvPollerEventData emv_event_data;
EmvPollerEvent emv_event;
NfcGenericEvent general_event;
NfcGenericCallback callback;
void* context;
};
EmvError emv_process_error(Iso14443_4aError error);
const EmvData* emv_poller_get_data(EmvPoller* instance);
#ifdef __cplusplus
}
#endif