Standalone SDK API Doc  V1.0.4
Functions
1.Terminal.h File Reference

Detailed Description

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

Functions

VARIANT_BOOL Connect_Net (BSTR IPAdd, LONG Portl)
 
VARIANT_BOOL Connect_Com (LONG ComPort, LONG MachineNumber, LONG BaudRate)
 
VARIANT_BOOL Connect_USB (LONG MachineNumber)
 
 Disconnect ()
 
VARIANT_BOOL IsTFTMachine (LONG dwMachineNumber)
 
VARIANT_BOOL GetDeviceStatus (LONG dwMachineNumber, LONG dwStatus, LONG *dwValue)
 
VARIANT_BOOL GetDeviceInfo (LONG dwMachineNumber, LONG dwInfo, LONG *dwValue)
 
VARIANT_BOOL SetDeviceInfo (LONG dwMachineNumber, LONG dwInfo, LONG dwValue)
 
VARIANT_BOOL SetDeviceTime (LONG dwMachineNumber)
 
VARIANT_BOOL SetDeviceTime2 (LONG dwMachineNumber, LONG dwYear, LONG dwMonth, LONG dwDay, LONG dwHour, LONG dwMinute, LONG dwSecond)
 
VARIANT_BOOL GetDeviceTime (LONG dwMachineNumber, LONG *dwYear, LONG *dwMonth, LONG *dwDay, LONG *dwHour, LONG *dwMinute, LONG *dwSecond)
 
VARIANT_BOOL GetSerialNumber (LONG dwMachineNumber, BSTR *dwSerialNumber)
 
VARIANT_BOOL GetProductCode (LONG dwMachineNumber, BSTR *lpszProductCode)
 
VARIANT_BOOL GetFirmwareVersion (LONG dwMachineNumber, BSTR *strVersion)
 
VARIANT_BOOL GetSDKVersion (BSTR *strVersion)
 
VARIANT_BOOL GetDeviceIP (LONG dwMachineNumber, BSTR *IPAddr)
 
VARIANT_BOOL SetDeviceIP (LONG dwMachineNumber, BSTR IPAddr)
 
VARIANT_BOOL GetDeviceMAC (LONG dwMachineNumber, BSTR *sMAC)
 
VARIANT_BOOL SetDeviceMAC (LONG dwMachineNumber, BSTR sMAC)
 
VARIANT_BOOL GetWiegandFmt (LONG dwMachineNumber, BSTR *sWiegandFmt)
 
VARIANT_BOOL SetWiegandFmt (LONG dwMachineNumber, BSTR sWiegandFmt)
 
VARIANT_BOOL GetCardFun (LONG dwMachineNumber, LONG *CardFun)
 
VARIANT_BOOL SetDeviceCommPwd (LONG dwMachineNumber, LONG CommKey)
 
VARIANT_BOOL SetCommPassword (LONG CommKey)
 
VARIANT_BOOL QueryState (LONG *State)
 
VARIANT_BOOL GetVendor (BSTR *strVendor)
 
VARIANT_BOOL GetDeviceStrInfo (LONG dwMachineNumber, LONG dwInfo, BSTR *Value)
 
VARIANT_BOOL GetPlatform (LONG dwMachineNumber, BSTR *Platform)
 

Function Documentation

◆ Connect_Net()

VARIANT_BOOL Connect_Net ( BSTR  IPAdd,
LONG  Portl 
)

To connect to the machine to set up a network connection with the machine by using an IP address.

Parameters
Parameter description:
name type param direction description of param
IPAdd BSTR [in] IP address of the machine
Portl LONG [in] Port number of the machine
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
The default port number for connecting to the machine is 4370.
Note
Applicable to BW, TFT, and IFACE devices

◆ Connect_Com()

VARIANT_BOOL Connect_Com ( LONG  ComPort,
LONG  MachineNumber,
LONG  BaudRate 
)

To connect to the machine through a serial port, that is, the RS232 RS485 port.

Parameters
Parameter description:
name type param direction description of param
ComPort LONG [in] Serial port of the PC to be connected to the machine
MachineNumber LONG [in] Machine ID
BaudRate LONG [in] Baud rate
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
This function is also used when a machine communicates with a PC by using a USB client. The precondition is that the USB client drive is installed beforehand to simulate a virtual serial port, which can be viewed in the device manager on the PC. The program can also search for this serial port. For details, see the description of USBClient in DEMO.
Note
Applicable to BW, TFT, and IFACE devices

