Unitech MR350 MKII Software Manual

Unitech MR350 MKII Software Manual

Data collection terminal
Hide thumbs Also See for MR350 MKII:

Advertisement

Quick Links

MR350MKII
Data Collection Terminal
Smart card reader programming Manual
Unitech Electronics Co., Ltd.
April 1999

Advertisement

Table of Contents
loading

Summary of Contents for Unitech MR350 MKII

  • Page 1 MR350MKII Data Collection Terminal Smart card reader programming Manual Unitech Electronics Co., Ltd. April 1999...
  • Page 2: Introduction

    It is not easy for users to develop their application program according ISO-7816 standard, user should know detail command format, computing cryptography .. etc. That is why Unitech provide this manual and utility library to help user to develop application program by simple API.
  • Page 3 Demo disk All necessary files are included into demo disk, you can find it from sub-directory Smart Card of DEMO disk. It includes SAMPLE01.c – sample program for issuing new Smart Card SAMPLE02.c – sample program for reading / writing Smart Card Function library GEMSmart Card.LIB –...
  • Page 4: Table Of Contents

    Introduction:...2 Table of contents : ...4 Chapter 1. System architecture...6 System diagram : ... 6 Relationship between Smart Card function Library and System call :... 7 Developing flow for user application program ... 8 Chapter 2. System function call (Firmware function call): ...9 Check Smart Card...
  • Page 5 3.18 F_SEL_ID ... 27 3.19 F_SET_FKEY ... 28 3.20 F_SET_SC ... 29 3.21 F_UPD_BIN... 30 3.22 F_UPD_REC... 31 3.23 F_VERIFY ... 32 3.24 F_WR_BIN ... 33...
  • Page 6: Chapter 1. System Architecture

    Although, there are variety of smart cards on the market to provide a design reference, Unitech develops an Smart Card library to provide all MPCOS-EMV command set, so user can directly use those function libraries to develop their application program without knowing detailed low level control register and data structure.
  • Page 7: Relationship Between Smart Card Function Library And System Call

    1.2 Relationship between Smart Card function Library and System function call Below diagram show relationship between Smart Card function library and system function call. The function call inside the black frame are only available for MPCOS-EMV card, other function library follow ISO 7816 standard. In this diagram, F/W means MR350MKII system function call. S_CHK_ICC S_OPEN_ICC F_CHK_ICC...
  • Page 8: Developing Flow For User Application Program

    1.3 Developing flow for user application program Below diagram is a flow chart for developing Smart Card application program. Check Smart Card is inserted ? (AH=0) Power on Smart Card (AH=1) Exchange message (AH=3) Power off Smart Card (AH=2) Check Smart Card is removed ? According above diagram, user should follow this flow chart to develop their application program.
  • Page 9: Chapter 2. System Function Call (Firmware Function Call)

    Chapter 2. System function call (Firmware function call): Below 3 system function calls are implemented on the Firmware of MR350MKII. Those function call only support short format and protocol are available for T=0 and T=1. All of the system function calls are implemented on system interrupt vector 06H (INT 06H) 3.1 Check Smart Card In Smart Card reader, there is a detector to check whether Smart Card is inserted.
  • Page 10: Power-On Smart Card

    2.2 Power-on Smart Card This function informs Smart Card reader to supply power to VCC pin on Smart card and it also needs to send pointer of ATR (Answer to reset) structure to get its status Entry Parameter INT 06H AH = 1 POWER ON Smart Card ES:DI=...
  • Page 11: Power Off Smart Card

    2.3 Power off Smart Card Entry parameter INT 06H AH = 2 ; POWER OFF Smart Card 2.4 Exchange message This function is used to send or receive data between MR350MKII and Smart Card Entry parameter INT 06H AH = 3 ;SEND COMMAND TO Smart Card DS:SI= buffer ;...
  • Page 12: Chapter 3. Function Library

    Chapter 3. Function library This chapter introduces whole function library by function name sequence. It includes function description, input/output parameter and data structure. This C function library can be included into user’ s application program and please use LARGE MEMORY MODEL to compile it. 3.1 Files description of Smart Card function library There are 4 files in our function library.
  • Page 13: F_Apd_Rec

    3.2 F_APD_REC This function writes data and initializes a record EF. When secure messaging is used, the function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call...
  • Page 14: F_Chk_Icc

    3.3 F_CHK_ICC This function is used to check Smart Card current stage. Compatible with ISO7816 or Gemplus command set Function call void F_CHK_ICC( S_CHK_ICC* ); Data structure of S_CHK_ICC typedef struct int ChkPower; int ChkPresent; } S_CHK_ICC; Input parameter : Output parameter :.
  • Page 15: F_Crt_Df

    3.5 F_CRT_DF This function creates a dedicated File. User should use function F_INI_ACC to load Access Condition before creates DF/EF. Compatible with ISO7816 or Gemplus command set Gemplus Function call void F_CRT_DF( S_CRT_DF* ); Data structure of S_CRT_DF typedef struct int Class;...
  • Page 16: F_Crt_Ef

    3.6 F_CRT_EF This function creates an Elementary File. User should use function F_INI_ACC to load Access Condition before creates DF/EF. Compatible with ISO7816 or Gemplus command set Gemplus Function call void F_CRT_EF( S_CRT_EF* ); Data structure of S_CRT_EF typedef struct int Class;...
  • Page 17: F_Err_Msg

    3.7 F_ERR_MSG Convert Smart Card reader return code to text description Compatible with ISO7816 or Gemplus command set Parital Function call void F_ERR_MSG( unsigned char* p_sw ,unsigned char* msg); Input parameter : P_sw : point to status word. Output parameter : : string buffer of text description...
  • Page 18: F_Ex_Apdu

    3.8 F_EX_APDU This function call exchanges APDU command with Smart Card and returns the card’ s response. Compatible with ISO7816 or Gemplus command set Function call void F_EX_APDU( S_EX_APDU* ); Data structure of S_EX_APDU typedef struct int InLen; unsigned char InApdu[MaxAPDU]; int OutLen;...
  • Page 19: F_Ini_Acc

    3.9 F_INI_ACC This function initializes the Access Conditions registers, which is pre-requisite for creation of EF or DF. Before useing function “F_CRT_EF” or “F_CRT_DF”. User should initializes Access Conditions registers. Access Conditions registers will reset to 0 when function “F_OPEN_ICC” or “F_SEL_ID”...
  • Page 20: F_Ld_Key

    3.11 F_LD_KEY This function loads/updates a triple DES key into a key file. Compatible with ISO7816 or Gemplus command set Gemplus Function call: void F_LD_KEY( S_LD_KEY* ); Data structure of S_LD_KEY typedef struct int Class; int Mode; unsigned char ShortId; int KeyNum;...
  • Page 21: F_Ld_Sc

    3.12 F_LD_SC This function loads a code into secret code file. Compatible with ISO7816 or Gemplus command set Gemplus Function call void F_LD_SC( S_LD_SC* ); Data structure of S_LD_SC typedef struct int Class; int Mode; unsigned char ShortId; int CodeNum; int CodeType;...
  • Page 22: F_Lib_Ver

    3.13 F_LIB_VER This function is used to get library version . Compatible with ISO7816 or Gemplus command set Function call void F_LIB_VER( int* main, int* extend ); Input parameter : Output parameter : Main : store main version of library. Extend : store extend version of library.
  • Page 23: F_Open_Icc

    3.14 F_OPEN_ICC Reset Smart Card and get Answer To Reset. This function sets Access Condition 1,2 and 3 to zero. Compatible with ISO7816 or Gemplus command set Function call void F_OPEN_ICC( S_OPEN_ICC* ); Data structure of S_OPEN_ICC typedef struct int Smart CardType; int AtrReady;...
  • Page 24: F_Rd_Bin

    3.15 F_RD_BIN This function is used to read a continuous block of bytes in a transparent EF. When secure messaging is used the function dose not accept the Read command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure...
  • Page 25: F_Rd_Rec

    3.16 F_RD_REC This function is used to read data from a record EF. When secure messaging is used this function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure...
  • Page 26: F_Sel_Fkey

    3.17 F_SEL_FKEY Computes a temporary administration key using a specified key. The temporary administration key is used for secure messaging. Only one temporary key is allowed at a given time. Compatible with ISO7816 or Gemplus command set Genplus Function call void F_SEL_FKEY( S_SEL_FKEY* );...
  • Page 27: F_Sel_Id

    3.18 F_SEL_ID This function allows you to select the Master File, a Dedicated File, or an Elementary File using its Identifier. The Get Response command is chained to retrieve the file descriptor. This function will set access condition register 1,2 and 3 to zero. Compatible with ISO7816 or Gemplus command set ISO 7816 Function call...
  • Page 28: F_Set_Fkey

    3.19 F_SET_FKEY This function is used to set temporary session key which has been established by function “F_SEL_FKEY”. Compatible with ISO7816 or Gemplus command set Genplus Function call void F_SET_FKEY( S_SEL_FKEY* GG ,unsigned char* key ) Input parameter : : a structure pointer and it is previously returned by function “F_SEL_FKEY”.
  • Page 29: F_Set_Sc

    3.20 F_SET_SC This function unlocks/changes a secret code in the secret code file under the currently selected DF. There is no limit to the number of times that a secret code can be unlocked/changed. Compatible with ISO7816 or Gemplus command set Genplus Function call void F_SET_SC( S_SET_SC* );...
  • Page 30: F_Upd_Bin

    3.21 F_UPD_BIN This function updates data in a transparent EF. When secure messaging is used the dose not accept this command of length greater than the communication Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call Void F_UPD_BIN( S_UPD_BIN* );...
  • Page 31: F_Upd_Rec

    3.22 F_UPD_REC This function updates data to a record EF. When secure messaging is used the function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call void F_UPD_REC( S_UPD_REC* );...
  • Page 32: F_Verify

    3.23 F_VERIFY This function presents a code to the card. Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call void F_VERIFY( S_VERIFY* ); Data structure of S_VERIFY typedef struct int Class; int ScNumber;...
  • Page 33: F_Wr_Bin

    3.24 F_WR_BIN This function writes data to a transparent EF. When secure messaging is used the function dose not accept this command of length greater than the communication buffer size(64 bytes). Compatible with ISO7816 or Gemplus command set IS7816 if class = normal Genplus if class = secure Function call Void F_WR_BIN( S_UPD_BIN* );...

Table of Contents