Check if a credential record is valid

Description

TestCredential(userID, const code[], &cmd=0, &param1=0, &param2=0, &count=0)

Search the credential database for the userID/code and returns the status.

Parameters

userID 32-bit user id. 0=search all records.
code Scancode to search for (up to 10 characters)
cmd 8-bit command code associated with the matching record
param1 16-bit application defined parameter associated with the matching record
param2 16-bit application defined parameter associated with the matching record
count 0=code is disabled, >0 = number of allowed uses remaining, <0=minutes left of use

The ezeio has a database of up to 324 credential records. The database can only be updated via API at this time.
The TestCredential command will search the database for matches, and return the record id (1-324) if found.
Each record can be set to be valid in a specific time range, on specific weekdays and/or have a limited use-count or lifetime after first use.
See the scancode API call for more details.

Return value

Returns the record ID (1-324) if there was a valid match, otherwise 0.

Example usage

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

Also see UpdateCredential

  • ezeio2/scriptref/testcredential.txt
  • Last modified: 2026-12-02 16:51
  • by andreh