Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

t0.h File Reference

T=0 declarations. More...

Go to the source code of this file.

Defines

#define CLA   ioheader[0]
#define INS   ioheader[1]
#define P1   ioheader[2]
#define P2   ioheader[3]
#define P3   ioheader[4]
#define T0_DIR_IN   TRUE
 Data from IFD to ICC. More...

#define T0_DIR_OUT   FALSE
 Data from ICC to IFD. More...


Functions

void t0_init (void)
 Initialize T=0 data. More...

void t0_recBlock (iu8 *dst, iu16 len)
 Receive multiple bytes. More...

void t0_wtx (void)
 Send a WTX. More...

bool t0_dir (bool in)
 Set IN/OUT direction if command. More...

void t0_exchApdu (void)
 Exchanged APDUs with IFD. More...

void t0_getResponse (void)
 Get Response command. More...

bool t0_testP1P2 (iu16 p1p2)
 Test P1P2 for correct content. More...

bool t0_testP3 (iu8 p3)
 Test P3 for correct content. More...


Variables

bool ioin
iu8 ioheader [5]
iu8 iodata [CONF_IODATA_SIZE]
iu16 iodatalen


Detailed Description

T=0 declarations.

T=0 is not implemented fully as library, but must be partly done in the commands itself. This reduces the RAM requirements. E.g. when doing an Update Binary the data must not be received in total before writing, but can be received and written in single bytes.

Id:
t0.h,v 1.13 2003/05/10 17:26:58 m Exp


Define Documentation

#define CLA   ioheader[0]
 

#define INS   ioheader[1]
 

#define P1   ioheader[2]
 

#define P2   ioheader[3]
 

#define P3   ioheader[4]
 

#define T0_DIR_IN   TRUE
 

Data from IFD to ICC.

#define T0_DIR_OUT   FALSE
 

Data from ICC to IFD.


Function Documentation

bool t0_dir bool    in
 

Set IN/OUT direction if command.

This should be called by each command to set the command case. With IN commands the command data is only available after this function has been called.

Only in an error case, where only a status word is to be returned this command doesn't have to be called.

Parameters:
in  Boolean value signaling direction.
Return values:
TRUE  on success.
FALSE  on failure. Error code given in sw.

void t0_exchApdu void   
 

Exchanged APDUs with IFD.

This function handles also the Get Response case.

void t0_getResponse void   
 

Get Response command.

Is called from t0_exchApdu.

void t0_init void   
 

Initialize T=0 data.

Must be called before the first t0_exchApdu.

void t0_recBlock iu8   dst,
iu16    len
 

Receive multiple bytes.

Receive len bytes and write them to dst.

Parameters:
dst  Pointer to destination area in RAM.
len  Data bytes to receive.

bool t0_testP1P2 iu16    p1p2
 

Test P1P2 for correct content.

Compares the values of P1 and P2 in header to p1p2. If they differ, sw is set to SW_WRONG_P1P2 and FALSE is returned.

Parameters:
p1p2  Target value of P1P2.
Return values:
TRUE  on success.
FALSE  on failure. Error code given in sw.

bool t0_testP3 iu8    p3
 

Test P3 for correct content.

Compares the value of P3 in header to p3. If they differ, sw is set to SW_WRONG_P1P2 and FALSE is returned.

Parameters:
p3  Target value of P3.
Return values:
TRUE  on success.
FALSE  on failure. Error code given in sw.

void t0_wtx void   
 

Send a WTX.


Variable Documentation

iu8 iodata[CONF_IODATA_SIZE]
 

iu16 iodatalen
 

iu8 ioheader[5]
 

bool ioin
 


Copyright 2002 by Matthias Bruestle. This is licensed under the GNU General Public License.