◆ Connect_USB()

VARIANT_BOOL Connect_USB ( LONG  MachineNumber)

To connect to the machine through a USB port.

Parameters
Parameter description:
name type param direction description of param
MachineNumber LONG [in] Machine ID
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Connect_Com
Attention
This function applies only to H series machines and cannot be used in the communication conducted through a USB client. For details about the communication conducted through a USB client, see the description of Connect_Com.
Note
Applicable to BW

◆ Disconnect()

Disconnect ( )

To disconnect from the machine to release relevant resources.

Parameters
None
Returns
None
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ IsTFTMachine()

VARIANT_BOOL IsTFTMachine ( LONG  dwMachineNumber)

To check whether the machine is a color-screen one.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetDeviceStatus()

VARIANT_BOOL GetDeviceStatus ( LONG  dwMachineNumber,
LONG  dwStatus,
LONG *  dwValue 
)

To query the data storage status on the machine, such as the number of administrators and number of users.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
dwStatus LONG [in] Data to be obtained
dwValue LONG* [out] Content of the data specified by dwStatus
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
The dwStatus parameter specifies the data to be obtained. The value range is 1-22. The values are described as follows:
1 Number of administrators
2 Number of registered users
3 Number of fingerprint templates on the machine
4 Number of passwords
5 Number of operation records
6 Number of attendance records
7 Fingerprint template capacity
8 User capacity
9 Attendance record capacity
10 Remaining fingerprint template capacity
11 Remaining user capacity
12 Remaining attendance record capacity
21 Number of faces
22 Face capacity
0 Other conditions
Note
Applicable to BW, TFT, and IFACE devices

◆ GetDeviceInfo()

VARIANT_BOOL GetDeviceInfo ( LONG  dwMachineNumber,
LONG  dwInfo,
LONG *  dwValue 
)

To obtain machine information, such as the language and baud rate.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
dwInfo LONG [in] Information type
dwValue LONG* [out] Informatin of the type specified by dwInfo
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
dwInfo: specifies the type of information to be obtained. The value ranges from 1 to 68, and cannot be 65. The values are described as follows:
  1. Maximum number of administrators, which is fixed at 500.
  2. Machine ID.
  3. Language: If the value of dwValue is 0, the language is English. The value 1 indicates other conditions. The value 2 indicates Traditional Chinese, and 3 indicates Thai.
  4. Idle duration (in minutes): After the specified idle duration elapses, the machine will enter the standby state or be shut down.
  5. Lock control duration, that is, the lock drive duration.
  6. Attendance record quantity alarm: When the specified attendance record quantity is reached, the machine will raise an alarm to remind the user.
  7. Operation record quantity alarm: When the specified operation record quantity is reached, the machine will raise an alarm to remind the user.
  8. Duplicate record time: minimum interval for a user to record the same attendance state.
  9. Baud rate for RS232/485 communication: The value 0 indicates the baud rate of 1200 bps, 1 indicates 2400 bps, 2 indicates 4800 bps, 3 indicates 9600 bps, 4 indicates 19200 bps, 5 indicates 38400 bps, 6 indicates 57600 bps, and Others indicates 115200 bps.
  10. Parity check bit, return value of which is fixed at 0.
  11. Stop bit, return value of which is fixed at 0.
  12. Date separator, return value of which is fixed at 1.
  13. Whether to enable network functions: The value 1 indicates enabling network functions and 0 indicates disabling network functions.
  14. Whether to enable RS232.
  15. Whether to enable RS485.
  16. Whether to enable announcements.
  17. Whether to perform high-speed comparison.
  18. Idle mode, that is, the state of the machine during idle hours. The value 87 indicates shutdown and 88 indicates hibernation.
  19. Automatic shutdown time: The default value is 255, which means that the machine will not automatically shut down.
  20. Automatic startup time: The default value is 55, which means that the machine will not automatically start.
  21. Automatic hibernation time: The default value is 255, which means that the machine will not automatically enter the hibernation state.
  22. Automatic ringing time 1: The default value is 65535, which means that the bell will not automatically ring.
  23. 1:N comparison threshold.
  24. Registration threshold.
  25. 1:1 comparison threshold.
  26. Whether to display the matching score during verification.
  27. Number of people that unlock the door concurrently.
  28. Verify the card number only.
  29. Network speed: The value 1 indicates 100M-H, 4 indicates 10M-F, 5 indicates 100M-F, 8 indicates AUTO, and Others indicates 10M-H.
  30. Whether a card must be registered.
  31. Waiting time before the machine automatically returns to the initial state if no operation is performed.
  32. Waiting time before the machine automatically returns to the initial state if no response is returned after the PIN is input.
  33. Waiting time before the machine automatically returns to the initial state if no operation is performed after entering the menu.
  34. Time format.
  35. Whether 1:1 comparison is mandatory.
    36¡ª40. Automatic ringing time 2, 3, 4, 5, and 6: The default value is 65535, which means that the bell will not automatically ring.
    41¡ª56. Automatic status change time 1¡ª16: The default values are all -1, which means that the status will not change automatically.
  36. Wiegand failure ID.
  37. Wiegand duress ID.
  38. Wiegand zone bit.
  39. Pulse width of Wiegand outputs.
  40. Pulse interval of Wiegand outputs.
  41. ID of the start sector on the MIFARE card where fingerprints are stored.
  42. Total number of sectors on the MIFARE card where fingerprints are stored.
  43. Number of fingerprints stored on the MIFARE card.
  44. Whether to display the attendance status.
    67-68. Meaningless.
  45. TCP Comm Port.
  46. UDP port.
  47. Fingerprint algorithm version.
  48. Face algorithm version.
  49. Finger vein version
  50. FaceFunOn.
  51. PIN2Width.
  52. IsSupportABCPin.
  53. IMEFunOn.
  54. IsSupportAlarmExt.
  55. ~DCTZ.
  56. ~DOTZ.
  57. dwValue serves the input and output parameter. The input indicates the name of another option to be obtained and the output is the value of this option. This function is similar to GetSysOption in this case.
    [Note] The values of the preceding time points are all digits, which can be converted into actual time points. Specifically, convert a value into binary format, the least significant eight bits indicate the minute and the most significant eight bits indicate the hour. For example, if the value is 2860, it is 101100101100 in binary, the least significant eight bits are 00101100, which is 44 in decimal, and the most significant eight bits are 00001011, which is 11 in decimal. That is, the actual time point is 11:44.
