| 1 |
/*
|
| 2 |
pps.h
|
| 3 |
Protocol Parameters Selection
|
| 4 |
|
| 5 |
This file is part of the Unix driver for Towitoko smartcard readers
|
| 6 |
Copyright (C) 2000 2001 Carlos Prados <cprados@yahoo.com>
|
| 7 |
|
| 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.
|
| 12 |
|
| 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.
|
| 17 |
|
| 18 |
You should have received a copy of the GNU Lesser General Public
|
| 19 |
License along with this library; if not, write to the Free Software
|
| 20 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 21 |
*/
|
| 22 |
|
| 23 |
#ifndef _PPS_
|
| 24 |
#define _PPS_
|
| 25 |
|
| 26 |
#include "defines.h"
|
| 27 |
|
| 28 |
/*
|
| 29 |
* Exported constants definition
|
| 30 |
*/
|
| 31 |
|
| 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
|
| 37 |
/*
|
| 38 |
* Exported data types definition
|
| 39 |
*/
|
| 40 |
|
| 41 |
typedef struct
|
| 42 |
{
|
| 43 |
double f;
|
| 44 |
double d;
|
| 45 |
double n;
|
| 46 |
BYTE t;
|
| 47 |
}
|
| 48 |
PPS_ProtocolParameters;
|
| 49 |
|
| 50 |
typedef struct
|
| 51 |
{
|
| 52 |
int icc;
|
| 53 |
void *protocol;
|
| 54 |
PPS_ProtocolParameters parameters;
|
| 55 |
}
|
| 56 |
PPS;
|
| 57 |
|
| 58 |
/*
|
| 59 |
* Exported functions declaration
|
| 60 |
*/
|
| 61 |
|
| 62 |
int PPS_Exchange (int lun, BYTE * params, unsigned *length);
|
| 63 |
|
| 64 |
#endif /* _PPS_ */
|