Standalone SDK API Doc  V1.0.4
Functions
3.04.Data-ShortKey.h File Reference

Detailed Description

Author
http://www.zkteco.com
Date
2017-10-01
copyright:
Copyright 2017 ZKTECO CO., LTD. All Rights Reserved.
Note

Functions

VARIANT_BOOL SSR_SetShortkey (LONG ShortKeyID, LONG ShortKeyFun, LONG StateCode, BSTR StateName, LONG StateAutoChange, BSTR StateAutoChangeTime)
 
VARIANT_BOOL SSR_GetShortkey (LONG ShortKeyID, LONG *ShortKeyFun, LONG *StateCode, BSTR *StateName, LONG *AutoChange, BSTR *AutoChangeTime)
 
VARIANT_BOOL EnableCustomizeAttState (LONG dwMachineNumber, LONG StateID, LONG Enable)
 
VARIANT_BOOL SetCustomizeAttState (LONG dwMachineNumber, LONG StateID, LONG NewStatel)
 
VARIANT_BOOL DelCustomizeAttState (LONG dwMachineNumber, LONG StateID)
 
VARIANT_BOOL GetAllSFIDName (LONG dwMachineNumber, BSTR *ShortkeyIDName, LONG BufferSize1, BSTR *FunctionIDName, LONG BufferSize2)
 
VARIANT_BOOL GetShortkey (LONG dwMachineNumber, LONG ShortKeyID, BSTR *ShortKeyName, BSTR *FunctionName, LONG *ShortKeyFun, LONG *StateCode, BSTR *StateName, BSTR *Description, LONG *AutoChange, BSTR *AutoChangeTime)
 
VARIANT_BOOL SetShortkey (LONG dwMachineNumber, LONG ShortKeyID, BSTR ShortKeyName, BSTR FunctionName, LONG ShortKeyFun, LONG StateCode, BSTR StateName, BSTR Description, LONG StateAutoChange, BSTR StateAutoChangeTime)
 

Function Documentation

◆ SSR_SetShortkey()

VARIANT_BOOL SSR_SetShortkey ( LONG  ShortKeyID,
LONG  ShortKeyFun,
LONG  StateCode,
BSTR  StateName,
LONG  StateAutoChange,
BSTR  StateAutoChangeTime 
)

To set a functional key. It is similar to the functional key definition function on the color-screen machine.

Parameters
Parameter description:
name type param direction description of param
ShortKeyID LONG [in] Key ID
ShortKeyFun LONG [in] Function of the key
StateCode LONG [in] State code of the status key
StateName BSTR [in] Name of the status key
StateAutoChange LONG [in] Auxiliary
StateAutoChangeTimeBSTR [in] Auxiliary
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
1. ShortKeyID: specifies the ID of the key. The mapping is as follows: F1 ? 1, F2 ? 2, F3 ? 3 ...
  1. ShortKeyFun: function of the specified key. The value 0 indicates that the function of the key is not defined, 1 indicates that the specified key is a status key, 2 indicates the work code of the key, and 3 indicates viewing the short message. Note: the value of ShortKeyFun will influence settings of the following four parameters. Please refer to the below instructions.
  2. StateCode: To set state code of specified status key. If the specified key is not a status key (namely, the value of ShortKeyFun is not 1), the value of StateCode will be ignored. If the specified key is a status key (ShortKeyFun=1), the state code of the specified status key is determined by the StateCode value, which ranges from 0 to 255.The state code of status key cannot be repeatedly, if the state code of different status key is set as the same, invoking of StateCode will fail. Such as F2 is a status key and the state code is 2; while you invoke StateCode Fun to set F3 as a status key and set its state code as 2, the invoking will fail.
  3. StateName: To set name of status key. If the specified key is not a status key (namely, the value of ShortKeyFun is not 1), the value of StateName will be ignored. If the specified key is a status key (ShortKeyFun=1), the name of specified status key will be determined by the StateName value. At most, 18 characters are supported.
  4. StateAutoChange: If the specified key is not a status key (namely, the value of ShortKeyFun is not 1), the value of StateAutoChange will be ignored. If the specified key is a status key (ShortKeyFun=1), the value of StateAutoChange indicates whether the status key automatically changes. 0: disable, 1: enable.
  5. StateAutoChangeTime: If the specified key is not a status key (namely, the value of ShortKeyFun is not 1), the value of StateAutoChangeTime will be ignored. If the specified key is a status key (ShortKeyFun=1), the automatic change time of the status key is set by the return value of StateAutoChangeTime. Requirements as below: 1) "08:30;09:00;08:00;12:00;11:12;00:00;00:00;". 2) Hour and minute are separated with ":",Dates are separated with ";",space is not allowed between them. 3) Everyday's automatic change time shall be specified(one whole week is a cycle), reaches which the attendance state will change to specified state automatically (the name of automatic change state is decided by StateName, value is defined by the return value of StateCode). If someday needs not to change attendance state automatically, set hour and minute of the StateAutoChangeTime as zero.

