#include <config.h>
#include <sw.h>
#include <commands.h>
#include <hal.h>
#include <t0.h>
#include <types.h>
#include <string.h>
Defines | |
#define | SW sw |
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 | iosend |
bool | ioin |
iu8 | ioheader [5] |
iu8 | iodata [sizeof(iodata)] |
iu16 | iodatalen |
|
|
|
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.
|
|
Exchanged APDUs with IFD. This function handles also the Get Response case. |
|
Get Response command. Is called from t0_exchApdu. |
|
Initialize T=0 data. Must be called before the first t0_exchApdu. |
|
Receive multiple bytes. Receive len bytes and write them to dst.
|
|
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.
|
|
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.
|
|
Send a WTX.
|
|
|
|
|
|
|
|
|
|
|