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

📄 ld_reader.h

📁 读卡器编程实例------Reader programming examples
💻 H
📖 第 1 页 / 共 4 页
字号:
				unsigned char	INS,
				unsigned char	P1,
				unsigned char	P2,
				unsigned char	Lc,
				unsigned char	*in,
				unsigned short	*status
			);

WORD DllExport ICCOutgoing
			(
				HICC			hCard,
				unsigned char	CLA,
				unsigned char	INS,
				unsigned char	P1,
				unsigned char	P2,
				unsigned char	Le,
				unsigned char	*out,
				unsigned short	*status
			);

WORD DllExport iCC_Reset(HICC hCard, LPBYTE Response, LPWORD lRep, LPSTATUS status);

WORD DllExport Entr(HICC hCard, BYTE Cla, BYTE INS, WORD P1P2, WORD Message_Length, LPBYTE Message, LPSTATUS status);

WORD DllExport Sort(HICC hCard, BYTE Cla, BYTE INS, WORD P1P2, WORD Message_Length, LPBYTE Message, LPSTATUS status);

WORD DllExport iCC_Power_off(HICC hCard, LPWORD MED);

/**************************************************************************
 *		                 Tools
 **************************************************************************/
WORD DllExport hex_to_str(LPBYTE data_hex, LPBYTE data_str, WORD byte_len);

WORD DllExport str_to_hex(LPBYTE data_str, LPBYTE data_hex, WORD byte_len);

WORD DllExport DataXorData(LPBYTE Data1, LPBYTE Data2, LPBYTE Data_out);

/**************************************************************************
 *                     Memary Card Library
 *
 *   used for STAR-707 IC Card Reader which support synchronous cards
 *
 **************************************************************************/
/* Card Type */
#define ATMEL_102		0x00	/* ATMEL 88SC102 Card */
#define SIEMENS_4442	0x01	/* SIEMENS SLE 4442 Card */
#define PHIL_2042		0x01	/* Phillps PCB2042 Card */
#define SIEMENS_4432	0x02	/* SIEMENS SLE 4432 Card */
#define PHIL_2032		0x02	/* Phillps PCB2032 Card */
#define ATMEL_16K		0x03	/* ATMEL 24C16 Card */
#define ATMEL_8K		0x03	/* ATMEL 24C08 Card */
#define ATMEL_4K		0x03	/* ATMEL 24C04 Card */
#define ATMEL_2K		0x03	/* ATMEL 24C02 Card */
#define ATMEL_1K		0x03	/* ATMEL 24C01 Card */
#define SIEMENS_4404	0x04	/* SIEMENS SLE 4404 Card */
#define HX_768			0x05	/* HUAXU  HX 768 Card */
#define SIEMENS_4428	0x06	/* SIEMENS SLE 4428 Card */
#define SIEMENS_4418	0x07	/* SIEMENS SLE 4418 Card */
#define ATMEL_1604		0x08	/* ATMEL 88SC1604 Card */
#define AT24C32			0x09	/* ATMEL 24c32 24c64 */
#define AT45D041_711	0x0a	/* ATMEL 45D041 */
#define ATMEL_1608		0x0b	/* ATMEL 1608 */

/* Zone Select Table (ATMEL_102) */
#define FZ		0x00			/* Fabrication Zone */
#define IZ		0x01			/* Issuer Zone */
#define SC		0x02			/* Security Code */
#define SCAC	0x03			/* False Attempts Counter */
#define CPZ		0x04			/* Code Protected Zone */
#define AZ1		0x05			/* Application Zone 1 */
#define EZ1		0x06			/* Application Zone 1 erase key */
#define AZ2		0x07			/* Application Zone 2 */
#define EZ2		0x08			/* Application Zone 2 erase key */
#define EC		0x09			/* Erase counter */

/* Zone Select Table (SLE_4442,SLE_4432) */
#define MM	0x00				/* Main Memory */
#define PM	0x01				/* Protection Memory */
#define SM	0x02				/* Security Memory */

