source: trunk/csctapi/ct_slot.h@ 1288

Last change on this file since 1288 was 1288, checked in by dingo35, 11 years ago

Remove dynamic datastructure PPS

File size: 2.6 KB
Line 
1/*
2 ct_slot.h
3 Card Terminal Slot handling definitions
4
5 This file is part of the Unix driver for Towitoko smartcard readers
6 Copyright (C) 2000 Carlos Prados <cprados@yahoo.com>
7
8 This version is modified by doz21 to work in a special manner ;)
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23*/
24
25#ifndef _CT_SLOT_
26#define _CT_SLOT_
27
28#include "defines.h"
29#include "../globals.h"
30#include "apdu.h"
31#include "ctapi.h"
32#include "ctbcs.h"
33
34
35/*
36 * Exported constats definition
37 */
38
39/* Type of protocol and ICC */
40#define CT_SLOT_PROTOCOL_T0 0
41#define CT_SLOT_PROTOCOL_T1 1
42#define CT_SLOT_PROTOCOL_T14 14
43#define CT_SLOT_PROTOCOL_SYNC 16
44#define CT_SLOT_ICC_ASYNC 0
45#define CT_SLOT_ICC_SYNC 1
46#define CT_SLOT_NULL -1
47
48/*
49 * Exported datatypes definition
50 */
51
52typedef struct
53{
54 int icc_type; /* Type of ICC */
55 int protocol_type; /* Type of protocol */
56}
57CT_Slot;
58
59/*
60 * Exported functions declaration
61 */
62
63/* Cretate a new CT_Slot */
64extern CT_Slot *
65CT_Slot_New ();
66
67/* Intialice a CT_Slot */
68extern char
69CT_Slot_Init (CT_Slot * slot, int sn);
70
71/* Check for card inserted */
72extern char
73CT_Slot_Check (CT_Slot * slot, unsigned int timeout, bool * card, bool * change);
74
75/* Probe ICC type and protocol */
76extern char
77CT_Slot_Probe (CT_Slot * slot, BYTE * userdata, unsigned length);
78
79/* Release status information */
80extern char
81CT_Slot_Release (CT_Slot * slot);
82
83/* Send a command to and ICC */
84extern char
85CT_Slot_Command (CT_Slot * slot, APDU_Cmd * cmd, APDU_Rsp ** rsp);
86
87/* Return ICC type */
88extern int
89CT_Slot_GetICCType (CT_Slot * slot);
90
91/* Get answer to reset of the card */
92extern void *
93CT_Slot_GetAtr (CT_Slot * slot);
94
95/* Says if this slot is last */
96extern bool
97CT_Slot_IsLast (CT_Slot * slot);
98
99/* Return slot type */
100extern void
101CT_Slot_GetType (CT_Slot * slot, BYTE * buffer, int len);
102
103/* Close a CT_Slot */
104extern char
105CT_Slot_Close (CT_Slot * slot);
106
107/* Delete a CT_Slot */
108extern void
109CT_Slot_Delete (CT_Slot * slot);
110
111#endif
112
Note: See TracBrowser for help on using the repository browser.