sdiprotocol.h
Last updated: 05-Mar-2025
Go to the documentation of this file.
1Â 6Â #ifndef _SDIPROTOCOL_H_ 7Â #define _SDIPROTOCOL_H_ 8Â 9Â #ifdef __cplusplus 10Â extern "C" { 11Â #endif 12Â 16Â #define SDI_PROTOCOL_ERR_IO -1 17Â #define SDI_PROTOCOL_ERR_CONCURRENT_USE -2 18Â #define SDI_PROTOCOL_ERR_CONNECT -3 19Â #define SDI_PROTOCOL_ERR_OVERFLOW -4 20Â #define SDI_PROTOCOL_ERR_PARAM -5 21Â #define SDI_PROTOCOL_ERR_OTHER -6 22Â #define SDI_PROTOCOL_ERR_NO_RECEIVE -7 23Â 26Â 30Â #define SDI_PROTOCOL_INIT_OPT_TRACE_EMV_CBK 0x01 31Â #define SDI_PROTOCOL_INIT_OPT_TRACE_SYSLOG 0x02 32Â #define SDI_PROTOCOL_INIT_OPT_TRACE_ADK_LOG 0x04 33Â 35Â 36Â /***************************************************************************** 37Â * SDI_ProtocolInit 38Â *****************************************************************************/ 60Â int SDI_ProtocolInit(unsigned options, const char *settings); 61Â 62Â /***************************************************************************** 63Â * SDI_Send 64Â *****************************************************************************/ 74Â int SDI_Send(const unsigned char *data, int dataLength); 75Â 76Â /***************************************************************************** 77Â * SDI_Receive 78Â *****************************************************************************/ 88Â int SDI_Receive(unsigned char *responseBuffer, int responseBufferSize); 89Â 90Â /***************************************************************************** 91Â * SDI_SendReceive 92Â *****************************************************************************/ 104Â int SDI_SendReceive(const unsigned char *data, int dataLength, unsigned char *responseBuffer, int responseBufferSize); 105Â 106Â /***************************************************************************** 107Â * SDI_Disconnect 108Â *****************************************************************************/ 116Â int SDI_Disconnect(void); 117Â 119Â typedef void (*SDI_DATA_AVAILABLE_CALLBACK_TYPE)(void *context); 120Â 121Â /***************************************************************************** 122Â * SDI_SetDataAvailableCallback 123Â *****************************************************************************/ 131Â int SDI_SetDataAvailableCallback(SDI_DATA_AVAILABLE_CALLBACK_TYPE cb, void *context); 132Â 140Â typedef void (*SDI_CALLBACK_TYPE)(unsigned char *dataIn, unsigned short sizeIn, unsigned char *dataOut, unsigned short *sizeOut, void *context); 141Â 142Â /*************************************************************************************** 143Â * SDI_SetSdiCallback 144Â ****************************************************************************************/ 150Â int SDI_SetSdiCallback(SDI_CALLBACK_TYPE cb, void *context); 151Â 157Â typedef void (*CARD_DETECTED_CALLBACK_TYPE)(unsigned char *dataIn, unsigned short sizeIn, void *context); 158Â 159Â /*************************************************************************************** 160Â * SDI_SetCardDetectedCallback 161Â ****************************************************************************************/ 167Â int SDI_SetCardDetectedCallback(CARD_DETECTED_CALLBACK_TYPE cb, void *context); 168Â 169Â /*************************************************************************************** 170Â * SDI_SendSysAbort 171Â ****************************************************************************************/ 177Â void SDI_SendSysAbort(void); 178Â 179Â /*************************************************************************************** 180Â * SDI_SendExternalButton 181Â ****************************************************************************************/ 186Â void SDI_SendExternalButton(void); 187Â 191Â typedef void (*EOF_DETECTED_CALLBACK_TYPE)(void *context); 192Â 193Â /*************************************************************************************** 194Â * SDI_SetEOFDetectedCallback 195Â ****************************************************************************************/ 202Â int SDI_SetEOFDetectedCallback(EOF_DETECTED_CALLBACK_TYPE cb, void *context); 203Â 204Â 205Â #ifdef __cplusplus 206Â } 207Â #endif 208Â 209Â #endif // _SDIPROTOCOL_H_
Rate this article: