introduction
With the rapid growth of smart cards in the fields of finance, telecommunications, mobile communications, medical insurance, pay TV, etc., their reliability requirements are getting higher and higher, and testing for smart card modules has become an indispensable quality assurance tool. Automated testing does not require manual intervention, which can improve test efficiency and receive more attention and application. In the process of developing automated testing, an efficient automated testing platform is the basic guarantee. According to the application status and market demand of smart card, this design uses TCL language and C language joint programming method, PC/SC as programming interface, realizes the test platform of smart card, can test the quality and performance of smart card.
1 Test system structure
The system structure with test function is shown in Figure 1. The test system generally consists of three parts: test platform, reader/writer and smart card. The test platform runs the test script and processes the results returned from the smart card. Inside the smart card, there is a program to be tested, and the test data is returned in response to a command sent from the test platform. The reader/writer provides an interface to the test platform and smart card. The research here focuses on the test platform.
2 test platform design ideas
The test platform software consists of two parts, the interface program and the communication software program, as shown in Figure 2. The interface program provides a friendly graphical screen that accepts user commands such as script input, button response, and more. The interface converts the user's tasks into internal instructions, which are then implemented by the communications software program, and the communications software program is responsible for communicating with the USB card reader. The following describes the implementation principles of the interface program and communication software program.
2.1 Interface Program
The interface program is divided into three layers, and the top layer is the script layer, which is used to support the ATP language. ATP is not a brand new language. It is an extension of the TCL language port. It is a command set for ATP. It includes TCL basic commands and application-related extension commands. The use of TCL basic instructions can be found in [1, 2], and the extended commands are extended by TCL specifically for smart card testing.
The middle tier is a TCI interpreter that expands according to the needs of the application. It contains the TCI standard library and the TCL extension library associated with the underlying interface program. The basic part of the ATP is executed by the TCL language interpreter by calling the TCL standard library; the extension part of the ATP is called by the extended TCL interpreter to call the TCL extension library.
The top and middle layers illustrate that TCI is a scripting language and an interpreter. The underlying is the interface program that provides an interface to the communications software program and is responsible for sending commands and returning status.
TCL's standard commands are native to TCL, and special commands related to the application need to be extended with C code. The following describes how to extend TCL commands. Before using TCL, the application must first create a TCL interpreter to create a standard command interpreter, and then call the Tcl_CreateCommand procedure to extend the interpreter using user-defined commands. Its prototype is:
Tcl—CreateCom mand (interp, cmdName, proc, cli-entData, deleteProc) where: interp is the created interpreter; cmdName is the name of the created command; proc is the function corresponding to the command; clientData is the value of a word length, Usually points to a private data structure; deleteProc is the function name of the logout command, and if it is empty, no function is called before the logout command. When Tcl_CreateCommand is called, the extension command name will be associated with name-tcl; when the name command is executed, the n am e-tcl function will be processed to process the name command.
After the program customization command is created, the application enters an infinite loop and is passed to the interpreter after the command. Call Tcl-Eval(interp,script), and after knowing the type of the command through the contents of the script, choose to perform the calculation in the corresponding procedure function.
The execution of the communication software program is called in the process function, thus implementing the interface between the interface program and the communication software program.
Milk Storage Bag,Breast Milk Cooler Bag,Breast Milk Storage,Breast milk Bag
Zhejiang Carebao Co., Ltd , https://www.carebao.com