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
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <chipcard/chipcard.h>
#include <chipcard/client.h>
int main(int argc, char **argv)
{
fprintf(stderr, "Please insert a chip card.\n");
return 0;
}
struct LC_CARD LC_CARD
Definition: card.h:25
CHIPCARD_API void LC_Card_Dump(const LC_CARD *cd, int indent)
CHIPCARD_API LC_CLIENT_RESULT LC_Card_Open(LC_CARD *card)
CHIPCARD_API LC_CLIENT_RESULT LC_Card_Close(LC_CARD *card)
CHIPCARD_API void LC_Card_free(LC_CARD *cd)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Start(LC_CLIENT *cl)
CHIPCARD_API void LC_Client_free(LC_CLIENT *cl)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_ReleaseCard(LC_CLIENT *cl, LC_CARD *card)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_GetNextCard(LC_CLIENT *cl, LC_CARD **pCard, int timeout)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Init(LC_CLIENT *cl)
CHIPCARD_API LC_CLIENT * LC_Client_new(const char *programName, const char *programVersion)
CHIPCARD_API LC_CLIENT_RESULT LC_Client_Stop(LC_CLIENT *cl)
struct LC_CLIENT LC_CLIENT
Definition: client.h:33