📄 pccti.h
字号:
#define TSI_OPEN_CCR5 0x0300 /* select CCR5 */
#define TSI_OPEN04 0x0400 /* select CCR2 (old style constant) */
#define TSI_OPEN_CCR2 0x0400 /* select CCR2 */
#define TSI_OPEN05 0x0500 /* select CRM7x (old style constant) */
#define TSI_OPEN_CRM7X 0x0500 /* select CRM7x */
#define TSI_OPEN06 0x0600 /* select ICT800 (old style constant) */
#define TSI_OPEN_ICT800 0x0600 /* select ICT800 */
#define TSI_OPEN07 0x0700 /* select KCT800 serial (old style constant) */
#define TSI_OPEN_KCT800 0x0700 /* select KCT800 serial */
#define TSI_OPEN08 0x0800 /* select KCT800 keyboard-interface (rfu, old style constant) */
#define TSI_OPEN_KCT800K 0x0800 /* select KCT800 keyboard-interface (rfu) */
#define TSI_OPEN09 0x0900 /* select MIFARE PC-Card (old style constant) */
#define TSI_OPEN_MIFBOARD 0x0900 /* select MIFARE PC-Card */
#define TSI_OPEN10 0x0a00 /* select MIFARE serial (rfu, old style constant) */
#define TSI_OPEN_MIFCOM 0x0a00 /* select MIFARE serial (rfu) */
#define TSI_OPEN11 0x0b00 /* select PCT (old style constant) */
#define TSI_OPEN_PCT 0x0b00 /* select PCT */
#define TSI_OPEN13 0x0d00 /* select VCT800 (old style constant) */
#define TSI_OPEN_VCT800 0x0d00 /* select VCT800 */
#define TSI_OPEN_EMU 0x1100 /* select Emulator */
#define TSI_OPEN_SIM 0x1200 /* select Simulator */
#define TSI_OPEN_PCSC 0x1300 /* select PC/SC reader */
#define TSI_OPEN_OEM 0x1400 /* select OEM reader */
#define TSI_OPEN_TS 0x4000 /* select TerminalServer */
/* config mode parameters for TSI_Config */
#define TSI_CONFIG_WIN_MSG 0x0001 /* (de)activate windows message handling */
#define TSI_CONFIG_MSG_BOX 0x0002 /* (de)activate generation of error message boxes */
#define TSI_CONFIG_INI_FILE 0x0004 /* (re)set INI-file (path &) name */
#define TSI_CONFIG_CALLBACK 0x0008 /* (de)activate journal callback function */
#define TSI_CONFIG_GET_TIMING 0x0010 /* get waiting times of T=1 Host */
#define TSI_CONFIG_SET_TIMING 0x0020 /* set waiting times of T=1 Host */
struct sCommand
{
unsigned uiCmdLen; /* length of command apdu */
unsigned char TSIFAR *ucpCmd; /* pointer to command apdu */
unsigned uiMinLen; /* minimum expected length of response */
/* for pre checking */
unsigned uiSW; /* reference code to compare the status words */
unsigned uiSWMask; /* comparison mask for the status words
example: SW == 0x9xxx ?
uiSW = 0x9000
uiSWMask = 0xf000 */
};
struct sResponse
{
unsigned uiBufSize; /* size of response buffer */
unsigned uiRespLen; /* returns the length of response */
unsigned char TSIFAR *ucpResp; /* buffer for response data, allocated by user */
};
struct sCTType
{
unsigned uiType; /* terminal type:
Bit 0 = 1 -> MKT Terminal
Bit 1 = 1 -> CT with Display
Bit 2 = 1 -> CT with keyboard
Bit 3 = 1 -> MKT - ECS implemented (rfu)
Bit 4 = 1 -> MKT - filesystem implemented (rfu)
Bit 15 = 1 -> extended functions */
unsigned uiTypeExtd; /* 0 -> no extended command set
1 -> CRM710 */
unsigned char ucFuncUnit[0x20]; /* list of supported functional units (terminated 0x00) */
char szCTManufacturer[0x06]; /* manufacturer id */
char szCTType[0x06]; /* identifier of CT */
char szCTVersion[0x06]; /* version of CT Software*/
char szCTInfo[0x51]; /* discretionary data */
};
struct sDebug
{
unsigned uiCmdBufSize; /* size of command data buffer */
unsigned uiCmdLen; /* returns the length of the command apdu */
unsigned char TSIFAR *ucpCmd; /* buffer stores the command data, allocated by user */
unsigned uiRespBufSize; /* size of response data buffer */
unsigned uiRespLen; /* returns the length of the response apdu */
unsigned char TSIFAR *ucpResp; /* buffer stores the response data, allocated by user */
};
struct sDisplay
{
unsigned char ucTime; /* waiting time:
user input, insertion or removal of icc */
char TSIFAR *szDispTxt; /* text to be displayed */
unsigned uiDataLen; /* length of discretionary data */
unsigned char TSIFAR *ucpDiscrData; /* discretionary data */
};
struct sAccess /* preliminary design; subject to future modifications */
{
unsigned uiInpMode; /* access control input mode */
unsigned uiInpLen; /* length of input data */
unsigned char TSIFAR *ucpInp; /* pointer to input data */
unsigned uiRespBufSize; /* response buffer size */
unsigned uiRespLen; /* length of response data */
unsigned char TSIFAR *ucpResp; /* pointer to response buffer according to uiRespBufSize */
};
struct sInput
{
unsigned char ucTime; /* waiting time */
char TSIFAR *szDispTxt; /* text to be displayed */
unsigned uiDataLen; /* length of discretionary data */
unsigned char TSIFAR *ucpDiscrData; /* discretionary data */
unsigned uiInpLen; /* expected length of input ( '00': <OK> ends input) */
BOOL bShowAsterisk; /* TRUE -> input characters are displayed as '*' */
};
struct sPINCmd
{
unsigned char ucTime; /* waiting time */
char TSIFAR *szDispTxt; /* text to be shown on the display */
unsigned uiDataLen; /* length of discretionary data */
unsigned char TSIFAR *ucpDiscrData; /* discretionary data */
unsigned uiCmdLen; /* length of ICC command */
unsigned char TSIFAR *ucpCmd; /* pointer to icc command */
unsigned uiPINLen; /* length of PIN and PUK */
unsigned uiPINPos; /* position of PIN in cmd */
unsigned uiNewPINPos; /* position of new PIN or old PIN in cmd */
BOOL bIsASCII; /* coding of PIN TRUE -> ascii, FALSE -> BCD */
};
struct sCTList
{
unsigned uiListBufSize; /* size of list buffer in characters */
unsigned uiListLen; /* returns the length of list buffer in characters */
char TSIFAR *mszCTList; /* buffer for CT list, allocated by user */
};
/* ***************************************************************** **
** type definition of the journal callback function **
** ***************************************************************** */
typedef void (TSIFAR *fctJouCbk)(unsigned short, unsigned short, unsigned short,
unsigned short, unsigned long, unsigned char*);
#ifdef __cplusplus /* extern "C" declaration of C-functions for C++ */
extern "C"
{
#endif
/* ***************************************************************** **
** resource allocation and handle generation functions **
** ***************************************************************** */
#ifndef __PCCTI_DLL_CALL
int TSICALL TSI_Init( unsigned TSIFAR *hCT, unsigned uiPortId,
unsigned uiMode);
#endif
int TSICALL TSI_InitEx( unsigned TSIFAR *hCT, const char *szCTName,
unsigned uiMode);
#ifndef __PCCTI_DLL_CALL
int TSICALL TSI_Close( unsigned hCT);
int TSICALL TSI_CreateHandle( unsigned TSIFAR *hCard, unsigned hCT,
unsigned uiDest);
int TSICALL TSI_DeleteHandle( unsigned hCard);
#endif
int TSICALL TSI_SetAccessControl( unsigned hCT, unsigned uiAccessControl,
struct sAccess TSIFAR *sInfo);
/* ***************************************************************** **
** general icc and ct communication function **
** ***************************************************************** */
#ifndef __PCCTI_DLL_CALL
int TSICALL TSI_Send( unsigned hCard,
const struct sCommand TSIFAR *sCmd,
struct sResponse TSIFAR* sResp);
/* ***************************************************************** **
** these functions provide easy access to **
** CT - Basic Command Set functionality **
** ***************************************************************** */
int TSICALL TSI_RequestICC( unsigned hCard,
const struct sDisplay TSIFAR *sDisp,
struct sResponse TSIFAR *sResp);
int TSICALL TSI_EjectICC( unsigned hCard,
const struct sDisplay TSIFAR *sDisp,
unsigned uiSignal);
int TSICALL TSI_ICCStatus( unsigned hCard);
int TSICALL TSI_CTType( unsigned hCT, struct sCTType TSIFAR *sCTType);
#endif
int TSICALL TSI_Reset( unsigned hCard, struct sResponse TSIFAR *sResp);
/* ***************************************************************** **
** extended CT - Basic Command Set of CTs w/ display and keyboard **
** ICT 800 **
** ***************************************************************** */
#ifndef __PCCTI_DLL_CALL
int TSICALL TSI_Display( unsigned hCT, struct sDisplay TSIFAR *sDisp);
#endif
int TSICALL TSI_Input( unsigned hCT, struct sInput TSIFAR *sInp,
struct sResponse TSIFAR *sResp);
int TSICALL TSI_VerifyPIN( unsigned hCard, struct sPINCmd TSIFAR *sPIN,
struct sResponse TSIFAR *sResp);
int TSICALL TSI_ChangePIN( unsigned hCard, struct sPINCmd TSIFAR *sPIN,
struct sResponse TSIFAR *sResp);
/* ***************************************************************** **
** additional functions for diagnosis and debug purposes **
** ***************************************************************** */
int TSICALL TSI_JournalOn( unsigned uiBufSize);
int TSICALL TSI_Journal( unsigned uiJouMode);
int TSICALL TSI_JournalSave( char TSIFAR *szFileName,
unsigned bAppend, unsigned bLineFeed);
int TSICALL TSI_JournalFree( void);
int TSICALL TSI_Debug( unsigned hCT, struct sDebug TSIFAR *sDbg);
int TSICALL TSI_WinMsg( BOOL bEnable);
int TSICALL TSI_Config( unsigned uiConfigMode, unsigned uiInp,
unsigned char TSIFAR *ucpPar1,
unsigned char TSIFAR *ucpPar2);
int TSICALL TSI_GetCTList( unsigned uiListMode,
struct sCTList TSIFAR *sList);
int TSICALL TSI_GetPortId( const char TSIFAR *szCTName,
unsigned TSIFAR *uipPortId);
#ifndef __PCCTI_DLL_CALL
char TSIFAR * TSICALL TSI_GetMsg( int iErrode);
#endif
/* ***************************************************************** **
** undocumented functions, declared here only for testing **
** ***************************************************************** */
int TSICALL TSI_Cancel( unsigned hCT ,int );
/* TSI_CTJournalSave saves communication only of port COM<uiPort> */
int TSICALL TSI_CTJournalSave( unsigned uiPort, char TSIFAR *szFileName,
unsigned bAppend, unsigned bLineFeed);
/* TSI_GetTiming gets the timing-parameters in milliseconds of the
communication between the PC and the CT (! NO ICC-timing !)*/
int TSICALL TSI_GetTiming( unsigned hCT, unsigned long *lCWT,
unsigned long *lBWT);
/* TSI_SetTiming sets the timing-parameters in milliseconds of the
communication between the PC and the CT (! NO ICC-timing !)*/
int TSICALL TSI_SetTiming( unsigned hCT, unsigned long lCWT,
unsigned long lBWT);
/* TSI_JournalGet not supported any more, returns error */
int TSICALL TSI_JournalGet( unsigned uiNumber, unsigned uiLen, char TSIFAR *s);
/* TSI_SetCallbackFunction initializes global callback function */
int TSICALL TSI_SetCallbackFunction( fctJouCbk pfctJouCbk);
#ifdef __cplusplus /* extern "C" declaration of C-functions for C++ */
}
#endif
#ifdef WIN32 /* reset struct member allignment */
#ifdef _MSC_VER /* to project defaults */
#pragma pack(pop, old_pack)
#elif __TURBOC__
#pragma option -a.
#endif
#else
#ifdef _MSC_VER
#pragma pack()
#elif __TURBOC__
#pragma option -a.
#endif
#endif
#endif /* PCCTI_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -