source: trunk/csctapi/cardterminal.h@ 1

Last change on this file since 1 was 1, checked in by root, 15 years ago

initial import

File size: 2.3 KB
Line 
1/*
2 cardterminal.h
3 Card Terminal 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 _CARDTERMINAL_
26#define _CARDTERMINAL_
27
28#include "defines.h"
29#include "ct_slot.h"
30#include "io_serial.h"
31#include "apdu.h"
32#include "ctapi.h"
33#include "ctbcs.h"
34#ifdef HAVE_PTHREAD_H
35#include "pthread.h"
36#endif
37
38/*
39 * Exported constats definition
40 */
41
42/* Maximum number of slots in a cardterminal */
43#define CARDTERMINAL_MAX_SLOTS 2
44
45/*
46 * Exported datatypes definition
47 */
48
49typedef struct
50{
51 IO_Serial * io; /* Serial device */
52 CT_Slot * slots[CARDTERMINAL_MAX_SLOTS]; /* Array of CT_Slot's */
53 int num_slots; /* Number of CT_Slot's */
54#ifdef HAVE_PTHREAD_H
55 pthread_mutex_t mutex;
56#endif
57}
58CardTerminal;
59
60/*
61 * Exported functions declaration
62 */
63
64/* Cretate a new CardTerminal */
65extern CardTerminal *
66CardTerminal_New ();
67
68/* Intialice a CardTerminal in a given port */
69extern char
70CardTerminal_Init (CardTerminal * ct, unsigned short pn);
71
72/* Send a CT-BCS command to a CardTerminal */
73extern char
74CardTerminal_Command (CardTerminal * ct, APDU_Cmd * cmd, APDU_Rsp ** rsp);
75
76/* Return the reference to a slot */
77extern CT_Slot *
78CardTerminal_GetSlot (CardTerminal * ct, int number);
79
80/* Close a CardTerminal */
81extern char
82CardTerminal_Close (CardTerminal * cn);
83
84/* Delete a CardTerminal */
85extern void
86CardTerminal_Delete (CardTerminal * ct);
87
88#ifdef HAVE_PTHREAD_H
89extern pthread_mutex_t *
90CardTerminal_GetMutex (CardTerminal * ct);
91#endif
92
93#endif
Note: See TracBrowser for help on using the repository browser.