TABLE OF CONTENTS

 

[Modules] Records

NAME

   DesfireAPI :: Linear or cyclic file related functions

COPYRIGHT

DESCRIPTION

   Implementation of DESFIRE functions to handle structured files.

[Functions] ClearRecordFile

NAME

   Desfire_ClearRecordFile

DESCRIPTION

   Allows to reset a Cyclic or Linear Record File to the empty state

SYNOPSIS

   [[sprox_desfire.dll]]
   SWORD SPROX_Desfire_ClearRecordFile(BYTE file_id);

   [[sprox_desfire_ex.dll]]
   SWORD SPROXx_Desfire_ClearRecordFile(SPROX_INSTANCE rInst,
                                     BYTE file_id);

   [[pcsc_desfire.dll]]
   LONG  SCardDesfire_ClearRecordFile(SCARDHANDLE hCard,
                                     BYTE file_id);

INPUTS

   BYTE file_id      : File IDentifier

RETURNS

   DF_OPERATION_OK   : success, data has been written
   Other code if internal or communication error has occured. 

NOTES

   Full "Read&Write" permission on the file is necessary for executing this command

[Functions] ReadRecords

NAME

   ReadRecords

DESCRIPTION

   Allows to read data out a set of complete records from a Cyclic or Linear Record File.

SYNOPSIS

   [[sprox_desfire.dll]]
   SWORD SPROX_Desfire_ReadRecords(BYTE file_id,
                                   BYTE comm_mode,
                                   DWORD from_record,
                                   DWORD max_record_count,
                                   DWORD record_size,
                                   BYTE data[],
                                   DWORD *record_count);

   [[sprox_desfire_ex.dll]]
   SWORD SPROXx_Desfire_ReadRecords(SPROX_INSTANCE rInst,
                                    BYTE file_id,
                                    BYTE comm_mode,
                                    DWORD from_record,
                                    DWORD max_record_count,
                                    DWORD record_size,
                                    BYTE data[],
                                    DWORD *record_count);

   [[pcsc_desfire.dll]]
   LONG  SCardDesfire_ReadRecords(SCARDHANDLE hCard,
                                  BYTE file_id,
                                  BYTE comm_mode,
                                  DWORD from_record,
                                  DWORD max_record_count,
                                  DWORD record_size,
                                  BYTE data[],
                                  DWORD *record_count);

INPUTS

   BYTE file_id           : File IDentifier
   BYTE comm_mode         : file's communication settings (DF_COMM_MODE_PLAIN, DF_COMM_MODE_MACED, 
                            DF_COMM_MODE_PLAIN2 or DF_COMM_MODE_ENCIPHERED)(see chapter 3.2 of 
                            datasheet of mifare DesFire MF3ICD40 for more information)
   DWORD from_record      : offset of the newest record to read. Set to 0 for latest record
   DWORD max_record_count : number of records to be read from the PICC. Set to 0 to read all records.
   DWORD record_size      : size of the record in bytes
   BYTE data[]            : buffer to receive the data
   DWORD *record_count    : actual number of records read

RETURNS

   DF_OPERATION_OK        : success, data has been read
   Other code if internal or communication error has occured. 

SEE ALSO

   ReadRecords2

[Functions] ReadRecords2

NAME

   ReadRecords2

DESCRIPTION

   Allows to read data out a set of complete records from a Cyclic or Linear Record File.

SYNOPSIS

   [[sprox_desfire.dll]]
   SWORD SPROX_Desfire_ReadRecords2(BYTE file_id,
                                    DWORD from_record,
                                    DWORD max_record_count,
                                    DWORD record_size,
                                    BYTE data[],
                                    DWORD *record_count);

   [[sprox_desfire_ex.dll]]
   SWORD SPROXx_Desfire_ReadRecords2(SPROX_INSTANCE rInst,
                                     BYTE file_id,
                                     DWORD from_record,
                                     DWORD max_record_count,
                                     DWORD record_size,
                                     BYTE data[],
                                     DWORD *record_count);

   [[pcsc_desfire.dll]]
   LONG  SCardDesfire_ReadRecords2(SCARDHANDLE hCard,
                                   BYTE file_id,
                                   BYTE comm_mode,
                                   DWORD from_record,
                                   DWORD max_record_count,
                                   DWORD record_size,
                                   BYTE data[],
                                   DWORD *record_count);

