Upload
blueocean101
View
360
Download
8
Embed Size (px)
Citation preview
8/10/2019 PullSDK User Guide-En V2.0-201201
1/37
PullSDK Interfaces User Guide
Version: 2.0
Support PullSDK 2.2.0.169 and above version
Date: Jan. 2012
About This Manual
This User uide introdu!es the inter"a!e and "un!tion operations o" the PullSDK.
8/10/2019 PullSDK User Guide-En V2.0-201201
2/37
#ontents
Contents
1. Overvie of the PullSDK Interfaces................................................................................................. ! 1 !
". Descri#tion of the PullSDK Interface Technolo$%............................................................................. ! 1 !
&. Installation of the PullSDK Interface................................................................................................. ! 1 !
'. Detailed Descri#tion of the PullSDK Interface (unctions............................................................. ! " !
$.1 #onne!t......................................................................................................................................... % 2 %
$.2 Dis!onne!t................................................................................................................................. % & %
$.& SetDevi!ePara'......................................................................................................................... % & %
$.$ etDevi!ePara'......................................................................................................................... % $ %
$.( #ontrolDevi!e............................................................................................................................. % $ %
$.6 SetDevi!eData............................................................................................................................. % 6 %$.) etDevi!eData............................................................................................................................. % 6 %
$.* etDevi!eData#ount................................................................................................................. % * %
$.9 DeleteDevi!eData......................................................................................................................... % 9 %
$.10 et+T,o-............................................................................................................................. % 10 %
$.11 Sear!hDevi!e......................................................................................................................... % 11 %
$.12 odi"/Pddress................................................................................................................. % 12 %
$.1& Pull,astrror......................................................................................................................... % 1& %
$.1$ SetDevi!e3ileData................................................................................................................. % 1$ %
$.1( etDevi!e3ileData................................................................................................................. % 1( %
$.16 Pro!ess4a!5upData................................................................................................................. % 16 %
). A##endi*......................................................................................................................................... ! 1+ !
(.1 tta!hed Table 1: Detailed Des!ription o" nter"a!e 3iles..................................................... % 1) %
(.2 tta!hed Table 2: Des!ription o" #ontroller Para'eters......................................................... % 1) %
(.& tta!hed Table &: Des!ription o" #ontrolDevi!e Para'eters................................................. % 2$ %
(.$ tta!hed Table $: Des!ription o" Stru!ture o" 3un!tion Tables............................................. % 2( %
(.( tta!hed Table (: Des!ription o" rror #odes in the +eturned Values.................................... % 2* %
(.6 tta!hed Table 6: Des!ription o" vent T/pes and #ode......................................................... % &0 %
(.) 3or'ats o" +eturned Data in 4u""er o" the et+T,o- 3un!tion............................................. % &$ %
I
8/10/2019 PullSDK User Guide-En V2.0-201201
3/37
(. ppendi
1. Overvie of the PullSDK Interfaces
The PullSDK inter"a!es are a -roup o" "un!tions7 8hi!h are used to a!!ess the data o" the #& and #$ a!!ess
!ontrol panels. PullSDK enables the developers o" "inal appli!ation pro-ra's to a!!ess the a!!ess !ontrol
panel 'ore visuall/7 !onvenientl/7 and !on!isel/. The PullSDK inter"a!e provides the "ollo8in- "un!tions:
+ead and set the !ontroller para'eters
+ead7 set7 and delete the related in"or'ation "or ea'ple7 ti'e se-'ent7 user in"or'ation7 and holida/
in"or'ation o" the !ontroller
Sear!h "or and 'odi"/ the devi!e in"or'ation
". Descri#tion of the PullSDK Interface Technolo$%
n the e/es o" the developers o" "inal appli!ation pro-ra's7 the PullSDK inter"a!es are a -roup o" etra!t
inter"a!es that are used to set and -et the data in the a!!ess !ontrol panel. t see's that the developers are
usin- the 'ost universal S;, senten!es 8hile a!!essin- the user data. n the e/es o" the developers o"
appli!ation pro-ra's7 the PullSDK inter"a!es see' to be a database server.
The PullSDK inter"a!es support the T#P
8/10/2019 PullSDK User Guide-En V2.0-201201
4/37
PullSDK nter"a!es User uide
'. Detailed Descri#tion of the PullSDK Interface (unctions
'.1 Connect
[Function]
int#onne!t!onst !harBPara'eters
[Objective]
The "un!tion is used to !onne!t a devi!e. "ter the !onne!tion is su!!ess"ul7 the !onne!tion handle is
returned.
[Parameter description]
Para,eters-
Cin: Spe!i"/ the !onne!tion options throu-h the para'eter7 "or ea'ple:
Eproto!olF+S$*(7portF#G27baudrateF&*$00bps7devi!eidF17ti'eoutF(00007 pass8dFHI
proto!olFT#P7ipaddressF192.16*.12.1($7portF$&)07ti'eoutF$0007pass8dFHI
To !onne!t a devi!e7 the s/ste' needs to trans"er the devi!e%related !onne!tion para'eters.
#rotocolindi!ates the proto!ol used "or !o''uni!ation. t present7 +S$*( and T#P !an be used.
#ort: #o''uni!ation port o" the devi!e. 3or ea'ple7 i" the +S$*( proto!ol is used7 /ou !an set #ortto
COM1: " the T#P is used7 the de"ault #ortis '&+unless other8ise noted.
deviceid: Devi!e D used b/ the serial port.
baudrate: 4aud rate used "or the !o''uni!ation o" the !o''uni!ation o" the serial port.
i#address: P address o" the related devi!e "or T#P
8/10/2019 PullSDK User Guide-En V2.0-201201
5/37
(. ppendi
'." Disconnect
[Function]
VoidDis!onne!tMAD,handle
[Objective]
The "un!tion is used to dis!onne!t the devi!e.
[Parameter description]
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
[Returned value]
Aone
[Example]
Python:
sel".!o''pro.Dis!onne!tsel".h!o''pro
sel".h!o''pro F 0
c2-
Dis!onne!thI
h F ntPtr.NeroI
'.& SetDevicePara,
[Function]
intSetDevi!ePara'MAD,handle7 !onst !harBte'Values
[Objective]
The "un!tion is used to set the !ontroller para'eters7 "or ea'ple7 the devi!e D7 door sensor t/pe7 drivin-
ti'e o" the lo!57 and read interval.
[Parameter description]
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
Ite, 3alues
Cin: The devi!e para'eter value to be setI the 'ultiple para'eter values !an be separated b/ !o''asI /ou
!an set at 'ost 20 para'eters at a ti'e tta!hed table 2 lists the para'eter value attributes.
[Returned value]
?hen the returned value is 7 it indi!ates that the operation is su!!ess"ul. ?hen the returned value is a
ne-ative value7 it indi!ates an error. tta!hed table ( lists the in"or'ation about the error !odes.
[Example]
P%thon-
ite's F EDevi!eDF17Door1SensorT/peF27Door1Driverti'eF67Door1nterti'eF&E
pLite's F !reateLstrin-Lbu""erite's
ret F sel".!o''pro.SetDevi!ePara'sel".h!o''pro7 pLite's
c#:
int ret F 0I
ite's F EDevi!eDF17Door1SensorT/peF27Door1Driverti'eF67Door1nterti'eF&E
ret F SetDevi!ePara'h7 ite'sI
&
8/10/2019 PullSDK User Guide-En V2.0-201201
6/37
PullSDK nter"a!es User uide
'.' GetDevicePara,
[Function]
intetDevi!ePara'MAD,handle7 !harB4u""er7 int4u""erSi=e7 !onst !harBte's
[Objective]
The "un!tion is used to read the !ontroller para'eters7 "or ea'ple7 the devi!e D7 door sensor t/pe7
drivin- ti'e o" the lo!57 and read interval.
[Parameter description]
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
4uffer
Cin: The bu""er used to re!eive the returned dataI the returned data is epressed in a tet "or'atI i" the
returned data is 'ultiple para's7 the 'ultiple para's are separated b/ co,,as.
4uffer Si5e
Cin The si=e o" the bu""er used to re!eive the returned data.
Ite,s
Cin: The para'eter na'es o" the devi!e to be readI the 'ultiple para'eter na'es are separated b/
!o''asI /ou !an read at 'ost &0 para'eters at a ti'e tta!hed table 1 lists the para'eter value
attributes.
[Returned value]
?hen the returned value is 7 it indi!ates that the operation is su!!ess"ul. ?hen the returned value is a
ne-ative value7 it indi!ates that the operation "ails. tta!hed table ( lists the in"or'ation about the error
!odes.
[Example]
Python:
bu""er F !reateLstrin-Lbu""er20$*
ite's F EDevi!eD7Door1SensorT/pe7Door1Driverti'e7Door1nterti'eE
pLite's F !reateLstrin-Lbu""erite's
retFsel".!o''pro.etDevi!ePara'sel".h!o''pro7 bu""er7 2(67 pLite's
c2-
int ret F 0I
int 4U33+SN F 10 B 102$ B 102$I
b/teC bu""er F ne8 b/teC4U33+SNI
ite's F EDevi!eD7Door1SensorT/pe7Door1Driverti'e7Door1nterti'eEI
ret F etDevi!ePara'h7 re" bu""er C07 4U33+SN7 ite'sI
'.) ControlDevice
[Function]
int #ontrolDevi!eMAD, handle7 ,GA GperationD7 ,GA Para'17 ,GA Para'27 ,GA
Para'&7 ,GAPara'$7 !onst !harBGptions
[Objective]
The "un!tion is used to !ontrol the a!tions o" the !ontroller.
[Parameter description]
4
8/10/2019 PullSDK User Guide-En V2.0-201201
7/37
(. ppendi
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
O#erationID
Cin Gperation !ontents: 1 "or output7 2 "or !an!el alar'7 & "or restart devi!e7 and $ "or enable
8/10/2019 PullSDK User Guide-En V2.0-201201
8/37
PullSDK nter"a!es User uide
'.6 SetDeviceData
[Function]
intSetDevi!eDataMAD,handle7!onst !harBTableAa'e7 !onst !harBData7 !onst !harBGptions
[Objective]
The "un!tion is used to set the devi!e data "or ea'ple7 the ti'e se-'ent7 user in"or'ation7 and holida/
in"or'ation. The devi!e data !an be one or 'ultiple re!ords.
[Parameter description]
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
Table7a,e
Cin: Data table na'e. tta!hed table $ lists the available data tables.
Data
Cin: Data re!ordI the data is epressed in a tet "or'atI the 'ultiple re!ords are separated b/ 8r8n7 and the
3ieldFValueH pairs are separated b/ 8t.
O#tions
Cin: The de"ault value is nullI it is used "or etension.
[Returned value]
?hen the returned value is 7 it indi!ates that the operation is su!!ess"ul. ?hen the returned value is a
ne-ative value7 it indi!ates that the operation "ails. tta!hed table ( lists the in"or'ation about the error
!odes.
[Example]
Python:
table F EuserE Q User in"or'ation table
data F EPinF19999Rt#ardAoF1&&)($01RtPass8ordF1RrRnPinF2Rt#ardAoF1$12*0(*RtPass8ordF1E
pLtable F !reateLstrin-Lbu""ertable
strLbu" F !reateLstrin-Lbu""erdata
ret F sel".!o''pro.SetDevi!eDatasel".h!o''pro7 pLtable7 strLbu"7 O Q Upload the strLbu" data
to the user in"or'ation table
c#
int ret F 0I
strin- devtablena'e F EuserEI
strin- data F EPinF19999Rt#ardAoF1&&)($01RtPass8ordF1RrRnPinF2Rt#ardAoF1$12*0(*RtPass8ordF1EI
strin- options F EEI
ret F SetDevi!eDatah7 devtablena'e7 data7 optionsI
'.+ GetDeviceData
[Function]
intetDevi!eDataMAD, handle7 !har B4u""er7 int 4u""erSi=e7 !onst !har BTableAa'e7 !onst !har
B3ieldAa'es7!onst !harB3ilter7 !onst !harBGptions
[Objective]
The "un!tion is used to read the devi!e data "or ea'ple7 the pun!h re!ords7 ti'e se-'ent7 user
in"or'ation7 and holida/ in"or'ation. The data !an be one or 'ultiple re!ords.
6
8/10/2019 PullSDK User Guide-En V2.0-201201
9/37
(. ppendi
[Parameter description]
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
4uffer
Cin: The bu""er used to re!eive the returned dataI the returned data is epressed in a tet "or'atI i" thereturned data is 'ultiple re!ords7 the 'ultiple re!ords are separated b/ 8r8n.
4ufferSi5e
Cin The si=e o" the bu""er used to re!eive the returned data.
Table7a,e
Cin: Data table na'e. tta!hed table $ lists the available data tables.
(ield7a,es
Cin: 3ield na'e listI the 'ultiple "ields are separated b/ se'i!olonsI 9indi!ates all "ields7 and the "irst line
in the returned data "ield is the "ield na'es.
(ilter
Cin: The !onditions o" readin- the dataI the !hara!ter strin- in the "or'at o" "ield na'e7 operator7 valueH
!an support 'ultiple !onditions7 8hi!h are separated b/ !o''asI "or ea'ple:
3ield na'eFValueno spa!e is allo8ed at t8o sides o" /
O#tions
Cin: Gnl/ used to do8nload data o" the a!!ess !ontrol re!ords event e""e!tivel/ at presentI 8hen the para'eter
value is 7e :ecord7 ne8 re!ords are do8nloaded. ?hen the value is null7 all re!ords are do8nloaded. ?hen do
8nload the other table data7 this "ield !an set to an e'pt/ strin-.
[Returned value]
?hen the returned value is or a positive value7 it indi!ates that the operation is su!!ess"ul the returned
value indi!ates the nu'ber o" re!ords. ?hen the returned value is a ne-ative value7 it indi!ates that theoperation "ails. tta!hed table ( lists the in"or'ation about the error !odes.
[Example]
Python:
table F HuserH Q Do8nload the user data "ro' the usertable
"ielna'e F EBE Q Do8nload all "ield in"or'ation in the table
p"ilter F EH Q Mave no "ilterin- !onditions and thus do8nload all in"or'ation
options F EH
uer/Lbu" F !reateLstrin-Lbu""er$B102$B102$
uer/Ltable F !reateLstrin-Lbu""ertable
uer/L"ieldna'e F !reateLstrin-Lbu""er"ieldna'e
uer/L"ilter F !reateLstrin-Lbu""er"ilter
uer/Loptions F !reateLstrin-Lbu""eroptions
ret F sel".!o''pro.etDevi!eDatasel".h!o''pro7 uer/Lbu"7 $B102$B102$7 uer/Ltable7
uer/L"ieldna'e7 uer/L"ilter7 uer/Loptions
c#
int ret F 0I
int 4U33+SN F 10 B 102$ B 102$I
b/teC bu""er F ne8 b/teC4U33+SNI
strin- devtablena'e F EuserEIstrin- str FEBEI
strin- devdat"ilter F EEI
)
8/10/2019 PullSDK User Guide-En V2.0-201201
10/37
PullSDK nter"a!es User uide
strin- options F EEI
ret F etDevi!eDatah7 re" bu""erC07 4U33+SN7 devtablena'e7 str7 devdat"ilter7 optionsI
'.; GetDeviceDataCount
[Function]
intetDevi!eData#ountvoidBMandle7 !onst !harBTableAa'e7 !onst !harB3ilter7!onst !harBGptions
[Objective]
The "un!tion is used to read the total nu'ber o" re!ords on the devi!e and return the nu'ber o" re!ords "or
the spe!i"ied data.
[Parameter description]
8/10/2019 PullSDK User Guide-En V2.0-201201
11/37
(. ppendi
'.= DeleteDeviceData
[Function]
intDeleteDevi!eDataMAD,handle7!onst !harBTableAa'e7!onst !harBData7!onst !harBGptions
[Objective]
The "un!tion is used to delete the data "or ea'ple7 user in"or'ation and ti'e se-'ent on the devi!e.
[Parameter description]
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
Table7a,e
Cin: Data table na'e. tta!hed table $ lists the available data tables.
Data
Cin: Data re!ordI the data is epressed in a tet "or'atI the 'ultiple re!ords are separated b/ 8r8n7 and the
3ieldFValueH pairs are separated b/ 8t.O#tions
Cin: The de"ault value is nullI it is used "or etension.
[Returned value]
?hen the returned value is or a positive value7 it indi!ates that the operation is su!!ess"ul. ?hen the
returned value is a ne-ative value7 it indi!ates that the operation "ails. tta!hed table ( lists the in"or'ation
about the error !odes.
[Example]
Python:
table F userH
data F EPinF2E Q #onditions o" deletin- the data
pLtable F !reateLstrin-Lbu""ertable
pLdata F !reateLstrin-Lbu""erdata
ret F sel".!o''pro.DeleteDevi!eDatasel".h!o''pro7 pLtable7 pLdata7 EE
c#
int ret F 0I
strin- devtablena'e F EuserEI
strin- data F EPinF2EI
strin- options F EEI
ret F DeleteDevi!eDatah7 devtablena'e7 data7 optionsI
9
8/10/2019 PullSDK User Guide-En V2.0-201201
12/37
PullSDK nter"a!es User uide
'.1 Get:T>o$
[Function]
int et+T,o-MAD,handle7!harB4u""er7 int4u""erSi=e
[Objective]
The "un!tion is used to a!uire the realti'e event re!ords -enerated b/ the euip'ent and the door status
or alar' status o" the euip'ent.
[Parameter description]
handle
Cin: The handle that is returned 8hen the !onne!tion is su!!ess"ul.
4uffer
Cin The bu""er used to re!eive the returned data7 the returned data is epressed in a tet "or'at.
This bu""er stores t8o t/pes o" data: realti'e event re!ords and door
8/10/2019 PullSDK User Guide-En V2.0-201201
13/37
(. ppendi
'.11 SearchDevice
[Function]
intSear!hDevi!e!harB#o''T/pe7!harBddress7 !harB4u""er
[Objective]
The "un!tion is used to sear!h "or the a!!ess !ontrol panel in the ,A.
[Parameter description]
Co,,T%#e
Cin: " the !o''uni!ation t/pe is set to UDP or thernet7 all devi!es o" the spe!i"ied !o''uni!ation
t/pe 8ill be sear!hed.
Address
Cin: 4road!ast addressI the s/ste' sear!hes "or the devi!es in the ,A 8ithin the spe!i"ied P address
ran-eI the de"ault value is "))."))."))."))?5no8n as net8or5 broad!astin-.
4uffer
Cin: The bu""er is used to save the dete!ted devi!es. Users should deter'ine the reuested 'e'or/
a!!ordin- to the nu'ber o" devi!es in the !orrespondin- net8or5. 3or ea'ple7 i" the net8or5 has not
'ore than (0 devi!es7 it is re!o''ended that users should reuest the 'e'or/ o" &2KI i" the net8or5 has
not 'ore than 100 devi!es7 it is re!o''ended that users should reuest the 'e'or/ o" 6$K.
[Returned value]
?hen the returned value is or a positive value7 it indi!ates the nu'ber o" "ound a!!ess !ontrol panels.
?hen the returned value is a ne-ative value7 it indi!ates that the operation "ails. tta!hed table ( lists the
in"or'ation about the error !odes.
[Note]
This approa!h is intended to sear!h "or a!!ess !ontrollers on a ,A in UDP broad!ast 'ode. UDP pa!5ets
!annot traverse routers7 so an a!!ess !ontroller 'ust not be separated "ro' a server b/ routers. " b/ this
'eans /ou "ind a devi!e that resides on a di""erent net8or5 se-'ent as a server but "ail to pin- the P
address o" an a!!ess !ontroller7 /ou 'a/ set the !ontroller and server addresses to be on the sa'e subnet
not ne!essaril/ on the sa'e net8or5 se-'ent. 3or details on net8or5 settin-7 !onsult related
ad'inistrator to obtain !orre!t P addresses7 subnet 'as5s and -ate8a/s.
[Example]
Python:
devLbu" F !reateLstrin-Lbu""erEE7 6$B102$
retFsel".!o''pro.Sear!hDevi!eEUDPE7 E2((.2((.2((.2((E7 devLbu"
c#
int ret F 0I
strin- udp F EUDPEI
strin- adr F E2((.2((.2((.2((EI
b/teC bu""er F ne8 b/teC6$ B 102$I
ret F Sear!hDevi!eudp7adr7 re" bu""erC0I
11
8/10/2019 PullSDK User Guide-En V2.0-201201
14/37
PullSDK nter"a!es User uide
'.1" Modif%IPAddress
[Function]
intodi"/Pddress!harB#o''T/pe7!harBddress7 !harB4u""er
[Objective]
The "un!tion is used to 'odi"/ the P addresses o" !ontrollers throu-h the UDP broad!ast 'ethod. 3or
se!urit/ purposes7 onl/ the P addresses7 subnets7 and -ate8a/s o" the a!!ess !ontrollers 8ith no pass8ords
spe!i"ied !an be 'odi"ied.
[Parameter description]
Co,,T%#e
Cin: #o''uni!ation 'odes e'plo/ed in sear!h o" a!!ess !ontrollers: UDP or thernet in this ea'ple.
Address
Cin: 4road!ast addressI the de"ault value is 2((.2((.2((.2((.
4ufferCin: The bu""er is used to save the # addresses and ne8 P addresses o" the tar-et devi!e.
#on"i-ure subnet 'as5s and -ate8a/s a!!ordin- to !urrent net8or57 e!ept "or P addresses.
[Returned value]
?hen the returned value is or a positive value7 it indi!ates the nu'ber o" re!ords "or the re!eived data.
?hen the returned value is a ne-ative value7 it indi!ates that the operation "ails. tta!hed table ( lists the
in"or'ation about the error !odes.
[Example]
Python:
'a! F 00:1):61:01:**:2) Q # address o" the tar-et devi!e
ne8Lip F 192.16*.12.1(6 Q Ae8 P address o" the devi!e
!o''Lp8d F
str F E#Fs7PddressFs E 'a!7ne8Lip
pLbu" F !reateLstrin-Lbu""erstr
'odi"/Lip F sel".!o''pro.odi"/PddressUDPH7 2((.2((.2((.2((H7 pLbu"
c#
int ret F 0I
strin- udp F EUDPEI
strin- address F E2((.2((.2((.2((EI
strin- bu""er F E#F00:1):61:01:**:2)E W E7E W EPddressF192.16*.12.1(6EIret F odi"/Pddressudp7address7bu""erI
12
8/10/2019 PullSDK User Guide-En V2.0-201201
15/37
(. ppendi
'.1& Pull>ast@rror
[Function]
intPull,astrror
[Objective]
The "un!tion is used to Gbtain the returned error !ode. " an error !ode return "ails b/ usin- other error
!odes7 this "un!tion !an be !alled to obtain the error !ode. 3or ea'ple7 i" 0 is returned 8hen an euip'ent
!onne!tion "ails b/ !allin- Connect07 /ou !an run this "un!tion to obtain !urrent error !ode.
[Parameter description]
Aone
[Returned value]
rror D.
[Example]
Python:See the ne8 !ontents belo8.
params= u"protocol=TCPipaddress=!#$!%&$!$#'!port=()*'timeout=)'''pass+d=!#)abc"
constr = create,strin-,bu..er/params0
sel.$1commpro = sel.$commpro$Connect/constr0
i. sel.$1commpro 2 '3
sel.$connected = True
else3
error F sel".!o''pro.Pull,astrror
c#
int ret = 0; // Error code
string str = "
proto!olFT#P7ipaddressF192.16*.1.2017portF$&)07ti'eoutF&0007pass8dF12&ab!";
h = Connect(str);
if (h != IntPtrero)
#ess$ge%o&'ho("Connect deice s*cceed!");
+
e,se
ret = P*,,-$stError();
#ess$ge%o&'ho("Connect deice .$i,ed! he error code is " ret);
+
1&
8/10/2019 PullSDK User Guide-En V2.0-201201
16/37
PullSDK nter"a!es User uide
'.1' SetDevice(ileData
[Function]
int SetDevi!e3ileDatavoid BMandle7 !onst !har B3ileAa'e7 !har B4u""er7int 4u""erSi=e7!onst !har
BGptions
[Objective]
The "un!tion is used to trans"er a "ile "ro' the P# to the devi!e. t 'ainl/ used to trans"er the updade "ile.
The updade "ile na'e is e'"8.!"-.
[Parameter description]
8/10/2019 PullSDK User Guide-En V2.0-201201
17/37
(. ppendi
'.1) GetDevice(ileData
[Function]
int etDevi!e3ileDatavoid BMandle7!har B4u""er7int B4u""erSi=e7!onst !har B3ileAa'e7!onst !har
BGptions
[Objective]
The "un!tion is used to obtain a "ile "ro' the devi!e to the P#. t !an obtain user "ile7 re!ord "ile and et!.
[Parameter description]
8/10/2019 PullSDK User Guide-En V2.0-201201
18/37
PullSDK nter"a!es User uide
'.16 Process4acu#Data
[Function]
intPro!ess4a!5upData!onst unsi-ned!harBrev4u"7 int"ile,en7 !harBout4u"7
int outSi=e
[Objective]
The "iles used "or pro!essin- euip'ent ba!5up "iles7 "or ea'ple7 ba!5up "iles in an SD !ard.
[Parameter description]
rev4uf
CinThe uploaded "ilesI
file>en
Cin The "ile len-thI
out4ufCin To re!eive the returnin- dataI
outsi5e
Cin The 'a len-th o" the re!eivin- data.
[Returned value]
The returnin- value is 0 or positive nu'ber "or su!!ess operation. Gther8ise7 the operation is
"ailed. 3or the error !odes7 please re"er to the ppendi (.
[Example]
Python "ilena'e F sddata.datH
bu""Llen F len"ilena'e
bu" F !reateLstrin-Lbu""er"ilena'e
bu""er F !reateLstrin-Lbu""er16B102$B102$
ret F sel".!o''pro. Pro!ess4a!5upDatabu"7 bu""Llen7 re"bu""erC07 16 B 102$ B 102$
c# b/teC bu""er F ne8b/teC16 B 102$ B 102$I
b/teC bu" F ne8b/teC16 B 102$ B 102$I
int4u""erSi=e F 0I
intret F %1Istrin-"ilena'e F Euser.datEI
Strea'+eaderpro3ile F ne8Strea'+eader"ilena'eI
4u""erSi=e F pro3ile.4aseStrea'.+eadbu"7 07 16 B 102$ B 102$I
ret F Pro!ess4a!5upDatabu"7 4u""erSi=e7 re"bu""erC07 16 B 102$ B 102$I
16
8/10/2019 PullSDK User Guide-En V2.0-201201
19/37
(. ppendi
). A##endi*
).1 Attached Table 1- Detailed Descri#tion of Interface (iles
3ile Aa'e Des!ription
pl!o''pro.dll D/na'i! !onne!tion database inter"a!e o" the PullSDK "un!tion
pl!o''s.dll Database on 8hi!h the PullSDK inter"a!es rel/
plrs!o''.dll Database on 8hi!h the PullSDK inter"a!es rel/
plt!p!o''.dll Database on 8hi!h the PullSDK inter"a!es rel/
rs!a-ent.dll Database on 8hi!h the PullSDK inter"a!es rel/
)." Attached Table "- Descri#tion of Controller Para,eters
ttribute Aa'e Para'eter +ead
8/10/2019 PullSDK User Guide-En V2.0-201201
20/37
PullSDK nter"a!es User uide
ttribute Aa'e Para'eter +ead
8/10/2019 PullSDK User Guide-En V2.0-201201
21/37
(. ppendi
ttribute Aa'e Para'eter +ead
8/10/2019 PullSDK User Guide-En V2.0-201201
22/37
PullSDK nter"a!es User uide
ttribute Aa'e Para'eter +ead
8/10/2019 PullSDK User Guide-En V2.0-201201
23/37
(. ppendi
ttribute Aa'e Para'eter +ead
8/10/2019 PullSDK User Guide-En V2.0-201201
24/37
PullSDK nter"a!es User uide
ttribute Aa'e Para'eter +ead
8/10/2019 PullSDK User Guide-En V2.0-201201
25/37
(. ppendi
ttribute Aa'e Para'eter +ead
8/10/2019 PullSDK User Guide-En V2.0-201201
26/37
PullSDK nter"a!es User uide
).& Attached Table &- Descri#tion of ControlDevice Para,eters
GperationD Des!riptio
n
Para'1 Para'2 Para'& Para'$ Gptions
1 Gutput
operation
Door nu'ber
or auiliar/
output
nu'ber
1: Door
ouptput
2: auiliar/
output t
he address
t/pe o"
output
operation
5
0: disable
2((: nor'al
open state
1X60: nor'al
open or the
duration o"
nor'al open
"
Para'2F17 thevalue o"
Para'& 'a5es
sense 5
reserve
d
pansi
on
para'ete
r is null
2 #an!el
alar'
0 null 5 0 null
5
0 null 5 reserve
d
pansi
on
para'ete
r is null
& +estart
devi!e
0 null 5 0 null
5
0 null 5 reserve
d
pansi
on
para'ete
r is null
$ nable
8/10/2019 PullSDK User Guide-En V2.0-201201
27/37
(. ppendi
).' Attached Table '- Descri#tion of Structure of (unction Tables
Table Aa'e TableAa'e 3ield +e'ar5s
#ard
nu'ber
in"or'ation
table
user #ardAo7 Pin7 Pass8ord7 roup7
StartTi'e7 ndTi'e
The StartTi,eand @ndTi,eshould be
spe!i"ied in a !orre!t "or'at.
>>>>DDI "or ea'ple: 20100*2&I
Grou#indi!ates the personnel -roup o"
'ulti%!ard veri"/!ation.
!!ess
privile-e list
userauthori=
e
Pin7 uthori=eTi'e=oned7
uthori=eDoord
uthori=eDoord is authori=ed b/ the
door:
1 denotes ,G#K1
2 denotes ,G#K2
& denotes ,G#K1 and ,G#K2
$ denotes ,G#K&
( denotes ,G#K1 and ,G#K&
6 denotes ,G#K2 and ,G#K&
) denotes ,G#K17 ,G#K27 ,G#K&
* denotes ,G#K$
9 denotes ,G#K1 and ,G#K$
10 denotes ,G#K2 and ,G#K$
11 denotes ,G#K17 ,G#K27 ,G#K$
12 denotes ,G#K& and ,G#K$
1& denotes ,G#K17 ,G#K&7 ,G#K$
1$ denotes ,G#K27 ,G#K&7 ,G#K$
1( denotes ,G#K17 ,G#K27 ,G#K&
and ,G#K$.
ssu'e that "our doors are nu'bered
17 27 &7 and $ respe!tivel/7 then:
11%1W12%1W1&%1W1$%
1F1(
or 11112 F 1(10
Molida/
table
holida/ Molida/7 Molida/T/pe7 ,oop The
8/10/2019 PullSDK User Guide-En V2.0-201201
28/37
8/10/2019 PullSDK User Guide-En V2.0-201201
29/37
(. ppendi
Table Aa'e TableAa'e 3ield +e'ar5s
3irst%!ard
door%
openin-
table
"irst!ard Pin7 DoorD7 Ti'e=oneD
ulti%!ard
openin-
table
'ulti!ard nde7 Doord7 roup17 roup27
roup&7 roup$7 roup(
roup 1 to roup ( are the nu'bers o" the
'ulti%!ard openin- -roups
,in5a-e
!ontrol
8/10/2019 PullSDK User Guide-En V2.0-201201
30/37
PullSDK nter"a!es User uide
Table Aa'e TableAa'e 3ield +e'ar5s
te'platev10
table
te'platev1
0
Si=e UD PA 3in-er
DValid Te'plate +esv
erd ndTa-
Aote: The "ields in the table are !ase%sensitive.
).) Attached Table )- Descri#tion of @rror Codes in the :eturned 3alues
1 5@rror Code of PullSDK and (ir,are 4% #rovided
rror #ode Des!ription
%1 The !o''and is not sent su!!ess"ull/
%2 The !o''and has no response
%& The bu""er is not enou-h
%$ The de!o'pression "ails
%( The len-th o" the read data is not !orre!t
%6 The len-th o" the de!o'pressed data is not !onsistent 8ith the epe!ted len-th
%) The !o''and is repeated
%* The !onne!tion is not authori=ed
%9 Data error: The #+# result is "ailure
%10 Data error: PullSDK !annot resolve the data
%11 Data para'eter error
%12 The !o''and is not ee!uted !orre!tl/
%1& #o''and error: This !o''and is not available%1$ The !o''uni!ation pass8ord is not !orre!t
%1( 3ail to 8rite the "ile
%16 3ail to read the "ile
%1) The "ile does not eist
%99 Un5no8n error
%100 The table stru!ture does not eist
%101 n the table stru!ture7 the Condition"ield does not eit
%102 The total nu'ber o" "ields is not !onsistent
%10& The seuen!e o" "ields is not !onsistent%10$ +eal%ti'e event data error
%10( Data errors o!!ur durin- data resolution.
%106 Data over"lo8: The delivered data is 'ore than $ 4 in len-th
%10) 3ail to -et the table stru!ture
%10* nvalid options
%201 ,oad,ibrar/ "ailure
%202 3ail to invo5e the inter"a!e
%20& #o''uni!ation initiali=ation "ails
%206 Start o" a serial inter"a!e a-ent pro-ra' "ails and the !ause -enerall/ relies in
ineisten!e or o!!upation o" the serial inter"a!e.
%&01 +euested T#P
8/10/2019 PullSDK User Guide-En V2.0-201201
31/37
(. ppendi
rror #ode Des!ription
%&02 n!orre!t version nu'ber
%&0& 3ail to -et the proto!ol t/pe
%&0$ nvalid SG#KT
%&0( SG#KT error%&06 MGST error
%&0) Connection $tte7t f$i,ed
2 5 inSocet @rror Codes
100&( +esour!es te'poraril/ unavailable.
This error is returned "ro' operations on nonblo!5in- so!5ets that !annot be
!o'pleted i''ediatel/7 "or ea'ple7 re!v ?sapire"L2i9e.asp 8hen no data is
ueued to be read "ro' the so!5et. t is a non%"atal error7 and the operation
should be retried later. t is nor'al "or ?S?GU,D4,G#K to be reported
as the result "ro' !allin- !onne!t on a nonblo!5in- SG#KLST+ so!5et
?sapire"L*')'.asp7 sin!e so'e ti'e 'ust elapse "or the !onne!tion to be
established.
100&* n operation 8as atte'pted on so'ethin- that is not a so!5et. ther the so!5et
handle para'eter did not re"eren!e a valid so!5et7 or "or sele!t7 a 'e'ber o" an
"dLset 8as no valid.
100($ #onne!tion reset b/ peer.
n eistin- !onne!tion 8as "or!ibl/ !losed b/ the re'ote host. This nor'all/
results i" the peer appli!ation on the re'ote host is suddenl/ stopped7 the host
is rebooted7 the host or re'ote net8or5 inter"a!e is disabled7 or the re'ote host
uses a hard !lose See setso!5opt ?sapire"L9$aa.asp "or 'ore in"or'ation on
the SGL,A+ option on the re'ote so!5et. This error 'a/ also result i" a
!onne!tion 8as bro5en due to 5eep%alive a!tivit/ dete!tin- a "ailure 8hile one
or 'ore operations are in pro-ress. Gperations that 8ere in pro-ress "ail 8ith
?SAT+ST. Subseuent operations "ail 8ith ?S#GAA+ST.
10060 #onne!tion ti'ed out.
!onne!tion atte'pt "ailed be!ause the !onne!ted part/ did not properl/
respond a"ter a period o" ti'e7 or established !onne!tion "ailed be!ause
!onne!ted host has "ailed to respond.10061 #onne!tion re"used.
Ao !onne!tion !ould be 'ade be!ause the tar-et 'a!hine a!tivel/ re"used it.
This usuall/ results "ro' tr/in- to !onne!t to a server that is ina!tive on the
"orei-n host [ that is7 one 8ith no server appli!ation runnin-.
1006( Ao route to host.
so!5et operation 8as atte'pted to an unrea!hable host. See
?SATUA+#M.
29
8/10/2019 PullSDK User Guide-En V2.0-201201
32/37
PullSDK nter"a!es User uide
).6 Attached Table 6- Descri#tion of @vent T%#es and Code
#ode vent T/pes Des!ription
0 Aor'al Pun!h Gpen n C#ard Gnl/ veri"i!ation 'ode7 the person has open
door per'ission pun!h the !ard and tri--ers this nor'al
event o" open the door.
1 Pun!h durin- Aor'al Gpen Ti'e
None
t the nor'all/ open period set to nor'all/ open period
o" a sin-le door or the door open period a"ter the "irst
!ard nor'all/ open7 or throu-h the re'ote nor'al open
operation7 the person has open door per'ission pun!h the
e""e!tive !ard at the opened door to tri--er this nor'al
events.
2 3irst #ard Aor'al Gpen Pun!h#ard
n C#ard Gnl/ veri"i!ation 'ode7 the person has "irst!ard nor'all/ open per'ission7 pun!h !ard at the settin-
"irst !ard nor'all/ open period but the door is not
opened7 and tri--er the nor'al event.
& ulti%#ard Gpen Pun!hin- #ard n C#ard Gnl/ veri"i!ation 'ode7 'ulti%!ard !o'bination !an
be used to open the door. "ter the last pie!e o" !ard veri"ied7
the s/ste' tri--er this nor'al event.
$ 'er-en!/ Pass8ord Gpen The pass8ord also 5no8n as the super pass8ord set "or the
!urrent door !an be used "or door open. t 8ill tri--er this
nor'al event a"ter the e'er-en!/ pass8ord veri"ied.
( Gpen durin- Aor'al Gpen Ti'e
None
" the !urrent door is set a nor'all/ open period7 the door
8ill open auto'ati!all/ a"ter the settin- start ti'e7 and
tri--er this nor'al event.
6 ,in5a-e vent Tri--ered ?hen the lin5a-e settin- the s/ste' ta5es e""e!t7 tri--er
this nor'al event.
) #an!el lar' ?hen the user !an!el the alar' o" the !orrespondin- door7 and
the operation is su!!ess7 tri--er this nor'al event.
* +e'ote Gpenin- ?hen the user opens a door "ro' re'ote and the
operation is su!!ess"ul7 it 8ill tri--er this nor'al event.
9 +e'ote #losin- ?hen the user !lose a door "ro' re'ote and the
operation is su!!ess"ul7 it 8ill tri--er this nor'al event.
10 Disable ntrada/ Aor'al Gpen Ti'e
None
?hen the door is in Aor'all/ Gpen AG state7 s8ipe
/our valid !ard "ive ti'es throu-h the reader or !all
#ontrolDevi!e to disable the AG period on that da/. n
this !ase7 tri--er this nor'al event.
11 nable ntrada/ Aor'al Gpen Ti'e
None
?hen the doors AG period is disabled7 s8ipe /our valid
!ard held b/ the sa'e user "ive ti'es throu-h the reader
or !all #ontrolDevi!e to enable the AG period on that
da/. n this !ase7 tri--er this nor'al event.
12 Gpen uiliar/ Gutput " the output point address is set to a spe!i"i! auiliar/
90
8/10/2019 PullSDK User Guide-En V2.0-201201
33/37
8/10/2019 PullSDK User Guide-En V2.0-201201
34/37
PullSDK nter"a!es User uide
2( nterlo!5 ?hen the interlo!5in- rules o" the s/ste' ta5e e""e!t7 tri--er
this abnor'al event.
26 ulti%#ard uthenti!ation
Pun!hin- #ard
Use 'ulti%!ard !o'bination to open the door7 the !ard
veri"i!ation be"ore the last one 8hether veri"ied or not7 tri--er
this nor'al event2) Unre-istered #ard +e"ers to the !urrent !ard is not re-istered in the s/ste'7 tri--er
this abnor'al event.
2* Gpenin- Ti'eout: The door sensor dete!t that it is epired the dela/ ti'e a"ter
opened7 i" not !lose the door7 tri--er this abnor'al event
29 #ard pired The person 8ith the door a!!ess per'ission7 pun!h !ard to
open the door a"ter the e""e!tive ti'e o" the a!!ess !ontrol7 !an
not be veri"ied and 8ill tri--er this abnor'al event.
&0 Pass8ord rror Use !ard plus pass8ord7 duress pass8ord or e'er-en!/
pass8ord to open the door7 tri--er this event i" the
pass8ord is 8ron-.
&1 Too Short 3in-erprint Pressin-
nterval
?hen the interval bet8een t8o !onse!utive "in-erprints
is less than the interval preset "or the door7 tri--er this
abnor'al event.
&2 ulti%#ard uthenti!ation Press
3in-erprint
n either the 3in-erprint onl/H or the #ard
8/10/2019 PullSDK User Guide-En V2.0-201201
35/37
(. ppendi
unepe!tedl/ opened.
10& Duress 3in-erprint Gpen Use the duress "in-erprint o" !urrent door veri"ied and tri--ered
alar' event.
200 Door Gpened #orre!tl/ ?hen the door sensor dete!ts that the door has been properl/
opened7 tri--erin- this nor'al event.201 Door #losed #orre!tl/ ?hen the door sensor dete!ts that the door has been properl/
!losed7 tri--erin- this nor'al event.
202 it button Gpen User press the eit button to open the door 8ithin the door
valid ti'e =one7 and tri--er this nor'al event.
20& ulti%#ard Gpen #ard plus
3in-erprint
Aor'al events that are tri--ered 8hen an/ person passes
the veri"i!ation 8ith his !ard and "in-erprint in 'ulti%
!ard a!!ess 'ode.
20$ Aor'al Gpen Ti'e None Gver "ter the settin- nor'al open ti'e =one7 the door 8ill !lose
auto'ati!all/. The nor'al open ti'e =one in!lude the nor'al
open ti'e =one in door settin- and the sele!ted nor'al open
ti'e =one in "irst !ard settin-.
20( +e'ote Aor'al Gpenin- Aor'al events that are tri--ered 8hen the door is set to
the AG state "or re'ote openin- operations.
206 Devi!e Start ?hen the devi!e is bein- a!tivated7 this nor'al event is
tri--ered.
220 uiliar/ nput Dis!onne!ted ?hen an/ auiliar/ input point brea5s do8n7 this nor'al
event is tri--ered.
221 uiliar/ nput Shorted ?hen an/ auiliar/ input point has short !ir!uited7 this
nor'al event is tri--ered.
2(( !tuall/ that obtain door status
and alar' status
See tta!h'ent )
&&
8/10/2019 PullSDK User Guide-En V2.0-201201
36/37
PullSDK nter"a!es User uide
).+ (or,ats of :eturned Data in 4uffer of the Get:T>o$ (unction
?hen the data in the bu""er is resolved and dete!ted to be:
ultiple realti'e event re!ords: separate those re!ords into sin-le ones 8ith RrRnH.
Door and alar' status re!orded in sin-le entries: separate those sin-le re!ords 8ith a !o''a
!onsiderin- that the data o" sin-le re!ords is separated 8ith a !o''a.
?hen /ou resolve sin-le re!ords7 'a5e ad\ust'ents a!!ordin- to bit $ o" the separated data. " bit $ is 2((7 this
re!ord !ontains the door status and alar' status onl/I other8ise7 this re!ord !ontains realti'e event re!ords.
The "ollo8in- table !o'pares the data stru!tures o" these t8o re!ords.
4it
0
4it 1 4it 2 4it & 4it $ 4it ( 4it 6
Doorou !an !all Get:T>o$ to!he!5 8hether the !a!he !ontains event re!ords. " so7 the devi!e returns all re!ords &0 entries at
'ost in the !urrent !a!heI other8ise7 the devi!e returns the door and alar' status events re"erred
above.
2
The door status re!ords !ontain the open
8/10/2019 PullSDK User Guide-En V2.0-201201
37/37
(. ppendi
arran-ed in an as!endin- order separatel/ represent doors 1 to $. 3or ea'ple7 i" this value is
0010200017 door Ao.1 is !losed7 door Ao.2 is not !on"i-ured 8ith the DSS7 door Ao.& is door opened7
and door Ao.$ is door !losed. #ontained in the alar' status and Gpenin- Ti'eout The Se!ond pla!e
the sa'e that $ b/tes are respe!tivel/ represents "our door status7 behind t8o pla!e o" a!h b/te
respe!tivel/ represents 8hether that have alar' or door open is overti'e7 arran-ed in an as!endin- orderseparatel/ represent alar' or door openin- ti'eout. 3or ea'ple7 i" this value is 0010200017 door Ao.1
is !losed7 door Ao.& 'eans door openin- ti'eout7 door Ao.2 and Ao.$ 'eans alar'.
$
?hen the re!ord adopts realti'e eventH status and t/pe o" event is Tri--ered ,in5a-e vent the !ode o"
t/pe event: 67 the sith pla!e saved ,in5a-e vent Tri--ered7 and the se!ond is "or reuse o" ,in5a-e
D7 t have so"t8are "or the devi!e s/n!hronous lin5a-e settin- usuall/ the lin5a-e in the D value o"
so"t8are end database.