test02.c

来自「一个免费的SMART CARD OS系统。」· C语言 代码 · 共 168 行

C
168
字号
/* ============================================================================   Project Name : jayaCard TCK   Module Name  : proto/tck/cos/test02/test02.c   Version : $Id: test02.c,v 1.26 2004/01/11 09:56:34 dgil Exp $	Description: COS TEST02 - Contactless Startup for Type A    The Original Code is jayaCard TCK code.    The Initial Developer of the Original Code is Gilles Dumortier.	Portions created by the Initial Developer are Copyright (C) 2002-2004 the    Initial Developer. All Rights Reserved.    Contributor(s):	Permission is granted to any individual to use, copy, or redistribute	this software so long as all of the original files are included	unmodified, that it is not sold for profit, and that this copyright	notice is retained.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   History Rev	Description   022403 dgil	wrote it from scratch   ============================================================================*/#include "precomp.h"/* ============================================================================	StopAtExit   ========================================================================= */int bExit = 0;/* ============================================================================	__hal_halt()   ========================================================================= */void __hal_halt(void){	/* just return ... */}/* ============================================================================	main()   ========================================================================= */int main(int argc, char ** argv){	if (argc > 1 && atoi( argv[1] ) ) {		bExit = atoi( argv[1] );	}	printf("Start of cos::test02\n");	LOG_DISABLE("SIMUMSG");	INIT();	printf("#1\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	ATS();	PPSA(0);	BAUDRATE(0);	APDU("0084000008",8);	POWEROFF();	printf("#2\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	ATS();	PPSA(1);	BAUDRATE(0x11);	APDU("0084000007",2);	POWEROFF();	printf("#3\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	ATS();	APDU("0084000008",8);	POWEROFF();	printf("#4\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	ATS();	APDU("0084000007",2);	POWEROFF();	printf("#5\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	HALTA();	POWEROFF();	printf("#6\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	ATS();	APDU("8086000003",3);	APDU("8086000008",8);	APDU("8086000011",17);	APDU("8086000010",16);	DESELECT();	POWEROFF();	printf("#7\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	ATS();	DESELECT();	POWEROFF();	/* Bug #743793		http://sourceforge.net/tracker/index.php?func=detail&aid=743793&group_id=13983&atid=113983	*/	printf("#8\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	ANTICOLA();	SELECTA();	ATS();	APDU("8084000008",0);	APDU("8084000008",0);	/* this should not freeze the COS */	DESELECT();	POWEROFF();	printf("#9\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	RESET();	WAKEUPA();	POWEROFF();	printf("#10\n");	POWERON(TCK_INTERFACE_CONTACTLESS_A);	REQA();	HALTA();	POWEROFF();	DONE(bExit);	printf("End of cos::test02\n");	return 0;}

⌨️ 快捷键说明

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