#ifndef CONTACT_H
#define CONTACT_H

#define EMVL1CT_STATUS_OK 0
#define EMVL1CT_STATUS_TIMEOUT -1
#define EMVL1CT_STATUS_NOT_INITIALIZED -99
#define EMVL1CT_STATUS_FAILED -8
#define EMVL1CT_STATUS_NOT_PRESENT -9

#include <stdint.h>

#define EMVL1_SCR_SLOT 0
#define EMVL1_SAM1_SLOT 1
#define EMVL1_SAM2_SLOT 2

uint32_t contact_getversion ();

#ifdef __cplusplus
extern "C"
#endif
    int
    contact_open ();

#ifdef __cplusplus
extern "C"
#endif
    int
    contact_close ();

#ifdef __cplusplus
extern "C"
#endif
    int
    contact_probe ();

#ifdef __cplusplus
extern "C"
#endif
    int
    contact_start ();

#ifdef __cplusplus
extern "C"
#endif
    int
    contact_stop ();

#ifdef __cplusplus
extern "C"
#endif
    int
    contact_apdu (char* req, int qsz, char* rsp, int* psz);
#ifdef __cplusplus
extern "C"
#endif
    int
    contact_get_atr (char* rsp, int* psz);

#ifdef __cplusplus
extern "C"
#endif
    int sam_open (uint8_t);

#ifdef __cplusplus
extern "C"
#endif
    int sam_close (uint8_t);

#ifdef __cplusplus
extern "C"
#endif
    int sam_probe (uint8_t);

#ifdef __cplusplus
extern "C"
#endif
    int sam_start (uint8_t);

#ifdef __cplusplus
extern "C"
#endif
    int sam_stop (uint8_t);

#ifdef __cplusplus
extern "C"
#endif
    int
    sam_apdu (uint8_t port, char* req, int qsz, char* rsp, int* psz);

#ifdef __cplusplus
extern "C"
#endif
    int
    sam_get_atr (uint8_t port, char* rsp, int* psz);

#endif // CONTACT_H
