globalplatform
connectionplugin.h
Go to the documentation of this file.
1 /* Copyright (c) 2009, Karsten Ohme
2  * This file is part of GlobalPlatform.
3  *
4  * GlobalPlatform is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * GlobalPlatform is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with GlobalPlatform. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
26 #ifndef OPGP_CONNECTION_PLUGIN_H
27 #define OPGP_CONNECTION_PLUGIN_H
28 
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33 
34 #ifdef WIN32
35 #include "stdafx.h"
36 #endif
37 
38 #include "connection.h"
39 #include "error.h"
40 #include "library.h"
41 
42 #define OPGP_PL_ERROR_PREFIX ((DWORD) 0x80500000)
43 
44 #define OPGP_PL_ERROR_NO_CARD_CONTEXT_INITIALIZED (OPGP_PL_ERROR_PREFIX | (DWORD)0x0001L)
45 #define OPGP_PL_ERROR_NO_CARD_INFO_INITIALIZED (OPGP_PL_ERROR_PREFIX | (DWORD)0x0002L)
46 
47 
49 OPGP_PL_API
51 
53 OPGP_PL_API
55 
57 OPGP_PL_API
58 OPGP_ERROR_STATUS OPGP_PL_list_readers(OPGP_CARD_CONTEXT cardContext, OPGP_STRING readerNames, PDWORD readerNamesLength);
59 
61 OPGP_PL_API
62 OPGP_ERROR_STATUS OPGP_PL_card_connect(OPGP_CARD_CONTEXT cardContext, OPGP_CSTRING readerName, OPGP_CARD_INFO *cardInfo, DWORD protocol);
63 
65 OPGP_PL_API
67 
69 OPGP_PL_API
70 OPGP_ERROR_STATUS OPGP_PL_send_APDU(OPGP_CARD_CONTEXT cardContext, OPGP_CARD_INFO cardInfo, PBYTE capdu, DWORD capduLength, PBYTE rapdu, PDWORD rapduLength);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 #endif
PDWORD
unsigned long * PDWORD
A Microsoft LPDWORD/Muscle pointer to a DWORD.
Definition: types.h:50
PBYTE
unsigned char * PBYTE
A Microsoft/Muscle LPBYTE, pointer to unsigned char.
Definition: types.h:48
OPGP_CARD_CONTEXT
Definition: connection.h:69
OPGP_PL_release_context
OPGP_PL_API OPGP_ERROR_STATUS OPGP_PL_release_context(OPGP_CARD_CONTEXT *cardContext)
This function releases the context to the connection layer established by establish_context().
OPGP_PL_card_connect
OPGP_PL_API OPGP_ERROR_STATUS OPGP_PL_card_connect(OPGP_CARD_CONTEXT cardContext, OPGP_CSTRING readerName, OPGP_CARD_INFO *cardInfo, DWORD protocol)
This function connects to a reader.
OPGP_ERROR_STATUS
Definition: error.h:45
DWORD
unsigned long DWORD
A Microsoft/Muscle DWORD definition.
Definition: types.h:52
error.h
OPGP_PL_card_disconnect
OPGP_PL_API OPGP_ERROR_STATUS OPGP_PL_card_disconnect(OPGP_CARD_CONTEXT cardContext, OPGP_CARD_INFO *cardInfo)
This function disconnects a reader.
library.h
OPGP_CSTRING
const typedef char * OPGP_CSTRING
A Microsoft/Muscle LPCTSTR.
Definition: types.h:47
OPGP_PL_send_APDU
OPGP_PL_API OPGP_ERROR_STATUS OPGP_PL_send_APDU(OPGP_CARD_CONTEXT cardContext, OPGP_CARD_INFO cardInfo, PBYTE capdu, DWORD capduLength, PBYTE rapdu, PDWORD rapduLength)
This function sends an APDU.
OPGP_PL_establish_context
OPGP_PL_API OPGP_ERROR_STATUS OPGP_PL_establish_context(OPGP_CARD_CONTEXT *cardContext)
This function establishes a context to connection layer.
OPGP_STRING
char * OPGP_STRING
A Microsoft/Muscle LPTSTR.
Definition: types.h:46
connection.h
OPGP_CARD_INFO
Definition: connection.h:80
OPGP_PL_list_readers
OPGP_PL_API OPGP_ERROR_STATUS OPGP_PL_list_readers(OPGP_CARD_CONTEXT cardContext, OPGP_STRING readerNames, PDWORD readerNamesLength)
This function returns a list of currently available readers.