libPCSCv2part10
 All Data Structures Files Functions Variables Macros Modules
PCSCv2part10.h
Go to the documentation of this file.
1 /*
2  PCSCv2part10.h: helper functions for PC/SC v2 part 10 services
3  Copyright (C) 2012 Ludovic Rousseau
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19 
20 /*
21  * $Id$
22  */
23 
24 #ifndef __reader_h__
25 
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29 
30 #ifdef HAVE_READER_H
31 #include <reader.h>
32 #else
33 
37 #define SCARD_CTL_CODE(code) (0x42000000 + (code))
38 
42 #define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)
43 
44 #define FEATURE_GET_TLV_PROPERTIES 0x12
46 #include <inttypes.h>
47 
48 /* Set structure elements aligment on bytes
49  * http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html */
50 #if defined(__APPLE__) | defined(sun)
51 #pragma pack(1)
52 #else
53 #pragma pack(push, 1)
54 #endif
55 
57 typedef struct
58 {
59  uint8_t tag;
60  uint8_t length;
61  uint32_t value;
63 
64 /* restore default structure elements alignment */
65 #if defined(__APPLE__) | defined(sun)
66 #pragma pack()
67 #else
68 #pragma pack(pop)
69 #endif
70 
71 /* properties returned by FEATURE_GET_TLV_PROPERTIES */
72 #define PCSCv2_PART10_PROPERTY_wLcdLayout 1
73 #define PCSCv2_PART10_PROPERTY_bEntryValidationCondition 2
74 #define PCSCv2_PART10_PROPERTY_bTimeOut2 3
75 #define PCSCv2_PART10_PROPERTY_wLcdMaxCharacters 4
76 #define PCSCv2_PART10_PROPERTY_wLcdMaxLines 5
77 #define PCSCv2_PART10_PROPERTY_bMinPINSize 6
78 #define PCSCv2_PART10_PROPERTY_bMaxPINSize 7
79 #define PCSCv2_PART10_PROPERTY_sFirmwareID 8
80 #define PCSCv2_PART10_PROPERTY_bPPDUSupport 9
81 #define PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize 10
82 #define PCSCv2_PART10_PROPERTY_wIdVendor 11
83 #define PCSCv2_PART10_PROPERTY_wIdProduct 12
85 #endif
86 #endif
87 
127  unsigned char *buffer, int length, int property, int * value);
128 
139  int property, int * value);
140 
Definition: PCSCv2part10.h:57
uint8_t tag
Definition: PCSCv2part10.h:59
uint8_t length
Definition: PCSCv2part10.h:60
int PCSCv2Part10_find_TLV_property_by_tag_from_hcard(SCARDHANDLE hCard, int property, int *value)
Find a integer value by tag from a PC/SC card handle.
int PCSCv2Part10_find_TLV_property_by_tag_from_buffer(unsigned char *buffer, int length, int property, int *value)
Find an integer value by tag from TLV buffer.
uint32_t value
Definition: PCSCv2part10.h:61