/* Functions */
WORD DllExport	ICCPowerUp(short hCard, unsigned char *resp, unsigned char *len);

/*
#ifndef __PAD03_H
WORD DllExport power_up( HICC hiCC );
WORD DllExport power_down( HICC hCard ) ;
WORD DllExport closecom(HICC hiCC);
#endif
*/
WORD DllExport	select_card(HICC hCard, unsigned char card_type);

WORD DllExport	read_card(HICC hCard, unsigned char zone, unsigned char addr, unsigned char len, unsigned char *data);

WORD DllExport	write_card(HICC hCard, unsigned char zone, unsigned char addr, unsigned char len, unsigned char *data);

WORD DllExport	check_code(HICC hCard, unsigned char code_length, unsigned char *code);

WORD DllExport	erase_word(HICC hCard, unsigned char zone, unsigned char addr, unsigned char len);

WORD DllExport	ICCBuzzer(HICC hCard, unsigned char times);

WORD DllExport	read_040_card(HICC hiCC, unsigned sector, BYTE addr, unsigned len, LPBYTE data);

WORD DllExport	read_card_protect(HICC hiCC, BYTE zone, unsigned addr, unsigned len, LPBYTE data);

WORD DllExport	write_040_card(HICC hiCC, unsigned sector, BYTE addr, unsigned len, LPBYTE data);

WORD DllExport	write_card_protect(HICC hiCC, BYTE zone, unsigned addr, unsigned len, LPBYTE data);

WORD DllExport	authen_1608(HICC hiCC, LPBYTE GC);

WORD DllExport	read_fuse_1608(HICC hiCC, unsigned char *key_stat);

WORD DllExport	read_status_1608(HICC hiCC, BYTE zone_No, BYTE W_R, unsigned char *key_stat);

WORD DllExport	ICCSetBaudRate(short hCT, unsigned long baud_rate);

WORD DllExport	ICCReset_711GS(HICC hCard, unsigned char *Respon, unsigned short *lRep);

WORD DllExport	PortInit_711GS(char *strComm, LPHICC CommHandle);

WORD DllExport	ICCExchange_711GS
				(
					HICC			hCard,
					unsigned char	CLA,
					unsigned char	INS,
					unsigned char	P1,
					unsigned char	P2,
					unsigned char	Lc,
					unsigned char	*in,
					unsigned char	Le,
					unsigned char	*out,
					unsigned char	*len,
					unsigned short	*status
				);

void DllExport	Get718ErrMessage(WORD err_code, char *message);

WORD DllExport	Asc2Bcd(unsigned char *bcd_buf, unsigned char *ascii_buf, int conv_len, unsigned char type);

WORD DllExport	Bcd2Asc(unsigned char *ascii_buf, unsigned char *bcd_buf, int conv_len, unsigned char type);

void DllExport	SetReadWriteDelay(unsigned long ulReadDelay, unsigned long ulWriteDelay);

WORD DllExport	ICCApdu
				(
					HICC				hCard,
					unsigned char		CLA,
					unsigned char		INS,
					unsigned char		P1,
					unsigned char		P2,
					unsigned char		Lc,
					unsigned char FAR	*in,
					unsigned char		Le,
					unsigned char FAR	*out,
					unsigned char FAR	*len,
					unsigned short FAR	*status
				);
#ifdef __cplusplus
}
#endif
#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif
#ifndef DllExport
#define DllExport	WINAPI
#endif
#ifndef IDLE
#define IDLE	(0x00)
#endif
#ifndef ALL
#define ALL (0x01)
#endif
#ifndef KEYB
#define KEYB	(0x04)
#endif
#ifndef KEYA
#define KEYA	(0x00)
#endif
#define ICCER_OK	0			/* 01h Ok */