◆ SSR_GetShortkey()

VARIANT_BOOL SSR_GetShortkey ( LONG  ShortKeyID,
LONG *  ShortKeyFun,
LONG *  StateCode,
BSTR *  StateName,
LONG *  AutoChange,
BSTR *  AutoChangeTime 
)

To query the settings of a functional key.

Parameters
Parameter description:
name type param direction description of param
ShortKeyID LONG [in] Key ID
ShortKeyFun LONG* [out] Function of the key
StateCode LONG* [out] State code of the status key
StateName BSTR* [out] Name of the status key
AutoChange LONG* [out] Whether the status key automatically changes
AutoChangeTime BSTR* [out] Automatic change time of the status key
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
1. ShortKeyID: specifies the ID of the key. The mapping is as follows: F1 ? 1, F2 ? 2, F3 ? 3 ...
  1. ShortKeyFun: function of the specified key. The value 0 indicates that the function of the key is not defined, 1 indicates that the specified key is a status key, 2 indicates the work code of the key, and 3 indicates viewing the short message.
  2. StateCode: If the specified key is a status key (ShortKeyFun=1), the state code of the status key is returned. Otherwise, 0 is returned.
  3. StateName: If the specified key is a status key (ShortKeyFun=1), the name of the status key is returned. Otherwise, a blank character string is returned.
  4. AutoChange: If the specified key is a status key (ShortKeyFun=1), the value of this parameter indicates whether the status key automatically changes. Otherwise, 0 is returned.
  5. AutoChangeTime: If the specified key is a status key (ShortKeyFun=1), the automatic change time of the status key is returned, in the format of a character string. Otherwise, a blank character string is returned.
Note
Applicable to TFT

◆ EnableCustomizeAttState()

VARIANT_BOOL EnableCustomizeAttState ( LONG  dwMachineNumber,
LONG  StateID,
LONG  Enable 
)

To specify whether to enable a customized attendance status value.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
StateID LONG [in] Attendance status value to be defined
Enable LONG [in] Whether to enable the attendance status definition function for the attendance status value specified by StateID
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
1. This function is a customization function. To use this function, the extension function must be enabled for the machine and the machine must support the attendance status definition function.
  1. Attendance status definition function: The mapping between the attendance status values and the states are as follows:
    If this function is enabled, you can invoke SetCustomizeAttState to change the status value of a state: 0!Check-In 1!Check-Out 2!Break-Out 3!Break-In 4!OT-In 5!OT-Out
    For example, EnableCustomizeAttState(1,0,1)// indicates enabling the customized state of 0 (check-in)
    SetCustomizeAttState(1,0,8)// indicates setting the customized status value to 8 for the status value 0 (check-in)
    If a user chooses check-in on the machine and passes verification, the saved attendance status value is 8.
Note
Applicable to BW

