User Manual

47
icdev: Value of Device Handle.
fileNo: File ID
value: the gotten value
sessionKey: session key
Return Value
0 if successful; otherwise, Nonzero. Reference Table 1.11
Example
int st;
unsigned int value;
st= fw_getvalue_desfire (icdev,0x02,&value,sesskey); / *sesskey means the session
key obtained by verifying key */
int fw_credit_desfire(int icdev,unsigned char fileNo,unsigned int
value,char*sessionKey);
Description
increment
Parameters
icdev: Value of Device Handle.
fileNo: File ID
value: the value to be increased
sessionKey: session key
Return Value
0 if successful; otherwise, Nonzero. Reference Table 1.11
Example
int st;
unsigned int value=100;/*set value=100*/
st= fw_credit_desfire (icdev,0x02,value,sesskey); / *sesskey means the session key
obtained by verifying key */
Remark
After this function called successfully, you must also call the function
fw_commitTransfer_desfire to make the operation into effect
int fw_debit_desfire(int icdev,unsigned char fileNo,unsigned int
value,char* sessionKey);
Description
decrement
Parameters
icdev: Value of Device Handle.
fileNo: File ID
value: the gotten value
sessionKey: session key
Return Value
0 if successful; otherwise, Nonzero. Reference Table 1.11
Example
int st;
unsigned int value=100;/*set the value to 100*/