⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pccti.h

📁 RSA C++源代码DEMO,附加DESMD5等众多算法
💻 H
📖 第 1 页 / 共 2 页
字号:
/************************************************************************
*************************************************************************
****
****      File name:                           pccti.h
****      Creation date  (DD.MM.YY):           13/02/96
****      Author:                              3se3/ tr
****
****      Comment:
****       include file for PC/CTI V3.3a
****
****      List of exported data structures:
****       struct sCommand
****       struct sResponse
****       struct sDisplay
****       struct sDebug
****       struct sCTType
****       struct sPINCmd
****       struct sInput
****
****      Revisions:
****
*************************************************************************
*************   (C) Copyright Giesecke & Devrient 1996  *****************/

#ifndef PCCTI_H    /* HeaderBlocker */
#define PCCTI_H

#ifdef __TURBOC__
    #define _far               far
   #define __cdecl             cdecl
#endif


#if defined( _WINDOWS) && !defined( _WIN32)/* definitions for WINDOWS */
  #define TSICALL  far pascal _loadds
  #define TSIFAR   far               
  #ifdef _MSC_VER
   #pragma pack(2)                       /* struct member allignment */
  #elif __TURBOC__
   #pragma option -a2
  #endif
#elif _WIN32                              /* WINDOWS NT, '95 32 bit */
  #define TSICALL  __stdcall
  #define TSIFAR                         /* 'far is an obsolete keyword' */
  #ifdef _MSC_VER
   #pragma pack(push, old_pack)   
   #pragma pack(8)             
  #elif __TURBOC__
   #pragma option -a8         
  #endif
#elif _OS2                               /* OS/2 */
  #define TSICALL   _System
  #define TSIFAR
#elif _MSDOS || __MSDOS__
  #if !M_I86LM && !__LARGE__
  #error memory models different from 'Large' not supported
  #endif
  #define TSICALL  __cdecl far
  #define TSIFAR   far            
  #ifdef _MSC_VER
    #pragma pack(2)
  #elif __TURBOC__
    #pragma option -a2
  #endif
#else
  #error target operation system not supported
#endif

#ifndef BOOL
  typedef int           BOOL;
#endif
#ifndef FALSE
  #define FALSE       (0x00 != 0x00)
#endif
#ifndef TRUE
  #define TRUE        (0x00 == 0x00)
#endif
#ifndef NULL
    #define NULL    ((void *)0)
#endif

/* Definition of the RETURN-Codes (error messages) from the TSI-functions */
#define TSI_OK             0x00     /* function executed correctly -> OK */
#define TSI_NO_ICC         0x01     /* no ICC contacted */
#define TSI_STATE_ERR      0x02     /* command not allowed at this state */
                                    /* (e.g.: VCC is off, error executing ICC-OFF of ICC-EJECT, ...) */
#define TSI_BREAK          0x03     /* communication interrupted (CTRL-BREAK, to many response data,...)*/
#define TSI_COMM_ERR_CT    0x04     /* communication error PC <-> chipcard terminal */
                                    /* no chipcard terminal connected or chipcard terminal not ready */
#define TSI_COMM_ERR_ICC   0x05     /* communication error with the ICC */
#define TSI_COMX_ERR       0x06     /* error opening/closing serial interface COMx */
#define TSI_CTH_ERR        0x07     /* invalid card terminal handle */
#define TSI_NAD_ERR        0x08     /* wrong NAD-byte of response data */
                                    /* e.g.: NAD-Command=02 and NAD-Response=21 */
#define TSI_PARA_ERR       0x09     /* wrong parameter (e.g.: invalid protocol, ...) */
#define TSI_CMD_LEN_ERR    0x0a     /* command data too long */
#define TSI_SW_ERR         0x0b     /* return code SW1/SW2 not equal reference code */
#define TSI_LENR_ERR       0x0c     /* layer-7 response data length to short (shorter than expected with min_lenr) */
#define TSI_JOU_ERR        0x0d     /* error of the internal journal functions */

#define TSI_INS_ERR        0x0e     /* error: instruction not supported */
#define TSI_CLA_ERR        0x0f     /* error: class not supported */
#define TSI_RESET_ERR      0x10     /* reset not successful */
#define TSI_USER_BREAK     0x11     /* process aborted by pressing cancel key */
#define TSI_TIMEOUT        0x12     /* user input incomplete in time */
#define TSI_ICC_NOTREMOVED 0x13     /* icc not removed within specified time */
#define TSI_CT_SW_ERR      0x14     /* wrong status word in response of CT */

#define TSI_MEM_ERR        0x15     /* out off memory */

#define TSI_CLOSE_ALL      0xffff   /* Parameter for tsi_close() -> Close all open communications */



/* destination parameter for TSI_CreateHandle */
#define TSI_CT              0x00
#define TSI_ICC1            0x01
#define TSI_ICC2            0x02
#define TSI_ICC3            0x03
#define TSI_ICC4            0x04
#define TSI_ICC5            0x05
#define TSI_ICC6            0x06
#define TSI_ICC7            0x07
#define TSI_ICC8            0x08
#define TSI_ICC9            0x09
#define TSI_ICC10           0x0a
#define TSI_ICC11           0x0b
#define TSI_ICC12           0x0c
#define TSI_ICC13           0x0d
#define TSI_ICC14           0x0e

