It is easier!

SmartCard sc;
ResponseAPDU rapdu;
PassThruCardService ptcs;
byte[] b, b2;

SmartCard.start();
SmartCard sc = SmartCard.waitForCard(new
CardRequest(PassThruCardService.class));
ptcs=(PassThruCardService)sc.getCardService(PassThruCardService.class, true);
rapdu=ptcs.sendCommandAPDU(new CommandAPDU(b));
rapdu=ptcs.sendCommandAPDU(new CommandAPDU(b2));
// etc...

Read the OCF docs, please.

Jes�s Pa�l


Jes�s Penuela Melero wrote:

> Hello,
> When I call to openSlotChannel() I always obtain the exception: "SlotChannel
> already allocated".
> I have obtained  the CardTerminal from the CardTerminalRegistry , and what I
> want is to send an APDU to the smartcard.
> How can I access this SlotChannel?
>
> What I did, is the following:
> I started by SmartCard.start(),
> then I used the WaitForCard() ,
> after that ,I obtained the CardTerminal object from the Registry as I
> explained before
> and finally I called to  ct.sendAPDU(ct.openSlotChannel(0),capdu);
>
> Thanks in advance
>
> ---
> > 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.

Reply via email to