◆ SetCustomizeAttState()

VARIANT_BOOL SetCustomizeAttState ( LONG  dwMachineNumber,
LONG  StateID,
LONG  NewStatel 
)

To set a customized attendance status value based on the original attendance status value.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
StateID LONG [in] Original status value
NewStatel LONG [in] New status value
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
This function is a customization function. To use this function, the extension function must be enabled for the machine and the machine must support the attendance status definition function. For details, see the description of EnableCustomizeAttState.
Note
Applicable to BW

◆ DelCustomizeAttState()

VARIANT_BOOL DelCustomizeAttState ( LONG  dwMachineNumber,
LONG  StateID 
)

To delete the customized attendance status value of an original attendance status value.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
StateID LONG [in] Original attendance status value of which the customized attendance value is to be deleted
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
This function is a customization function. To use this function, the extension function must be enabled for the machine and the machine must support the attendance status definition function. For details, see the description of EnableCustomizeAttState.
Note
Applicable to BW

◆ GetAllSFIDName()

VARIANT_BOOL GetAllSFIDName ( LONG  dwMachineNumber,
BSTR *  ShortkeyIDName,
LONG  BufferSize1,
BSTR *  FunctionIDName,
LONG  BufferSize2 
)

To query the shortcut key name and function lists.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
ShortkeyIDName BSTR* [out] List of shortcut key IDs and names
BufferSize1 LONG [in] Size of the buffer for storing the list of shortcut key IDs and names
FunctionIDName BSTR* [out] List of function IDs and names
BufferSize2 LONG [in] Size of the buffer for storing the list of function IDs and names
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
1. ShortkeyIDName: specifies the list of shortcut key IDs and names, in the format of "ID,Key_Name\r\n1,F1\r\n2,F2...".
  1. FunctionIDName: specifies the list of function IDs and names, in the format of "ID,Func_Name\r\n1,adduser\r\n2,userlist...".
  2. The values of BufferSize1 and BufferSize2 are est to 4 kB.
Note
This interface is applicable to the new architecture firmware.

◆ GetShortkey()

VARIANT_BOOL GetShortkey ( LONG  dwMachineNumber,
LONG  ShortKeyID,
BSTR *  ShortKeyName,
BSTR *  FunctionName,
LONG *  ShortKeyFun,
LONG *  StateCode,
BSTR *  StateName,
BSTR *  Description,
LONG *  AutoChange,
BSTR *  AutoChangeTime 
)

To query the settings of a functional key.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
ShortKeyID LONG [in] Key ID
ShortKeyName BSTR* [out] Key name
ShortKeyName BSTR* [out] Function name of the key
ShortKeyFun LONG* [out] Key type
StateCode LONG* [out] State code of the status key
StateName BSTR* [out] Name of the status key
Description BSTR* [out] Description of the status key
AutoChange LONG* [out] Whether the status key automatically changes
AutoChangeTime BSTR* [out] Automatic change time of the status key
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
1. The mapping between ShortKeyName and ShortKeyID is as follows: F1 ! 1, F2 ! 2, F3 ! 3 ...
  1. ShortKeyFun: function of the specified key. The value 0 indicates a functional key and 1 indicates a status key.
  2. ShortKeyName: name of the key specified by ShortKeyID.
  3. FunctionName: If the specified key is a functional key (ShortKeyFun=0), the function name is returned.
  4. FunctionName: If the specified key is a status key (ShortKeyFun=1), the name of the key is returned. In this case, the value of FunctionName is the same as that of StateName.
  5. StateCode: If the specified key is a status key (ShortKeyFun=1), the state code of the status key is returned. Otherwise, an invalid value is returned.
  6. StateName: If the specified key is a status key (ShortKeyFun=1), the name of the status key is returned. Otherwise, an invalid value is returned.
  7. AutoChange: If the specified key is a status key (ShortKeyFun=1), the value of this parameter indicates whether the status key automatically changes. Otherwise, an invalid value is returned.
  8. Description: If the specified key is a status key (ShortKeyFun=1), the description of the status key is returned. Otherwise, an invalid value is returned.
  9. AutoChangeTime: If the specified key is a status key (ShortKeyFun=1), the automatic change time of the status key is returned, in the format of a character string. Otherwise, an invalid value is returned.
