NAME
DesfireAPI :: Value file related functions
COPYRIGHT
(c) 2009 SpringCard - www.springcard.com
DESCRIPTION
Implementation of DESFIRE functions to handle value files (counters).
NAME
Credit
DESCRIPTION
Allows to increase a value stored in a Value File.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_Credit(BYTE file_id, BYTE comm_mode, LONG amount); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_Credit(SPROX_INSTANCE rInst, BYTE file_id, BYTE comm_mode, LONG amount); [[pcsc_desfire.dll]] LONG SCardDesfire_Credit(SCARDHANDLE hCard, BYTE file_id, BYTE comm_mode, LONG amount);
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) LONG amount : amount to increase to the current value stored in the file. Only positive values allowed.
RETURNS
DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.
NOTES
The Credit command requires Authentication with the key specified for "Read&Write" access.
SEE ALSO
Credit2
NAME
Credit2
DESCRIPTION
Allows to increase a value stored in a Value File.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_Credit2(BYTE file_id, LONG amount); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_Credit2(SPROX_INSTANCE rInst, BYTE file_id, LONG amount); [[pcsc_desfire.dll]] LONG SCardDesfire_Credit2(SCARDHANDLE hCard, BYTE file_id, LONG amount);
INPUTS
BYTE file_id : File IDentifier LONG amount : amount to increase to the current value stored in the file. Only positive values allowed.
RETURNS
DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.
NOTES
The Credit command requires Authentication with the key specified for "Read&Write" access.
SEE ALSO
Credit
NAME
Debit
DESCRIPTION
Allows to decrease a value stored in a Value File.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_Debit(BYTE file_id, BYTE comm_mode, LONG amount); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_Debit(SPROX_INSTANCE rInst, BYTE file_id, BYTE comm_mode, LONG amount); [[pcsc_desfire.dll]] LONG SCardDesfire_Debit(SCARDHANDLE hCard, BYTE file_id, BYTE comm_mode, LONG amount);
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) LONG amount : amount to decrease to the current value stored in the file. Only positive values allowed.
RETURNS
DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.
NOTES
The Credit command requires Authentication with the key specified for "Read", "Write" ord "Read&Write" access.
SEE ALSO
Debit2
NAME
Debit2
DESCRIPTION
Allows to decrease a value stored in a Value File.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_Debit2(BYTE file_id, LONG amount); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_Debit2(SPROX_INSTANCE rInst, BYTE file_id, LONG amount); [[pcsc_desfire.dll]] LONG SCardDesfire_Debit2(SCARDHANDLE hCard, BYTE file_id, LONG amount);
INPUTS
BYTE file_id : File IDentifier LONG amount : amount to decrease to the current value stored in the file. Only positive values allowed.
RETURNS
DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.
NOTES
The Credit command requires Authentication with the key specified for "Read", "Write" ord "Read&Write" access.
SEE ALSO
Debit
NAME
GetValue
DESCRIPTION
Allows to read current stored value from Value Files
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_GetValue(BYTE file_id, BYTE comm_mode, LONG *value); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_GetValue(SPROX_INSTANCE rInst, BYTE file_id, BYTE comm_mode, LONG *value); [[pcsc_desfire.dll]] LONG SCardDesfire_GetValue(SCARDHANDLE hCard, BYTE file_id, BYTE comm_mode, LONG *value);
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) LONG *value : pointer to receive current value
RETURNS
DF_OPERATION_OK : success, value has been read Other code if internal or communication error has occured.
SEE ALSO
GetValue2
NAME
GetValue2
DESCRIPTION
Allows to read current stored value from Value Files
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_GetValue2(BYTE file_id, LONG *value); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_GetValue2(SPROX_INSTANCE rInst, BYTE file_id, LONG *value); [[pcsc_desfire.dll]] LONG SCardDesfire_GetValue2(SCARDHANDLE hCard, BYTE file_id, LONG *value);
INPUTS
BYTE file_id : File IDentifier LONG *value : pointer to receive current value
RETURNS
DF_OPERATION_OK : success, value has been read Other code if internal or communication error has occured.
SEE ALSO
GetValue
NAME
LimitedCredit
DESCRIPTION
Allows a limited increase of a value stored in a Value File without having full Read&Write permissions to the file. This feature can be enabled or disabled during value file creation.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_LimitedCredit(BYTE file_id, BYTE comm_mode, LONG amount); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_LimitedCredit(SPROX_INSTANCE rInst, BYTE file_id, BYTE comm_mode, LONG amount); [[pcsc_desfire.dll]] LONG SCardDesfire_LimitedCredit(SCARDHANDLE hCard, BYTE file_id, BYTE comm_mode, LONG amount);
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) LONG amount : amount to increase to the current value stored in the file. Only positive values allowed.
RETURNS
DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.
SEE ALSO
LimitedCredit2
NAME
LimitedCredit2
DESCRIPTION
Allows a limited increase of a value stored in a Value File without having full Read&Write permissions to the file. This feature can be enabled or disabled during value file creation.
SYNOPSIS
[[sprox_desfire.dll]] SWORD SPROX_Desfire_LimitedCredit2(BYTE file_id, LONG amount); [[sprox_desfire_ex.dll]] SWORD SPROXx_Desfire_LimitedCredit2(SPROX_INSTANCE rInst, BYTE file_id, LONG amount); [[pcsc_desfire.dll]] LONG SCardDesfire_LimitedCredit2(SCARDHANDLE hCard, BYTE file_id, LONG amount);
INPUTS
BYTE file_id : File IDentifier LONG amount : amount to increase to the current value stored in the file. Only positive values allowed.
RETURNS
DF_OPERATION_OK : success, data has been written Other code if internal or communication error has occured.
SEE ALSO
LimitedCredit