[Pcsclite-cvs-commit] Drivers/ccid/src parse.c,1.2,1.3
rousseau@quantz.debian.org
rousseau@quantz.debian.org
Wed, 10 Sep 2003 10:57:31 +0200
Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory quantz:/tmp/cvs-serv601
Modified Files:
parse.c
Log Message:
indent the output with one feature per line (and not on the same line
separated by ,)
Index: parse.c
===================================================================
RCS file: /cvsroot/pcsclite/Drivers/ccid/src/parse.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- parse.c 21 Aug 2003 14:10:33 -0000 1.2
+++ parse.c 10 Sep 2003 08:57:29 -0000 1.3
@@ -26,6 +26,7 @@
#include <usb.h>
#include "pcscdefines.h"
+#include "ccid.h"
#include "ccid_usb.h"
#ifndef TRUE
@@ -36,12 +37,18 @@
int ccid_parse_interface_descriptor(char device_name[], usb_dev_handle *handle,
struct usb_device *dev);
+
+/*****************************************************************************
+ *
+ * main
+ *
+ ****************************************************************************/
int main(int argc, char *argv[])
{
status_t res;
int channel;
- for (channel=0; channel<PCSCLITE_MAX_CHANNELS; channel++)
+ for (channel=0; channel<PCSCLITE_MAX_READERS; channel++)
{
res = OpenUSB(channel<<16, channel);
if (res != STATUS_SUCCESS)
@@ -69,6 +76,7 @@
return 0;
} /* main */
+
/*****************************************************************************
*
* Parse a CCID USB Descriptor
@@ -160,21 +168,20 @@
printf(" bcdCCID: %X.%02X\n", extra[3], extra[2]);
printf(" bMaxSlotIndex: 0x%02X\n", extra[4]);
- printf(" bVoltageSupport: 0x%02X -", extra[5]);
+ printf(" bVoltageSupport: 0x%02X\n", extra[5]);
if (extra[5] & 0x01)
- printf(" 5.0V");
+ printf(" 5.0V\n");
if (extra[5] & 0x02)
- printf(" 3.0V");
+ printf(" 3.0V\n");
if (extra[5] & 0x04)
- printf(" 1.8V");
- printf("\n");
+ printf(" 1.8V\n");
- printf(" dwProtocols: 0x%02X%02X 0x%02X%02X -", extra[9], extra[8], extra[7],extra[6]);
+ printf(" dwProtocols: 0x%02X%02X 0x%02X%02X\n", extra[9], extra[8],
+ extra[7],extra[6]);
if (extra[6] & 0x01)
- printf(" T=0");
+ printf(" T=0\n");
if (extra[6] & 0x02)
- printf(" T=1");
- printf("\n");
+ printf(" T=1\n");
printf(" dwDefaultClock: %.3f MHz\n", dw2i(extra, 10)/1000.0);
printf(" dwMaximumClock: %.3f MHz\n", dw2i(extra, 14)/1000.0);
@@ -186,49 +193,47 @@
printf(" dwMaxIFSD: %d\n", dw2i(extra, 28));
printf(" dwSynchProtocols: 0x%08X\n", dw2i(extra, 32));
- printf(" dwMechanical: 0x%08X -", dw2i(extra, 36));
+ printf(" dwMechanical: 0x%08X\n", dw2i(extra, 36));
if (extra[36] == 0)
- printf(" No special characteristics");
+ printf(" No special characteristics\n");
if (extra[36] & 0x01)
- printf(" Card accept mechanism");
+ printf(" Card accept mechanism\n");
if (extra[36] & 0x02)
- printf(" Card ejection mechanism");
+ printf(" Card ejection mechanism\n");
if (extra[36] & 0x04)
- printf(" Card capture mechanism");
+ printf(" Card capture mechanism\n");
if (extra[36] & 0x08)
- printf(" Card lock/unlock mechanism");
- printf("\n");
+ printf(" Card lock/unlock mechanism\n");
- printf(" dwFeatures: 0x%08X -", dw2i(extra, 40));
+ printf(" dwFeatures: 0x%08X\n", dw2i(extra, 40));
if (extra[40] == 0)
- printf(" No special characteristics");
+ printf(" No special characteristics\n");
if (extra[40] & 0x02)
- printf(" Automatic parameter configuration based on ATR data,");
+ printf(" Automatic parameter configuration based on ATR data\n");
if (extra[40] & 0x04)
- printf(" Automatic activation of ICC on inserting,");
+ printf(" Automatic activation of ICC on inserting\n");
if (extra[40] & 0x08)
- printf(" Automatic ICC voltage selection,");
+ printf(" Automatic ICC voltage selection\n");
if (extra[40] & 0x10)
- printf(" Automatic ICC clock frequency change according to parameters,");
+ printf(" Automatic ICC clock frequency change according to parameters\n");
if (extra[40] & 0x20)
- printf(" Automatic baud rate change according to frequency and Fi, Di parameters,");
+ printf(" Automatic baud rate change according to frequency and Fi, Di parameters\n");
if (extra[40] & 0x40)
- printf(" Automatic parameters negotiation made by the ICC,");
+ printf(" Automatic parameters negotiation made by the ICC\n");
if (extra[40] & 0x80)
- printf(" Automatic PPS made by the ICC,");
+ printf(" Automatic PPS made by the ICC\n");
if (extra[41] & 0x01)
- printf(" CCID can set ICC in clock stop mode,");
+ printf(" CCID can set ICC in clock stop mode\n");
if (extra[41] & 0x02)
- printf(" NAD value other than 00 accepted (T=1),");
+ printf(" NAD value other than 00 accepted (T=1)\n");
if (extra[41] & 0x04)
- printf(" Automatic IFSD exchange as first exchange (T=1),");
+ printf(" Automatic IFSD exchange as first exchange (T=1)\n");
if (extra[42] & 0x01)
- printf(" TPDU level exchange,");
+ printf(" TPDU level exchange\n");
if (extra[42] & 0x02)
- printf(" Short APDU level exchange,");
+ printf(" Short APDU level exchange\n");
if (extra[42] & 0x04)
- printf(" Short and Extended APDU level exchange,");
- printf("\n");
+ printf(" Short and Extended APDU level exchange\n");
printf(" dwMaxCCIDMessageLength: %d bytes\n", dw2i(extra, 44));
printf(" bClassGetResponse: %d\n", extra[48]);