Note
This interface is applicable to the new architecture firmware.

◆ SetShortkey()

VARIANT_BOOL SetShortkey ( LONG  dwMachineNumber,
LONG  ShortKeyID,
BSTR  ShortKeyName,
BSTR  FunctionName,
LONG  ShortKeyFun,
LONG  StateCode,
BSTR  StateName,
BSTR  Description,
LONG  StateAutoChange,
BSTR  StateAutoChangeTime 
)

To set a functional key. It is similar to the functional key definition function on the color-screen machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
ShortKeyID LONG [in] Key ID
ShortKeyName BSTR [in] Key name
FunctionName BSTR [in] Function name of the key
ShortKeyFun LONG [in] Key type
StateCode LONG [in] State code of the status key
StateName BSTR [in] Name of the status key
Description BSTR [in] Description of the status key
AutoChange LONG [in] Whether the status key automatically changes
AutoChangeTime BSTR [in] Automatic change time of the status key
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
1. When setting ShortKeyName and ShortKeyID, ensure that the mapping between ShortKeyName and ShortKeyID is as follows: F1 ! 1, F2 ! 2, F3 ! 3 ...
  1. ShortKeyFun: function of the specified key. The value 0 indicates a functional key and 1 indicates a status key. Note that the value of this parameter will affect the settings of other four parameters.
  2. StateCode: state code of the status key.
    If the specified key is not a functional key, that is, the value of ShortKeyFun is not 1, the value of this parameter will be ignored.
    If the specified key is a status key, that is, the value of ShortKeyFun is 1, the value of this parameter is the state code of the status key, and ranges from 0 to 255. The state values of status keys cannot be duplicate. Otherwise, function invocation will fail. For example, F2 is a status key and its state code is 2. If you invoke this function to set F3 as a status key and set its state code to 2, the function invocation will fail.
  3. StateName: name of the status key.
    If the specified key is not a functional key, that is, the value of ShortKeyFun is not 1, the value of this parameter will be ignored.
    If the specified key is a status key, that is, the value of ShortKeyFun is 1, the value of this parameter is the name of the status key, and contains at most 18 characters.
  4. Description: description of the status key.
    If the specified key is not a functional key, that is, the value of ShortKeyFun is not 1, the value of this parameter will be ignored.
    If the specified key is a status key, that is, the value of ShortKeyFun is 1, the value of this parameter is the description of the status key.
  5. StateAutoChange: whether the status key automatically changes:
    If the specified key is not a functional key, that is, the value of ShortKeyFun is not 1, the value of this parameter will be ignored.
    If the specified key is a status key, that is, the value of ShortKeyFun is 1, the value of this parameter indicates whether the status key automatically changes. The value 0 indicates that the status key automatically changes and 1 indicates that the status key does not automatically change.
  6. StateAutoChangeTime:
    If the specified key is not a functional key, that is, the value of ShortKeyFun is not 1, the value of this parameter will be ignored.
    If the specified key is a status key, the value of this parameter is the automatic change time of the status key. The details are as follows: 1. 08:30;09:00;08:00;12:00;11:12;00:00;00:00; 2. The hour is separated from the minute with a colon (:), and days are separated with a semicolon (;), free from spaces. 3. You must specify the automatic change time of each day, with a week as a cycle. After the specified time arrives, the attendance status will change to the state specified by StateName and StateCode. If automatic change is disabled on a day, the hour and minute are both set to 0.
  7. If the return value of issued status key is -15001 repeatedly, the return value of description will be -15002 repeatedly.
Note
This interface is applicable to the new architecture firmware.