FFGPM2KSetCardType - FFGPM2KCardPowerUp - FFGPM2KCardPowerDn - FFGPM2KChkSecrCode - FFGPM2KSetSecrCode - FFGPM2KRead - FFGPM2KWrite
GemPlus GPM2K memory SmartCard commands

Prototype

Put the following prototype in the prototypes section of the application program header file:

int   ( __stdcall *pfnFFGPM2KSetCardType )( void );
int   ( __stdcall *pfnFFGPM2KCardPowerUp )( void );
int   ( __stdcall *pfnFFGPM2KCardPowerDn )( void );
int   ( __stdcall *pfnFFGPM2KChkSecrCode )( char* );
int   ( __stdcall *pfnFFGPM2KSetSecrCode )( char* );
char* ( __stdcall *pfnFFGPM2KRead )( int, int );
int   ( __stdcall *pfnFFGPM2KWrite )( int, int, char* );

Purpose

Operations with the GemPlus GPM2K memory SmartCard.

Description and use

FFGPM2KSetCardType is used to tell the GemPlus GemPC410 SmartCard reader is a GemPlus GPM2K memory SmartCard.

FFGPM2KCardPowerUp and FFGPM2KCardPowerDn are used to tell the GemPlus GemPC410 SmartCard reader to power up or power down the GemPlus GPM2K memory SmartCard.

FFGPM2KChkSecrCode is used to tell the GemPlus GemPC410 SmartCard reader to check the secred code of the inserted GemPlus GPM2K memory SmartCard.

FFGPM2KSetSecrCode is used to tell the GemPlus GemPC410 SmartCard reader to set a new secred code for the inserted GemPlus GPM2K memory SmartCard.

FFGPM2KRead is used to tell the GemPlus GemPC410 SmartCard reader to read data from the inserted GemPlus GPM2K memory SmartCard.

FFGPM2KWrite is used to tell the GemPlus GemPC410 SmartCard reader to write data to the inserted GemPlus GPM2K memory SmartCard.

Specification

GemPlus GPM2K is a simple and cheap memory SmartCard that you can use in your apps to implement special features. Please read my old
article about this topic.

Parameters
  • FFGPM2KSetCardType:
    • (no parameters)
  • FFGPM2KCardPowerUp:
    • (no parameters)
  • FFGPM2KCardPowerDn:
    • (no parameters)
  • FFGPM2KChkSecrCode:
    • CSC - card secret code: a 3 byte string
  • FFGPM2KSetSecrCode:
    • CSC - card secret code: a 3 byte string
  • FFGPM2KRead:
    • address of the 1st byte to read
    • number of bytes to read
  • FFGPM2KWrite:
    • address of the 1st byte to write
    • number of bytes to write

Return value

The status byte of the SmartCard, returned by all but one of the routines, is given in Appendix A of the GemCore V1.21-Based Reader Reference Manual, page 94, that you can easily download from the site of GemPlus. The reference manual does not say, but I am advising you here, that S=0 means that the command has been successfully completed.
  • FFGPM2KSetCardType:
    • the status byte of the SmartCard
  • FFGPM2KCardPowerUp:
    • 0: OK
    • 251: no SmartCard into reader
  • FFGPM2KCardPowerDn:
    • the status byte of the SmartCard
  • FFGPM2KChkSecrCode:
    • the status byte of the SmartCard
  • FFGPM2KSetSecrCode:
    • the status byte of the SmartCard
  • FFGPM2KRead:
    • pointer to a sequence of as many bytes as the second parameter
  • FFGPM2KWrite:
    • the status byte of the SmartCard

Application example
  • complete example where all the functions are tested; the example is carried out using a GemPlus GemPC410 SmartCard reader

See also

Notes