Hi Marc,
the CardRequest-object is not "senseless". The CardRequest-object specifies
the CardService which is required for the purposes of the application. For
one card there can be many available CardServices. For instance
FileAccessCardService or SignatureCardService.
If a card is inserted, the ATR is passed to all CardServiceFactories that
are registered in the opencard.properties file. Now the factory has to
decide if the ATR specifies an available cardtype and if for this cardtype
the required CardService is available. If the card doesn't match your
requirements you can't use it for the purposes of your application and need
not to create a SmartCard object.
Nevertheless I'm also not completely happy with the current mechanism. In
my oppinion it would be helpful in some cases if I could ask for an
Enumeration of available CardServices for an inserted CardType.
Kind regards
Gunnar
>Hi,
>
>I'm trying to use SmartCard.getSmartCard to get a SmartCard reference
>when a new card is inserted (i.e. I'm doing this in cardInserted)
>
>However, many of the method signatures have been deprecated as of OCF 1.2
>and the one I am supposed to use is:
>
>getSmartCard( CardTerminalEvent, CardRequest)
>
>Now this seems really stupid to me, as I have to create a CardRequest
>object using values taken from the even I'm passing to getSmartCard! As
>far as I can see the only difference is the int value for
>ANYCARD/NEWCARD, which is all I really need to specify (the rest can be
>gleaned from the event).
>
>Does anyone know why this is?! Surely it would make sense to have:
>
>getSmartCard( CardTerminalEvent, int reqCardType)
>
>Where the value of the second parameter is CardRequest.ANYCARD or
>CardRequest.NEWCARD. This saves the hassle of creating another
>"senseless" object.
>
>Oh well...
>
>Cheers
>
>
>
>
>---
> > 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.
---
> 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.