UpdateCredential

Adjust the use count of a given credential record

Description

UpdateCredential(recordIdx, fReset=0)

Adjust the use count of the given record

Parameters

recordIdx Record index (usually the returned value from TestCredential) 1-324
fReset If true, the record will be reset and marked invalid. If false, record will be updated.

Updates the use-count or expiration of the given record.

Return value

Returns number of remaining uses (positive) or the remaining time in minutes (negative).

Example usage

 
    new code{} = "1234"; // should be user input from e.g. a keypad 
    new idx;
 
    if( (idx = TestCredential( 0, code, cmd, p1, p2, count )) > 0 ) {
        if( cmd == 1 ) {
            // Grant access
            UpdateCredential(idx, 0);
        }
    }
 

Also see TestCredential