3 Protocol Parameters Selection
5 This file is part of the Unix driver for Towitoko smartcard readers
6 Copyright (C) 2000 2001 Carlos Prados <cprados@yahoo.com>
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with this library; if not, write to the Free Software Foundation,
20 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 * Exported constants definition
32 #define PPS_OK 0 /* Negotiation OK */
33 #define PPS_ICC_ERROR 1 /* Comunication error */
34 #define PPS_HANDSAKE_ERROR 2 /* Agreement not reached */
35 #define PPS_PROTOCOL_ERROR 3 /* Error starting protocol */
36 #define PPS_MAX_LENGTH 6
38 #define PPS_HAS_PPS1(block) ((block[1] & 0x10) == 0x10)
39 #define PPS_HAS_PPS2(block) ((block[1] & 0x20) == 0x20)
40 #define PPS_HAS_PPS3(block) ((block[1] & 0x40) == 0x40)
43 * Exported data types definition
53 PPS_ProtocolParameters;
59 PPS_ProtocolParameters parameters;
64 * Exported functions declaration
67 int PPS_Exchange (int lun, BYTE * params, /*@out@*/ unsigned *length,