Note
Applicable to BW, TFT, and IFACE devices

◆ SetDeviceInfo()

VARIANT_BOOL SetDeviceInfo ( LONG  dwMachineNumber,
LONG  dwInfo,
LONG  dwValue 
)

To set machine information, such as the language and duplicate record time.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
dwInfo LONG [in] Information type, ranging from 1-20, 80, 81. For details about the meanings of values, see the description of GetDeviceInfo
dwValue LONG [in] Information of the type specified by dwInfo
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
dwInfo specifies the information type, ranging from 1-20, 80, 81. For details about the meanings of values, see the description of GetDeviceInfo.
Note
Applicable to BW, TFT, and IFACE devices

◆ SetDeviceTime()

VARIANT_BOOL SetDeviceTime ( LONG  dwMachineNumber)

To set the time of the machine to be the same as that of the local computer. To set specified time, see the description of SetDeviceTime2.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ SetDeviceTime2()

VARIANT_BOOL SetDeviceTime2 ( LONG  dwMachineNumber,
LONG  dwYear,
LONG  dwMonth,
LONG  dwDay,
LONG  dwHour,
LONG  dwMinute,
LONG  dwSecond 
)

To set the time of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
dwYear LONG [in] Year
dwMonth LONG [in] Month
dwDay LONG [in] Date
dwHour LONG [in] Hour
dwMinute LONG [in] Minute
dwSecond LONG [in] Second
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetDeviceTime()

VARIANT_BOOL GetDeviceTime ( LONG  dwMachineNumber,
LONG *  dwYear,
LONG *  dwMonth,
LONG *  dwDay,
LONG *  dwHour,
LONG *  dwMinute,
LONG *  dwSecond 
)

To query the time of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
dwYear LONG* [out] Year
dwMonth LONG* [out] Month
dwDay LONG* [out] Date
dwHour LONG* [out] Hour
dwMinute LONG* [out] Minute
dwSecond LONG* [out] Second
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetSerialNumber()

VARIANT_BOOL GetSerialNumber ( LONG  dwMachineNumber,
BSTR *  dwSerialNumber 
)

To query the serial number of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
dwSerialNumber BSTR* [out] Serial number
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetProductCode()

VARIANT_BOOL GetProductCode ( LONG  dwMachineNumber,
BSTR *  lpszProductCode 
)

To query the product code of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
lpszProductCode BSTR* [out] Product code
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetFirmwareVersion()

