[Pcsclite-git-commit] [CCID] 01/03: PowerOn: move from 1.8V to 5V if 1.8V is not supported
Ludovic Rousseau
rousseau at moszumanska.debian.org
Tue Oct 4 15:35:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
rousseau pushed a commit to branch master
in repository CCID.
commit a0815cfa7b70d96ae4b793285b92b70f2b95a487
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date: Tue Oct 4 14:56:45 2016 +0200
PowerOn: move from 1.8V to 5V if 1.8V is not supported
If the reader does not support 1.8V we do not move to auto but to 5V and
check that 5V is supported by the reader.
The reader may not support Automatic Voltage Selection and may not
support 1.8V either.
---
src/commands.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/commands.c b/src/commands.c
index fbca893..3d171f3 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -197,6 +197,7 @@ RESPONSECODE CmdPowerOn(unsigned int reader_index, unsigned int * nlength,
{
int bVoltageSupport = ccid_descriptor->bVoltageSupport;
+check_again:
if ((1 == voltage) && !(bVoltageSupport & 1))
{
DEBUG_INFO1("5V requested but not support by reader");
@@ -212,7 +213,8 @@ RESPONSECODE CmdPowerOn(unsigned int reader_index, unsigned int * nlength,
if ((3 == voltage) && !(bVoltageSupport & 4))
{
DEBUG_INFO1("1.8V requested but not support by reader");
- voltage = 0; /* auto */
+ voltage = 1; /* 5V */
+ goto check_again;
}
}
--
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