#ifdef __cplusplus
extern "C"
{	//Used for C++
#endif

void DllExport LongToCharIntel(unsigned long lLongVal, unsigned char *pucVal);
void DllExport LongToCharMoto(unsigned long lLongVal, unsigned char *pucVal);
void  DllExport CharToLongIntel(unsigned char *pucVal, unsigned long* plLongVal);
void  DllExport CharToLongMoto(unsigned char *pucVal, unsigned long* plLongVal);
WORD DllExport	Mif_ChangeBaudRate(HICC hCT, long ulBaudRate);

WORD DllExport	Mif_PortInit(LPSTR lpName, LPHICC hCT, unsigned long bps);

WORD DllExport	Mif_Close(HICC hCT);
WORD DllExport	Mif_ReadVersion(HICC hCT, char *szVersion);

/********************************SAM卡模块*************************************/
WORD DllExport	JudgeSamStatu(HICC hCT, uchar *ucStatus);

WORD DllExport	SAM_ICCPowerUp(HICC hCT, uchar *pucOut, uchar *ucLen);

WORD DllExport	SAM_ICCPowerDown(HICC hCT);

WORD DllExport	SAM_ICCInComing
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Lc,
					uchar			*in,
					unsigned short	*usSW1SW2
				);

WORD DllExport	SAM_ICCOutGoing
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Le,
					uchar			*out,
					unsigned short	*usSW1SW2
				);

WORD DllExport	SAM_ICCOutGoingEx
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Le,
					uchar			*out,
					unsigned short	*act_len,
					unsigned short	*SW1SW2
				);

WORD DllExport	SAM_ICCExchange
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Lc,
					uchar			*in,
					uchar			Le,
					uchar			*out,
					uchar			*length,
					unsigned short	*usSW1SW2
				);

/******************************高速SAM卡模块***********************************/
WORD DllExport	HSAM_ICCPowerUp(HICC hCT, uchar *pucOut, uchar *ucLen);

WORD DllExport	HSAM_ICCPowerDown(HICC hCT);

WORD DllExport	HSAM_ICCInComing
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Lc,
					uchar			*in,
					unsigned short	*usSW1SW2
				);

WORD DllExport	HSAM_ICCOutGoing
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Le,
					uchar			*out,
					unsigned short	*usSW1SW2
				);

WORD DllExport	HSAM_ICCOutGoingEx
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Le,
					uchar			*out,
					unsigned short	*act_len,
					unsigned short	*usSW1SW2
				);

WORD			ICCTransmit711F
				(
					short			hCT,
					char			cCardNo,
					unsigned char	CLA,
					unsigned char	INS,
					unsigned char	P1,
					unsigned char	P2,
					unsigned char	Lc,
					unsigned char	*_in,
					unsigned char	Le,
					unsigned char	*_out,
					unsigned short	*retlen,
					unsigned short	*usSW1SW2
				);

WORD DllExport	ICCTransmitAsc711F
				(
					IN HICC					hCard,
					IN BYTE					bCardNo,
					IN unsigned char		*pbSendBuffer,
					IN BYTE					bSendLength,
					OUT unsigned char		*pbRecvBuffer,
					IN OUT unsigned short	*pbRecvLength
				);

/*******************************非接触卡模块***********************************/
WORD DllExport	MifConfig(HICC hCT, uchar *ucStatus);

WORD DllExport	MifRequest(HICC hCT, uchar ucFlag, uchar *pucCardType, uchar *ucStatus);

WORD DllExport	MifAnticoll(HICC hCT, uchar *pucCardId, uchar *ucStatus);

WORD DllExport	MifSelect(HICC hCT, uchar *pucCardId, uchar *ucSize, uchar *ucStatus);

WORD DllExport	MifAuth(HICC hCT, uchar ucMode, uchar ucSec, uchar *ucStatus);

WORD DllExport	MifAuthToRam(HICC hCT, uchar ucSec, uchar ucKeyType, uchar *pucKey, uchar *ucStatus);

