sdiprotocol.h
Last updated: 02-Oct-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Â 115Â unsigned char* SDI_GetStoredResponse(unsigned *dataLen); 116Â 117Â /***************************************************************************** 118Â * SDI_Disconnect 119Â *****************************************************************************/ 127Â int SDI_Disconnect(void); 128Â 130Â typedef void (*SDI_DATA_AVAILABLE_CALLBACK_TYPE)(void *context); 131Â 132Â /***************************************************************************** 133Â * SDI_SetDataAvailableCallback 134Â *****************************************************************************/ 142Â int SDI_SetDataAvailableCallback(SDI_DATA_AVAILABLE_CALLBACK_TYPE cb, void *context); 143Â 151Â typedef void (*SDI_CALLBACK_TYPE)(unsigned char *dataIn, unsigned short sizeIn, unsigned char *dataOut, unsigned short *sizeOut, void *context); 152Â 153Â /*************************************************************************************** 154Â * SDI_SetSdiCallback 155Â ****************************************************************************************/ 161Â int SDI_SetSdiCallback(SDI_CALLBACK_TYPE cb, void *context); 162Â 168Â typedef void (*CARD_DETECTED_CALLBACK_TYPE)(unsigned char *dataIn, unsigned short sizeIn, void *context); 169Â 170Â /*************************************************************************************** 171Â * SDI_SetCardDetectedCallback 172Â ****************************************************************************************/ 178Â int SDI_SetCardDetectedCallback(CARD_DETECTED_CALLBACK_TYPE cb, void *context); 179Â 180Â /*************************************************************************************** 181Â * SDI_SendSysAbort 182Â ****************************************************************************************/ 188Â void SDI_SendSysAbort(void); 189Â 190Â /*************************************************************************************** 191Â * SDI_SendExternalButton 192Â ****************************************************************************************/ 197Â void SDI_SendExternalButton(void); 198Â 202Â typedef void (*EOF_DETECTED_CALLBACK_TYPE)(void *context); 203Â 204Â /*************************************************************************************** 205Â * SDI_SetEOFDetectedCallback 206Â ****************************************************************************************/ 213Â int SDI_SetEOFDetectedCallback(EOF_DETECTED_CALLBACK_TYPE cb, void *context); 214Â 215Â /*************************************************************************************** 216Â * SDI_SetLoggingCallback 217Â ****************************************************************************************/ 225Â int SDI_SetLoggingCallback(void (*cb)(const char*, void*), void* context); 226Â 227Â 228Â #ifdef __cplusplus 229Â } 230Â #endif 231Â 232Â #endif // _SDIPROTOCOL_H_
Rate this article: