[Pcsclite-git-commit] [CCID] 01/02: Add Microchip SEC1210 UART support.
Ludovic Rousseau
rousseau at moszumanska.debian.org
Wed May 17 11:34:09 UTC 2017
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository CCID.
commit ec652d249dc81c647bf80d5d3c21665ef00c6d8b
Author: Fabio Araujo <fabio.araujo at transdatasmart.com.br>
Date: Mon May 15 09:09:26 2017 -0300
Add Microchip SEC1210 UART support.
The Microchip SEC1210 can be connected on a serial port instead of USB.
---
src/ccid.h | 1 +
src/ccid_serial.c | 23 +++++++++++++++++++++++
src/reader.conf.in | 1 +
3 files changed, 25 insertions(+)
diff --git a/src/ccid.h b/src/ccid.h
index fdc4a64..b219884 100644
--- a/src/ccid.h
+++ b/src/ccid.h
@@ -194,6 +194,7 @@ typedef struct
#define SCR331DI 0x04E65111
#define SCR331DINTTCOM 0x04E65120
#define SDI010 0x04E65121
+#define SEC1210 0x04241202
#define CHERRYXX33 0x046A0005
#define CHERRYST2000 0x046A003E
#define OZ776 0x0B977762
diff --git a/src/ccid_serial.c b/src/ccid_serial.c
index 1484c37..df92fed 100644
--- a/src/ccid_serial.c
+++ b/src/ccid_serial.c
@@ -525,6 +525,8 @@ static status_t set_ccid_descriptor(unsigned int reader_index,
readerID = GEMCORESIMPRO2;
else if (0 == strcasecmp(reader_name,"GemPCPinPad"))
readerID = GEMPCPINPAD;
+ else if (0 == strcasecmp(reader_name,"SEC1210"))
+ readerID = SEC1210;
/* check if the same channel is not already used to manage multi-slots readers*/
for (i = 0; i < CCID_DRIVER_MAX_READERS; i++)
@@ -574,6 +576,11 @@ static status_t set_ccid_descriptor(unsigned int reader_index,
serialDevice[reader_index].ccid.dwMaxDataRate = 125000;
break;
+ case SEC1210:
+ serialDevice[reader_index].ccid.arrayOfSupportedDataRates = NULL;
+ serialDevice[reader_index].ccid.dwMaxDataRate = 826000;
+ break;
+
/* GemPC Twin or GemPC Card */
default:
serialDevice[reader_index].ccid.arrayOfSupportedDataRates = SerialTwinDataRates;
@@ -649,6 +656,16 @@ static status_t set_ccid_descriptor(unsigned int reader_index,
serialDevice[reader_index].ccid.arrayOfSupportedDataRates = SerialExtendedDataRates;
serialDevice[reader_index].ccid.dwMaxDataRate = 500000;
break;
+
+ case SEC1210:
+ serialDevice[reader_index].ccid.dwFeatures = 0x000100B2;
+ serialDevice[reader_index].ccid.dwDefaultClock = 4800;
+ serialDevice[reader_index].ccid.dwMaxDataRate = 826000;
+ serialDevice[reader_index].ccid.arrayOfSupportedDataRates = NULL;
+ serialDevice[reader_index].ccid.bMaxSlotIndex = 1; /* 2 slots */
+ serialDevice[reader_index].echo = FALSE;
+ break;
+
}
end:
@@ -834,6 +851,11 @@ status_t OpenSerialByName(unsigned int reader_index, char *dev_name)
unsigned char rx_buffer[50];
unsigned int rx_length = sizeof(rx_buffer);
+ if (0 == strcasecmp(reader_name,"SEC1210"))
+ {
+ tx_buffer[0] = 0x06;
+ }
+
/* 2 seconds timeout to not wait too long if no reader is connected */
if (IFD_SUCCESS != CmdEscape(reader_index, tx_buffer, sizeof(tx_buffer),
rx_buffer, &rx_length, 2*1000))
@@ -850,6 +872,7 @@ status_t OpenSerialByName(unsigned int reader_index, char *dev_name)
/* perform a command to configure GemPC Twin reader card movement
* notification to synchronous mode: the card movement is notified _after_
* the host command and _before_ the reader anwser */
+ if (0 != strcasecmp(reader_name,"SEC1210"))
{
unsigned char tx_buffer[] = { 0x01, 0x01, 0x01};
unsigned char rx_buffer[50];
diff --git a/src/reader.conf.in b/src/reader.conf.in
index 194792b..7dbed28 100644
--- a/src/reader.conf.in
+++ b/src/reader.conf.in
@@ -7,6 +7,7 @@
# GemCoreSIMPro2
# GemPCPinPad
# GemPCTwin (default value)
+# SEC1210 (Dual slot Reader)
# example: /dev/ttyS0:GemPCPinPad
#DEVICENAME /dev/ttySn[:reader]
#FRIENDLYNAME "GemPCTwin serial"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/CCID.git
More information about the Pcsclite-cvs-commit
mailing list