libPCSCv2part10
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#ifndef __reader_h__
21
22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#ifdef HAVE_READER_H
27#include <reader.h>
28#else
29
33#define SCARD_CTL_CODE(code) (0x42000000 + (code))
34
38#define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)
39
40#define FEATURE_GET_TLV_PROPERTIES 0x12
42#include <inttypes.h>
43
44/* Set structure elements alignment on bytes
45 * http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html */
46#if defined(__APPLE__) | defined(sun)
47#pragma pack(1)
48#else
49#pragma pack(push, 1)
50#endif
51
53typedef struct
54{
55 uint8_t tag;
56 uint8_t length;
57 uint32_t value;
59
60/* restore default structure elements alignment */
61#if defined(__APPLE__) | defined(sun)
62#pragma pack()
63#else
64#pragma pack(pop)
65#endif
66
67/* properties returned by FEATURE_GET_TLV_PROPERTIES */
68#define PCSCv2_PART10_PROPERTY_wLcdLayout 1
69#define PCSCv2_PART10_PROPERTY_bEntryValidationCondition 2
70#define PCSCv2_PART10_PROPERTY_bTimeOut2 3
71#define PCSCv2_PART10_PROPERTY_wLcdMaxCharacters 4
72#define PCSCv2_PART10_PROPERTY_wLcdMaxLines 5
73#define PCSCv2_PART10_PROPERTY_bMinPINSize 6
74#define PCSCv2_PART10_PROPERTY_bMaxPINSize 7
75#define PCSCv2_PART10_PROPERTY_sFirmwareID 8
76#define PCSCv2_PART10_PROPERTY_bPPDUSupport 9
77#define PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize 10
78#define PCSCv2_PART10_PROPERTY_wIdVendor 11
79#define PCSCv2_PART10_PROPERTY_wIdProduct 12
81#endif
82#endif
83
123 unsigned char *buffer, int length, int property, int * value);
124
135 int property, int * value);
136
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.
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.
Definition: PCSCv2part10.h:54
uint8_t tag
Definition: PCSCv2part10.h:55
uint8_t length
Definition: PCSCv2part10.h:56
uint32_t value
Definition: PCSCv2part10.h:57