Overview
[Tutorial 1 (Basic Usage of Libchipcard2)]

Collaboration diagram for Overview:

This is a small tutorial on how to use the basic functions of libchipcard2. It just waits for a card to be inserted and prints some card's information. This is the most basic type of application using a chipcard, no error checking is performed.

This tutorial is intended to show the basics only. After studying this tutorial you should advance to the next one, which will explain all the methods used.

Usage: tutorial1a

/***************************************************************************
 $RCSfile$
                             -------------------
    cvs         : $Id$
    begin       : Mon Mar 01 2004
    copyright   : (C) 2004 by Martin Preuss
    email       : martin@libchipcard.de

 ***************************************************************************
 *          Please see toplevel file COPYING for license details           *
 ***************************************************************************/


#ifdef HAVE_CONFIG_H
# include <config.h>
#endif


/* You always need to include the header files of Libchipcard2 to work with
 * it ;-)
 */
#include <chipcard/chipcard.h>
#include <chipcard/client/client.h>


int main(int argc, char **argv) {
  LC_CLIENT *cl;
  LC_CARD *card;

  cl=LC_Client_new("tutorial1a", "1.0");
  LC_Client_Init(cl);

  LC_Client_Start(cl);

  fprintf(stderr, "Please insert a chip card.\n");
  LC_Client_GetNextCard(cl, &card, 30);

  LC_Client_Stop(cl);

  LC_Card_Open(card);

  LC_Card_Dump(card, stderr, 0);

  LC_Card_Close(card);
  LC_Client_ReleaseCard(cl, card);
  LC_Card_free(card);

  LC_Client_free(cl);
  return 0;
}




Generated on Mon Jul 5 23:17:17 2010 for libchipcard by  doxygen 1.6.3