Hi everybody.

I use OpenCard Framework 1.2, GemXpresso RAD211 and a GCR410 card reader.
I work under Win NT4.

My main class implements CTListener. Then I have cardInserted(CardTerminal 
ct) and cardRemoved(CardTerminal ct) methods.
My program launch firstly initOCF method :

public void initOCF() throws Exception
  {
    SmartCard.start();
    terminal = 
CardTerminalRegistry.getRegistry().cardTerminalForName(target);
    CardTerminalRegistry.getRegistry().addCTListener(this);
    if(terminal == null)
      throw new IOException("Reader not found : " + target);
  }

Then, if I insert a card, cardInserted method will be executed, and if I 
remove the card, cardRemoved method will de executed.

public void cardInserted(CardTerminalEvent ctEvent)
  {
    try
    {
      System.out.println("card inserted");

      cr = new CardRequest();
      cr.setCardTerminal(terminal);

      sc = SmartCard.getSmartCard(ctEvent, cr);
      serv = (CardServiceVOPCardManager)sc.getCardService(CardServiceVOP  
CardManager.class, true);

      libService = new GemXpressoService();
      libService.setCardService(serv);

      SelectResult selectResult = serv.select(aid);
      if(!((selectResult!=null)&&(selectResult.isOK())))
      {
        System.out.println("that card don't have the applet");
      }
      else
      {
        System.out.println("Good card");
      }
    }
    catch(Exception e)
    {
      System.out.println(e.getMessage());
    }
}

My problem is that if I don't put the card in the good side in the reader , 
I will receive an exception launch by "SmartCard.getSmartCard(ctEvent, 
cr);", and then no cardInserted method will be called after. It is the same 
problem if I call initOCF after the exception.

The message of the exception is :
opencard.core.terminal.CardTerminalException : 
com.gemplus.opencard.terminal.GemcoreFamilyException : Buffer received : 
<<A2>>


Can anybody help me please ?
Thanks in advance.

Franck



---
> 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