Dear Opencard Forum,
I have some doubts about OCF architecture and the way to implement it.
1- In OpenCard Framework 1.1 Programmer's Guide is said (page 13):
"Thus, once an object has obtained a SlotChannel object, no other
object can gain access to the associated smart card until that
SlotChannel object has been released."
i) How can a CardService gain exclusive access to a SlotChannel
object?
ii) I have one application which interacts with 2 identical cards
(the same CardService) and 1 CardTerminal with 2 slots. I want to
send commands for both cards, but the first slot gains exclusive access
and all the commands are sent to it.
Here is the code I use:
// Command for Card in Slot1
CardRequest cr1 = new CardRequest(ReadPers.class);
SmartCard sc1 = SmartCard.waitForCard(cr1);
UrbiReadPers urpers1 = (UrbiReadPers)sc1.getCardService(ReadPers.class,
true);
lName1 = urpers1.GetName();
// Command for Card in Slot2
CardRequest cr2 = new CardRequest(ReadPers.class);
SmartCard sc2 = SmartCard.waitForCard(cr2);
UrbiReadPers urpers2 = (UrbiReadPers)sc1.getCardService(ReadPers.class,
true);
lName2 = urpers2.GetName();
Where is the problem and how can I solve it?
2- Obtaining a smartcard from a particular slot from a particular
CardTerminal:
In OpenCard Framework 1.1 Programmer's Guide is said (page 35):
"Applications may have a need for a particular card reader or slot."
i) I know the way to obtain a smartcard object from a particular
CardTerminal, but how can I specify a particular slot of that
CardTerminal?
Here is the code I use, to allocate a specific CardTerminal
to a specific CardService:
// Allocates (Sets) one CardTerminal for PersCard
Enumeration terminals =
CardTerminalRegistry.getRegistry().getCardTerminals();
CardTerminal PersTerminal = null;
while (terminals.hasMoreElements()) {
PersTerminal = (CardTerminal) terminals.nextElement();
if (PersTerminal.getType().equals (PersTerminalType)) {
break;
}
}
this.crPers = new CardRequest(ReadPers.class);
this.crPers.setCardTerminal(PersTerminal); // Allocates the
PersTerminal,
// but not
the slot
SmartCard scPers = SmartCard.waitForCard(this.crPers);
this.uCardPers = (ReadPers)scPers.getCardService(ReadPers.class, true);
If my CardTerminal has several Slots, how can I allocate a specific slot
for this CardService?
3- Concerning Factories:
i) How many CardTerminal Factories and CardService Factories can I
have at the same time in
my application? There is any limit?
ii) I don't understand the concept of Primary CardServiceFactory can
anyone explain it to me?
4- Concerning configuration with opencard.properties:
i) I'm using OCF with I.E4.0, where can I put the
file(opencard.properties) to configure the framework?
Thank you in advance for any comments.
Jorge Mendes
---
> 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/