Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

libchipcard.h

Go to the documentation of this file.
00001 /***************************************************************************
00002   $RCSfile: libchipcard.h,v $
00003                              -------------------
00004     cvs         : $Id: libchipcard.h,v 1.19 2003/05/08 12:38:39 aquamaniac Exp $
00005     begin       : Sun Mar 10 2002
00006     copyright   : (C) 2002 by Martin Preuss
00007     email       : martin@libchipcard.de
00008 
00009 
00010  ***************************************************************************
00011  *                                                                         *
00012  *   This library is free software; you can redistribute it and/or         *
00013  *   modify it under the terms of the GNU Lesser General Public            *
00014  *   License as published by the Free Software Foundation; either          *
00015  *   version 2.1 of the License, or (at your option) any later version.    *
00016  *                                                                         *
00017  *   This library is distributed in the hope that it will be useful,       *
00018  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00019  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00020  *   Lesser General Public License for more details.                       *
00021  *                                                                         *
00022  *   You should have received a copy of the GNU Lesser General Public      *
00023  *   License along with this library; if not, write to the Free Software   *
00024  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00025  *   MA  02111-1307  USA                                                   *
00026  *                                                                         *
00027  ***************************************************************************/
00028 
00037 #ifndef LIBCHIPCARD_H
00038 #define LIBCHIPCARD_H
00039 
00040 #include <chipcard/ctcore_public.h>
00041 
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045 
00046 
00047 #define CHIPCARD_SUCCESS                   0
00048 #define CHIPCARD_ERROR_INVALID             1
00049 #define CHIPCARD_ERROR_BUFFER              2
00050 #define CHIPCARD_ERROR_CARD_REMOVED        3
00051 
00052 #define CHIPCARD_ERROR_NO_REQUEST          4
00053 #define CHIPCARD_ERROR_NO_MESSAGE          5
00054 #define CHIPCARD_ERROR_BAD_CHANNEL_STATUS  6
00055 #define CHIPCARD_ERROR_NO_COMMANDS         7
00056 #define CHIPCARD_ERROR_NO_CONFIG           8
00057 #define CHIPCARD_ERROR_UNREACHABLE         9
00058 #define CHIPCARD_ERROR_DRIVER              10
00059 #define CHIPCARD_ERROR_NO_READER           11
00060 #define CHIPCARD_ERROR_COMMAND_NOT_FOUND   12
00061 #define CHIPCARD_ERROR_BAD_RESPONSE        13
00062 #define CHIPCARD_ERROR_NO_CARD             14
00063 #define CHIPCARD_ERROR_ABORTED             15
00064 #define CHIPCARD_ERROR_INTERRUPTED         16
00065 #define CHIPCARD_ERROR_NO_TRANSPORT        17
00066 #define CHIPCARD_ERROR_INTERNAL            99
00067 
00068 #define CHIPCARD_STATUS_INSERTED        CTREADERSTATUS_INSERTED
00069 #define CHIPCARD_STATUS_CONNECTED       CTREADERSTATUS_CONNECTED
00070 #define CHIPCARD_STATUS_PROCESSOR       CTREADERSTATUS_PROCESSOR
00071 #define CHIPCARD_STATUS_LOCKED_BY_OTHER CTREADERSTATUS_LOCKED_BY_OTHER
00072 
00073 #define CHIPCARD_READERFLAGS_KEYPAD  CTREADERFLAGS_KEYPAD
00074 #define CHIPCARD_READERFLAGS_DISPLAY CTREADERFLAGS_DISPLAY
00075 
00076 
00077 CHIPCARD_API struct CHIPCARD_READERDESCRSTRUCT {
00078   unsigned int flags;
00079   char name[64];
00080   char type[64];
00081 };
00082 CHIPCARD_API typedef struct CHIPCARD_READERDESCRSTRUCT CHIPCARD_READERDESCR;
00083 
00101 CHIPCARD_API int ChipCard_Work();
00102 
00116 CHIPCARD_API int ChipCard_AddServer(const char *addr,
00117                                     int port);
00118 
00126 CHIPCARD_API void ChipCard_ReaderDescr_free(CHIPCARD_READERDESCR *rd);
00151 CHIPCARD_API int ChipCard_Init(const char *configfile,
00152                                const char *section);
00153 
00162 CHIPCARD_API void ChipCard_Fini();
00173 
00189 CHIPCARD_API int ChipCard_LocateCommand(const char *command,
00190                                         const char *readertype,
00191                                         const char *cardtype,
00192                                         char *buffer,
00193                                         int bufferlen);
00194 
00203 CHIPCARD_API int ChipCard_ExistsCommand(const char *command);
00204 
00205 
00213 int ChipCard_MakeAPDU(char *buffer, int *bufferlen,
00214                       const char *command,
00215                       int argc, ...);
00216 
00225 
00234 CHIPCARD_API int ChipCard_CheckResponse(int requestid);
00235 
00246 CHIPCARD_API void ChipCard_WithdrawRequest(int requestid);
00247 
00257 CHIPCARD_API void ChipCard_AbandonRequest(int requestid);
00258 
00273 
00286 CHIPCARD_API int ChipCard_RequestAllocReader(int *requestid,
00287                                              unsigned int tid);
00288 
00304 CHIPCARD_API int ChipCard_CheckAllocReader(int requestid,
00305                                            int *thdl,
00306                                            CHIPCARD_READERDESCR **rd);
00307 
00318 CHIPCARD_API int ChipCard_RequestReleaseReader(int *requestid,
00319                                                unsigned int tid);
00320 
00329 CHIPCARD_API int ChipCard_CheckReleaseReader(int requestid);
00330 
00340 CHIPCARD_API int ChipCard_RequestConnect(int *requestid,
00341                                          unsigned int thdl,
00342                                          int cardId,
00343                                          int waitForIt);
00344 
00354 CHIPCARD_API int
00355   ChipCard_RequestStopConnect(int *requestid,
00356                               unsigned int thdl,
00357                               int prevRequest);
00358 CHIPCARD_API int
00359   ChipCard_CheckStopConnect(int requestid,
00360                             int *result);
00361 
00362 
00387 CHIPCARD_API int ChipCard_CheckConnect(int requestid,
00388                                        int *result,
00389                                        char *atrbuffer,
00390                                        int *atrbufferlength);
00391 
00403 CHIPCARD_API int ChipCard_RequestDisconnect(int *requestid,
00404                                             unsigned int thdl);
00405 
00406 
00421 CHIPCARD_API int ChipCard_CheckDisconnect(int requestid,
00422                                           int *result);
00423 
00424 
00437 CHIPCARD_API int ChipCard_RequestCommand(int *requestid,
00438                                          unsigned int thdl,
00439                                          const char *sendBuffer,
00440                                          int sendBufferLength);
00441 
00463 CHIPCARD_API int ChipCard_CheckCommand(int requestid,
00464                                        int *result,
00465                                        char *recvBuffer,
00466                                        int *recvBufferLength);
00467 
00484 CHIPCARD_API int ChipCard_RequestFindReader(int *requestid,
00485                                             const char *readerType,
00486                                             unsigned int readerFlags,
00487                                             unsigned int readerFlagsMask);
00488 
00507 CHIPCARD_API int ChipCard_CheckFindReader(int requestid,
00508                                           unsigned int *readerbuffer,
00509                                           int *readerBufferLength);
00519 CHIPCARD_API int ChipCard_RequestStatReader(int *requestid,
00520                                             int thdl);
00521 
00548 CHIPCARD_API int ChipCard_CheckStatReader(int requestid,
00549                                           int *result,
00550                                           unsigned int *status,
00551                                           char *atrbuffer,
00552                                           int *atrlen);
00553 
00566 CHIPCARD_API int ChipCard_RequestWaitReader(int *requestid,
00567                                             int mustChange,
00568                                             const char *readerType,
00569                                             unsigned int readerFlags,
00570                                             unsigned int readerFlagsMask,
00571                                             unsigned int status,
00572                                             unsigned int statusMask,
00573                                             unsigned int statusDelta);
00574 
00589 CHIPCARD_API int ChipCard_CheckWaitReader(int requestid,
00590                                           int *tid,
00591                                           unsigned int *status,
00592                                           unsigned int *readerflags,
00593                                           unsigned int *cardId);
00594 
00604 CHIPCARD_API int ChipCard_StopWaitReader(int prevRequest);
00605 
00606 
00607 
00613 CHIPCARD_API int ChipCard_RequestPing(int *requestid,
00614                                       int serviceid);
00618 CHIPCARD_API int ChipCard_CheckPing(int requestid);
00619 
00620 
00621 #ifdef __cplusplus
00622 }
00623 #endif
00624 
00625 #endif
00626 
00627 
00628 

Generated on Mon Jun 6 18:17:40 2005 for libchipcard by  doxygen 1.4.2