| 2 |
commands.h: Commands sent to the card |
commands.h: Commands sent to the card |
| 3 |
Copyright (C) 2003 Ludovic Rousseau |
Copyright (C) 2003 Ludovic Rousseau |
| 4 |
|
|
| 5 |
This program is free software; you can redistribute it and/or modify |
This library is free software; you can redistribute it and/or |
| 6 |
it under the terms of the GNU General Public License as published by |
modify it under the terms of the GNU Lesser General Public |
| 7 |
the Free Software Foundation; either version 2 of the License, or |
License as published by the Free Software Foundation; either |
| 8 |
(at your option) any later version. |
version 2.1 of the License, or (at your option) any later version. |
| 9 |
|
|
| 10 |
This program is distributed in the hope that it will be useful, |
This library is distributed in the hope that it will be useful, |
| 11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
GNU General Public License for more details. |
Lesser General Public License for more details. |
| 14 |
|
|
| 15 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU Lesser General Public |
| 16 |
along with this program; if not, write to the Free Software |
License along with this library; if not, write to the Free Software |
| 17 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 |
*/ |
*/ |
| 19 |
|
|
| 20 |
/* |
/* |
| 25 |
#define STATUS_OFFSET 7 |
#define STATUS_OFFSET 7 |
| 26 |
#define ERROR_OFFSET 8 |
#define ERROR_OFFSET 8 |
| 27 |
|
|
| 28 |
RESPONSECODE CmdPowerOn(int lun, int * nlength, unsigned char buffer[]); |
RESPONSECODE CmdPowerOn(unsigned int reader_index, unsigned int * nlength, |
| 29 |
RESPONSECODE CmdEscape(int lun, int command); |
unsigned char buffer[]); |
|
RESPONSECODE CmdPowerOff(int lun); |
|
|
RESPONSECODE CmdGetSlotStatus(int lun, unsigned char buffer[]); |
|
|
RESPONSECODE CmdXfrBlock(int lun, int tx_length, unsigned char tx_buffer[], |
|
|
int *rx_length, unsigned char rx_buffer[], int protoccol); |
|
|
RESPONSECODE CCID_Transmit(int lun, int tx_length, unsigned char tx_buffer[]); |
|
|
RESPONSECODE CCID_Receive(int lun, int *rx_length, unsigned char rx_buffer[]); |
|
|
RESPONSECODE CmdXfrBlockTPDU_T0(int lun, int tx_length, |
|
|
unsigned char tx_buffer[], int *rx_length, unsigned char rx_buffer[]); |
|
|
RESPONSECODE CmdXfrBlockTPDU_T1(int lun, int tx_length, |
|
|
unsigned char tx_buffer[], int *rx_length, unsigned char rx_buffer[]); |
|
|
RESPONSECODE SetParameters(int lun, char protocol, int length, unsigned char buffer[]); |
|
| 30 |
|
|
| 31 |
void i2dw(int value, unsigned char *buffer); |
RESPONSECODE SecurePINVerify(unsigned int reader_index, |
| 32 |
|
const unsigned char TxBuffer[], unsigned int TxLength, |
| 33 |
|
unsigned char RxBuffer[], unsigned int *RxLength); |
| 34 |
|
|
| 35 |
|
RESPONSECODE SecurePINModify(unsigned int reader_index, |
| 36 |
|
const unsigned char TxBuffer[], unsigned int TxLength, |
| 37 |
|
unsigned char RxBuffer[], unsigned int *RxLength); |
| 38 |
|
|
| 39 |
|
RESPONSECODE CmdEscape(unsigned int reader_index, |
| 40 |
|
const unsigned char TxBuffer[], unsigned int TxLength, |
| 41 |
|
unsigned char RxBuffer[], unsigned int *RxLength); |
| 42 |
|
|
| 43 |
|
RESPONSECODE CmdPowerOff(unsigned int reader_index); |
| 44 |
|
|
| 45 |
|
RESPONSECODE CmdGetSlotStatus(unsigned int reader_index, |
| 46 |
|
unsigned char buffer[]); |
| 47 |
|
|
| 48 |
|
RESPONSECODE CmdXfrBlock(unsigned int reader_index, unsigned int tx_length, |
| 49 |
|
unsigned char tx_buffer[], unsigned int *rx_length, |
| 50 |
|
unsigned char rx_buffer[], int protoccol); |
| 51 |
|
|
| 52 |
|
RESPONSECODE CCID_Transmit(unsigned int reader_index, unsigned int tx_length, |
| 53 |
|
const unsigned char tx_buffer[], unsigned short rx_length, unsigned char bBWI); |
| 54 |
|
|
| 55 |
|
RESPONSECODE CCID_Receive(unsigned int reader_index, unsigned int *rx_length, |
| 56 |
|
unsigned char rx_buffer[]); |
| 57 |
|
|
| 58 |
|
RESPONSECODE SetParameters(unsigned int reader_index, char protocol, |
| 59 |
|
unsigned int length, unsigned char buffer[]); |
| 60 |
|
|
| 61 |
|
int isCharLevel(int reader_index); |
| 62 |
|
|