source: trunk/csctapi/ct_slot.h@ 1266

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

Finally killed ifd_towitoko layer, 1 down, 3 to go; guess what, GPIO compiles now

File size: 2.8 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 void * icc; /* Integrated circuit card */
55 void * protocol; /* Protocol handler */
56 int icc_type; /* Type of ICC */
57 int protocol_type; /* Type of protocol */
58}
59CT_Slot;
60
61/*
62 * Exported functions declaration
63 */
64
65/* Cretate a new CT_Slot */
66extern CT_Slot *
67CT_Slot_New ();
68
69/* Intialice a CT_Slot */
70extern char
71CT_Slot_Init (CT_Slot * slot, int sn);
72
73/* Check for card inserted */
74extern char
75CT_Slot_Check (CT_Slot * slot, unsigned int timeout, bool * card, bool * change);
76
77/* Probe ICC type and protocol */
78extern char
79CT_Slot_Probe (CT_Slot * slot, BYTE * userdata, unsigned length);
80
81/* Release status information */
82extern char
83CT_Slot_Release (CT_Slot * slot);
84
85/* Send a command to and ICC */
86extern char
87CT_Slot_Command (CT_Slot * slot, APDU_Cmd * cmd, APDU_Rsp ** rsp);
88
89/* Return ICC type */
90extern int
91CT_Slot_GetICCType (CT_Slot * slot);
92
93/* Return a reference to the ICC */
94extern void *
95CT_Slot_GetICC (CT_Slot * slot);
96
97/* Get answer to reset of the card */
98extern void *
99CT_Slot_GetAtr (CT_Slot * slot);
100
101/* Says if this slot is last */
102extern bool
103CT_Slot_IsLast (CT_Slot * slot);
104
105/* Return slot type */
106extern void
107CT_Slot_GetType (CT_Slot * slot, BYTE * buffer, int len);
108
109/* Close a CT_Slot */
110extern char
111CT_Slot_Close (CT_Slot * slot);
112
113/* Delete a CT_Slot */
114extern void
115CT_Slot_Delete (CT_Slot * slot);
116
117#endif
118
Note: See TracBrowser for help on using the repository browser.