libchipcard 5.1.6
memorycard.h File Reference
#include <chipcard/card.h>
Include dependency graph for memorycard.h:

Go to the source code of this file.

Functions

Extending Basic Card Object
CHIPCARD_API int LC_MemoryCard_ExtendCard (LC_CARD *card)
CHIPCARD_API int LC_MemoryCard_UnextendCard (LC_CARD *card)
Reading And Writing

Normally read-/write operations are limited to about 256 bytes, so these functions encapsulate the ISO functions to allow for transfers of an arbitrary number of bytes.

CHIPCARD_API LC_CLIENT_RESULT LC_MemoryCard_ReadBinary (LC_CARD *card, int offset, int size, GWEN_BUFFER *buf)
CHIPCARD_API LC_CLIENT_RESULT LC_MemoryCard_WriteBinary (LC_CARD *card, int offset, const char *ptr, unsigned int size)
Informational Functions
CHIPCARD_API unsigned int LC_MemoryCard_GetCapacity (const LC_CARD *card)

Function Documentation

◆ LC_MemoryCard_ExtendCard()

CHIPCARD_API int LC_MemoryCard_ExtendCard ( LC_CARD * card)

Extends a basic card type thus making functions of this group available. This stores some memory-card-related data with the given card object.

References CHIPCARD_API.

◆ LC_MemoryCard_UnextendCard()

CHIPCARD_API int LC_MemoryCard_UnextendCard ( LC_CARD * card)

Unextend a card object which has previously been extended using LC_MemoryCard_ExtendCard. This functions releases all memory-card-related ressources.

References CHIPCARD_API.

◆ LC_MemoryCard_ReadBinary()

CHIPCARD_API LC_CLIENT_RESULT LC_MemoryCard_ReadBinary ( LC_CARD * card,
int offset,
int size,
GWEN_BUFFER * buf )

Read data from the card.

Parameters
cardcard object
offsetoffset of the memory area on the card
sizenumber of bytes to read
bufGWEN_BUFFER to receive the data read

References CHIPCARD_API.

◆ LC_MemoryCard_WriteBinary()

CHIPCARD_API LC_CLIENT_RESULT LC_MemoryCard_WriteBinary ( LC_CARD * card,
int offset,
const char * ptr,
unsigned int size )

Write data to the card.

Parameters
cardcard object
offsetoffset of the memory area on the card
ptrpointer to the data to be written
sizenumber of bytes to write

References CHIPCARD_API.

◆ LC_MemoryCard_GetCapacity()

CHIPCARD_API unsigned int LC_MemoryCard_GetCapacity ( const LC_CARD * card)

Returns the capacity of the card in bytes. For some cards the capacity can not be determined, in which case this function returns 0.