Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

CTCommand Class Reference
[This and That]

Describes a APDU (command for a chip card). More...

#include <ctcommand.h>

List of all members.

Public Member Functions

unsigned char cla () const
void setCla (unsigned char c)
unsigned char ins () const
 command (depends on your chip card)
void setIns (unsigned char c)
unsigned char p1 () const
 some commands have parameters which are stored in p1 and p2.
void setP1 (unsigned char c)
unsigned char p2 () const
 some commands have parameters which are stored in p1 and p2.
void setP2 (unsigned char c)
const string & data () const
 data to be send and data received, respectively. Please note that this field gets overwritten upon transmission to the chip card or terminal.
void setData (const string &s)
void setData (const char *p, unsigned int s)
void setData (char c)
void setData (unsigned char c)
void addData (const string &s)
void addData (char c)
void addData (unsigned char c)
unsigned short lr () const
 expected maxmimum length of card's answer. This field is somewhat tricky. The reason is, that this field MAY occur, it may have a valid value and/or it may have the value 0 for CTAPI. To reflect this I gave this field special handling for some values: -0 means that no answer from the card is expected -1-255 tell the precise number of bytes expected -256 or higher mean: no limit (256 or more bytes)
void setLr (unsigned short s)
unsigned char sw1 () const
 general processing status
void setSw1 (unsigned char c)
unsigned char sw2 () const
 processing qualifier
void setSw2 (unsigned char c)
 CTCommand ()
 ~CTCommand ()
string toString ()


Detailed Description

Describes a APDU (command for a chip card).

This is the command struct for an iso command.

Author:
Martin Preuss<martin@libchipcard.de>


Constructor & Destructor Documentation

CTCommand::CTCommand  ) 
 

CTCommand::~CTCommand  ) 
 


Member Function Documentation

void CTCommand::addData unsigned char  c  )  [inline]
 

void CTCommand::addData char  c  )  [inline]
 

void CTCommand::addData const string &  s  )  [inline]
 

unsigned char CTCommand::cla  )  const [inline]
 

command class 0x20 for terminal, 0x00 for card. some cards may define other classes, so have a look at the documentation for the card you want to write classes for

const string& CTCommand::data  )  const [inline]
 

data to be send and data received, respectively. Please note that this field gets overwritten upon transmission to the chip card or terminal.

unsigned char CTCommand::ins  )  const [inline]
 

command (depends on your chip card)

unsigned short CTCommand::lr  )  const [inline]
 

expected maxmimum length of card's answer. This field is somewhat tricky. The reason is, that this field MAY occur, it may have a valid value and/or it may have the value 0 for CTAPI. To reflect this I gave this field special handling for some values: -0 means that no answer from the card is expected -1-255 tell the precise number of bytes expected -256 or higher mean: no limit (256 or more bytes)

unsigned char CTCommand::p1  )  const [inline]
 

some commands have parameters which are stored in p1 and p2.

unsigned char CTCommand::p2  )  const [inline]
 

some commands have parameters which are stored in p1 and p2.

void CTCommand::setCla unsigned char  c  )  [inline]
 

void CTCommand::setData unsigned char  c  )  [inline]
 

void CTCommand::setData char  c  )  [inline]
 

void CTCommand::setData const char *  p,
unsigned int  s
[inline]
 

void CTCommand::setData const string &  s  )  [inline]
 

void CTCommand::setIns unsigned char  c  )  [inline]
 

void CTCommand::setLr unsigned short  s  )  [inline]
 

void CTCommand::setP1 unsigned char  c  )  [inline]
 

void CTCommand::setP2 unsigned char  c  )  [inline]
 

void CTCommand::setSw1 unsigned char  c  )  [inline]
 

void CTCommand::setSw2 unsigned char  c  )  [inline]
 

unsigned char CTCommand::sw1  )  const [inline]
 

general processing status

All commands return a two byte result code, if they were processed by the card. The first one is here.

unsigned char CTCommand::sw2  )  const [inline]
 

processing qualifier

All commands return a two byte result code, if they were processed by the card. This is the second one (processing qualifier, tells you more precise about the result)

string CTCommand::toString  ) 
 

Creates an APDU from this command object.


The documentation for this class was generated from the following file:
Generated on Fri Dec 3 23:10:25 2004 for libchipcard by  doxygen 1.3.9.1