VARIANT_BOOL GetFirmwareVersion ( LONG  dwMachineNumber,
BSTR *  strVersion 
)

To query the firmware version of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
strVersion BSTR* [out] Firmware version of the machine
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetSDKVersion()

VARIANT_BOOL GetSDKVersion ( BSTR *  strVersion)

To query the SDK version.

Parameters
Parameter description:
name type param direction description of param
strVersion BSTR* [out] SDK version
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetDeviceIP()

VARIANT_BOOL GetDeviceIP ( LONG  dwMachineNumber,
BSTR *  IPAddr 
)

To query the IP address of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
IPAddr BSTR* [out] IP address
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ SetDeviceIP()

VARIANT_BOOL SetDeviceIP ( LONG  dwMachineNumber,
BSTR  IPAddr 
)

To set the IP address of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
IPAddr BSTR [in] IP address
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetDeviceMAC()

VARIANT_BOOL GetDeviceMAC ( LONG  dwMachineNumber,
BSTR *  sMAC 
)

To query the MAC address of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
sMAC BSTR* [out] MAC address
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ SetDeviceMAC()

VARIANT_BOOL SetDeviceMAC ( LONG  dwMachineNumber,
BSTR  sMAC 
)

To set the MAC address of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
sMAC BSTR [in] MAC address
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetWiegandFmt()

VARIANT_BOOL GetWiegandFmt ( LONG  dwMachineNumber,
BSTR *  sWiegandFmt 
)

To query the Wiegand format of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
sWiegandFmt BSTR* [out] Wiegand format
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ SetWiegandFmt()

VARIANT_BOOL SetWiegandFmt ( LONG  dwMachineNumber,
BSTR  sWiegandFmt 
)

To set the Wiegand format of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
sWiegandFmt BSTR [in] Wiegand format
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetCardFun()

VARIANT_BOOL GetCardFun ( LONG  dwMachineNumber,
LONG *  CardFun 
)

To query whether the machine supports the RF card.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
CardFun LONG* [in] Whether the RF card is supported
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
If the value of CardFun is 1, the machine supports only the RF card. If the value is 2, both the RF card and fingerprints are supported. If the value is 0, the RF card is not supported.
Note
Applicable to BW, TFT, and IFACE devices

◆ SetDeviceCommPwd()

VARIANT_BOOL SetDeviceCommPwd ( LONG  dwMachineNumber,
LONG  CommKey 
)

To set the communication password of the machine, which will be saved on the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
CommKey LONG [in] Communication password
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ SetCommPassword()

VARIANT_BOOL SetCommPassword ( LONG  CommKey)

To set the communication password of the PC. A connection can be set up between the machine and the PC only if their communication passwords are the same.

Parameters
Parameter description:
name type param direction description of param
CommKey LONG [in] Communication password
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ QueryState()

VARIANT_BOOL QueryState ( LONG *  State)

To query the current status of the machine.

Parameters
Parameter description:
name type param direction description of param
State LONG* [out] Current status of the machine
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
State specifies the current status of the machine. The meanings of the values are as follows:
0 Waiting state
1 Fingerprint registration state
2 Fingerprint identification state
3 Menu access state
4 Busy state (handling other work)
5 State of waiting for card writing
Note
Applicable to BW, TFT, and IFACE devices

◆ GetVendor()

VARIANT_BOOL GetVendor ( BSTR *  strVendor)

To query the manufacturer of the machine.

Parameters
Parameter description:
name type param direction description of param
strVendor BSTR* [in] Manufacturer of the machine
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices

◆ GetDeviceStrInfo()

VARIANT_BOOL GetDeviceStrInfo ( LONG  dwMachineNumber,
LONG  dwInfo,
BSTR *  Value 
)

To query the delivery time of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
dwInfo LONG [in] It can be set only to 1
Value BSTR* [out] Delivery time of the machine
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
dwInfo can be set only to 1.
Note
Applicable to BW, TFT, and IFACE devices

◆ GetPlatform()

VARIANT_BOOL GetPlatform ( LONG  dwMachineNumber,
BSTR *  Platform 
)

To query the platform of the machine.

Parameters
Parameter description:
name type param direction description of param
dwMachineNumber LONG [in] Machine ID
Platform BSTR* [out] Platform name
Returns
Value description:
name type description of value
True BOOL Function execution success
False BOOL Function execution failure
See also
Attention
Note
Applicable to BW, TFT, and IFACE devices