$. "kyt_7000.dll" Library 
     - Library for Windows NT4.0/2000/XP and Windows 98/Millennium
     - Notice: BYTE==unsigned char, UINT==unsigned int
=====================================================================

@. EnablePort()
     - Set the serial port to communicate with the terminal.
	
* PROTOTYPE 
     - BOOL EnablePort(char* port, BYTE size, BYTE parity, BYTE stopbit
       , DWORD baudrate, BYTE control)
* PARAMETERS(Refer to "struct _DCB" in the MSDN.)
     - port      : ex) "COM1", "COM2", ...
     - size      : Number of bits/byte, 4-8.
     - parity    : 0-4=None,Odd,Even,Mark,Space.
     - stopbit   : 0,1,2 = 1, 1.5, 2.
     - baudrate  : Baudrate at which running.
     - control   : 0,1,2,3 = None, XOn/XOff, RTS/CTS, Both.
* RETURN
     - Normal: 1
     - Error : 0
* REMARKS
	 - ex) EnablePort( "COM1", 8, 0, 0, 19200, 2);
=====================================================================

@. DisablePort()
     - Close the serial port to communicate with the terminal.

* PROTOTYPE 
     - BOOL DisablePort()
* PARAMETERS : void
* RETURN     : 
     - Normal: 1
     - Error : 0
=====================================================================

@. chk_res()
     - Check finishing the execution about the request command. and read 
       the result values about the request command.

* PROTOTYPE 
     - int chk_res(BYTE *pbp_stat, BYTE *pbp_res, 
       UINT *pipu_res_len, BYTE * pbp_prc_no, int *pi_errno)
* PARAMETERS
     - pbp_stat: The Pointer of the buffer to take the status value(1BYTE) of the terminal.
     - pbp_res: The Pointer of the buffer to take the result value of the request command
     - res_len: The length of pbp_res
     - pbp_prc_no: The variable for save the sequence number of the request command to process.
     - pi_errno:
         . Normal: 0
         . Error : etc(Refer Error Code List.)
* RETURN
     - 0:	Don't finish the processing.
     - 1:	Finish the processing.
* DETAIL
     - If(pi_errno!=0): You must handle that error
     - If(pi_errno==2000): Negative Response save Negative Code(2Byte) in pbp_res variable.
=====================================================================

@. exe_cmd()
    - Transmit the command to the terminal.
* PROTOTYPE
    - int exe_cmd(char pcCmd, byte *pbpDat, int piDatLen)
* PARAMETERS : Refer to the spec.
    - pcCmd: Command
    - pbpDat: The Pointer of the buffer that Data(Data field in the Command structure) of the command is filled.
    - piDatLen: The length of Data.

* RETURN
    - 0 : Parameter Error
    - 1 ~ 255: The Sequence number of that request(It is utilized to confirm whether
      it is the result of your request when you read the result.)
* REMARKS
    - It automatically retry 3 times when communication problems arise.
    - This function can execute all command that is written on the Spec.
=====================================================================

@. exe_stop()
     - Stop process about request command.
     	
* PROTOTYPE 
     - void exe_stop()
* PARAMETERS : void
* RETURN 	 : void
* DETAIL
     - If you must stop the execution because of the time is delayed. 
       Call exe_stop() function.
=====================================================================

@. call_src_ver()
     - Display source version of the dll program into the Message Box
	
* PROTOTYPE 
     - void call_src_ver()
* PARAMETERS : void
* RETURN     : void 

=====================================================================
 $. eject()
      - eject the card in the terminal.
	
 * PROTOTYPE 
      - int eject()
 * PARAMETERS	: void
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.
=====================================================================
 @. ic_card_cmd()
      - This is the function for operation under ISO 7816. Accordingly, 
        user can handle all IC cards Conforming to ISO 7816-4 and T=0,T=1.
	
 * PROTOTYPE 
      - int ic_card_cmd(byte pb_cla, byte pb_ins, byte pb_p1, byte pb_p2, byte pb_lc
        , byte *pbp_data, byte pb_le, byte pb_le_flg, byte *res,UINT *res_len);
 * PARAMETERS
      - pb_cla    : Class(CLA)
      - pb_ins    : Instruction(INS)
      - pb_p1     : Offset: High Value(P1)
      - pb_p2     : Offset: Low Value	(P2)
      - pb_lc     : A Number of data to transfer(Lc)
      - pbp_data  : Data to transfer(Data)
      - pb_le     : Anumber of data to receive(Le)
      - pb_le_flg : 
          .pb_le_flg==0: Le exists.
          .pb_le_flg==1: Le doesn't exist.
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.
=====================================================================

 @. read_ms_data()
      - Read the Magnetic Card Data

 * PROTOTYPE 
      - int read_ms_data()
 * PARAMETERS : void
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.
=====================================================================

 @. stat_rqt()
      - Request Status Value.
	
 * PROTOTYPE 
      - int stat_rqt()
* PARAMETERS : void
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.
=====================================================================
@. ver_rqt()
      - Read F/W Version of the terminal.
	
 * PROTOTYPE 
      - int ver_rqt()
 * PARAMETERS : void
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.

=====================================================================

 @. ic_card_reset()
      - Command for sending Reset signal contacted ic card and for receiving ATR from IC Card.

 * PROTOTYPE 
      - int ic_card_reset();
 * PARAMETERS : void
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.
=====================================================================

 @. ic_card_sel()
       - IC Card Select Command

 * PROTOTYPE 
      - int ic_card_sel(BYTE pb_card_type)
 * PARAMETERS 
     - pb_card_type
         .pb_card_type=='0': Selection of Inserted Card.
         .pb_card_type=='1': Selection of SAM Slot.
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.
=====================================================================

 @. set_baudrate()
       - Baud Rate Setting Command

 * PROTOTYPE 
      - int set_baudrate(BYTE pb_baudrate)
 * PARAMETERS : 
      - pb_baudrate
          .pb_baudrate=='0': 9600 BPS
          .pb_baudrate=='1': 19200 BPS(Default)
          .pb_baudrate=='2': 38400 BPS
 * RETURN : The Sequence number about that request
      - It is utilized to confirm whether it is the result about request 
        when you read the result.
=====================================================================


$. Error Code List

1		: No ACK Error
2		: TIMEOUT Error
3		: NAK Error
2000	: Negative Error
102		: Compulsion termination Error
106		: Packet Frame Error
107		: BCC Error


$. Implement the Manager Program.

1.Open and set the serial port by call EnablePort() function in7000.dll.

2.Call eject(), ic_card_reset(), read_ms_data(),... function according to the deed to do.

The Returned value(pbp_prc_no) in an each function is the sequence number about that

request command.

It is utilized to confirm whether it is the result about the request when you read the

result of the request command.

3. For confirm the result about the request. First you ckeck finishing the execution

about the request by chk_res() function. if that finished the execution. Process the result values.

4.If you must stop the execution because of the time is delayed. Call exe_stop() function.

5.Call DisablePort() function if you close the serial port.

6. If you changes the setup of the serial port. call EnablePort() function again.

But you must call DisablePort() function for close the existing serial port before call 

EnablePort() function.

