1 SDK Description *he comm#nication !rotocol S+K is an interface for data comm#nication with standalone finger!rint devices, access control devices, and /I+ card devices. It can be #sed to convenientl" manage #ser information and finger!rints, download attendance records, o!eration records, #ser information, finger!rint tem!lates, and face tem!lates, set devices, and config#re access control. *he S+K is #sed toB 1. +ownload attendance records. 2. !load and download #ser information, card information, finger!rints, and face information. 3. Set access control r#les of access control devices. -. Set device time, match thresholds, etc. . *rigger vario#s events of devices in real time, for e;am!le, finger!rint verification.
2 (uic& Start 2"1 erms 1.
/ealtime event After the S+K and the device comm#nicate with each other s#ccessf#ll", some o!erations on the device (for e;am!le, connecting to the device, verif"ing a #ser, and enrolling a #ser) trigger corres!onding events in real time, and data is transmitted to the '% (host com!#ter). *he triggered events are called realtime events. sers can monitor device states and #ser o!erations in real time thro#gh realtime events.
2.
' Shortened form of Cfinger!rintC.
3.
inger!rint algorithm A finger!rint algorithm refers to the algorithm #sed to generate and verif" finger!rint tem!lates. At !resent, ZKinger 10.0 is the latest finger!rint algorithm.It is a highs!eed algorithm with higher !erformance. or details, see A@s.
-.
.
*ime Zone, gro#!, o!en door combination *hese three terms are the most im!ortant conce!ts of access control.
1
A *ime Zone is a time range. A *ime Zone incl#des the time information of one week, and a time range is s!ecified for each da" of this week. or e;am!le, the following e;!ression indicates
a
time
range
from
00B00
to
22B11
in
each
da"
of
one
weekB
00002211000022110000221100002211000022110000221100002211. 6enerall", 0 *ime Zones can be set in the device. A gro#! is a collection. 8 hen man" #sers have the same access control !rivileges, these #sers can be added to the same gro#! and #se the gro#! *ime Zone. *hen, *ime Zones can be set for the gro#!. An o!en door combination refers to the gro#!s that are reD#ired for #nlock. If the o!en door combination contains onl" one gro#!, it indicates that the door is o!ened when an" of the #sers in this gro#! !asses verification. If the o!en door combination contains two or more gro#!s, the door is o!ened onl" after all gro#!s !ass verification. or e;am!le, an o!en door combination contains gro#!s A and $, the door is o!ened onl" after a member of gro#! A and a member of gro#! $ !ass verification. *he following fig#re shows the relationshi! of the three conce!tsB
.
&!eration record An o!eration record, also called management record, is a record generated when #sers or administrators o!erate on the device, for e;am!le, !owering onEoff the device and enrolling a #ser.
2"2 Common !rocesses or details, see the descri!tions of the demo !rogram.
2
2"2"1 Donloa%in *tten%ance )ecor%s ᄃ
2"2"2 Donloa%in Operation )ecor%s
2"2" Settin *ccess Control
ᄃ
2"2"' Donloa%in 3ser #nformation, Finerprint emplates, or Face emplates *he left diagram shows the !rocess of downloading the information of all #sers.
*he
right
diagram shows the !rocess downloading information of a s!ecified #ser.
3
of the
ᄃ
-
2"2"- )eceivin )eal+time vents /ealtime events can be received in two modes. *he second mode is recommended.
2"2"/ nrollin 3sers Online 43ploa%in #nformation, Finerprint emplates, an% Face emplates of 3sers5 *he following diagram shows
the
!rocess
of
creating a #ser on the device and #!loading the card n#mber, !assword, and finger!rint information for the #ser (that is, enrolling a card #ser, a !assword #ser, and a finger!rint #ser).
ᄃ
)elate% *ttributes "1 *cc6roup 3sae: Set or obtain the gro#! to which a #ser belongs. If this attrib#te is set before #ser information is #!loaded, the #ser gro#! is set when SetserInfo is #sed to #!load #ser information. &therwise, Acc6ro#! is 1 b" defa#lt. *"!eB :&76, writable
"2 *ccime7ones 3sae: Set the *ime Zone of a #ser. If this attrib#te is set before #ser information is #!loaded, the *ime Zone of a #ser is set when SetserInfo is #sed to #!load #ser information. 8pe: :&76 F. It can be regarded as a long onedimensional arra" with s#bscri!t 3. /eadableEwritable
" 9*S/' sageB 8hen the val#e is set to *r#e, the S+K o#t!#ts the character string tem!late in basecodes. &therwise, the S+K o#t!#ts the character string tem!late in he;adecimal codes. *"!eB :&76, readableEwritable
"' Car%umber sageB Set or read the card n#mber of a #ser. If this attrib#te is #navailable, #se 6etStr%ardn#mber and SetStr%ardn#mber instead. *"!eB :&76, readableEwritable
"- Comm!ort sageB Set the n#mber of the serial !ort or the !ort for /S-9 comm#nication. *"!eB :&76, readableEwritable
"/ Convert9#6sageB 8hen the val#e is set to *r#e, the S+K a#tomaticall" converts the font from sim!lified %hinese to traditional %hinese for offline develo!ment. *his f#nction is invalid for series !rod#cts of >#ltilang#age versions. +o not set this f#nction in this case. *"!eB :&76, readableEwritable %a#tionB *his attrib#te is invalid for >#ltilang#age versions. In addition, "o# do not need to modif" this attrib#te for Z4>100 .22, Z4>200 .30, and later versions.
". !#;i%th sageB Indicate the ma;im#m length of the #ser I+ (Arabic n#meral). *"!eB :&76, read onl"
"< 6etStrCar%umber =Definition> =A/IA7*?$&&: 6etStr%ard7#mber(Go#tH $S*/F A%ard7#mber) =3sae> &btain the val#e of cardn#mber of the S+K. 6enerall", this f#nction can be #sed to obtain the card n#mber of a #ser immediatel" after the #ser information is obtained. =!arameter> Acard7#mber %ard n#mber =)eturn ?alue> /et#rn *r#e if it is s#ccessf#l, or ret#rn alse. =)elate% Function> 6etserInfo
"@ SetStrCar%umber =Definition> =A/IA7*?$&&: SetStr%ard7#mber(GinH $S*/ A%ard7#mber) =3sae> Set the val#e of cardn#mber of the S+K. 6enerall", this f#nction can be #sed to set the card n#mber of a #ser before the #ser information is set. =!arameter> Acard7#mber %ard n#mber =)eturn ?alue>
/et#rn *r#e if it is s#ccessf#l, or ret#rn alse. =)elate% Function> SetserInfo
' )eal+time vent Functions '"1 Obtainin )eal+ime vents '"1"1 )event =Definition> =A/IA7*?$&&: /eg4vent( GinH :&76 dw>achine7#mber, GinH :&76 4vent>ask) =3sae> /egister reD#ired realtime events. =!arameter> dw>achine7#mberB +evice n#mber 4vent>askB %ode of an event. =al#es are as followsB 1
&nAtt*ransaction, &nAtt*ransaction4;
2 (11)
&ninger
- (12)
&n7ewser
9 (13)
&n4nrollinger
1 (1-)
&nKe"'ress
2 (1)
&n=erif"
12 (19)
&ningereat#re
102- (15)
&n+oor, &nAlarm
20-9 (110)
&n
-05 (111)
&n8rite%ard
9152 (112)
&n4m!t"%ard
139- (113)
&n+elete*em!late
*o register m#lti!le realtime events, !erform the J&/ o!eration between binar" codes of related events. or e;am!le, to register all realtime events, the val#e of 4vent>ask is 3. =)eturn ?alue> /et#rn *r#e if it is s#ccessf#l, or ret#rn alse.
9
=)elate% Function> /ead/*:og, 6et/*:og
'"1"2 )ea%)Ao =Definition> =A/IA7*?$&&: /ead/*:og( GinH :&76 dw>achine7#mber) =3sae> /ead realtime events and write them to the b#ffer of the '%. *his f#nction can be #sed with 6et/*:og to activel" obtain realtime events from the device after the '% connects to the device s#ccessf#ll". =!arameter> dw>achine7#mberB +evice n#mber =)eturn ?alue> /et#rn *r#e if it is s#ccessf#l, or ret#rn alse. =)elate% Function> 6et/*:og
'"1" 6et)Ao =Definition> =A/IA7*?$&&: 6et/*:og(:&76 dw>achine7#mber) =3sae> &btain an event from the b#ffer of the '% and trigger the event. *his f#nction can be #sed with /ead/*:og to activel" obtain realtime events from the device after the '% connects to the device s#ccessf#ll". =!arameter> dw>achine7#mberB +evice n#mber =)eturn ?alue> /et#rn *r#e if it is s#ccessf#l, or ret#rn alse. =)elate% Function> /ead/*:og
'"2 )eal+ime vents '"2"1 OnConnecte% *his event is triggered when the '% connects to the device s#ccessf#ll". 7o val#e is ret#rned.
5
'"2"2 OnDisConnecte% *his event is triggered when the '% disconnects from the device s#ccessf#ll". 7o val#e is ret#rned.
'"2" On*larm &nAlarm (:&76 Alarm*"!e,:&76 4nroll7#mber,:&76 =erified) *his event is triggered when the device re!orts an alarm. G/et#rn =al#eH Alarm *"!eB *"!e of an alarm. B *am!er alarm. 9B alse alarm. 32B *hreatened alarm. 3-B Anti!ass back alarm. 4nroll7#mberB ser I+.
*he val#e is 0 when a tam!er alarm, false alarm, or threatened alarm is given. *he val#e is the #ser I+ when other threatened alarm or anti!ass back alarm is given.
=erifiedB 8hether to verif"
*he val#e is 0 when a tam!er alarm, false alarm, or threatened alarm is given. *he val#e is 1 when other alarms are given.
'"2"' OnDoor &n+oor (:&76 4vent*"!e) *his event is triggered when the device o!ens the door. G/et#rn =al#eH 4vent*"!eB &!en door t"!e -B *he door is not closed. 3B 4;it b#tton. B *he door is closed. 1B *he door is o!ened #ne;!ectedl".
'"2"- On*ttransactionB &nAtt*ransaction4;
($S*/
4nroll7#mber,:&76
IsIn=alid,:&76
AttState,
:&76
=erif">ethod,:&76 ear, :&76 >onth, :&76 +a", :&76 in#te, :&76 Second, :&76 8ork%ode) *his event is triggered after verification s#cceeds. =)eturn ?alue> 4nroll7#mberB serI+ of a #ser. IsIn=alidB 8hether a record is valid. 1B 7ot valid. 0B =alid. AttStateB Attendance state (defa#lt val#e).
earE>onthE+a"Ein#teE Second indicates the time when verification s#cceeds. 8ork%odeB work code ret#rned d#ring verification. /et#rn 0 when the device does not s#!!ort work code.
'"2"/ OnnrollFinerB &n4nrollinger (:&76 4nroll7#mber, :&76 ingerInde;, :&76 Action/es#lt, :&76 *em!late:ength) *his event is triggered when a finger!rint is registered. =)eturn ?alue> 4nroll7#mberB ser I+ of the finger!rint being registered ingerInde;B Inde; of the c#rrent finger!rint Action/es#ltB &!eration res#lt. /et#rn 0 if the o!eration is s#ccessf#l, or ret#rn a val#e greater than 0. *em!late:engthB :ength of the finger!rint tem!late
'"2". OnFiner *his event is triggered when a finger!rint is !laced on the finger!rint sensor of the device. 7o val#e is ret#rned.
11
'"2"< OnFinerFeature &ningereat#re (:&76 Score) *his event is triggered when a #ser !laces a finger and the device registers the finger!rint. =)eturn ?alue> ScoreB @#alit" score of a finger!rint
'"2"@ On$#Dum &n %ard7#mberB 7#mber of a card that can be an I+ card or an ifare card, the event is triggered onl" when the card is #sed as an I+ card.
'"2"10 One3ser &n7ewser (:&76 4nroll7#mber) *his event is triggered when a new #ser is s#ccessf#ll" enrolled. =)eturn ?alue> 4nroll7#mberB serI+ of the newl" enrolled #ser.
'"2"11 On?erif8 &n=erif" (:&76 serI+) *his event is triggered when a #ser is verified. =)eturn ?alue> 8hen verification s#cceeds, serI+ indicates the I+ of the #ser. /et#rn the card n#mber if card verification is s#ccessf#l, or ret#rn 1.
'"2"12 On;riteCar% &n8rite%ard (:&76 4nroll7#mber, :&76 Action/es#lt, :&76 :ength) *his event is triggered when the device writes a card. =)eturn ?alue> 4nroll7#mberB I+ of the #ser to be written into a card Action/es#ltB /es#lt of writing #ser information into a card. 0B S#ccess. &ther val#esB ail#re. :engthB SiMe of the data to be written into a card
12
'"2"1 Onmpt8Car% &n4m!t"%ard (:&76 Action/es#lt) *his event is triggered when a >ifare card is em!tied. =)eturn ?alue> Action/es#ltB /es#lt of em!t"ing a card. 0B S#ccess. &ther val#esB ail#re.