/* number of serial port for TSI_Init */
#define TSI_COM1            0x01
#define TSI_COM2            0x02
#define TSI_COM3            0x03
#define TSI_COM4            0x04
#define TSI_COM5            0x05
#define TSI_COM6            0x06
#define TSI_COM7            0x07
#define TSI_COM8            0x08
#define TSI_COM9            0x09
#define TSI_COM10           0x0a
#define TSI_COM11           0x0b
#define TSI_COM12           0x0c
#define TSI_COM13           0x0d
#define TSI_COM14           0x0e
#define TSI_COM15           0x0f
#define TSI_COM16           0x10
#define TSI_COM17           0x11
#define TSI_COM18           0x12
#define TSI_COM19           0x13
#define TSI_COM20           0x14
#define TSI_COM21           0x15
#define TSI_COM22           0x16
#define TSI_COM23           0x17
#define TSI_COM24           0x18
#define TSI_COM25           0x19
#define TSI_COM26           0x1a
#define TSI_COM27           0x1b
#define TSI_COM28           0x1c
#define TSI_COM29           0x1d
#define TSI_COM30           0x1e
#define TSI_COM31           0x1f
#define TSI_COM32           0x20

/* board number for MIFARE */
#define TSI_BOARD200        0x00
#define TSI_BOARD210        0x01
#define TSI_BOARD220        0x02
#define TSI_BOARD230        0x03
#define TSI_BOARD240        0x04
#define TSI_BOARD250        0x05
#define TSI_BOARD260        0x06
#define TSI_BOARD270        0x07
#define TSI_BOARD280        0x08
#define TSI_BOARD290        0x09
#define TSI_BOARD2A0        0x0a
#define TSI_BOARD2B0        0x0b
#define TSI_BOARD2C0        0x0c
#define TSI_BOARD2D0        0x0d
#define TSI_BOARD2E0        0x0e
#define TSI_BOARD2F0        0x0f
#define TSI_BOARD300        0x10
#define TSI_BOARD310        0x11
#define TSI_BOARD320        0x12
#define TSI_BOARD330        0x13
#define TSI_BOARD340        0x14
#define TSI_BOARD350        0x15
#define TSI_BOARD360        0x16
#define TSI_BOARD370        0x17
#define TSI_BOARD380        0x18
#define TSI_BOARD390        0x19
#define TSI_BOARD3A0        0x1a
#define TSI_BOARD3B0        0x1b
#define TSI_BOARD3C0        0x1c
#define TSI_BOARD3D0        0x1d
#define TSI_BOARD3E0        0x1e
#define TSI_BOARD3F0        0x1f

/* mode parameters for the Journal Callback Function */
#define TSI_CBK_COMMAND     0x0001
#define TSI_CBK_RESPONSE    0x0002
/*      TSI_CBK_SECM        0x0010  not used by PC/CTI */
/*      TSI_CBK_STM         0x0100  not used by PC/CTI */
#define TSI_CBK_PCCTI       0x0200
#define TSI_CBK_ERR         0x8000

/* host ID for the Journal Callback Function */
#define TSI_HOST            0x0100
#define TSI_REMOTE          0x1000

/* port ID for the Journal Callback Function */
/*      TSI_COMx  x = 1 - 32       */
/*      TSI_OPENx x = 00 - 13      */

/* client ID for the Journal Callback Function */
/*      TSI_CT                     */
/*      TSI_ICCx  x = 1 - 14       */

/* function parameters for TSI_Journal */
#define TSI_JOU_CLEAR       0x00
#define TSI_JOU_FREE        0x01
#define TSI_JOU_OFF         0x02

/* parameters for TSI_JournalSave */
#define TSI_JOU_NO_LF       0x00
#define TSI_JOU_LF          0x01
#define TSI_JOU_OVERWRITE   0x00
#define TSI_JOU_APPEND      0x01

/* port access mode for TSI_Init  */
#define TSI_EXCLUSIVE       0x00        /* default */
#define TSI_SHARED          0x01        /* (rfu) */
#define TSI_MASTER          0x02        /* (rfu) */

/* signal for TSI_Eject */
#define TSI_EJECT_BEEP      0x01        /* acoustical signal */
#define TSI_EJECT_BLINK     0x02        /* optical signal */
#define TSI_EJECT_KEEP_ICC  0x04        /* card delivery: keep icc (default is throwout) */

/* mode parameters for TSI_ListReaders */
#define TSI_LIST_ALL        0x00        /* list all readers */
#define TSI_LIST_PCSC       0x01        /* list PCSC readers only */
#define TSI_LIST_CTAPI      0x02        /* list CTAPI readers only */

/* access control parameters for TSI_SetAccessControl */
#define TSI_UNLOCK          0x00        /* release temporary exclusive access to CT */
#define TSI_LOCK            0x01        /* request temporary exclusive access to CT */

/* constants or terminal selection */   /* autodetection takes some seconds for OTI or PCT ! */
#define TSI_OPEN00          0x0000      /* autodetect CCR2, CCR5, ICT800, KCT800, VCT800, OTI or PCT */
                                        /*   (old style constant) */
#define TSI_OPEN_COM        0x0000      /* autodetect CCR2, CCR5, ICT800, KCT800, VCT800, OTI or PCT */
#define TSI_OPEN01          0x0100      /* select DEG_D01: mkt-terminal (rfu, old style constant) */
#define TSI_OPEN_MKT        0x0100      /* select DEG_D01: mkt-terminal (rfu) */
#define TSI_OPEN02          0x0200      /* select OTI Contactless Reader (old style constant) */
#define TSI_OPEN_OTI        0x0200      /* select OTI Contactless Reader */
#define TSI_OPEN03          0x0300      /* select CCR5 (old style constant) */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -