UCS SDK v3.0 Programmer's Manual (Eng)
UCS SDK v3.0 Programmer's Manual (Eng)
Programmer’s Guide
Version 3.0
June, 2009
This agreement is a legal usage license agreement between Union Community Co., Ltd. and the
user.
If you do not agree with the terms and condition of the agreement, please return the product
promptly. If you return the product, you will receive a refund.
1. Usage License
UNION COMMUNITY Co., Ltd. Grants licensee to use this SDK a personal, Limited, non-
transferable, non-exclusive right to install and use one copy of the SDK on a single computer
exclusively.
The software is considered 'being used' if it is stored in a computer's main or other storage device.
The number of software copies will be determined by taking the greater number of the number of
computers 'used' by the software and the number of computers with the software stored.
Licensee may use the SDK solely for developing, designing, and testing UNION software
applications for use with UNION products ("Applications").
2. Right to Upgrade
If you have purchased the software by upgrading an older version, the usage license of the old
version is transferred to the new version. However, you may only use the old version under the
condition that the old and new versions are not running simultaneously. Therefore, you are
prohibited from transferring, renting or selling the old version. You maintain the usage license for
the program and ancillary files that are in the old version but not in the new version.
3. Assignment of License
If you wish to transfer the usage license of this software to a third party, you must first obtain a
written statement indicating that the recipient agrees with this agreement. You must then transfer
the original disk and all other program components, and all copies of the program must be
destroyed. After the transfer is complete, you must notify UNION COMMUNITY Co., Ltd. to update
the customer registration.
Licensee shall not rent, lease, sell or lend the software application developed using the SDK to a
third party without UNION's prior written consent.
4. Copyright
All copyrights and intellectual properties of the software and its components belong to UNION
COMMUNITY Co., Ltd. and these rights are protected under Korean and international copyright
laws. Therefore, you may not make copies of the software other than for your backup purposes.
In addition, you may not modify the software other than for reverse-engineering purposes to
secure compatibility. Finally, you may not modify, transform or copy any part of the
documentation without written permission from UNION COMMUNITY. (If you're using a network
product, you may copy the documentation in the amount of the number of users)
5. Installation
An individual user can install this software in his/her PCs at home and office, as well as in a
mobile PC. However, the software must not be running from two computers simultaneously. A
single product can be installed in two or more computers in one location, but one of those
computers must have a usage rate of at least 70%. If another computer has a usage rate of 31%
or higher, another copy of the software must be purchased.
6. Limitation of Warranty
UNION COMMUNITY Co., Ltd. guarantees that the CD-ROM and all components are free of
physical damage for a year after purchase.
UNION DISCLAIMS ALL WARRANTIES NOT EXPRESSLY PROVIDED IN THIS AGREEMENT
INCLUDING, WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE. If you find any manufacture defect within the warranty period, we
will replace the product. You must be able to prove that the product has been purchased within a
year to receive a replacement, but we will not replace a product damaged due to your mishandling
or negligence. UNION COMMUNITY Co., Ltd. does not guarantee that the software and its
features will satisfy your specific needs, and is not liable for any consequential damages arising
out of the use of this product.
7. Liabilities
UNION COMMUNITY Co., Ltd. is not liable for any verbal, written or other agreements made by
third parties, including product suppliers and dealers.
9. Customer Service
UNION COMMUNITY Co., Ltd. makes every effort to provide registered customers with technical
assistance and solutions to problems regarding software applications under certain system
environments. When a customer submits a suggestion about any inconvenience or anomaly
experienced during product usage, UNION COMMUNITY Co., Ltd. will take corrective action and
notify the customer of the result.
11. Contact
If you have any questions about this agreement, please contact UNION COMMUNITY Co., Ltd. via
telephone, fax or e-mail.
1. Outline.................................................................................................................................. 13
1.1 Application ...................................................................................................................... 13
1.2 Special Features ............................................................................................................ 13
3. Installation ........................................................................................................................ 28
3.1 System Requirements .................................................................................................. 28
3.2 Installing ........................................................................................................................... 29
3.3 Installed Files .................................................................................................................. 32
3.3.1 Windows System Directory ......................................................................................... 32
3.3.2 Executable Module : /Bin ........................................................................................... 32
3.3.3 Header File : /Include................................................................................................. 32
3.3.4 Library File : /lib ......................................................................................................... 33
3.3.5 Sample Source : /Sample.......................................................................................... 33
3.3.6 Manual : /Manual ....................................................................................................... 33
UCS (UNION COMMUNITY Server) SDK was written in high level SDK to develop an application
program that can interlock with all network fingerprint recognition terminals of Union Community
Co., Ltd.
UCS SDK along with UCB (UNION COMMUNITY Biometric) is intended to provide a server API
(Application Programming Interface) and consists of Biometric API for user registration and
authentication and server API that can communicate with a network terminal.
1.1 Application
UCS SDK along with UCB SDK defines API on fingerprint recognition technology and server API
that can interlock with network terminal products. Therefore, applied in fingerprint authentication
system development, it can be used to optimize performance during the fusion and registration of
various fingerprint recognition, authentication and recognition.
All modules provided in UCS (UNION COMMUNITY Server) SDK were complied under VC++ 6.0
and programming using this SDK is possible under most 32bit compilers such as Visual C++
UCS SDK provides COM module for C/C++ developers and also developers using Visual Basic or
Delphi to make development easy under these tools.
API Layer
COM Module ( UCSCOM.dll )
■ Terminal
It is a network fingerprint recognition terminal supplied by Union Community Co., Ltd.
■ Client
It is an application program to communicate with a network fingerprint recognition terminal
supplied.
■ Client ID
Client ID is used to develop an application program of client/server model.
Server module requires key to distinguish each client to support multi client environments and t
is called clietID.
■ Authentication Type
The fingerprint recognition terminal supports various authentication types to distinguish users.
Type Value(Constant) Details
Fingerprint 0 Fingerprint is used as authentication method.
Fingerprint card 1 Fingerprint card is used as authentication method.
Password 2 Password is used as authentication method.
Card 3 Card is used as authentication method.
Card or fingerprint 4 Card or fingerprint is used as authentication method.
Card and fingerprint 5 The combination of card and fingerprint is used as
authentication method.
Card or password 6 Card or password is used as authentication method.
Card and password 7 The combination of card and fingerprint is used as
authentication method.
(ID and fingerprint) or 8 The combination of ID and fingerprint or combination of
(card and fingerprint) card and fingerprint is used as authentication method.
(ID and password) or 9 The combination of ID and password or combination of
(card and password) card and password is used as authentication method.
Fingerprint and 10 The combination if fingerprint and password is used as
password authentication.
Fingerprint or password 11 Password is used as authentication method after
■ Authentication Mode
It defines authentication purpose during user authentication.
Mode Vale Content
■ Log Type
UCS SDK defines three types of log to acquire log data from the terminal.
Type Value Content
(Constant)
Log not transmitted to 0 New log that has not been transmitted to the server
the server
Log transmitted to the 1 Log that has already been transmitted to the server
server
All logs 2 All logs stored in the terminal
■ User Flag
It is a one byte data field that defines authentication type and if a user is administrator.
① Fingerprint
7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Bit
Admin Identify 0 0 0 0 0 1
② Fingerprint card
■ Terminal State
The terminal transmits its state and the state information of devices attached to the terminal to
the server periodically or immediately when there is change in state.
-Terminal state : This value is a state value that changes according to “lock scheduling” function
of the terminal.
-Lock device state : This value is a state value that changes according to “open scheduling”
function of the terminal.
-Door monitoring state : This value is a door state value that is transmitted from the lock device
with monitoring capability.
-Terminal cover state : This value is a value that returns terminal cover state.
State Value Description
(Constant
)
Terminal state 0 Lock cancel state
1 Lock state (The connection to the server is maintained during
terminal lock state but access to the terminal not from the
server is not allowed. However, if administrator access
permission option is used, only administrator’s access is
allowed.)
Lock device state 0 Lock state
1 Open state
Door monitoring 0 Closed state
state 1 Open state
2 State without monitoring
Terminal cover state 0 Closed state
1 Open state
■ Callback Event
UCS module uses event method to send data received from the terminal to the application
program.
■ CPU
Above Intel Pentium 133Mhz
■ Memory
Above 16M
■ USB Port
USB 1.1
■ OS
Windows 98/ME or 2000/XP/2003/Vista(32 bit only)
When SDK installation is completed normally, the following files are copied into the designated
installation directory.
UCSAPI.dll
It is a basic module that realizes all functions related with the network fingerprint recognition
terminal.
UCSCOM.dll
COM module for RAD tool developers and web developers
WSEngine.dll
Communication module for processing Windows Socket I/O
UCSSample.exe
UCSAPI.dll
UCSCOM.dll
WSEngine.dll
ucsapi.h
It is a basic header file of UCSAPI module. The application must include this file to use UCSAPI
module. ucsapi.h additionally includes ucsapi_api.h, ucsapi_err.h and ucsapi_type.h file required
to use the module.
ucsapi_api.h
The prototype of all functions provided in UCSAPI module is defined.
ucsapi_type.h
The type and macro used in UCSAPI module are defined.
ucsapi_type.h additionally includes ucsapi_porttype.h.
ucsapi_porttype.h
The type and macro used in UCSAPI module are defined.
ucsapi.lib
Library file to link the module statically in the application
Visual C++
Sample source using UCSAPI.dll
Visual Basic
Sample source using UCSCOM.dll
Delphi
Sample source using UCSCOM.dll
UCSAPI
#ifdef (WIN32)
#define UCSAPI __stdcall
#else
#define UCSAPI
#endif
UCSAPI_BOOL
UCSAPI_RETURN
UCSAPI_EventHandler
This type is definition on callback function to receive the event occurred from the terminal.
UCSAPI_CALLBACK_EVENT
This type defines the callback event occurred from the terminal.
UCSAPI_OPTION_FLAG
#define UCSAPI_OPTION_NAME_BIT 2
#define UCSAPI_OPTION_NAME 1 << UCSAPI_OPTION_NAME_BIT
#define UCSAPI_OPTION_SERVERINFO_BIT 3
#define UCSAPI_OPTION_SERVERINFO 1 << UCSAPI_OPTION_SERVERINFO_BIT
#define UCSAPI_OPTION_NETWORKINFO_BIT 4
#define UCSAPI_OPTION_NETWORKINFO 1 << UCSAPI_OPTION_NETWORKINFO_BIT
#define UCSAPI_OPTION_WORKINGMODE_BIT 6
#define UCSAPI_OPTION_WORKINGMODE 1 << UCSAPI_OPTION_WORKINGMODE_BIT
#define UCSAPI_OPTION_OPERATIONMODE_BIT 7
#define UCSAPI_OPTION_OPERATIONMODE 1 <<
UCSAPI_OPTION_OPERATIONMODE_BIT
UCSAPI_LOG_TYPE
#define UCSAPI_TYPE_NEW_LOG 0
#define UCSAPI_TYPE_OLD_LOG 1
#define UCSAPI_TYPE_ALL_LOG 2
UCSAPI_LENGTH
#define UCSAPI_LEN_PWD 8
#define UCSAPI_LEN_CARDNUM 20
UCSAPI_AUTH_TYPE
#define UCSAPI_AUTHTYPE_FP 0
#define UCSAPI_AUTHTYPE_FPCARD 1
#define UCSAPI_AUTHTYPE_PW 2
#define UCSAPI_AUTHTYPE_CARD 3
#define UCSAPI_AUTHTYPE_CARD_OR_FP 4
#define UCSAPI_AUTHTYPE_CARD_AND_FP 5
#define UCSAPI_AUTHTYPE_CARD_OR_PW 6
#define UCSAPI_AUTHTYPE_CARD_AND_PW 7
#define UCSAPI_AUTHTYPE_ID_AND_FP_OR_CARD_AND_FP 8
#define UCSAPI_AUTHTYPE_ID_AND_PW_OR_CARD_AND_PW 9
#define UCSAPI_AUTHTYPE_FP_AND_PW 10
#define UCSAPI_AUTHTYPE_FP_OR_PW 11
UCSAPI_AUTH_REQ
This type defines the type designated when the terminal requests authentication to the server.
#define UCSAPI_AUTHREQ_FP_1TO1 0
#define UCSAPI_AUTHREQ_FP_1TON 1
UCSAPI_AUTH_MODE
#define UCSAPI_AUTHMODE_ATTENDANCE 0
#define UCSAPI_AUTHMODE_LEAVE 1
#define UCSAPI_AUTHMODE_NORMAL 2
#define UCSAPI_AUTHMODE_OUT 3
#define UCSAPI_AUTHMODE_RETURN 4
UCSAPI_PACKET_INFO
UCSAPI_DATA
UCSAPI_PROCESSING_INFO
UCSAPI_VERIFY_INFO
UserID : User ID
AuthType : Authentication type
#define UCSAPI_AUTHTYPE_FP 0
#define UCSAPI_AUTHTYPE_PW 2
#define UCSAPI_AUTHTYPE_CARD 3
AuthMode : Authentication mode
#define UCSAPI_AUTHMODE_ATTENDANCE 0
#define UCSAPI_AUTHMODE_LEAVE 1
#define UCSAPI_AUTHMODE_NORMAL 2
#define UCSAPI_AUTHMODE_OUT 3
#define UCSAPI_AUTHMODE_RETURN 4
InputIdLength : It includes the length of ID pressed through key pad when the terminal requests
authentication to the server.
This value can be used to realize shortcut ID function during 1:N server authentication.
If user ID registered in the server is “1234” and ID(UserID) entered from the terminal is “12”with ID
length (InputIdLength) entered “2”, the server needs to mark only 99 people from 1200 to 1299.
SecuLevel : Fingerprint authenticating level (Refer to terminology definition.)
IsAccessibility : The terminal includes information if authentication authority exists. If the value is 1,
authority exists. If the value is 0, authority does not exist.
IsMatched : It includes authentication execution result. If the value is 1, authority exists. If the
value is 0, authority does not exist.
ErrorCode : It includes error code on work processed.
UCSAPIERR_NONE value indicates success and all other values express error condition.
VerifyData : Sample data acquired from the terminal during authentication request. They can be
fingerprint sample, password and card number according to AuthType.
UCSAPI_LOCK_SCHEDULE
} UCSAPI_LOCK_SCHEDULE;
Note.
If there is no period restriction, fill the values with 0. (YYYYMMDDYYYYMMDD)
If only time is restricted without period restriction, lock function is controlled at a
designated time every day.
UCSAPI_OPEN_SCHEDULE
} UCSAPI_OPEN_SCHEDULE;
Note.
If there is no period restriction, fill the values with 0. (YYYYMMDDYYYYMMDD)
If only time is restricted without period restriction, open function is controlled at a
designated time every day.
} UCSAPI_TIMEZONE;
IsUsed : This includes the validity of time zone. If the value is 1, time zone is valid.
StartHour : Start hour
StartMin : Start minute
EndHour : End hour
EndMin : End minute
UCSAPI_DAY_SCHEDULE
This type includes information on the lock schedule of the terminal and the open schedule of the
doorlock by day of the week.
Day of the week scheduling allows up to three lock, open scheduling per day.
UCSAPI_DAY_SCHEDULE
} UCSAPI_HOLIDAY_SCHEDULE;
UCSAPI_BASIC_SCHEDULE
} UCSAPI_BASIC_SCHEDULE;
UCSAPI_EXPAND_SCHEDULE
} UCSAPI_EXPAND_SCHEDULE;
UCSAPI_SECURITY_LEVEL
UCSAPI_NETWORK_INFO
NetworkType : IP type. If this value is 0, it supports fixed IP. If this value is 0, it supports dynamic
IP.
IP : Terminal IP information
Subnet : Subnet mask information
Gateway : Gateway information
UCSAPI_SERVER_INFO
IP : Server IP.
Port : Port information for server connection
UCSAPI_TERMINAL_SCHEDULE
} UCSAPI_TERMINAL_SCHEDULE;
UCSAPI_BASIC_TERMINAL_OPTIONS
This type includes the basic option setting value of the terminal.
Bright, Contrast, Gatin : Setting value on fingerprint recognition sensor (This value is not used.)
SecuLevel : Fingerprint authentication level (Refer to Terminology Explanation in section 2.4.)
MicLevel : Microphone volume level (This value is not used.)
IDLength : User ID length
IsUseAutoEnter : It is a value to express terminal’s automatic enter function capability. This is a
function to input Enter key automatically when there is input as many as ID length.
IsUseVoice : It is a value to express voice use. If the value is 1, voice is used. If the value is 0,
Voice is not used.
UCSAPI_EXPAND_TERMINAL_OPTIONS
This type includes the expanded option setting value of the terminal.
UCSAPI_TERMINAL_OPTIONS
UCSAPI_DATETIME_INFO
UCSAPI_LOG_DATA
} UCSAPI_LOG_DATA;
UCSAPI_USER_FLAG
For detailed explanation on structure members, refer to Terminology Explanation in section 2.4.
UCSAPI_ACCESS_DATE
UCSAPI_ACCESS_TIME
UCSAPI_USER_INFO
Note.
When access authority is net set, AccessDate and AccessTime are filled with 0. If access
restriction is set on time without access restriction on period, restriction is effective at a
designated time every day.
UCSAPI_USER_DATA
This type is structure to include user’s authentication authority information and authentication data.
UCSAPI_USER_COUNT
This type is a structure to include to the number of use stored in the terminal.
Users are divided into administrator and general users. The terminal administrator has authority to
change terminal setting information.
UCSAPI_TERMINAL_USER
UCSAPI_IPADDRESS
UCSAPI_ServerStart
Description
This function initializes UCSAPI module and performs server function.
Parameter
MaxClient: It defines the maximum number of connected terminals. The server adjusts memory
use according to the number of clients entered and secures the number of connections by
increasing memory use if client connection goes over the maximum number.
Port : Communication port for terminal connection
Reserved : Field reserved for future use
pUCSAPINotifyCallback : Callback function pointer for event notice
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : uint8_t ip[4]; // Terminal IP
Description
This function cancels the connection of connected terminals and terminates server function.
Parameter
None
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
Callback Event
None
Callback parameter
wParam : UCSAPI_PACKET_INFO
lParam : None
UCSAPI_AddUser
Description
This function downloads user information to the designated terminal.
Previously registered user information will be overwritten.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
UserID: User ID
UserName : Buffer pointer including user name
IsAdmin: Terminal administrator status. If the value is 1, terminal administrator. If the value is 0,
general user.
DateLimit: Buffer pointer to set allowed time for authentication. In case of no restriction on
authentication period, it is set to NULL value.
TimeLimit: Buffer pointer to set allowed time for authentication. In case of no restriction on
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : None
※ Cautions
When multiple users are transferred to the terminal using UCSAPI_AddUser function, make sure to
call UCSAPI_AddUser and check UCSAPI_EVENT_ADDUSER event if it is processed normal before
transferring users.
Description
This function deletes user information from the designated terminal.
If UserID value is -1, all user information stored in the terminal is deleted.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
UserID : User ID
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_DELETEUSER
Callback Parameter
wParam : UCSAPI_PACKET_INFO
※ Cautions
When multiple users are deleted from the terminal using UCSAPI_DeleteUser function, make sure to
call UCSAPI_DeleteUser and check UCSAPI_EVENT_DELETEUSER event if it is processed normal
before deleting users.
Description
This function acquires the number of registered users from the designated terminal.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_GETUSERCOUNT
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : UCSAPI_USER_COUNT
Description
This function acquires the ID list of all registered users from the designated terminal.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_GETUSERLIST
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : UCSAPI_TERMINAL_USER
Description
This function acquires designated user’s data from the designated terminal.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
UserID : User ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_GETUSERDATA
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : UCSAPI_USER_DATA
UCSAPI_GetAccessLog
Description
This function acquires the authentication log in designated type from the designated terminal.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
LogType : Log type
0 : New log that has not been transmitted to the server
1 : Log that has already been transmitted to the server
2 : All logs stored in the terminal
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_GETACCESSLOG
Description
This function acquires the number authentication logs in designated type from the designated
terminal.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
LogType : Log type
0 : Log that has not been transmitted to the server
1 : Log that has already been transmitted to the server
2 : All logs stored in the terminal
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_GETACCESSLOGCOUNT
UCSAPI_ServerResponse
Description
This function is called to respond to request from the terminal.
During working in N/S (server authentication mode), the terminal can request the application
program for user’s authentication information to acquire authentication information. Also, the
terminal can make authentication request to user’s authentication by transmitting entered
authentication information (fingerprint, card number and password) to the server.
Parameter
TerminalID : Terminal ID.
Message : Message type on the terminal’s request (For more information, refer to Callback Event
Summary in section 2.4.)
UCSAPI_EVENT_REQUEST_VERIFYINFO
UCSAPI_EVENT_REQUEST_CARDVERIFYMATCH
UCSAPI_EVENT_REQUEST_VERIFYMATCH
UCSAPI_EVENT_REQUEST_IDENTIFYMATCH
wParam : It is defined for structure pointer on packet information (UCSAPI_PACKET_INFO).
lParam : It is defined for structure pointer for authentication information (UCSAPI_VERIFY_INFO).
Request Event Description
UCSAPI_EVENT_REQUEST_VERIFYINFO The application program must reply to the terminal
(User’s authentication information request) with authentication type (AuthType) and
authentication authority (IsAccessibility). If there is
no authentication authority, error on this must also
be replied.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_REQUEST_VERIFYINFO
UCSAPI_EVENT_REQUEST_CARDVERIFYMATCH
UCSAPI_EVENT_REQUEST_VERIFYMATCH
UCSAPI_EVENT_REQUEST_IDENTIFYMATCH
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : UCSAPI_VERIFY_INFO
UCSAPI_GetTerminalCount
Description
This function acquires the number of terminals connected to the server.
Parameter
TerminalCount : Buffer pointer to receive the number of terminals back
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
None
Callback Parameter
None
Description
This function acquires the firmware version of the designated terminal.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_FW_VERSION
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : UCSAPI_DATA
Description
This function upgrades the designated terminal’s firmware.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
FilePath : Buffer pointer including firmware file path
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_FW_UPGRADING
UCSAPI_EVENT_FW_UPGRADE
Callback Parameter
wParam : UCSAPI_PACKET_INFO
Description
This function acquires basic option setting value from the terminal.
Details on basic option are defined in UCSAPI_BASIC_TERMINAL_OPTIONS structure.
Parameter
ClientID : Client ID
TerminalID : Terminal ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_GET_BASIC_TERMINAL_OPTION
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : UCSAPI_BASIC_TERMINAL_OPTIONS
Description
This function acquires expanded option setting value from the terminal.
Details on expanded option are defined in UCSAPI_EXPAND_TERMINAL_OPTIONS structure.
Parameter
ClientID : Client ID
TerminalID : Terminal ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_GET_EVENT_TERMINAL_OPTION
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : UCSAPI_EXPAND_TERMINAL_OPTIONS
Description
This function changes terminal’s option value.
Parameter
ClientID : Client ID
TerminalID : Terminal ID.
BasicOptionFlag : It is the combination value of basic option items to be changed.
UCSAPI_OPTION_SCHEDULE
UCSAPI_OPTION_USEVOICE
UCSAPI_OPTION_AUTOENTER
UCSAPI_OPTION_IDLENGTH
UCSAPI_OPTION_MICLEVEL
UCSAPI_OPTION_SECURITYLEVEL
UCSAPI_OPTION_SENSOR
ExpandOptionFlag : It is the combination value of expanded option items to be changed.
UCSAPI_OPTION_SERVERINFO
UCSAPI_OPTION_NETWORKINFO
UCSAPI_OPTION_WORKINGMODE
UCSAPI_OPTION_OPERATIONMODE
UCSAPI_OPTION_NAME
BasicOption : Pointer on UCSAPI_BASIC_TERMINAL_OPTIONS structure
ExpandOption : Pointer on UCSAPI_EXPAND_TERMINAL_OPTIONS structure
Schedule : Pointer on UCSAPI_TERMINAL_SCHEDULE structure
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_SET_TERMINAL_OPTION
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : None
Description
This function forcefully opens the lock device attached to the terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_INVALID_POINTER
UCSAPIERR_INVALID_TERMINAL
Callback Event
UCSAPI_EVENT_TERMINAL_OPEN
Callback Parameter
wParam : UCSAPI_PACKET_INFO
lParam : None
6.1 Properties
LONG ErrorCode
Prototype:
[ReadOnly] long ErrorCode;
Description:
Values for errors occurred during the setting of executed methods and properties are
stored.
The value of 0 means success and all other values mean failure.
Errors occurred during the setting of the method and property of a child object can also
be obtained using this value
LONG ConnectionsOfTerminal
Prototype:
[ReadOnly] long ConnectionsOfTerminal;
Description:
It includes the number of terminals connected to the server.
This value can be acquired after calling GetTerminalCount() method.
LONG TotalFingerCount
Prototype:
[ReadOnly] long TotalFingerCount;
Related methods:
EnrollFromTerminal
Related properties:
FingerID
LONG FingerID
Prototype:
[ReadOnly] long FingerID(long nIndex);
Description:
The finger ID information of converted FIR is stored as array.
nIndex can have a value ranging in 0 ~ (TotalFingerCount – 1).
It is used only after the EventGetUserData is called.
Related methods:
EnrollFromTerminal
Related properties:
FPSampleDataLength, FPSampleData
LONG SampleNumber
Prototype:
[ReadOnly] long SampleNumber;
Description:
The number of finger-by-finger templates of converted FIR is stored. The value of
either 1 or 2 is stored. It is used only after the EventGetUserData is called.
Related methods:
EnrollFromTerminal
LONG FPSampleData
Prototype:
[ReadOnly] VARIANT FPSampleData(
long nFingerID,
long SampleNum);
Description:
Binary stream data of finger-by-finger templates of converted FIR are obtained.
nFingerID and SampleNum can be obtained using FingerID and SampleNumber
property.
It is used only after the EventGetUserData is called.
Parameters:
nFingerID:
The ID of a finger to be obtained.
nSampleNumber:
The number of a sample to be obtained. The value of either 0 or 1 is used.
Related methods:
EnrollFromTerminal
Related properties:
FingerID, SampleNumber, FPSampleDataLength
LONG FPSampleDataLength
Prototype:
[ReadOnly] long FPSampleDataLength(
long nFingerID,
long SampleNum);
Description:
Parameters:
nFingerID:
The ID of a finger to be obtained.
nSampleNumber:
The number of a sample to be obtained. The value of either 0 or 1 is used.
Related methods:
EnrollFromTerminal
Related properties:
FingerID, SampleNumber, FPSampleData
ServerStart
( LONG MaxClient,
LONG Port)
Description
This method initializes UCSCOM module and performs server function.
Parameter
MaxClient: It defines the maximum number of terminals that can be connected. The server adjusts
internal memory use according to the number of clients entered and secures the number of
connections by increasing memory automatically if client connections go over the maximum
number.
Port : Communication port for terminal connection
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventTerminalConnected(LONG TerminalID, BSTR TerminalIP)
Event Parameter
TerminalID: Terminal ID
Description
This method cancels the connection of terminals connected and terminates server function.
Parameter
None
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
None
Event Parameter
None
Definition
This method is for adding password info to the user and this has to be called before AddUser
method.
Parameter
TextPW : Buffer pointer containing password info. It applies only when AuthType is password
combination.
Definition
This method is for adding RFID info to the user and this has to be called before AddUser method.
Parameter
TextRFID : Buffer pointer containing RFID info. It applies only when AuthType is RFID
combination.
AddMethodFinger (Addition)
( BOOL bInitiialize,
LONG nSrcFPDataType,
LONG nFPDataSize,
VARIANT FPData1,
VARIANT FPData2
)
definition
This method is for adding FP info to the user and this has to be called before AddUser method.
Parameter
bInitialize : It initialize FIR data and defines if it needs to make a new one.
If this value is False, newly adding template data will be continuously added to FIR data which is
made internally and there will be one FIR data which contains multiple template data. If this
nSrcFPDataType:
Adding Template Type Info. Refer to UCBioAPI_TEMPLATE_TYPE for related value.
FPData1:
Adding Template data. (Binary stream data)
FPData2:
Adding the second fingeprirnt Template data. (Binary stream data)
This value is not needed for defining as option. If so, SamplesPerFinger value for FIR to be
generated is 1 internally.
AddUser
( LONG ClientID,
LONG TerminalID,
LONG UserID,
BSTR UserName,
LONG IsAdmin,
BSTR DateLimit,
BSTR TimeLimit,
LONG SecuLevel,
LONG AuthType,
BSTR TextPW,
BSTR TextRFID,
BSTR TextBIR )
Description
This method downloads user information from the designated terminal.
Previously registered user information will be overwritten.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
UserID: User ID
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Related Properties
ErrorCode
Event
EventAddUser(LONG Client, LONG TerminalID);
Event Parameter
ClientID : Client ID
TerminalID : Terminal ID
※ Cautions
When multiple users are transferred to the terminal using AddUser method, make sure to call
AddUser and check EventAddUser event if it is processed normal before transferring users.
Description
This method deletes user data from the designated terminal.
If UserID value is -1, all user information stored in the terminal is deleted.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
UserID: User ID
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventDeleteUser(LONG Client, LONG TerminalID);
Event Parameter
ClientID : Client ID
TerminalID : Terminal ID
※ Cautions
When multiple users are transferred to the terminal using DeleteUser meothod, make sure to call
DeleteUser and check EventDeleteUser event if it is processed normal before transferring users.
Description
This method acquires the number of registered users from the designated terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventGetUserCount(LONG ClientID, LONG TerminalID, LONG AdminCount, LONG UserCount);
Event Parameter
ClientID : Client ID
TerminalID : Terminal ID
AdminCount : The number of terminal administrators
UserCount : The number of general users
Description
This method acquires the ID list of all registered users from the designated terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
Return Value
UCSAPIERR_NONE indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventGetUserList(LONG ClientID, LONG TerminalID, LONG UserID, LONG IsAdmin, LONG
CurrentBlock, LONG TotalBlock);
Event Parameter
ClientID : Client ID
TerminalID : Terminal ID
UserID : User ID
IsAdmin : Terminal administrator status (If the value is 1, terminal administrator. If the value is 0,
general user.)
CurrentBlock : Index of block data currently being transmitted
Description
This method acquires designated user’s data from the designated terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
UserID : User ID
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
FPSampleData
TotalFingerCount
FingerID
FPSampleDataLength
SampleNumber
Event
EventGetUserData(LONG ClientID, LONG TerminalID, LONG UserID, BSTR UserName, LONG
IsAdmin, BSTR DateLimit, BSTR TimeLimit, LONG SecuLevel, LONG AuthType, BSTR
TextPW, BSTR TextRFID);
TextPW : Buffer pointer including password. It is set if AuthType is the combination of passwords.
Otherwise, it is set to NULL value.
TextRFID : Buffer pointer including card number. It is set if AuthType is the combination of cards.
Otherwise, it is set to NULL value.
GetAccessLog
( LONG ClientID,
LONG TerminalID,
LONG LogType )
Description
This method acquires designated user’s data from the designated terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
LogType : Authentication log type
0 : New log that has not been transmitted to the server
1 : Log that has already transmitted to the server
2 : All logs stored in the terminal
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventGetAccessLog(LONG ClientID, LONG TerminalID, LONG UserID, BSTR AccessTime, LONG
AuthMode, LONG AuthType, LONG IsMatched, LONG CurrentBlock, LONG TotalBlock);
Description
This method acquires the number of authentication logs in designated type from the designated
terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
LogType : Authentication log type
0 : New log that has not been transmitted to the server
1 : Log that has already been transmitted to the server
2 : All logs stored in the terminal
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventGetAccessLogCount(LONG ClientID, LONG TerminalID, LONG LogCount);
Event Parameter
ClientID : Client ID
GetTerminalCount
Description
This method acquires the number of terminals connected to the server.
Parameter
None
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
TerminalCount
Event
None
Event Parameter
None
Description
This method acquires the firmware version of the designated terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventFirmwareVersion(LONG ClientID, LONG TerminalID, BSTR Version);
Event Parameter
ClientID : Client ID
TerminalID : Terminal ID
Version : Firmware Version
Description
This method upgrades the firmware of the designated terminal.
Parameter
ClientID : Client ID.
TerminalID : Terminal ID.
FilePath : String including firmware file path
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventFirmwareUpgrading(LONG ClientID, LONG TerminalID, LONG CurrentBlock, LONG
TotalBlock);
EventFirmwareUpgrade(LONG ClientID, LONG TerminalID);
Event Parameter
ResponseVerifyInfo
( LONG TerminalID,
LONG UserID,
LONG AuthType,
LONG IsAccessibility,
LONG ErrorCode )
Description
This method is called to return result on user authentication request.
The application program transmits authentication information of the user designated from the
terminal to the terminal.
This method is called for the application program to reply with user’s authentication type
(AuthType) and authentication authority (IsAccessibility) requested from the terminal to the
terminal. In case of no authentication authority, error on this must also be replied.
Parameter
TerminalID : Terminal ID.
UserID : User ID
AuthType : Authentication type
IsAccessibility : Authentication authority status. If the value is 1, authentication authority exists. If
the value is 0, authentication authority does not exist.
ErrorCode : It includes error on authentication authority.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
Event
EventRequestVerifyInfo(LONG TerminalID, LONG UserID);
Event Parameter
TerminalID : Terminal ID
UserID : User ID
Description
This method is called to return result on card authentication request.
After comparing card data acquired from the terminal with registered information, the application
program reply with the result to the terminal.
Parameter
TerminalID : Terminal ID.
UserID : User ID.
IsAccessibility : Authentication authority status. If the value is 1, authentication authority exists. If
the value is 0, authentication authority does not exist.
IsMatched : Authentication result. If the value is 1, authentication authority exists. If the value is 0,
authentication authority does not exist.
ErrorCode : It includes error on authentication authority and result.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event Parameter
TerminalID : Terminal ID
AuthMode : Authentication mode
TextRFID : Text type RFID string
Description
This method is called to return result on 1:1 authentication request.
After comparing fingerprint or password data acquired from the terminal with registered
information, the application program replies with result to the terminal.
Parameter
TerminalID : Terminal ID.
UserID : User ID.
IsAccessibility : Authentication authority status. If the value is 1, authentication authority exists. If
the value is 0, authentication authority does not exist.
IsMatched : Authentication result. If the value is 1, authentication authority exists. If the value is 0,
authentication authority does not exist.
ErrorCode : It includes error on authentication authority and result.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event Parameter
TerminalID : Terminal ID
UserID : User ID
AuthMode : Authentication mode
UCSAPI_AUTHMODE_ATTENDANCE 0
UCSAPI_AUTHMODE_LEAVE 1
UCSAPI_AUTHMODE_NORMAL 2
UCSAPI_AUTHMODE_OUT 3
UCSAPI_AUTHMODE_RETURN 4
SecuLevel : Fingerprint authentication level (Refer to Terminology Explanation.)
AuthType : Authentication type
UCSAPI_AUTHTYPE_FP 0
UCSAPI_AUTHTYPE_PW 2
UCSAPI_AUTHTYPE_CARD 3
VerifyData : Data according to authentication type (fingerprint or password)
Description
This method is called to transmit result on 1:N authentication request to the terminal.
After comparing fingerprint data acquired from the terminal with registered information, the
application program replies with the result to the terminal.
Parameter
TerminalID : Terminal ID
UserID : Authenticated user ID
IsAccessibility : Authentication authority status. If the value is 1, authentication authority exists. If
the value is 0, authentication authority does not exist.
IsMatched : Authentication result. If the value is 1, authentication authority exists. If the value is 0,
authentication authority does not exist.
ErrorCode : It includes error on authentication authority and result.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event Parameter
TerminalID : Terminal ID
AuthMode : Authentication mode
InputIDLength : It includes the length of ID pressed through key pad during authentication request
from the terminal to the server.
This value can be used to realize shortcut ID function during 1:N server authentication.
If user ID registered in the server is “1224” and input ID (UserID) from the terminal is “12” with the
length of input ID (InputIdLength) “2”, the server needs to mark only 99 people from 1200 to 1299.
SecuLevel : Fingerprint authentication level (Refer to Terminology Explanation.)
AuthType : Authentication type acquired at the terminal
VerifyData : Sample data acquired from the terminal during authentication request. They can be
fingerprint sample, password or card number according to AuthType.
OpenTerminal
( LONG ClientID,
LONG TerminalID )
Description
This method forcefully opens the lock device attached to the terminal.
Parameter
ClientID : Client ID
TerminalID : Terminal ID.
Return Value
UCSAPIERR_NONE value indicates success. All other values express error condition.
Error
UCSAPIERR_FUNCTION_FAILED
UCSAPIERR_NOT_ACTIVE
UCSAPIERR_START_SERVER
Related Properties
ErrorCode
Event
EventOpenTerminal(LONG ClientID, LONG TerminalID);
Event Parameter
ClientID : Client ID
TerminalID : Terminal ID
The application program must call UCAPI_ServerStart() function to start server function.
UCAPI_ServerStart() function puts terminal’s connection to the designated connection port always
on standby. Also, the application program must call UCSAPI_ServerStop function to terminate
server function.
Starting Server
LONG MaxClient = 1;
LONG Port = 2201;
UCSAPI_RETURN ret = UCSAPI_ServerStart(MaxClient,
Port,
0,
(UCSAPI_EventHandler) UCSAPINotifyCallback);
If(ret == UCSAPIERR_NONE)
//Success
else
//Fail
Terminating Server
The application program must call UCSAPI_ServerStop() function to terminate server function.
UCSAPI module provides function to add or delete terminal users by the application program.
Adding User
The application program calls UCSAPI_AddUser() function to add user information to the terminal.
if(ret == UCSAPIERR_NONE)
//Success
Deleting User
The application program calls UCSAPI_DeleteUser() function to delete user from the terminal.
To delete all users in the terminal, set UserID to -1.
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
switch(EventType)
{
case UCSAPI_EVENT_REQUEST_VERIFYINFO:
memcpy(&vi, (UCSAPI_VERIFY_INFO*)lParam, sizeof(UCSAPI_VERIFY_INFO));
PacketInfo.ClientID = 0;
PacketInfo.ErrorCode = 0;
vi.AuthType = UCSAPI_AUTHTYPE_FP;
vi.IsAccessibility = TRUE;
UCSAPI_ServerResponse(
TerminalID,
UCSAPI_EVENT_REQUEST_VERIFYINFO,
(WPARAM)&PacketInfo,
(LPARAM)&VerifyInfo);
break;
}
}
vi.AuthType = UCSAPI_AUTHTYPE_CARD;
If(IsAccessiility())
{
vi.IsAccessibility = TRUE;
If(strcmp(szCardNumber, ReferenceCardNumber) == 0)
UCSAPI_ServerResponse(
TerminalID,
UCSAPI_EVENT_REQUEST_CARDVERIFYMATCH,
(WPARAM)&PacketInfo,
(LPARAM)&VerifyInfo);
break;
}
}
If(IsAccessibility())
{
vi.IsAccessibility = TRUE;
If(ret == UCBioAPIERROR_NONE)
{
vi.IsMatched = TRUE;
vi.ErrorCode = 0;
vi.UserID = MatchedUserID;
}
else
{
vi.IsMatched = FALSE;
vi.ErrorCode = UCSAPIERR_MATCHING;
}
}
else
{
vi.IsAccessibility = FALSE;
vi.IsMatched = FALSE;
vi.ErrorCode = UCSAPIERR_ACCESSIBILITY;
}
UCSAPI_ServerResponse(
TerminalID,
UCSAPI_EVENT_REQUEST_VERIFYMATCH,
(WPARAM)&PacketInfo,
(LPARAM)&VerifyInfo);
break;
}
}
If(IsAccessibility())
{
vi.IsAccessibility = TRUE;
UCSAPI_ServerResponse(
TerminalID,
UCSAPI_EVENT_REQUEST_VERIFYMATCH,
(WPARAM)&PacketInfo,
(LPARAM)&VerifyInfo);
break;
}
}
uint32_t ConnectionsOfTerminal=0;
UCSAPI_RETURN ret = UCSAPI_GetTerminalCount(&ConnectionsOfTerminal);
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
//Option flag is set with combination of items on options allowed for setting.
BasicOptionFlag |= UCSAPI_OPTION_IDLENGTH | UCSAPI_OPTION_SCHEDULE;
ExpandOptionFlag |= UCSAPI_OPTION_OPERATIONMODE | UCSAPI_OPTION_NAME;
UCSAPI_BASIC_TERMINAL_OPTIONS BasicOption;
memset(&BasicOption, 0, sizeof UCSAPI_BASIC_TERMINAL_OPTIONS);
UCSAPI_EXPAND_TERMINAL_OPTIONS ExpandOption;
memset(&ExpandOption, 0, sizeof UCSAPI_EXPAND_TERMINAL_OPTIONS);
BasicOption.IdLength = 4;
Schedule.ScheduleType = 1;
//The below scheduling is a setting example to lock the terminal from 9:30 to 18:30.
Schedule.ScheduleData.Expand.THU.Lock1.IsUsed = 1;
Schedule.ScheduleData.Expand.THU.Lock1.StartHour = 9;
Schedule.ScheduleData.Expand.THU.Lock1.StartMin = 30;
Schedule.ScheduleData.Expand.THU.Lock1.EndHour = 18;
Schedule.ScheduleData.Expand.THU.Lock1.EndMin = 30;
ExpandOption.OperationMode = 1;
sprintf((char*)ExpandOption.PrintName, "%s", "UNION");
ret = UCSAPI_SetTerminalOption(
m_ClientID,
TerminalID,
BasicOptionFlag,
ExpandOptionFlag,
&BasicOption,
&ExpandOption,
&Schedule);
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
if(ret == UCSAPIERR_NONE)
//Success
else
//Fail
UCSCOM module was developed to support RAD tool (Visual Basic, Delphi and etc.) developers
and web developers (IIS) but not all functions supported in UCSAPI module are supported.
UCSCOM module’s method and property are explained in detail in chapter 6 UCBCOM Methods
and Properties.
UCSCOMObj.ServerStart(MaxClient, 2201)
If UCSCOMObj.ErrorCode = UCSAPIERR_NONE Then
‘ Success
Else
‘ Failed
End If
//Related event 1
Private Sub UCSCOMObj_EventTerminaConnected(ByVal TerminalID As Long, ByVal TerminalIP
As String)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
//Related event 2
Private Sub UCSCOMObj_EventTerminaDisconnected(ByVal TerminalID As Long)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
UCSCOMObj.ServerStop()
If UCSCOMObj.ErrorCode = UCSAPIERR_NONE Then
‘ Success
Else
‘ Failed
End If
UCSCOM module provides function to add or delete terminal’s users by the application program.
Adding User
To add user information to the terminal, the application program calls AddUser() method.
AuthType = UCSAPI_AUTHTYPE_FP
IsAdmin = 0
DateLimit = “0000000000000000” ‘YYYYMMDDYYYYMMDD
TimeLimit = “00000000” ‘HHmmHHmm
SecuLevel = 0 ‘In case of using terminal’s authentication level, 0 is designated.
‘In case authentication level is 0, terminal uses terminal’s
‘authentication level.
‘To separately designate user’s authentication level, value
‘other than 0 must be used.
UCSCOMObj.AddUser(
ClientID,
TerminalID,
UserID,
UserName,
IsAdmin,
DateLimit, ‘ In case of no authentication restriction on period, NULL can be entered.
TimeLimit, ‘ In case of no authentication restriction on time, NULL can be entered.
SecuLevel,
AuthType)
//Related event
Private Sub UCSCOMObj_EventAddUser(ByVal ClientID As Long, ByVal TerminalID As Long)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
End Sub
Deleting User
To delete terminal user from the terminal, the application program calls DeleteUser() method.
To delete all users in the terminal, set UserID to -1.
//Related event
Private Sub UCSCOMObj_EventDeleteUser(ByVal ClientID As Long, ByVal TerminalID As Long)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
End Sub
//Related event
Private Sub UCSCOMObj_EventGetUserCount(ByVal ClientID As Long, ByVal TerminalID As Long,
ByVal AdminCount As Long, ByVal UserCount As Long)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
End Sub
End Sub
//Related event
Private Sub UCSCOMObj_EventGetUserData(ByVal ClientID As Long, ByVal TerminalID As Long,
ByVal UserID As Long, ByVal UserName As String, ByVal
Admin As Long, ByVal DateLimit As String, ByVal
TimeLimit As String, ByVal SecuLevel As Long, ByVal
AuthType As Long, ByVal TextPW As String, ByVal
TextRFID As String)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
//Related event
Private Sub UCSCOMObj_EventGetAccessLog(ByVal Handle As Long, ByVal TerminalID As Long,
ByVal UserID As Long, ByVal AccessTime As String, ByVal
AuthMode As Long, ByVal AuthType As Long, ByVal Result
As Long, ByVal CurrentBlock As Long, ByVal TotalBlock As
Long)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
End Sub
//Related event
Private Sub UCSCOMObj_EventGetAccessLogCount(ByVal Handle As Long, ByVal TerminalID As
Long, ByVal LogCount As Long)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
End Sub
End Sub
End Sub
End Sub
End Sub
UCSCOMObj.GetTerminalCount()
//Related event
//None
UCSCOMObj.GetFirmware(ClientID, TerminalID)
//Related event
Private Sub UCSCOMObj_EventFirmwareVersion(ByVal ClientID As Long, ByVal TerminalID As
Long, ByVal Version As String)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
End Sub
UCSCOMObj.GetFirmware(ClientID, TerminalID)
End Sub
UCSCOMObj.OpenTerminal(ClientID, TerminalID)
‘Related event
Private Sub UCSCOMObj_EventOpenTerminal(ByVal ClientID As Long, ByVal TerminalID As Long)
If UCSCOMObj.EventError = UCSAPIERR_NONE Then
‘Success
Else
‘Failed
End If
End Sub
UCSCOMObj : Variant;
UCSCOMObj := CreateOleObject(‘UCSCOMLib.UCSCOMObj’);
MaxClient = 1;
Port = 2201;
UCSCOMObj.ServerStart(MaxClient, 2201);
if UCSCOMObj.ErrorCode = UCSAPIERR_NONE Then
begin
//Success
end;
//Related event
procedure EventTerminalConnected(TerminalID: Integer, TerminalIP: WideString);
procedure EventTerminalDisconnected(TerminalID: Integer);
Terminating Server
UCSCOMObj.ServerStop();
UCSCOM module provides function to add or delete terminal’s user by the application program.
Adding User
To add user information to the terminal, the application program calls AddUser() method.
AuthType = UCSAPI_AUTHTYPE_FP;
IsAdmin = 0;
DateLimit = “0000000000000000”; //YYYYMMDDYYYYMMDD
TimeLimit = “00000000”; //HHmmHHmm
SecuLevel = 0; //In case terminal’s authentication level is used, 0 is designated.
//In case authentication level is 0, terminal uses terminal’s
//authentication level value.
//To separately designate user’s authentication level, value
//other than 0 must be used.
UCSCOMObj.AddUser(
ClientID,
TerminalID,
UserID,
UserName,
IsAdmin,
DateLimit, // In case of no authentication restriction on period, NULL can be entered.
TimeLimit, // In case of no authentication restriction on time, NULL can be entered.
SecuLevel,
AuthType,
NULL, //It is used when authentication type is combination of UCSAPI_AUTHTYPE_PW.
NULL //It is used when authentication type is combination of UCSAPI_AUTHTYPE_CARD.
TextBDBTemplate); //It is used when authentication type is combination of
UCSAPI_AUTHTYPE_FP.
//Related event
procedure EventAddUser(ClientID: Integer, TerminalID: Integer);
Deleting User
To delete user from the terminal, the application program calls DeleteUser() method.
To delete all users in the terminal, set UserID to -1.
//Related event
procedure EventDeleteUser(ClientID: Integer, TerminalID: Integer, UserID: Integer);
UCSCOMObj.GetUserCount(ClientID, TerminalID)
//Related event
procedure EventGetUserCount(ClientID: Integer; TerminalID: Integer; AdminCount: Integer;
UserCount: Integer);
UCSCOMObj.GetUserList(ClientID, TerminalID);
//Related event
procedure EventGetUserList(ClientID: Integer; TerminalID: Integer; UserID: Integer;
Admin: Integer; CurrentBlock: Integer; TotalBlock: Integer);
//Related event
procedure EventGetAccessLog(ClientID: Integer; TerminalID: Integer; UserID: Integer;
const AccessTime: WideString; AuthMode: Integer; AuthType:
Integer;
Result: Integer; CurrentBlock: Integer; TotalBlock: Integer);
//Related event
procedure EventGetAccessLogCount(ClientID: Integer; TerminalID: Integer; LogCount: Integer);
UCSCOMObj.GetTerminalCount();
//Related event
//None
UCSCOMObj.GetFirmware(ClientID, TerminalID);
//Related event
procedure EventFirmwareVersion(ClientID: Integer; TerminalID: Integer; const Version:WideString);
UCSCOMObj.OpenTerminal(ClientID, TerminalID);
//Related event
procedure EventOpenTerminal(ClientID: Integer; TerminalID: Integer);
0
UCSAPIERR_CARD_DUPLICATED 0x00177 Duplicate card number occurred during card registration in
1 the terminal.