[Pcsclite-cvs-commit] CVS Drivers/ccid/src
CVS User rousseau
ludovic.rousseau@free.fr
Mon, 02 May 2005 13:28:30 +0000
Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv658
Modified Files:
ifdhandler.c
Log Message:
T0_card_timeout()/T1_card_timeout(): use ceil() to round the timeout
--- /cvsroot/pcsclite/Drivers/ccid/src/ifdhandler.c 2005/05/02 09:21:56 1.71
+++ /cvsroot/pcsclite/Drivers/ccid/src/ifdhandler.c 2005/05/02 13:28:30 1.72
@@ -17,11 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: ifdhandler.c,v 1.71 2005/05/02 09:21:56 rousseau Exp $ */
+/* $Id: ifdhandler.c,v 1.72 2005/05/02 13:28:30 rousseau Exp $ */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <math.h>
#include <PCSC/pcsclite.h>
#include <PCSC/ifdhandler.h>
@@ -1168,14 +1169,14 @@
/* card WWT */
/* see ch. 8.2 Character level, page 15 of ISO 7816-3 */
- t = 960 * TC2 * f / (clock_frequency * 1000);
+ t = ceil(960 * TC2 * f / (clock_frequency * 1000));
/* use the bigest one */
if (t > timeout)
timeout = t;
/* default WWT (TC2=0x0A) */
- t = 960 * 0x0A * f / (clock_frequency * 1000);
+ t = ceil(960 * 0x0A * f / (clock_frequency * 1000));
/* use the bigest one */
if (t > timeout)
@@ -1193,14 +1194,14 @@
/* card BWT */
/* see ch. 9.5.3.2 Block waiting time, page 20 of ISO 7816-3 */
- t = 11 * f / d / (clock_frequency * 1000) + (1<<BWI) * 960 * 372 / (clock_frequency * 1000); /* seconds */
+ t = ceil(11 * f / d / (clock_frequency * 1000) + (1<<BWI) * 960 * 372 / (clock_frequency * 1000)); /* seconds */
/* use the bigest one */
if (t > timeout)
timeout = t;
/* default BWT (BWI=0x04) */
- t = 11 * f / d / (clock_frequency * 1000) + (1<<4) * 960 * 372 / (clock_frequency * 1000); /* seconds */
+ t = ceil(11 * f / d / (clock_frequency * 1000) + (1<<4) * 960 * 372 / (clock_frequency * 1000)); /* seconds */
/* use the bigest one */
if (t > timeout)