WORD DllExport	MifHalt(HICC hCT, uchar *ucStatus);

WORD DllExport	MifRead(HICC hCT, uchar ucBlock, uchar *pucBuf, uchar *ucStatus);

WORD DllExport	MifWrite(HICC hCT, uchar ucBlock, uchar *pucBuf, uchar *ucStatus);

WORD DllExport	MifIncrement(HICC hCT, uchar ucBlock, uchar *pucVal, uchar *ucStatus);

WORD DllExport	MifDecrement(HICC hCT, uchar ucBlock, uchar *pucVal, uchar *ucStatus);

WORD DllExport	MifRestore(HICC hCT, uchar ucBlock, uchar *ucStatus);

WORD DllExport	MifTransfer(HICC hCT, uchar ucBlock, uchar *ucStatus);

WORD DllExport	MifLoadkey(HICC hCT, uchar ucMode, uchar *NKey, uchar *ucStatus);

WORD DllExport	MifReset(HICC hCT, uchar Flag, uchar *ucStatus);

WORD DllExport  MifSetParam(HICC hCT, unsigned char ucParaAddr, unsigned char ucParaValue, unsigned char *ucStatus);
WORD DllExport	MifResetPro
				(
					HICC			hCT,
					uchar			ucFlag,
					uchar			ucRLen,
					uchar			*pucOut,
					uchar			*ucLen,
					unsigned short	*usSW1SW2
				);

WORD DllExport	MifDeselectPro(HICC hCT, unsigned short *usSW1SW2);

WORD DllExport	MifExchangePro
				(
					HICC			hCT,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Lc,
					uchar			*In,
					uchar			Le,
					uchar			*Out,
					uchar			*Len,
					unsigned short	*usSW1SW2
				);

WORD DllExport	MifTypeSelect(HICC hCT, uchar ucType, uchar *ucStatus);

WORD DllExport	MifRequestB
				(
					HICC	hCT,
					uchar	ucFlag,
					uchar	ucAfi,
					uchar	ucN,
					uchar	*pucOut,
					uchar	*ucLen,
					uchar	*ucStatus
				);

WORD DllExport	MifSlotMarker(HICC hCT, uchar ucNi, uchar *pucOut, uchar *ucLen, uchar *ucStatus);

WORD DllExport	MifPiccAttrib
				(
					HICC	hCT,
					uchar	*PUPI,
					uchar	PARAM1,
					uchar	PARAM2,
					uchar	PARAM3,
					uchar	ucCid,
					uchar	*pucOut,
					uchar	*ucLen,
					uchar	*ucStatus
				);

WORD DllExport	MifPiccHltb(HICC hCT, uchar *PUPI, uchar *ucStatus);

WORD DllExport	MifDeselectB(HICC hCT, uchar ucCid, uchar *ucStatus);

WORD DllExport	MifExchangeB
				(
					HICC			hCT,
					uchar			ucCid,
					uchar			CLA,
					uchar			INS,
					uchar			P1,
					uchar			P2,
					uchar			Lc,
					uchar			*In,
					uchar			Le,
					uchar			*Out,
					uchar			*Len,
					unsigned short	*usSW1SW2
				);

/*******************************其它模块***************************************/
WORD DllExport	BuzzerMs(HICC hCT, uchar ucTimes);

WORD DllExport	DelayMs(HICC hCT, uchar ucTimes);

WORD DllExport	SetLed(HICC hCT, uchar ucLed, uchar ucOffOn);

void DllExport	GetFileErrMessage(char cStatus, char *szErrMessage);

void DllExport	GetMifErrMessage(char ucStatus, char *szErrMessage);

WORD DllExport	Bcd2Asc(unsigned char *ascii_buf, unsigned char *bcd_buf, int conv_len, unsigned char type);

#ifdef __cplusplus
}
#endif
#endif

⌨️ 快捷键说明

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