[Pcsclite-cvs-commit] r6258 - /trunk/Drivers/ccid/src/ifdhandler.c
rousseau at users.alioth.debian.org
rousseau at users.alioth.debian.org
Wed Apr 4 20:44:21 UTC 2012
Author: rousseau
Date: Wed Apr 4 20:44:20 2012
New Revision: 6258
URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6258
Log:
IFDHControl(): Add support of dwMaxAPDUDataSize
This property indicates if a reader/driver supports extended APDU or
not.
>From PC/SC v2 part 10 (version 2.02.09 not yet published):
dwMaxAPDUDataSize: Maximal size of data the reader and its driver can support
0: short APDU only.
0<X<=256: forbidden values (RFU)
256 < X <= 0x10000: short and extended APDU of up to X bytes of data
0x10000 < X: invalid values (RFU)
Modified:
trunk/Drivers/ccid/src/ifdhandler.c
Modified: trunk/Drivers/ccid/src/ifdhandler.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/ifdhandler.c?rev=6258&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c (original)
+++ trunk/Drivers/ccid/src/ifdhandler.c Wed Apr 4 20:44:20 2012
@@ -1535,6 +1535,23 @@
RxBuffer[p++] = idProduct >> 8;
}
+ /* dwMaxAPDUDataSize */
+ {
+ int MaxAPDUDataSize = 0; /* short APDU only by default */
+
+ /* reader is TPDU or extended APDU */
+ if ((ccid_descriptor -> dwFeatures & CCID_CLASS_EXTENDED_APDU)
+ || (ccid_descriptor -> dwFeatures & CCID_CLASS_TPDU))
+ MaxAPDUDataSize = 0x10000;
+
+ RxBuffer[p++] = PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize;
+ RxBuffer[p++] = 4; /* length */
+ RxBuffer[p++] = MaxAPDUDataSize & 0xFF;
+ RxBuffer[p++] = (MaxAPDUDataSize >> 8) & 0xFF;
+ RxBuffer[p++] = (MaxAPDUDataSize >> 16) & 0xFF;
+ RxBuffer[p++] = (MaxAPDUDataSize >> 24) & 0xFF;
+ }
+
*pdwBytesReturned = p;
return_value = IFD_SUCCESS;
}
More information about the Pcsclite-cvs-commit
mailing list