Sorry if I have posted this before but I�m having trouble posting to the
site.
I�m a veteran PC/SC programmer and I�ve written CardServices for the
Datakey 330 card.
My code worked fine with my current USB reader (reader type doesn�t
matter) then I installed a 2nd USB reader and I received the error
below.
This error also shows up if you only have 1 installed USB reader but
remove it before running OpenCard. � Please confirm this with your code
!!!!!
------------------------------------------------------------------------
------------
Pcsc10CardTerminal: PCSC Exception in method SCardGetStatusChange: error
executing SCardGetStatusChange
return code = 8010002e
I found the reference to the error code in: Microsoft
Embedded\wce300\Pocket PC 2002\include\WINERROR.H
Don�t ask me why it was in that compiler and not Visual C++ 5.0�s.
Anyway, it�s the SCARD_E_NO_READERS_AVAILABLE error.
Why?, here�s why:
In line 133 of class:
opencard.core.event.EventGenerator()
there is the following method:
public void createEventsForPresentCards(CTListener ctListener)
throws CardTerminalException {
Enumeration e =
CardTerminalRegistry.getRegistry().getCardTerminals();
while (e.hasMoreElements()) {
CardTerminal ct = (CardTerminal)e.nextElement();
int slots = ct.getSlots();
for (int i=0; i<slots; i++) {
if (ct.isCardPresent(i)) {
ctListener.cardInserted(new CardTerminalEvent(ct,
CardTerminalEvent.CARD_INSERTED, i));
}
}
}
}
This method gets the list of readers to search through from the system
registry. That�s incorrect because not all of those registered readers
will be plugged into the computer at that time.
This method should get the list of readers from PC/SC�s
SCardListReaders() which returns the CURRENTLY PLUGGED IN
READERS!!!!!!!!!.
As soon as ct.getSlots() is called on a reader that is not plugged into
the system you get the error.
Why doesn't everyone get this error?
Because it depends on how far down the list of readers it gets before it
hits one that�s not really plugged into the computer. If you've only
installed one reader, you won't get this error.
Windows OS comes with 4 virtual readers installed that are always
�connected�. Then there�s your intended USB reader (installed and
plugged in) and then, say, one more USB reader installed but not plugged
into the computer at that time.
If this method tries your intended (and plugged in) reader before trying
the not-plugged in reader then the error will not show up. But it�s
really luck of the draw.
In essence, if two USB readers are installed then only the 1st one
listed in the registry will work.
Even if your application seems to work fine now, it might fail when a
2nd USB reader is installed in the user�s machine. (depending on where
is falls in the registry) This could also be the cause of other errors
when retrieving reader information such as how many readers and their
names, ect.
Please confirm.
-Alan
Alan Kozlay� Software/Hardware Engineer
Biometric Associates, Inc.
[EMAIL PROTECTED]
www.biometricassociates.com
9475 Deerco Rd. Suite 410
Lutherville, MD 21093
(410) 252-7210 desk
(410) 252-7214 fax
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.