INPUTS

   BYTE file_id           : File IDentifier
   DWORD from_record      : offset of the newest record to read. Set to 0 for latest record
   DWORD max_record_count : number of records to be read from the PICC. Set to 0 to read all records.
   DWORD record_size      : size of the record in bytes
   BYTE data[]            : buffer to receive the data
   DWORD *record_count    : actual number of records read

RETURNS

   DF_OPERATION_OK        : success, data has been read
   Other code if internal or communication error has occured. 

SEE ALSO

   ReadRecords

[Functions] WriteRecord

NAME

   WriteRecord

DESCRIPTION

   Allows to write data to a record in a Cyclic or Linear Record File.

SYNOPSIS

   [[sprox_desfire.dll]]
   SWORD SPROX_Desfire_WriteRecord(BYTE file_id,
                                     BYTE comm_mode,
                                     DWORD from_offset,
                                     DWORD size,
                                     const BYTE data[]);

   [[sprox_desfire_ex.dll]]
   SWORD SPROXx_Desfire_WriteRecord(SPROX_INSTANCE rInst,
                                     BYTE file_id,
                                     BYTE comm_mode,
                                     DWORD from_offset,
                                     DWORD size,
                                     const BYTE data[]);

   [[pcsc_desfire.dll]]
   LONG  SCardDesfire_WriteRecord(SCARDHANDLE hCard,
                                     BYTE file_id,
                                     BYTE comm_mode,
                                     DWORD from_offset,
                                     DWORD size,
                                     const BYTE data[]); 

INPUTS

   BYTE file_id      : File IDentifier
   BYTE comm_mode    : file's communication settings (DF_COMM_MODE_PLAIN, DF_COMM_MODE_MACED, 
                       DF_COMM_MODE_PLAIN2 or DF_COMM_MODE_ENCIPHERED)(see chapter 3.2 of 
                       datasheet of mifare DesFire MF3ICD40 for more information)
   DWORD from_offset : offset within one single record in bytes
   DWORD size        : size data to be written in bytes
   BYTE data[]       : buffer containing the data to write

RETURNS

   DF_OPERATION_OK   : success, data has been written
   Other code if internal or communication error has occured. 

SEE ALSO

   WriteRecord2

[Functions] WriteRecord2

NAME

   WriteRecord2

DESCRIPTION

   Allows to write data to a record in a Cyclic or Linear Record File.

SYNOPSIS

   [[sprox_desfire.dll]]
   SWORD SPROX_Desfire_WriteRecord2(BYTE file_id,
                                     DWORD from_offset,
                                     DWORD size,
                                     const BYTE data[]);

   [[sprox_desfire_ex.dll]]
   SWORD SPROXx_Desfire_WriteRecord2(SPROX_INSTANCE rInst,
                                     BYTE file_id,
                                     DWORD from_offset,
                                     DWORD size,
                                     const BYTE data[]);

   [[pcsc_desfire.dll]]
   LONG  SCardDesfire_WriteRecord2(SCARDHANDLE hCard,
                                     BYTE file_id,
                                     DWORD from_offset,
                                     DWORD size,
                                     const BYTE data[]); 

INPUTS

   BYTE file_id      : File IDentifier
   DWORD from_offset : offset within one single record in bytes
   DWORD size        : size data to be written in bytes
   BYTE data[]       : buffer containing the data to write

RETURNS

   DF_OPERATION_OK   : success, data has been written
   Other code if internal or communication error has occured. 

SEE ALSO

   WriteRecord

Generated from sprox_desfire_records.c on Mon Jan 30 14:25:27 2012