1-- 2-- Copyright (c) 2010, 3-- Reto Buerki <reet@codelabs.ch> 4-- 5-- This file is part of PCSC/Ada. 6-- 7-- PCSC/Ada is free software; you can redistribute it and/or modify 8-- it under the terms of the GNU Lesser General Public License as published 9-- by the Free Software Foundation; either version 2.1 of the License, or 10-- (at your option) any later version. 11-- 12-- PCSC/Ada is distributed in the hope that it will be useful, 13-- but WITHOUT ANY WARRANTY; without even the implied warranty of 14-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15-- GNU Lesser General Public License for more details. 16-- 17-- You should have received a copy of the GNU Lesser General Public License 18-- along with PCSC/Ada; if not, write to the Free Software 19-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, 20-- MA 02110-1301 USA 21-- 22 23with PCSC.Thin.IFDHandler; 24 25package IFD is 26 27 use PCSC.Thin; 28 29 subtype Value_Array is Byte_Array (0 .. MAX_ATR_SIZE); 30 -- Transfer data, use max ATR size as upper constraint for now 31 32 type Value_Access is access Value_Array; 33 -- Access to transfer data array 34 35 function IFDHCloseChannel (Lun : DWORD) return IFDHandler.RESPONSECODE; 36 pragma Export (Convention => C, 37 Entity => IFDHCloseChannel, 38 External_Name => "IFDHCloseChannel"); 39 40 function IFDHControl 41 (Lun : DWORD; 42 TxBuffer : Value_Access; 43 TxLength : DWORD; 44 RxBuffer : Value_Access; 45 RxLength : PDWORD) 46 return IFDHandler.RESPONSECODE; 47 pragma Export (Convention => C, 48 Entity => IFDHControl, 49 External_Name => "IFDHControl"); 50 51 function IFDHCreateChannel 52 (Lun : DWORD; 53 Channel : DWORD) 54 return IFDHandler.RESPONSECODE; 55 pragma Export (Convention => C, 56 Entity => IFDHCreateChannel, 57 External_Name => "IFDHCreateChannel"); 58 59 function IFDHCreateChannelByName 60 (Lun : DWORD; 61 DeviceName : LPSTR) 62 return IFDHandler.RESPONSECODE; 63 pragma Export (Convention => C, 64 Entity => IFDHCreateChannelByName, 65 External_Name => "IFDHCreateChannelByName"); 66 67 procedure IFDHGetCapabilities 68 (Result : out DWORD; 69 Lun : DWORD; 70 Tag : DWORD; 71 Length : PDWORD; 72 Value : Value_Access); 73 pragma Export (Convention => C, 74 Entity => IFDHGetCapabilities, 75 External_Name => "IFDHGetCapabilities"); 76 pragma Export_Valued_Procedure (Internal => IFDHGetCapabilities, 77 External => "IFDHGetCapabilities"); 78 79 function IFDHICCPresence (Lun : DWORD) return IFDHandler.RESPONSECODE; 80 pragma Export (Convention => C, 81 Entity => IFDHICCPresence, 82 External_Name => "IFDHICCPresence"); 83 84 procedure IFDHPowerICC 85 (Result : out IFDHandler.RESPONSECODE; 86 Lun : DWORD; 87 Action : DWORD; 88 Atr : ATR_Access; 89 AtrLength : PDWORD); 90 pragma Export (Convention => C, 91 Entity => IFDHPowerICC, 92 External_Name => "IFDHPowerICC"); 93 pragma Export_Valued_Procedure (Internal => IFDHPowerICC, 94 External => "IFDHPowerICC"); 95 96 function IFDHSetCapabilities 97 (Lun : DWORD; 98 Tag : DWORD; 99 Length : DWORD; 100 Value : Value_Access) 101 return IFDHandler.RESPONSECODE; 102 pragma Export (Convention => C, 103 Entity => IFDHSetCapabilities, 104 External_Name => "IFDHSetCapabilities"); 105 106 function IFDHSetProtocolParameters 107 (Lun : DWORD; 108 Protocol : DWORD; 109 Flags : UCHAR; 110 PTS1 : UCHAR; 111 PTS2 : UCHAR; 112 PTS3 : UCHAR) 113 return IFDHandler.RESPONSECODE; 114 pragma Export (Convention => C, 115 Entity => IFDHSetProtocolParameters, 116 External_Name => "IFDHSetProtocolParameters"); 117 118 function IFDHTransmitToICC 119 (Lun : DWORD; 120 SendPci : IFDHandler.SCARD_IO_HEADER; 121 TxBuffer : Value_Access; 122 TxLength : DWORD; 123 RxBuffer : Value_Access; 124 RxLength : PDWORD; 125 RecvPci : IFDHandler.PSCARD_IO_HEADER) 126 return IFDHandler.RESPONSECODE; 127 pragma Export (Convention => C, 128 Entity => IFDHTransmitToICC, 129 External_Name => "IFDHTransmitToICC"); 130 131end IFD; 132