NEW8210 EFT-POS APPLICATION DEVELOPMENT MANUAL
V 0.1.2
Author: Harrison Approved:
Date: 2013-12-03 Date:
NEW POS E!HNO"O#$ "%&%ED '''.ne'poste(h.(o)
1. Revision History Date
Revision Leve
Des!"i#tion
Mo$i%ie$ &'
2013-3-13
0.0.1
!reate
*+an Huan,
2013--20
0.0.2
*evision NEW210 SD/ head ie
Harrison "ee
2013--2
0.0.3
Add#P*SAP%des(ription
2013--2
0.0.
*evision
Henr+"i
2013--
0.0.4
AddtheAP%o5ar(ode-s(an6 Add t'o s+ste) AP%.
Ae7 !hen
2013-0-1
0.0.
Add i,ure .4.4 a nd r evised
*+an Huan,
/entSon,
so)e )is-spe. 2013-08-2
0.0.
*evisedtheWNEAP%
2013-10-21
0.0.
Add AP% or o5tain inor)ation o 5atter+ Add AP% or VPDN )odue
/entSon, Henr+ "i
Add AP% or (ontro the po'er o )ode) &odi+ the stru(ture o &ode)DiaPar)s9t 2013-12-03
0.0.8
AddAP% or e7tern P%NPAD N20
201-01-02
0.1.0
AddAP% or 'ireess )odue
Henr+ "i Henr+ "i
Add des(ription or return vaue o ppp )odue 201-02-2
0.1.1
AddAP%orDuaS%&
201-0-31
0.1.2
i7 de(ription o return vaue o )a,stripe9set9tra(;set< )a,stripe9,et9tra(;set.
Henr+"i Henr+ "i
Deete )a,stripe9reset
2( )ene"a Int"o$*!tion NEW210 is a )o5ie POS ter)ina< 5ase on "inu7 OS 5+ Ne' Pos e(hnoo,+ "i)ited< it=s deveop)ent pator) is "inu7 OS< pease do'noad the atest SD/< ir)'are< DownloadTool and reated do(u)ents ro) the server: tp:>>(usto)er:oadsot'are?121.14.13.230>NEW210>SD/
he appi(ation deveop environ)ent is "inu7 or Windo's. % +ou 'ant to deveop in "inu7 s+ste)< +ou shoud insta "inu 7 s+ste) in +our host P! 5+ +ourse< 'e don=t oer an+ "inu7 OS insta pro,ra)s. We re(o)) end usin, *edHat Enterprise Server 7 325it version to deveop)ent< and +ou shoud do'noad "inu7 SD/ o NEW210. % +ou 'ant to deveop in Windo's s+ste)< +ou shoud do'noad Windo's SD/ o NEW210. Either +ou see(t Windo's or "inu7 pator) to deveop)ent< We re(o))end use E(ipse to deveop +our appi(ations< +ou (an do'noad the "inu7>Windo's version ro) the server: http:>>'''.e(ipse.or,>do'noads>. NEW210 supports !>!@@ deveop)ent< te)porari+ not supports ava deveop)ent< pease do'noad E(ipse %DE or !>!@@ Deveopers version.
+( F*n!tion Int"o$*!tion
,( Deveo#ent Pat%o" % +ou 'ant deveop the appi(ation on "inu7 pator)< +ou need to insta a 32-5it "inu7 s+ste) 5ased on 7 pator) Bour SD/ have not 5een (ertii(ated on -5it "inu7C. $ou (an aso deveop appi(ation on a virtua "inu7 5+ runnin, virtua )a(hine on Windo's s+ste)< at that ti)e< +ou (an deveop appi(ation on Windo's pator). Due to 'e don=t oer SD/ on Windo's pator)< so +ou (an=t deveop appi(ation on Windo's s+ste) dire(t+. o deveop appi(ation< 'e re(o))end to use E(ipse< it is a )uti-pator) deveop)ent too 5ased on ava< E(ipse inte,rates un(tions o edit< (o)pie< de5u,< and et(<. E(ipse has riend+ intera(e< and eas+ operatin,. % +ou ;no' ho' to 'rite &a;eie 'e< +ou aso (an deveop appi(ation dire(t+ 'ithout an+ deveop)ent too.
,(1(Insta !"oss !o#ie too!.ain %o" Lin*/ he too(hain or NEW210 is 5ased on A*& (ross (o)pie too(hain 'hi(h has the version o ,i5(-2.8 ,((-.3.< the too(hain supports (o)pie !opt>(o)pier> he (o))and a5ove F-! >opt >(o)pier>G is unip to >opt oder< +ou aso (an unip too(hain to an+'here +ou 'ant< 5ut pease ensure that a(tive user have the read and 'rite ri,hts to the unip oder. Ater unip to oder< use the (o))and 5eo' to test 'hether the too (hains is usa5e: >opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,(( -v % have output inor)ation 5eo'< the too(hain is avaia5e. sin, 5uit-in spe(s.
ar,et: ar)-un;no'n-inu7-,nu
!oni,ured 'ith: >ho)e>ihua>too(hain>(ross>5in>tar,ets>sr(>,((-.3.>(oni,ure --5uidIi3-5uid9redhat-inu7-,nu --hostIi3-5uid9redhat-inu7-,nu ,eneri(
--tar,etIar)-un;no'n-inu7-,nu --prei7I>opt>(o)pier>,i5(-oa5i-too(hain-ar)-
--'ith-s+srootI>opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>ar)-un;no'n-inu7-,nu>>s+s-root
an,ua,esI(<(@@<ava
--disa5e-)utii5
--'ith-oatIsot
--ena5e-
--'ith-p;,versionIJKihua933?13.(o)LJ
--ena5e-99(7a9ate7it --'ith-,)pI>opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri( --'ith-)prI>opt>(o)pier>,i5(-oa5itoo(hain-ar)-,eneri( --'ith-ppI>opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri( --'ith-(oo,I>opt>(o)pier>,i5(-oa5itoo(hain-ar)-,eneri(
--'ith-)p(I>opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(
prei7I>opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>ar)-un;no'n-inu7-,nu>>s+s-root
--disa5e-ns
--'ith-o(a--ena5e-
threadsIposi7 --ena5e-s+)versI,nu --ena5e-(88 --ena5e-on,-on, --ena5e-tar,et-optspa(e
hread )ode: posi7
!! ve"sion ,(+(,BKihua933?13.(o)LC
Me(ause this too(hain uses a hi,h ,rade version o #!! too( hain< it needs d+na)i( i5rar+ )pr-2..2< i +our "inu7 s+ste) haven=t the d+na)i( i5rar+< or haven=t the enou,h hi,h ,rade version o d+na)i( i5rar+< it 'i report error i5)pr.so 'hen usin, this too(hain. Pease do'noad )pr-2..2.tar.52< (o)pie and insta it a,ain< step
5eo': nip ie: ta" /% #%"-2(,(2(ta"(&2
!oni,ure and (o)pie: !$ #%"-2(,(2 (3!on%i*"e 4#"e%i/53*s" a6e
%nsta: need root privie,e s* a6e insta e/it
,(2( Insta E!i#se %o" Lin*/ 1. Do'noad E(ipse he server is: http:>>'''.e(ipse.or,>do'noads> , pease do'noad "inu7 ie pa(;a,e have the version o E(ipse %DE or !>!@@ Deveopers. 2. nip E(ipse tar 7 e(ipse-(pp-heios-inu7-,t;.tar., -! >opt !o))and a5ove F-! >optG is unip to >opt oder< ensure that a(tive user has read and 'rite ri,hts. Aso +ou (an unip to an+ other oders. 3. *un E(ipse E7e(ute F>opt>e(ipse>e(ipseG to run E(ipse< aso +ou (an (reate an appi(ation aun(her to run it.
!i(; Wor;5en(h< ,o into !>!@@ deveop)ent intera(e:
,(+(Insta !"oss !o#ie too!.ain %o" Win$o7s he Windo's (o)pie too(hain or NEW210 is 5ased on A*& (ross (o)pie too(hain 'hi(h has the version o ,i5(-2.8 ,((-.3.< the too(hain supports (o)pie !
he i,ure 5eo' sho's the Environ)ent Varia5es diao, 5o7 that opens ne7t. %t ists t'o ;inds o varia5e- those that app+ on+ to the (urrent user and those that app+ to the 'hoe s+ste). $ou (an si)p+ s(ro do'n the ists to see 'hat is on +our s+ste) or +ou (an edit the ists. o (reate a ne' varia5e< use the Ne' 5utton. here are aso 5uttons or editin, and or deetin, varia5es.
he 5o7 or addin, a ne' user varia5e is sho'n 5eo'. #enera+< this is i;e+ to 5e a dire(tor+ that +ou use reuent+ 5ut (an 5e an+ strin, o ess than 182 5+tes. he )a7i)u) tota sie or a environ)ent varia5es< in(udin, varia5e na)es and the euas si,n< is 32 (hara(ters.
he ne7t i,ure sho's a 5o7 or editin, a varia5e6 in this (ase it is the PAH varia5e. Me sure to re)e)5er to separate dire(tor+ na)es 'ith a se)i(oon.
Pease add the path o (o)pier into Varia5e vaue: !:,i5(-oa5i-too(hain-ar)-,eneri(5in se the (o))and 5eo' to test 'hether the too (hains is usa5e: !:Do(u)ents and Settin,sAd)inistratorL (:,i5(-oa5i-too(hain-ar)-,eneri(5inar)-un;no'n-inu7-,nu-,(( -v sin, 5uit-in spe(s. ar,et: ar)-un;no'n-inu7-,nu !oni,ured 'ith: >ho)e>Ad)inistrator>(rosstoo>5in>5uid>sr(>,((-.3.>(oni,ure --5uidIi-5uid9p(-(+,'in --hostIi5uid9p(-(+,'in
--tar,etIar)-un;no'n-inu7-,nu
--prei7I>(+,drive>!>,i5(-oa5i-too(hain-ar)-,eneri(
--'ith-
s+srootI>(+,drive>!>,i5(-oa5i-too(hain-ar)-,eneri(>ar)-un;no'n-inu7-,nu>>s+s-root --ena5e-an,ua,esI(<(@@
--ena5e-i5ssp
--'ith-p;,versionIihua933?13.(o) --ena5e-99(7a9ate7it
--ena5e-i5)udap
--'ith-,)pI>ho)e>Ad)inistrator>(rosstoo>5in>5uid>ar)-un;no'n-inu7-,nu>5uid>stati(
--'ith-)prI>ho)e>Ad)inistrator>(rosstoo>5in>5uid>ar)-un;no'n-inu7-,nu>5uid>stati( --ena5e-threadsIposi7 --ena5e-tar,et-optspa(e --'ith-o(a-prei7I>(+,drive>!>,i5(-oa5i-too(hain-ar)-,eneri(>ar)-un;no'n-inu7-,nu>>s+s-root --disa5e-ns --ena5e-s+)versI,nu --ena5e-(88 --ena5e-on,-on, hread )ode: posi7 !! ve"sion ,(+(,Bihua933?13.(o)C
,(,( Insta E!i#se %o" Win$o7s 1.
2.
Do'noad E(ipse he server is: http:>>'''.e(ipse.or,>do'noads> , pease do'noad Windo's ie pa(;a,e have the version o E(ipse %DE or !>!@@ Deveopers. nip E(ipse
3.
*un E(ipse
,(( C"eate a##i! ation #"oe!t As 5eo' introdu(e ho' to (reate a NEW210 appi(ation pro,ra) proe(t 5+ ! an,ua,e< (reate a !@@ an,ua,e proe(t is si)iar to !:
4.5.1.
C"eate ne7 #"oe!t
!hoose )enu ie-LNe'-L! Proe(t< or (hoose too5ar Ne'-L! Proe(t< or ri,ht (i(; on Proe(t E7porer 'indo's=s 5an;< (hoose Ne'-L! Proe(t:
,((2(
!on%i*"e a##i!ation #"oe!t
!oni,ure appi(ation proe(t na)e at Proe(t Na)e< (hoose Heo Word ANS% ! Proe(t at Proe(t t+pe< i +ou (hooses E)pt+ Proe(t < it 'i not ,enerate deaut pro,ra). We re(o))end auto)ati( ,enerate pro,ra) 'hi(h is (ontain )ain un(tion 5+ E(ipse.hen (i(; Ne7t to ,o into ne7t (oni,uration.
!i(; Ne7t a,ain to ,o into ne7t (oni,uration:
ina+ (i(; inish to (o)pete (oni,uration.
,((+(
o$i%'3a$$ so*"!e !o$e
he )ainBC un(tion 'hi(h ,enerated auto)ati(a+ 5+ E(ipse is not a standard ! pro,ra) 'ritin, st+e< 'e 'i i7 it: Qin(ude Kstdio.hL Qin(ude Kstdi5.hL int )ainBint ar,(< (har Rar,vTC U putsBHeo WordC6 >R prints Heo Word R> return E%9S!!ESS6 X Noti(e: 'hen run an appi(ation on "inu7< s+ste) (an trans)it para)eters to appi(ation< so 'e need to )odi+ Fint )ainBvoidCG to standard Fint )ainBint ar,(<(har Rar,(TCG. % +ou need to add a ne' sour(e ie to proe(t< or add a ne' oder< (an ta;e the sa)e )ethod i;e (reate a ne' proe(t:
!hoose Ne'-LSour(e oder to add a ne' sour(e oder to proe(t6 !hoose Ne'-LSour(e ie to add sour(e ie to proe(t6 !hoose Ne'-LHeader ie to add head ie to proe(t6
4.5.4.
Co#ie !on%i*"e 7a' 1
%n deaut (ondition < proe(t (reate 5+ E(ipse use ,(( to (o)pie the pro,ra)s< and the tar,et is a appi(ation run on 7 pator)6 Mut our tar,et s+ste) is A*&< o (ourse it (an not run on 7 pator)< so +ou need to (oni,ure the (o)pie too(hain< (ross (o)pie pro,ra) 'hi(h is runnin, on A*& pator). %n Proe(t E7pore 'indo's< ri,ht (i(; the (oni,ured proe(t< (hoose Properties
irst+ (hoose !oni,uration: A (oni,urationsT< so the (oni,ure 5eo' 'i 5e
avaia5e to 5oth De5u, version and *eease version.
,((,(1(
Con%i*"e )CC C Co#ie"
!hoose F#!! ! !o)pier ro) oo Settin,sG ta,< (ross (o)pie too(hain 'hi(h 'e provide:
)odi+ F!o))andG on ri,ht side to
% +ou use "inu7 s+ste)< it shoud 5e: >opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,(( % +ou use Windo's s+ste)< it shoud 5e: >(+,drive>(>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,(( Assu)e the "inu7 too(hain 'as instaed in: >opt>(o)pier>,i5(-oa5i-too(hain-ar),eneri( Assu)e the Windo's too(hain 'as instaed in: !:,i5(-oa5i-too(hain-ar)-,eneri(
Prepro(essor Option: Do not need to )odi+< ;eep deaut. S+)5os Option: Here is used to deine>undeined so)e user-deined &a(ro 'hie (o)piin,< ust i;e add YDaaaaa -555555 'hie (o)piin,. %n(ude Option:
Here is used to (oni,ure head ie and its sear(h path 'hie 5e (o)pied< ust i;e add (o)pie para)eter Yi7777.h -"+++++. Opti)iation Option: Here is used to (oni,u re (o)pie opti)ied options< in deaut (ondition< (hoose NoneB-O0C 'hen (o)piin, De5u, version< (hoose Opti)ie )ostB-O3C 'hen (o)piin, *eease version.$ou
aso (an (oni,ure other opti)ied eve 5+ +ourse: -O0 )eans
De5u,,in, Option:
don=t opti)ie6-O1 )eans i,ht'ei,ht opti)iation6-O2 )eans )oderate opti)iation6-O3 )eans hi,h+ opti)ied< -Os )eans opti)ie or spa(e. Here is used to set the de,ree o (o)pied o5e(t (ode in(udin, de5u, inor)ation .%n deaut (ondition< (hoose &a7i)u)B-,3C 'hen (o)piin, De5u, version6 (hoose None 'hen (o)piin, *eease version6-,3 (ontains a ot o de5u, inor)ation< None don=t (ontain an+ de5u, inor)ation.% +ou needs to de5u,< had
5etter (hoose Y, or Y,36 in reeasin, version< (hoose None. Warnin,s Option: Here is used to (oni,ure (o)pie 'arnin, option< deaut option is A 'arnin,sB-WaC. &is(eaneous Option: Here is used to deine (o)pie options or ourseves. or NEW210< 'e re(o))end set FOther a,sG as: -Wunde -Wstri(t-protot+pes -Werror-i)pi(it-un(tionde(aration -Wde(aration-ater-state)ent -si,ned-(har -)ar) -)ap(s -)no-s(hed-proo, -)a5iIap(s-,nu -)itte-endian -)no-thu)5-inter'or; -)sot-oat -(
,((,(2(
Con%i*"e )CC C Lin6e"
!hoose F#!! ! "in;er o oo Settin,sG ta,s< )odi+ F!o))andG on ri,ht side to (ross (o)pie too(hain 'e provided: % +ou use "inu7 s+ste)< it shoud 5e: >opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,(( % +ou use Windo's s+ste)< it shoud 5e: >(+,drive>(>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,((
#enera Option:
"i5raries Option:
Here is a ,enera in;in, option. !hoose No shared i5rariesBstati(C i +ou need stati( in; pro,ra)6(hoose nothin, i +ou need d+na)i( in; pro,ra). sua+< 'e (hoose d+na)i( in; pro,ra). Here is used to (oni,ure in;in, assi,ned d+na)i( i5rar+ and (oni,ure path o sear(h d+na)i( i5rar+< ust i;e option Y77777 Y "77777.or e7a)pe< i +ou 'ant to in; i5rar+ dire(t5.so< ust
need to add dire(t5 in "i5rariesB-C< and add path o d+na)i( i5rar+ in "i5rar+ sear(h pathB-"C. &is(eaneous Option: or NEW210< 'e )odi+ "in;er a,s to: -)ar) -)ap(s -)no-s(hed-proo, -)a5iIap(s-,nu -)itteendian -)no-thu)5-inter'or; -)sot-oat -W<-&ap<ZUPWDX>Z UProNa)eX.)ap Shared "i5rar+ Settin,s: Options here is avaia5e 'hen (o)piin, d+na)i( i5rar+< ;eep deaut option 'hen (o)piin, appi(ation pro,ra).
,((,(+(
Con%i*"e )CC Asse&e"
!hoose #!! Asse)5er o oo Settin,s ta,< )odid+ (ross (o)pie too(hain 'e provide in ri,ht side=s !o))and to : % +ou use "inu7 s+ste)< it shoud 5e: >opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,(( % +ou use Windo's s+ste)< it shoud 5e:
>(+,drive>(>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,((
Here is used to (oni,ure (o)pie options 'hi(h is used 'hen (o)piin, asse)5+ ie< usua+ appi(ation doesn=t use asse)5+ an,ua,e< so it is not need to (oni,ure.
4.5.5.
Co#ie !on%i*"e 7a' 2
,(((1(
)o&a settin %o" a #"oe!t
%n deaut (ondition < proe(t (reate 5+ E(ipse use ,(( to (o)pie the pro,ra)s< and the tar,et is a appi(ation run on 7 pator)6 Mut our tar,et s+ste) is A*&< o (ourse it (an not run on 7 pator)< so +ou need to (oni,ure the (o)pie too(hain< (ross (o)pie pro,ra) 'hi(h is runnin, on A*& pator). We setting the global environment configure in here, to avoid setting every project. Click the menu “Window!!"select “#references as follow figure$
Click the button “%dd... to add an environment variable “&CC#%T' as follow figure$
Suppose +our "inu7 too(hain insta as oo' path: >opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri( And suppose +ou Windo's too(hain insta as oo' path: !: ,i5(-oa5i-too(hain-ar)-,eneri(5inar)-un;no'n-inu7-,nu-,(( The value of “&CC#%T' macro is$ “(opt(compiler(glibc!oabi!toolchain!arm!generic(bin(arm!unknown!linu)!gnu!, show as follow figure$
,(((2(
C*""ent P"oe!t !o#ie settin
4.5.5.2.1. Configure GCC C Compiler *elect the “ #!! ! !o)pier in the tag “ oo Settin,sG< and (han,e the !o))and as
oo': +&CC#%T'-gcc
Prepro(essor Option: Do not need to )odi+< ;eep deaut. S+)5os Option: %n(ude Option:
Here is used to deine>undeined so)e user-deined &a(ro 'hie (o)piin,< ust i;e add YDaaaaa -555555 'hie (o)piin,. Here is used to (oni,ure head ie and its sear(h path 'hie 5e (o)pied< ust i;e add (o)pie para)eter Yi7777.h -"+++++.
Opti)iation Option: Here is used to (oni,u re (o)pie opti)ied options< in deaut (ondition< (hoose NoneB-O0C 'hen (o)piin, De5u, version< (hoose Opti)ie )ostB-O3C 'hen (o)piin, *eease version.$ou aso (an (oni,ure other opti)ied eve 5+ +ourse: -O0 )eans
De5u,,in, Option:
don=t opti)ie6-O1 )eans i,ht'ei,ht opti)iation6-O2 )eans )oderate opti)iation6-O3 )eans hi,h+ opti)ied< -Os )eans opti)ie or spa(e. Here is used to set the de,ree o (o)pied o5e(t (ode in(udin, de5u, inor)ation .%n deaut (ondition< (hoose &a7i)u)B-,3C 'hen (o)piin, De5u, version6 (hoose None 'hen (o)piin, *eease version6-,3 (ontains a ot o de5u, inor)ation< None don=t (ontain an+ de5u, inor)ation.% +ou needs to de5u,< had 5etter (hoose Y, or Y,36 in reeasin, version< (hoose None.
Warnin,s Option:
Here is used to (oni,ure (o)pie 'arnin, option< deaut option is A 'arnin,sB-WaC.
&is(eaneous Option: Here is used to deine (o)pie options or ourseves. or NEW210< 'e re(o))end set FOther a,sG as: -Wunde -Wstri(t-protot+pes -Werror-i)pi(it-un(tionde(aration -Wde(aration-ater-state)ent -si,ned-(har -)ar) -)ap(s -)no-s(hed-proo, -)a5iIap(s-,nu -)itte-endian -)no-thu)5-inter'or; -)sot-oat -(
4.5.5.2.2. Configure GCC C Linker !hoose F#!! ! "in;er o oo Settin,sG ta,s< )odi+ F!o))andG on ri,ht side to (ross (o)pie too(hain 'e provided: +&CC#%T'-gcc
#enera Option:
"i5raries Option:
Here is a ,enera in;in, option. !hoose No shared i5rariesBstati(C i +ou need stati( in; pro,ra)6(hoose nothin, i +ou need d+na)i( in; pro,ra). sua+< 'e (hoose d+na)i( in; pro,ra). Here is used to (oni,ure in;in, assi,ned d+na)i( i5rar+ and (oni,ure path o sear(h d+na)i( i5rar+< ust i;e option Y77777 Y "77777.or e7a)pe< i +ou 'ant to in; i5rar+ dire(t5.so< ust
need to add dire(t5 in "i5rariesB-C< and add path o d+na)i( i5rar+ in "i5rar+ sear(h pathB-"C. &is(eaneous Option: or NEW210< 'e )odi+ "in;er a,s to: -)ar) -)ap(s -)no-s(hed-proo, -)a5iIap(s-,nu -)itteendian -)no-thu)5-inter'or; -)sot-oat -W<-&ap<ZUPWDX>Z
UProNa)eX.)ap Shared "i5rar+ Settin,s: Options here is avaia5e 'hen (o)piin, d+na)i( i5rar+< ;eep deaut option 'hen (o)piin, appi(ation pro,ra).
4.5.5.2.3. Configure GCC Assembler !hoose #!! Asse)5er o oo Settin,s ta,< )odi+ (ross (o)pie too(hain 'e provide in ri,ht side=s !o))and to : +&CC#%T'-gcc
Here is used to (oni,ure (o)pie options 'hi(h is used 'hen (o)piin, asse)5+ ie< usua+ appi(ation doesn=t use asse)5+ an,ua,e< so it is not need to (oni,ure.
4.5.6. Settins o% E!i#se in Win$o7s
here are so)e dierent settin, s or E(ipse 5et'een "inu7 and Windo's< it due to the path strin, in 'indo's )a+ (oni(t 'ith &a;eie. he [= and [:= in 'indo's path strin, 'i ead e(ipse aied to parse )a;eie< so 'e need (han,e the [= and [:= in other 'a+. he rue o transation 5eo': 1.
transate‘’into‘>’in path strin,
2. transate‘D%S/-"AME":’into‘>(+,drive> D%S/-"AME">’ or e7a)pe: FE:NEW210sd;in(udeG shoud transate into F>(+,drive>e>NEW210>sd;>in(udeG F!:,i5(-oa5i-too(hain-ar)-,eneri(5inar)-un;no'n-inu7-,nu-,(( G transate into
shoud
F>(+,drive>(>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,(( G
,((9(
Co#ie
se (o))and FMuid Proe(tG to (o)pie an appi(ation< there are so)e )ethods to e7e(ute this (o))and: !hoose )enu Proe(t-LMuid Proe(t !hoose proe(t o Proe(t E7porer< ri,ht (i(; it< see(t Muid Proe(t (o))and.
!hoose Muid 5utton on too5ar
Deaut (o)pie is De5u, version< i +ou 'ant to (o)pie a *eease version< +ou (an (hoose Muid 5utton on too5ar< then see(t *eease. % +ou 'ant to (o)pie a,ain< (hoose Muid !ean (o))and< then (hoose Muid Proe(t (o))and< output inor)ation o (o)pie is o(ated at !onsoe 'indo' o %DE environ)ent:
% so)e 'arnin,s>errors appear ater (o)pied< the 'arnin,s>errors 'i o(ate at !onsoe 'indo'< at the sa)e ti)e< there 'i have o5vious 'arnin,>error a,s on proe(t o Proe(t E7porer 'indo'.
,((8(
R*n #"o"a
NEW210 have an appi(ation aun(her< user=s appi(ation (an run 5+ this aun(her< it need deveoper to 'rite a aun(h (oni,uration< and add it to (urrent user=s Des;top oder Ba'a+s o(ate at >ho)e>ad)in>Des;topC. Meo' is appi(ation aun(her (oni,ure ie or):
iena)e is 77777.des;top !ontent o ie is so)e re(ord entries. Ever+ ine o ie is a re(ord entr+. here is 2 t+pies o re(ord entr+< one is se(tion des(ription< another is ite) des(ription. Se(tion des(ription 5e,ins o FG< and ends o FTG< 5et'een FG and GTG is ;e+ 'ord o se(tion des(ription. %te) des(ription is a t+pe o F;e+ 'ord I des(ripe the (ontentG.
No' 'e use an e7a)pe to de(are the or)at o ie. We 5uid a aun(her (oni,uration ie< the ie is saved as F>ho)e>user0>Des;top>de)o.des;topG< and ie (ontent is 5eo': Des;top Entr+T +peIAppi(ation VersionI0.0.1 Na)eI De)o pro,ra) !o))entINEW210 De)o pro,ra) %(onI>ho)e>user0>NEW210de)o>de)o9o,o9.pn, E7e(I>ho)e>user0>NEW210de)o>de)o PathI>ho)e>user0>NEW210de)o er)inaIase
%n e7a)pe a5ove< se(tion des(riptor is FDes;top Entr+G< it is i7ed. his ieBde)o.des;topC des(ri5es a appi(ation pro,ra)B+peIAppi(ationC. he appi(ation version is F0.0.1GBVersionI0.0.1C. he appi(ation dispa+s the na)e o Fde)o pro,ra)GBNa)eIde)o pro,ra)C on appi(ation )ana,er. he appi(ation note )essa,e is FNEW210 de)o pro,ra)GB!o))entINEW210 de)o pro,ra)C. he appi(ation dispa+s an i(on o de)o9o,o9.pn, B%(onI>ho)e>user0>NEW210de)o>de)o9o,o9.pn,C on appi(ation )ana,er. % user 'ant to e7e(ute this appi(ation pro,ra)< user 'i e7e(ute the (o))and: >ho)e>user0>NEW210de)o>de)oBE7e(I>ho)e>user0>NEW210de)o>de)oC6 he appi(ation=s (urrent path is: >ho)e>user0>NEW210de)o BPathI>ho)e>user0>NEW210de)oC. he pro,ra) doesn=t need to e7e(ute in er)ina Ber)ina I aseC.
Ater 5uidin, an appi(ation aun(her (oni,uration ie< do'noad it to >ho)e>user0>Des;top oder< no' +ou (an see the aun(her ite) in s+ste)=s appi(at ion )ana,er< and then do'noad the rea appi(ation and resour(e ies to >ho)e>user0>NEW210de)o oder 'hi(h des(ri5ed in aun(her (oni,uration ie< and +ou (an startup appi(ation 5+ appi(ation )ana,er. Notes: i +our appi(ation aun(her (oni,uration ie is 5uit on Windo's< pease )odi+ ie=s ine eed F0d 0aG to F0dG< there haven=t an+ pro5e)s i it 5uit in "inu7. Me(ause o in Windo's< ine eed is (onsisted o F0d@0aGBenter@ine eedC< 5ut on "inu7< on+ re(o,nies F0aG< don=t re(o,nies F0dG< so need to deete F0dG in ie< +ou (an use he7 ie editor to edit it. $ou aso (an use !onsoe to run appi(ation< it (an 5e used ust 'hen deveopin, 5+ deveoper.
,(:( De&* #"o"a NEW210 use ,d5 to de5u, its pro,ra)< 'e had instaed ,d5server pro,ra) on NEW210< so de5u,,in, pro,ra) on NEW210 is ver+ (onvenient< and (an underta;e re)ote de5u,,in,. Meore de5u,,in, pro,ra)< 'e need (o)pie pro,ra) to a De5u, version< it is due to need use Y, option 'hen (o)piin,< and +ou had 5etter not use an+ opti)iationBuse Y O0 optionC< then the tar,et 'i (ontains de5u, inor)ation and (an 5e de5u,,ed. he *eease version tar,et a'a+s doesn=t use Y, option< and use so)e opti)ie options Ba'a+s YO2 or YO3C< so the tar,et (an not 5e de5u,,ed. When de5u,,in,< +ou (an use sin,e-step de5u,,in,. % +ou ;no' ,d5 (o))and 'e< +ou (an de5u, 5+ usin, ,d5 (o))and dire(t+< aso (an use other ,d5 ront-end too< i;e DDD< insi,ht< et(. No' 'e 'i introdu(e so)e )ethods a5out ho' to de5u, pro,ra).
,(:(1(
De&* &' E!i#se
We had introdu(ed ho' to (reate a E(ipse ! Proe(t a5ove< no'< 'e 'i )odi+ ! Proe(t sour(e (ode< add a 5u, < then indin, the 5u, 5+ E(ipse. &odi+ sour(e (ode to the (ontent 5eo': Qin(ude Kstdio.hL Qin(ude Kstdi5.hL Qin(ude Kstrin,.hL stati( int 5u,9in9hereBvoidC U int Rp6 # 5 NULL; <# 5 0/12+,:986
return Rp6 X int )ainBint ar,(< (har Rar,vTC U
putsBHeo WordnC6 >R prints Heo Word R> printB!a 5u, un(tion: nC6 5u,9in9hereBC6 printBPro,ra) 'i e7itnC6 return E%9S!!ESS6 X Ater )odiied< (o)pie appi(ation or De5u, version< then do'noad to NEW210< run it< pro,ra) e7it a5nor)it+. No' 'e prepare to de5u, pro,ra)< use de5u, )ethod o ,d5server @ ,d5< use t(p to re)ote de5u,,in,. irst+< +ou need (onne(t NEW210 'ith host P! 5+ ethernet net'or;< +ou (an use a s'it(h to (onne(t host P! 'ith NEW210< aso (an use a net'or; (a5e to (onne(t host P! 'ith NEW210 dire(t+. Ater (onne(tin,< (oni,ure deveopin, P! %P and NEW210 %P< then the+ (an visit ea(h other< +ou (an use pin, (o))and to a(hieve it. or e7a)pe< +our host P!=s %P is 182.1.1.100< NEW210=s %P is 182.1.1.200< then +ou e7e(ute the (o))and in host P!: pin, 182.1.1.200 % P! re(eives resp onse< it )eans that the+ (an vis it ea(h other< then +ou e7e(ute the a5nor)a+ pro,ra) ust no' on NEW210< the )ethod or e7e(ution is run pro,ra) in (onsoe. No' introdu(e a5out ho' to enter into NEW210=s (ons oe: use ssh to o,in to NEW210 ro) host P!< e7e(ute (o))and 5eo': ssh user0?182.1.1.200 he user na)e (an 5e: user0 or user1 \ or user 14 Enter pass'ord: Bi +ou do not ;no' pass'ord< pease (onta(t usC Ater (o)pete< i +ou (an see the (o))and notes< that )eans it had entered into (onsoe. E7e(ute pro,ra) 'hi(h 'i 5e de5u,,ed in (onsoe: ,d5server o(ahost:2331 .>De)oApp hen< start De5u,,in, in E(ipse< e7e(ute )enu *un-LDe5u, (o))and or (i(; De5u, 5utton on too5ar< then it 'i ,enerate a De5u, (oni,uration< o (ourse this (oni,uration (an not de5u,< it need so)e )odii(ation. hen e7e(ute De5u, !oni,urations:
!hoose FSee(t other\G 5otto)< then (hoose #DMBDSC *e)ote S+ste) Pro(ess "aun(her< (i(; O/ to (onir):
!oni,ure De5u,,er< (hoose De5u,,er ta,< (oni,ure #DM de5u,,er to ar)-un;no'ninu7-,nu-,d5 o too(hain:
>opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-,d5 !oni,ure #DM (o))and ie to nu< ust i;e pi(ture 5eo':
S'it(h to F!onne(tionG ta5 pa,e o De5u,,er< (hoose !P o +pe option< (oni,ure NEW210=s %P address to FHost na)e o %P addressG< (oni,ure Port nu)5er to 2331B'hen run ,d5server (o))and on NEW210 a5ove< 'o (hoose ,d5server=s istenin, port o 2331< )a;e sure that ,d5server=s istenin, port is the sa)e as hereC< then (i(; De5u, 5utton to de5u,< i;e pi(ture 5eo':
No' enter into the de5u, 'indo'< (i(; Step Over BC to s;ip this senten(e< (i(; Step into B4C to enter into un(ti on i)pe)entation o this senten(e< aso (an (oni, ure 5rea;point to de5u,< 'e 'i not introdu(e these de5u, )ethods here.Pi(ture 5eo' is the o(ation 'hen 'e e7e(utin, the error an,ua,e< it 'i noti(e error 'hen (i(;in, Step Over< the pro5e) o pro,ra) is here:
% the pro,ra))er 'ants to stop de5u,,in,< ri,ht (i(; De)oApp!>!@@ Appi(ationT o De5u, 'indo'< and (hoose Fer)inate and *e)oveG.
,(:(2(
De&* t."o*. insi.t $e&*e"
%nsi,ht de5u,,er is aso a eas+ used ,d5 ,raphi(a ront-end de5u,,in,< it aso uses ,d5 to de5u,< it has intuitive intera(e< and eas+ to use. his too is a open sour(e too< +ou (an do'noad it at http:>>sour(e'are.or,>insi,ht>do'noads.php . % +ou 'ant to de5u, NEW210 appi(ation pro,ra)< 'e need to (ross (o)pie it. Here 'e don=t introdu(e ho' to (o)pie this too< 5ut ho' to )a;e use o this too. irst+ run ar)-inu7-insi,ht< its intera(e is 5eo':
hen e7e(ut e )enu ie-LOpen< open De)oApp pro,ra) 'e have (o)pied< then e7e(ute ie-Lar,et Settin,s< (oni,ure it i;e pi(ture 5eo':
Set !onne(tion ar,et to #DMserver>!P< set in;in, Hostna)e to the sa)e as NEW210=s %P address< set in;i n, port to the sa)e as istenin, port o e7e(utin, ,d5server< then (i(; O/. E7e(ute )enu *un-L!onne(t to tar,et< i (onne(t to ,d5server su((essu+ it 'i noti(e in;in, su((essu+< then e7e(ute *un-L*un (o))and to start to de5u, pro,ra)< it is the sa)e as E(ipse< support step de5u,,in,< settin, 5rea;points
,(:(+(
Fin$ #"o&e &' 6e"ne e""o" essae
E7(ept o usin, #DM to de5u, appi(ation pro,ra)< 'e aso (an ind out the o(ation o e7(eption ro) error )essa,e 'hi(h is printed 5+ ;erne. his )ethod needs deveoper ;no's 'e a5out asse)5+ an,ua,e< it is it to e7perien(ed deveopers. Pi(ture 5eo' is the error )essa,e printed 5+ ;erne 'hen e7e(utin, the e7(eption pro,ra):
11.10000T De)oApp: unhanded pa,e aut B11Cat 0700000000< (ode 071 11.10000T p,dI (10000 11.10000T 00000000T Rp,dI21(2031< RpteI00000000< RppteI00000000 11.20000T 11.20000T Pid: 32< (o)): 11.20000T !P: 0
De)oApp
Not tainted B2..2.4-NEW210 Q3C
11.20000T PC
is at 0/8,,0
11.20000T LR
is at 0/8,8,
11.20000T p( : K00000LT
r : K0000LT
psr: 0000010
11.20000T sp : 5e8520 ip : 5e853 p : 5e8530
11.20000T r10: 002000 r8 : 00000000 r : 00000000 11.20000T r : 00000000 r : 0000310 r4 : 00000000 r : 0000a( 11.20000T r3 : 1234 r2 : 00000000 r1 : 00000000 r0 : 0000001 11.20000T a,s:n]!v %*^s on %^s on &ode
SE*932
%SA A*& Se,)ent user
11.20000T !ontro: 000431 a5e: 210000 DA!: 00000014 11.20000T K(002(5eLT Bsho'9re,s@070>07(C ro) K(0030ddLT B99do9user9aut@074(>07aC 11.20000T r:(1(00 11.20000T K(0030dLT B99do9user9aut@070>07aC ro) K(003108LT Bdo9pa,e9aut@07200>0723C 11.20000T r:(1d51 r:(1(00 r4:(1ee5a r:00010000 11.20000T K(0030e8LT Bdo9pa,e9aut@070>0723C ro) K(002520(LT Bdo9DataA5ort@073>078C 11.20000T K(00251dLT Bdo9DataA5ort@070>078C ro) K(00255a0LT Bret9ro)9e7(eption@070>0710C 11.20000T E7(eptionsta(;B07(1150 to 07(11C 11.20000T a0:
0000001 00000000 00000000 1234
11.20000T (0: 0000a( 00000000 0000310 00000000 00000000 00000000 002000 5e8530 11.20000T e0: 5e8535e8520 0000 00000 0000010
hese de5u, )essa,e (an ,et 5+ e7e(utin, d)es, pro,ra). or) these error )essa,e< 'e ound that e7(eption happened on SE*932 )ode< it is appi(ation pro,ra) e7(eption< i the )ode is not SE*932< then it isn=t an appi(ation pro,ra) e7(eption6 +ou (an aso ind that error pro,ra) is De)oApp< the reason o e7(eption happen is Funhanded pa,e autB11C at 0700000000G< P! point to 070 'hen e7(eption happenin,< return address "* point to 07< a the re,ister=s vaue 'hen e7(eption happenin, have 5een printedB*0 ~ *10 、 SP 、 %P 、 P 、 SPS* 、 "* 、 P!C < 'ith these inor)ation< 'e (an ind the o(ation o error pro,ra) 5+ disasse)5e appi(ation inor)ation. o disase)5ed the pro,ra) De)oApp< use (o))and 5eo': >opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-o5du)p
-D
De)oApp L De)oApp.as) A)on, (o))and a5ove< F L De)oApp.as) G 'rite disasa)5ed (ontent to De)oApp.as) ie< then 'e open this ie< ind asse)5in, (ode 'hen e7(eption happenin, : 000020 K5u,9in9hereL: 20: e1a0(00d 2: e82dd00 2: e2(500 2(: e2dd00
)ovip< sp push Up< ip< r< p(X su5 p< ip< Q 6 07 su5 sp< sp< Q 6 07
30: e3a03000 3: e4053010 3: e4152010 3(: e483010
)ovr3 < Q0 6 070 str r3< p< Q-1T dr r2< p< Q-1T dr r3< p(< Q1T 6 4 K5u,9in9here@073L
0: e423000 : e4153010
str r3< r2T dr r3< p< Q-1T
: e4833000 dr r3< r3T (: e1a00003 )ovr0< r3 40: e88da00 d)i5 sp< Up< sp< p(X 4: 1234 .'ord 071234 str r3<r2T put vaue o r3 into the unit o r2 pointin, to:
30: e3a03000 )ovr 3< Q0 3: e4053010 str r3< p< Q-1T
set *3 to 0 store *3 in the unit o p-1 pointin, to
3: e4152010 dr r2< p< Q-1T set *2 to unit (ontent o p-1 pointin, to 3(: e483010 dr r3< p(< Q1T 6 set *3 to unit (ontent o p(@1 pointin, to 0: e423000 str r3< r2T set unit o *2 pointin, to to (ontent o *3 %t is (ear that the vaue o *2 is 0 5eore e7e(ute str r3<r2T6 vaue o r3 is (ontent o address 4< it is 071234. Ater e7e(utin, str r3<r2T< it is the sa)e as RBuint329t RC 0 I 071234. % deveopers don=t ;no' asse)5e an,ua,e 'e< 'e (an (han,e asse)5e (ode to ! (ode. ust needin, to add YS<--sour(e option 'hen disasse)5in,: %nter)i7 sour(e (ode 'ith disasse)5+,(o))and 'hi(h is to disasse)5ed is 5eo': >opt>(o)pier>,i5(-oa5i-too(hain-ar)-,eneri(>5in>ar)-un;no'n-inu7-,nu-o5du)p De)oApp L De)oApp.as) No' oo; at disasse)5er (ode< it is (ear: 000020 K5u,9in9hereL: Qin(ude Kstdio.hL Qin(ude Kstdi5.hL Qin(ude Kstrin,.hL stati( int 5u,9in9hereBvoidC U 20: e1a0(00d )ovip< sp 2: e82dd00 push Up< ip< r< p(X 2: e2(500 2(: e2dd00 int Rp6 p I N""6 30: e3a03000 3: e4053010
su5 p< ip< Q 6 07 su5 sp< sp< Q 6 07
)ovr3 < Q0 6 070 str r3< p< Q-1T
-DS
Rp I 0712346 3: e4152010 dr r2< p< Q-1T 3(: e483010 0: e423000
dr r3< p(< Q1T 6 4 K5u,9in9here@073L str r3< r2T
return Rp6 : e4153010
dr r3< p< Q-1T
: e4833000
dr r3< r3T
(: e1a00003
)ovr0< r3
X 40: e88da00 d)i5 4: 1234 .'ord
,(:(,(
sp< Up< sp< p(X 071234
Con$ition o% !an not $e&*
We have introdu(ed 2 de5u,,in, )ethods< the+ are a de5u,,in, 5+ #DM< 5ut there 'i have (onditions that (an not use #DM to de5u,:
error (ode is in a d+na)i( i5rar+
o5e(t pro,ra) not (ontains de5u, )essa,e o5e(t have 5een opti)ied sour(e (ode have so)e ies that have the sa)e iena)e
% o5e(t pro,ra) have 5een opti)ied< then sour(e (ode 'i not (orrespond to de5u,,in, o(ation 'hen de5u,,in,6 i o5e(t pro,ra) do not (ontains de5u,,in, )essa,e< then ,d5 (an=t ;no' the o(ation o sour(e (ode< and o (ourse (an not (orrespond to sour(e (ode to de5u,,in,6 i error (ode is in d+na)i( i5rar+ < ,d5 (an not de5u, in d+na)i( i5rar+< 5e(ause o d+na)i( i5rar+ is d+na)i( in;in,< o(ation o in;in, is not i7ed6 i sour(e (ode have so)e ies that have the sa)e iena)e< and the+ are o(ated in dierent oder< it )a+ sear(h the 'ron, sour(e ie 'hen de5u,,in,.
( API an*a NEW210 devi(e na)e: Devi!e
Printer &a,neti(stripe &ode)>#P*S>!D&A
Devi!e%ienae
Notes
>dev>printer_
_I0<1<2<\<14
>dev>)a,(ard_
_I0<1<2<\<14
>dev>tt+S1
Mars(anner>E7terna PED
>dev>tt+S2
A*
>dev>tt+S3
AD
>dev>ad(
N!!ard
>dev>n(
%!!ard
>dev>user(ard >dev>sa)(ard_
ser (ard _I1<2<3 SA& (ard
(1(S'ste AP% un(tions o this )odue 'as deined in the Fposapi.hG6 Fi5pos.soG )ust 5e used 'hen in;in,.
(1(1(
s's="e&oot
P"otot'#e
void s+s9re5ootBvoidC
F*n!tion
*estart s+ste)
Pa"aete"
None
Ret*"n
None
S*##o"t
NEW210
Notes
S+ste) 'i turn o a the pro,ra)< reset and restart
(1(2(
s's=#o7e"o%%
P"otot'#e
void s+s9po'eroBvoidC
F*n!tion
Po'er o
Pa"aete"
None
Ret*"n
None
S*##o"t
NEW210
Notes
S+ste) 'i turn o a the pro,ra)< po'er o the s+ste)
(1(+(
s's=6&$=set
P"otot'#e
int s+s9;5d9setB(onst stru(t ;5dset RpsetC
F*n!tion
set (oni,uration o (urrent s+ste) and ;e+
Pa"aete"
pset (input para)eter )
5eep9ena5e
Ena5e>Disa5e 5uer 'hen pressin, or not: 1: ena5e< 0: disa5e
5eep9re
he reuen(+ o 5uer Bunit: HC
5eep9ti)e
Muer duration 0`100)sC
ti)e
Bunit:
)s<
5a(;i,ht
Ater pr essin, th e ;e +< the du ration ti)e that 5a(;i,ht is turned on: 0: no 5ri,ht 5a(;i,ht Positive nu)5er : Mri,ht 5a(;i,ht is turn o auto)ati(a+ 'hen the nu)5er o se(onds e7pires Ne,ative nu)5er : Ma(;i,ht a'a+s
eed9ena5e
on Ena5e>Disa5e ee din, or not 'hen pressin, the eed ;e+: 1: ena5e< 0: disa5e Noti(e: this para)eter 'as reserved or uture use.
Ret*"n
S*##o"t
0
Set O/.
-E%NVA"
input para)eter error
others
other error (ode
NEW210
Notes
(1(,(
s's=6&$=et
P"otot'#e
int s+s9;5d9,etBstru(t ;5dset RpsetC
F*n!tion
,et (oni,uration o (urrent s+ste) and ;e+ pset
Pa"aete"
5eep9ena5e
(output para)eter )
Ena5e>disa5e 5uer rin,in, 'hen pressin, ;e+pad 1: ena5e< 0: disa5e
5eep9re
he reuen(+ o 5uer Bunit: HC
5eep9ti)e
Muer duration ti)e Bunit: )sC
5a(;i,ht
Ater pressin, t he ;e+< the ti)e h o' on, 5a(;i,ht is turned on: 0: no 5ri,ht 5a(;i,ht Positive nu)5er : Mri,ht 5a(;i,ht is turn o auto)ati(a+ 'hen the nu)5er o se(onds e7pires Ne,ative nu)5er : Ma(;i,ht a'a+s on
eed9ena5e
Ret*"n
0
Set O/.
Ena5e>Disa5e ee din, or not 'hen pressin, the eed ;e+: 1: ena5e< 0: disa5e
-E%NVA"
input para)eter error
others
other error (ode
NEW210
>e A##i!a&e in Notes
(1((
s's=set=tie
P"otot'#e
int s+s9set9ti)eB(onst stru(t t) Rt)C
F*n!tion
Setup ter)ina s+ste) o(a date and ti)e
Pa"aete"
t)
t)9se(
se(ond , s(ope : 0 ~ 1 , ao' eap se(ond
Ret*"n
t)9)in
)inute,s(ope:0~48
t)9hour
hour,s(ope:0~23
t)9)da+
da+ , s(ope : 1 ~ 31 , da+ 5e,in ro) 1
t)9)on
)onth , s(ope : 0 ~ 11, )onth 5e,in ro) 0
t)9+ear
+ear,s(ope:ti)e oset ro) 1800
0
Settin,su((ess
-E%NVA"
%nput para)eter error
others
Other error (ode
S*##o"t
NEW210
Notes
!a this un(tion to set s+ste)=s o(a ti)eBno t ! ti)eC< transition ro) o(a ti)e to ! ti)e is depended on settin,s o s+ste) ti)e one. Due to the i)itation o *! (hip< 'hen set in the ti)e 5eore
180< it 'i ai
(1(:(
s's=et=stat*s=&a"=.ei.t
P"otot'#e
int s+s9,et9status95ar9hei,htBvoidC6
F*n!tion?
#et hei,ht o the status 5ar
Pa"aete"?
无
Ret*"n?
*eturn the points o the status 5ar
NEW210
S*##o"t? Notes?
s's=$ea'=to=s*s#en$
5.1..
P"otot'#e?
int s+s9dea+9to9suspendBvoidC6
F*n!tion?
&a;e ter)ina no suspend in 3 )inutes
Pa"aete"?
None
Ret*"n?
0
S*##o"t?
NEW210
Su((ess
Notes?
(1(8(
s's=s*s#en$=no7
P"otot'#e?
int s+s9suspend9no'BvoidC
F*n!tion?
S+ste) suspend i))ediate+
Pa"aete"?
None
Ret*"n?
0
S*##o"t?
NEW210
Su((ess
Notes?
(1(@(
s's=et=sn
P"otot'#e
(har Rs+s9,et9snB(har Rsn< int n5+tesC
F*n!tion
#et the devi(e seria nu)5er
Pa"aete"
sn (output)
Save the a(uired seria nu)5er
n5+tes
&a7i)u) 5+tes nu)5er o sn
Ret*"n
#ot sn< return N"" i it ais
S*##o"t
NEW210
Notes
(1(10( &ee# P"otot'#e
void 5eepBunsi,ned int reuen(+< unsi,ned int ;eep)sC
F*n!tion
(ontro 5uer ran,
Pa"aete"
reuen(+
Sound reuen(ies o 5uer (~20000H)
;eep)s None
!ontinuous rin,in, ;eep)s ,unit:)s
Ret*"n S*##o"t
NEW210
Notes
5.1.11.
s's=&a!6i.t=set=tie
P"otot'#e
int s+s95a(;i,ht9set9ti)eBint ;eepC
F*n!tion
set 5a(;i,ht o or on
Pa"aete"
;eep(unit:se(ond)
Ret*"n
0 Others
L0
Ma(;i,ht is turned o auto)ati(a+ 'hen the nu)5er o ;eep se(onds e7pires
I0
no5a(;i,ht
K0
Ma(;i,ht a'a+s on
O/ Set Other error (ode
S*##o"t
NEW210
Notes
On(e it is set up< the 5a(;i,ht 'i run a((ordin, to the set vaue. Mut ater s+ste) reset< the set vaue o 5a(;i,ht 'i re(over to its deaut one..
5.1.12.
s's=&a!6i.t=et=tie
P"otot'#e
int s+s95a(;i,ht9,et9ti)eBint R;eepC
F*n!tion
,et settin,s o (urrent 5a(;i,ht
Pa"aete"
;eep ( output , unit : !oni,uration o (urrent 5a(;i,ht 'i se(ond) save at this vaue 0 O/ Set
Ret*"n
>e
-E%NVA"
%nput para)eter error<;eep is nu
others
Othererror(ode
NEW210
a##i!ation in Notes
On(e it is set up< the 5a(;i,ht 'i run a((ordin, to the set vaue. Mut ater s+ste) reset< the set vaue o 5a(;i,ht 'i re(over to its deaut one..
(1(1+( s's=et=a!.ine=!on%i P"otot'#e
int s+s9,et9)a(hine9(oni,B&a(hine!oni,9t (oni,T< uint329t nrC
F*n!tion
#et o(a (oni,uration inor)ation o )odue
Pa"aete"
(oni, (output)
he output o )odue (oni,uration
nr
#et the e7pe(ted )a7i)a nu)5er o )odue inor)ation< nu)5er o (oni,.
Ret*"n
LI0
he n u)5er o r ea o utput ) odue inor)ation
-E%NVA"
inputpara)etererror
others
othererror(ode
S*##o"t
NEW210
Notes
his un(tion is used to o5tain ter)ina=s )odue inor)ation< store ,ettin, inor)ation in the stru(ture o (oni,< )odue na)e is sho'n: &oduena)e er)ina Printer &ode)
P!%
&odueinor)ation er)inana)e (NEW210) Printert+pe () )a7i)u) rate o s+n(hronous>as+n(hronous (o))uni(ation None
SM host
SM standard intera(e(SM2.0)
SM devi(e
None
Ethernet
None
W%%
None
#P*S
None
!D&A
None
N!
None
(1(1,( e$=et=&"i.tness P"otot'#e
int ed9,et95ri,htnessB(onst (har Red9na)e< uint329t R5ri,htnessC
F*n!tion?
#et the 5ri,htness o ed i,ht
Pa"aete"?
ed9na)e
edna)e
5ri,htness Boutput para)eterC
"ed 5ri,htness , s(ope : 0 ~ 244 , 0 dar;est,244 i,htest
0
O/ Set
-E%NVA"
%nputpara)etererror
others
Othererror(ode
Ret*"n?
>e
NEW210
a##i!a&e in? Notes
LED nae $e%inition
Co""es#on$in
"ED9A**OW9DOWN
Fdo'n arro'G i(on o "!D
"ED9A**OW9P
Gup arro'G i(on o "!D
"ED9MAE*$9SHE""
G5atter+ apperen(eG i(on o "!D
"ED9MAE*$91
G5atter+ po'erGi(on o "!D
"ED9MAE*$92 "ED9MAE*$93 "ED9MAE*$9 "ED9MA!/"%#H
"!D 5a(;i,ht
"ED9!A*D
G(ardGi(ono"!D
"ED9"!D9!ON*AS
"!D (ontrast
"ED9"O!/
Go(;Gi(ono"!D
"ED9POWE*9SPP"$
Gpo'erG i(on o "!D
"ED9&ODE&9OHOO/
Go-hoo;G i(on o "!D
"ED9&ODE&9ONHOO/
Gon-hoo;G i(on o "!D
"ED9&ODE&9MASE
GphoneG i(on o "!D
"ED9S%#NA"9SA%ON
G'ireess 5ase stationG i(on o "!D
"ED9S%#NA"91
G'ireess si,naG i(on o "!D
"ED9S%#NA"92 "ED9S%#NA"93 "ED9S%#NA"9 "ED9ON"%NE
&ode) onine "ED indi(ator
"ED9
&ode)senddata"EDindi(ator
"ED9*
&ode)re(eivedata"EDindi(ator
(1(1( e$=set=&"i.tness P"otot'#e
int ed9set95ri,htnessB(onst (har Red9na)e< uint329t 5ri,htnessC
F*n!tion
set the 5ri,htness o ed i,ht
Pa"aete"
ed9na)e
edna)e
5ri,htness
"ed 5ri,htness , ran,e : 0 ~ 244 , 0 dar;est,244 5ri,htest
Ret*"n
0
O/ Set
-E%NVA"
%nputpara)etererror
Others
Other error (ode
S*##o"t
NEW210
Notes
or deinition o ed9na)e< pease reer to ed9,et95ri,htness or (onvenien(e< deine 2 "ED i,htness: Qdeine "ED9M*%#HNESS9&%N 0 Qdeine "ED9M*%#HNESS9&A 244
5.1.16.
s's=et=.a"$7a"e=!on%i
P"otot'#e
int s+s9,et9hard'are9(oni,B(onst (har R)odue< (har t+pe12T< int Rnu)5ersC
F*n!tion
#et o(a (oni,uration inor)ation o hard'are )odue
Pa"aete"
)odue (input)
he na)e o hard'are )odue need to 5e o5tained. or detais
t+pe BoutputC
he t+pe o hard'are )odue.
nu)5ers
#et the e7pe(ted )a7i)a nu)5ers o the hard'are )odue.
Ret*"n
0 others
Su((essu. aied
S*##o"t
NEW210
Notes
Hard'are )oduesBthe para)eter o )odueC as sho'n 5eo': Hard'are)odue
5.1.1.
(o))ent
HA*DWA*E9&A!H%NE
er)ina Na)e (e.,. NEW210
HA*DWA*E9MAE*$
Matter+
HA*DWA*E9"!D
"!D
HA*DWA*E9O!HS!*EEN
ou(h S( reen
HA*DWA*E9/E$MOA*D
/e+Moard
HA*DWA*E9&S*
&a,neti(Stripe*eader
HA*DWA*E9P*%NE*
Printer
HA*DWA*E9N!
N!
HA*DWA*E9
ransash
HA*DWA*E9%!
%!!ard*eader
HA*DWA*E9SA&
SA&Sot
HA*DWA*E92S%&
S%&Sot
HA*DWA*E9A*
A*
HA*DWA*E9MA*S!ANNE*
Mar(ode S(anner
HA*DWA*E9W%*E"ESS
Wireess
HA*DWA*E9&ODE&
&ODE&
HA*DWA*E9"AN HA*DWA*E9W%%
"AN W%%
HA*DWA*E9M"EOOH
Mueou(h
HA*DWA*E9SMH
SMHost
HA*DWA*E9SMD
SMDevi(e
HA*DWA*E9SMO
SMO#
HA*DWA*E9#PS
#PS
HA*DWA*E9%N#E*P*%N
in,erPrinter
s's=so%t7a"e=*#$ate
P"otot'#e
int s+s9sot'are9updateB(onst (har Riena)eC
F*n!tion
sed to update the ie o spe(iied path Biena)eC.
Pa"aete"
iena)e(input)
he u path na)e o ie that need to 5e updated.
Ret*"n
0
Su((essu.
others
aied
>e
NEW210
a##i!ation in Notes
!ain, this un(tion (an update the ie that is do'noaded 5+ &S re)ote+. he para)eter o iena)e is that do'noaded 5+ &S and stored te)porari+ int the POS )a(hine. he iena)e in(udes the ir)'are and the ie pa(;ed 5+ Ne'210Do'noadoo. % it is a ir)'are< ater (ain, this un(tion< +ou )ust restart the )a(hine in order to (o)pete the update. % it is a pa(;ed ie< (a this un(tion and then update is (o)pete i))ediate+.
(1(18( s's=&atte"'=in%o P"otot'#e
int s+s95atter+9inoB5atter+9ino9t R5atter+9inoC
F*n!tion
O5tain the inor)ation o 5atter+。
Pa"aete"
5atter+9ino BOutputC
status
0-Matter+-po'ered 1-!har,in, 2-u (har,e 3-E7terna-po'ered
Ret*"n >e a##i!ation in Notes?
(ur9vaues
!urrentvota,e
)a79vaues
&a7i)u) vota,e
)in9vaues
&ini)u)vota,e
per(ent
Per(ento5atter+ie
0
Su((essu
others
aied< pease reer to Kerrno.hL.
NEW210
(2(e' &oa"$ Muttons deinition o NEW210 (o)pies 'ith standard P!-101 ;e+5oard < users (an ,et the sa)e resut 5+ operatin, an e7terna ;e+5oard< or pressin, ;e+ in NEW210 dire(t+. When user pressin, an ;e+< s+ste) 'i send the ;e+ vaue o ;e+< and the state vaue o this ;e+ is state Fpress do'nG< ater 00)s< s+ste) 'i send ;e+ vaue o this ;e+ a,ain< the state vaue o the ;e+ is aso Fpress do'nG< And then ever+ )s s+ste) 'i send the ;e+ vaue and Fpress do'nG state vaue < unti the ;e+ reease. S+ste) send ;e+ vaue o the ;e+ and state FreeaseG. %n other 'ords< as on, as ;e+ is pressed< s+ste) 'i send ;e+ vaue and state o the ;e+ a the ti)e< unti ;e+ is reeased. he (orresponden(e o NEW210=s ;e+s and P!-101=s ;e+s is isted as oo': NEW8210
PC-101
6e'
6e'
Co$e
S'&o
0
0
/E$90
070M
D%/S90
0730
1
1
/E$91
0702
D%/S91
0731
2
2
/E$92
0703
D%/S92
0732
3
3
/E$93
070
D%/S93
0733
/E$9
0704
D%/S9
073
4
4
/E$94
070
D%/S94
0734
/E$9
070
D%/S9
073
/E$9
070
D%/S9
073
/E$9
0708
D%/S9
073
8
8
/E$98
070A
D%/S98
0738
!AN!E"
Es(
/E$9ES!
0701
D%/S9ES!APE
ENE*
Enter
/E$9ENE*
071!
D%/S9ENE*
071M
/E$9P
07
D%/S9!*SO* 9P
07002
b
b
/E$9DOWN
07!
D%/S9!*SO*9DOWN
07003
!"EA*
Ma(;spa(e
/E$9MA!/SPA!E
070E
D%/S9MA!/SPA!E
070
EED
PrS(rn
/E$9S$S*^
073
D%/S9P*%N
07008
&EN
"etAt
/E$9"EA"
073
D%/S9A"
0720
/E$9"E!*"
071D
D%/S9!ON*O"
07202
070D
N!
"et!tr
A"PHA
"et Shit
/E$9"ESH%
072A
D%/S9SH%
07201
A&-1
1
/E$91
073M
D%/S91
07101
A&-2
2
/E$92
073!
D%/S92
07102
A&-3
3
/E$93
073D
D%/S93
07103
A&-
/E$9
073E
D%/S9
0710
he Po'er ;e+ is not isted here< 5e(ause NEW210 appi(ation pro,ra) (an=t (ontro and ,et this ;e+< 'hie pressin, po'er ;e+ or )ore than 1.4 s< s+ste) 'i 5e turned o auto)ati(a+. %n addition< on deaut (ondition it 'i start printer=s un(tion o Fpaper s;ipG 'hen pressin,
eed ;e+< appi(ation pro,ra) (an ,et the ;e+ vaue o the ;e+.
(+(Dis#a' NEW210 dispa+ 5ased on the Dire(tM i5rar+< the 'e5 site is http:>>'''.dire(t5.or,. AP% do(u)ents in; is http:>>'''.dire(t5.or,>do(s>Dire(tM9*eer 919>inde7.ht). he appi(ations 5ased on Dire(tM have its o'n FWindo'G< Dre(tM )ana,e the entire dispa+ 'indo's< and so that ea(h pro,ra) is dispa+ed on the "!D does not
interere 'ith other pro,ra)s. Mesides )ana,e the dispa+ 'indo's< Dire(tM aso )ana,es the input devi(es< the event 5uer< onts< ,raphi(s < audio>video< providin, users 'ith a uniied< riend+ pro,ra))in, intera(e. NEW210 (an support these onts:
>! OMB11 5it)ap ontC MDBMit)ap Distri5ution or)atC
NEW210 (an support these pi(ture or)at:
PE# PN# #% M&P
he or)ats o ot5 and 5d are point-arra+ ont i5rar+ < the ot5 or)at is 5inar+ arra+ i5rar+< and the 5d or)at is te7t arra+ i5rar+< these t'o or)ats (an 5e (onverted to ea(h other< the ie o 5d or)at is ar,er than that o ot5 or)at. No )atter tt i5rar+< or ot5< 5d ont i5rar+< it is the sa)e intera(e or e7terna (a< the pro,ra))er no need to (are or the dierent. Note: the tt or)at is oo)a5e< 5ut the ot5 and 5d or)ats una5e to do so< the sie o the) are i7ed< i a not e7ist sie is see(ted< it 'i not 'or;.
(+(1( Di"e!tF>
(+(1(1(
La'e"s
%t represents a separate i)a,e 5uer. &ost e)5edded devi(es have )ore than one a+er. Hard'are usin, the appropriate apha vaue or 5endin,< then dispa+.
(+(1(2(
S*"%a!e
A reserved area o )e)or+ used to store pi7e data. he operation Fdra'in,G and F5ittin,G are uti)ate+ a(t on the sura(es< the )e)or+ o sura(e (an 5e o5tained ro) video )e)or+< aso (an 5e o5tained ro) s+ste) )e)or+< 'hi(h is deter)ined 5+ the ,iven i)it.
(+(1(+(
P"ia"' S*"%a!e
%t represents a parti(uar a+er o spe(ia sura(e o the ra)e 5uer. % the pri)ar+ sura(e is sin,e 5uer< an+ operation on this )ain sura(e 'i 5e seen on s(reen.
he reationship 5et'een the) is so)e one-to-one or one-to-)an+: 1 %Dire(tM N S(reens 1 S(reen N "a+ers 1 "a+er 1 Pri)ar+ Sura(e 1 "a+er N Windo's
1 Windo' 1 Windo' Sura(e 1 Sura(e N Su5sura(e sua+ one s(reen has a dispa+ a+er< 5ut DM support ea(h o the) have )utipe
instan(es.
(+(1(,(
La'e"s an$ S!"eens
Ea(h s(reen has one or )ore a+ers< t+pi(a+< a s(reen on+ has one a+er< 5ut so)e s+ste) support overa+s< due to hard'are support one a+er dispa+ a5ove on other a+ers< there (an 5e e7ist )an+ a+ers.
(+(1((
S!"eens an$ Win$o7s
S(reen (an not (reate 'indo' dire(t+< 5ut +ou (an reuest a pri)ar+ a+ercs %D< and reuest %Dire(tM intera(e or +our a+er intera(e< then 5+ this intera(e< +ou (an (reate a 'indo'.
(+(1(:(
S*"%a!es an$ Win$o7s
Ever+ 'indo' asso(iatin, 'ith a sura(e< the (ontent dra'n to the sura(e 'i not
dispa+ on the s(reen i))ediate+< 5e(ause the 'indo' )ana,er 'i asse)5es a sura(es to a )ain sura(e Y 5ased on the re,ion to 5e reshened and the seuen(e o sta(;.
(+(1(9(
S*"%a!es an$ La'e"s
Ever+ a+er asso(iati n, 'ith a sura(e< too. his sura(e is a dire(t )aniestation to the a+er )e)or+. %n e7(usive )ode< +ou (an on+ a((ess to this sura(e< other'ise< +ou (an on+ (reate a 'indo'< then dra' the sura(e 5+ 'indo' )ana,er.
5.3.2. P"o"a &ase$ on Di"e!tF>
A 5asi( appi(ation 5ased on Dire(tM is as oo'in,: int main(int argc, char *argv[]) { IDirectFB *dfb DFBResult ret; * Initiali!e DirectFB including c"mmand line #arsing$ * ret % DirectFBInit(argc, argv); if (ret) { DirectFB&rr"r('DirectFBInit() failed', ret); g"t" eitentr; + * reate the su#er interface$ * ret % DirectFBCreate(-dfb); if (ret) { DirectFB&rr"r('DirectFBreate() failed', ret); g"t" eitentr; + .. eitentr/ .. return ret; +
irst +ou shoud initiaie the Dire(tM< 5+ (ain, the AP% Di(e(tM%nitBC< pro(ess the
input para)eter< then 5+ (ain, the AP% Dire(tM!reateBC to (reate a d5 o5e(t. Note: this o5e(t shoud 5e reeased 5+ (ain, AP% *eeaseBC to reease the resour(e o((upied 5+ it. A5ove 'e des(ri5ed the reation a5out s(reen< a+er< 'indo' and sura(e< the+ are see)ed (o)pe7< +ou (an re)e)5er the rue or short: 'hen (usto) dispa+s< itcs on+ to sura(e
Dire(tM%nit
Dire(tM!reateBd5C
d5-L#etDispa+"a+erBa+erC
a+er-L!reateWindo' B'indo'C
'indo'-L#etSura(eBsura(eC
5.3.3. Loa$ iae
So)eti)es 'e need to dispa+ a i)a,e on "!D< the Dire(tM has aread+ provides a set o AP%s< or the pro,ra))ers< 'e oer the oo'in, (ode to dispa+ a i)a,e.
static IDirectFBSurface *load_image(IDirectFB *dfb, const char *lename) { IDirectFBImageProider *!roider" IDirectFBSurface *imgsurf # $%&&" DFBSurfaceDescri!tion dsc" DFB'esult err"
err # dfb reateImageProider(dfb, lename, +!roider)" if (err # DFB_-.) { f!rintf( stderr, /ouldn0t load image from le 01s02 1s3n/, lename, DirectFB4rrorString( err ))" return $%&&" 5 !roider6etSurfaceDescri!tion(!roider, +dsc)" dsc78ags # DSD4S_9ID:; < DSD4S_;4I6;: < DSD4S_PI=4&F-'>?:" dsc7!i@elformat # DSPF_?'6B" if (dfb reateSurface(dfb, +dsc, +imgsurf) ## DFB_-.) !roider'ender:o(!roider, imgsurf, $%&&)" !roider'elease(!roider)" return imgsurf" 5 he (ode a5ove used to oad a i)a,e to a Dire(tMcs sura(e< the i)a,e stored in the sura(e )e)or+< 5ut it 'i not dispa+ on "!D. o dispa+ the i)a,e< another operation is needed: %Dire(tMSura(e::Mit. o oo) or the i)a,e< +ou (an use %Dire(tMSura(e::stret(hMit< usin, the AP% %Dire(tMSura(e::ieMit< +ou (an )a,ni+ the i)a,e to the u s(reen. Note: ater these operations< i the sura(e 'ith the i)a,e is no on,er 5e needed< +ou shoud (a AP% *eeaseBC to reease the resour(e< other'ise it 'i ead to the ea;a,e o )e)or+.
5.3.4. P"o"a in6in
Appi(ations 5ased on Dire(tM need the oo'in, D""s:
i5.so i5usion.so i5dire(t.so i5dire(t5.so
When in;in,< pease use (o))and ine: F- -usion -dire(t -dire(t5G< and use F-"G to inde7 the path o these i5rar+.
(,(Pe$ PED supports &aster>Session , i7ed , D/P ;e+ soutions , ;e+s supports or ever+ ;e+ t+pe: /e+na)e &aster/e+
Nu)5ero;e+s 102
P%N /e+
102
&A! /e+
102
i7ed-P%N/e+
102
i7ed-&A!/e+ D/P /e+
102 1
Supports onine P%N and oine painte7t pin and oine en(ipher pin. AP% un(tions o this )odue 'as deined in the Fped.hG6 Fi5ped.soG )ust 5e used 'hen in;in,.
(,(1(
#e$=et="an$o
P"otot'#e
uint329t ped9,et9rando)BvoidC
F*n!tion
#et a 32-5it rando)ness nu)5er.
Pa"aete"
None
Ret*"n
An unsi,ned rando)ness nu)5er B32 5itsC.
S*##o"t
NEW210
Notes
5.4.2.
#e$=et="an$o=n"
P"otot'#e
int ped9,et9rando)9nrBuint329t 5+tes< void RdataC
F*n!tion
#et rando) nu)5er ro) PED
Pa"aete"?
5+tes
M+tes< ess than 12;5
data ( output
Muer to re(eive the rando) nu)5ers.
) Ret*"n
0
Su((ess
-1
Error. he e rror ( ode pease ,ets ro) the ,o5a varia5e errno.
NEW210
S*##o"t? Notes
(,(+(
#e$=set=#in=in#*t="eion
P"otot'#e?
int ped9set9pin9input9re,ionBint 7< int +< int 'idth< int hei,htC
F*n!tion?
Set the P%N enter 'indo' postion
Pa"aete"?
7
7
+
$
'idth
Width
hei,ht
Hei,ht
Ret*"n
S*##o"t
0
su((ess
-1
Error. he e rror ( ode pease ,ets ro) the ,o5a varia5e errno.
NEW210
Notes
(,(,(
#e$=%o"at
P"otot'#e
int ped9or)atBvoidC
F*n!tion
*e5uid PED BOr PED or)atC< it 'i (ear a PED ;e+ and uno(; the PED B% the PED is in o(; statusC. On+ the root user (an re5uid PED 'hen PED 'as atta(;ed .
Pa"aete"
None
Ret*"n
0
Su((ess
-1
Error. he error (ode pease ,ets ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
(,((
#e$=!ea"=*se"=6e's
P"otot'#e
int ped9(ear9user9;e+sBvoidC
F*n!tion
!ear (urrent user=s Bor (urrent appi(ationC PED ;e+s.
Pa"aete"
None
Ret*"n
0
Su((ess
-1
Error. he error (ode pease ,ets ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
(,(:(
#e$=$eete=6e'
P"otot'#e
int ped9deete9;e+Buint329t /e++pe< uint329t /e+%nde7C
F*n!tion
Deete one PED ;e+ o'n to the (urrent appi(ation.
Pa"aete"
/e++pe
Delete key type. *upport key type as follow$ /01T0#/12%*T /01T0#/1#34 /01T0#/12%C /01T0#/1536#34 /01T0#/15362%C /01T0#/1D7#T
/e+%nde7
/e+inde7. 1.% the ;e+ t+pe is /01T0#/1#34
(
/01T0#/12%*T /01T0#/12%C
( (
/01T0#/1536#34 ( /01T0#/15362%C, the key inde) value from 8 to 98:;< :.3f the key type is /01T0#/1D7#T/0, the key inde) value from 8 to 9=< Ret*"n
S*##o"t
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
Notes
(,(9( P"otot'#e
#e$=et=sensitive=tie" int ped9,et9sensitive9ti)erBuint329t Sensitive+peC
F*n!tion
#et PED re)ain sensitive servi(e ti)e
Pa"aete"
*ensitiveType>i?
T0#/1#34134T/@A%B
8)89
The
time
interval
between twice pin input operation. Ret*"n
LI0
he re)ain ti)e.
S*##o"t
NEW210
Notes
(,(8(
#e$=set=#in=in#*t=tieo*t
P"otot'#e
int ped9set9pin9input9ti)eoutBuint329t ti)eoutC
F*n!tion
Set P%N input ti)e out vaueBunit: se(ondC.
Pa"aete"
timeout
Ret*"n
S*##o"t
"9:8
3nvalidinputvalue.
;89:8
Aalid input value
8
*et the default timeout value 8 seconds.
E;8
3nvalid input value.
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
Notes
(,(@(
#e$=et=$*6#t=6sn
P"otot'#e F*n!tion
int ped9,et9du;pt9;snBuint329t /e+%nde7< void R/snC !a(uate P%N Mo(; and &A! one ti)e ater one ti)e /SN ,et
Pa"aete"
/e+%nde7 /snBOutputC
Ret*"n
/e+ %nde7 0 ~14 #et 10 5+tes o /SN vaue
0
Su((ess
-1
Error. he error (od e pease ,et s ro ) the , o5a va ria5e errno.
S*##o"t
NEW210
Notes
% (ontinue (a ped9,et9)a(9du;ptBC 2 ti)es or (ontinue (a ped9,et9pin9du;ptBC 2 ti)es< the /SN 'i (han,e auto)ati(a+.
(,(10( #e$=7"ite=#in=6e' P"otot'#e
int ped9'rite9pin9;e+Buint329t &aster/e+%D< uint329t Pin/e+%D< uint329t Pin/e+"en< (onst void RPin/e+C
F*n!tion
Write a P%N ;e+ into the PED< 'hi(h en(r+pted 5+ &aster/e+%D< and
Pa"aete"
'ithout veri+ (ode. &aster/e+%D &aster ;e+=s %D< 0...1023. Pin/e+%D
he P%N ;e+=s %D< 0...1023.
Pin/e+"en
"en,th o Pin/e+< 1 or 2.
Pin/e+
his para)eter 'i 5e ied the (urrent P%N ;e+ (ipherte7t data.
Ret*"n
S*##o"t
0
Su((ess
-1
Error. he error (ode pease ,ets ro) the ,o5a varia5e errno.
NEW210
Notes
(,(11( #e$=7"ite=#in=6e'=e/ P"otot'#e
int ped9'rite9pin9;e+9e7Buint329t &ode< uint329t &aster/e+%D< uint329t Dest/e+%D< uint329t /e+"en< (onst void R/e+DataC6
F*n!tion
Write P%N /e+ to PED
Pa"aete"
&ode
Ret*"n
DEA9DE!*$P
En(r+pted /e+Data
/E$9VE*%$9NONE
No (he(; vaue
/E$9VE*%$9/V!
/V!
/E$9VE*%$9!&A!
!&A!
&aster/e+%D Dest/e+%D
&aster ;e+ %nde7 ,vaue 0...1023. P%N /e+ inde7 ,vaue 0...1023.
/e+"en
/e+Data en,th , P%N /e+ data en,th @!he(;data en,th(/V!、!&A! is 5+tes)
/e+Data
Painte7t>En(ipher P%N /e+ @ !he(; data
0
Su((ess
-1
Error. he error (ode pease ,ets ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
he P%N ;e+ is en(r+pted 5+ &aster/e+< the A&odeshoud 5e DEA9DE!*$P arith)eti( or 'ith one o /E$9VE*%$9NONE ,/E$9VE*%$9/V!,/E$9VE*%$9!&A!6
he P%N ;e+ (ann ot 5e (ipher te7t < so the DEA9NONE6
A&odeshoud not 5e
% 'ith /V! (he(; vaue< the /e+"en shoud 5e n @ (nI1: sin,e DES,nI2: dou5e DES,nI3: tri5e DES) % 'ith !&A! (he(; vaue< then the /e+"en shoue 5e 32@ 5+tes< the 32 5+tes: t+pede stru(t U uint19t uint9t uint9t
/e+"en6 /e+2T6 PadT6
>R /e+ en,th R> >R /e+ vaue R>
X DesSe(ret9t6
(,(12( #e$=7"ite=a!=6e' P"otot'#e
int ped9'rite9)a(9;e+Buint329t &aster/e+%D< uint329t &a(/e+%D< uint329t &a(/e+"en< (onst void R&a(/e+C6
F*n!tion
Write a en(ipher &A! ;e+ to PED< )a( ;e+ en( r+pted 5+ the &aster;e+< 'ithout (he(; vaue.
Pa"aete"
&aster/e+%D
%nde7 o &aster;e+ ,Vaue 0...1023. &A!/e+%nde7 ,Vaue 0...1023.
&a(/e+%D &a(/e+"en
&A! /e+ en,th< 1 or 2 。 En(ipher&a(;e+vaue
&a(/e+ Ret*"n
S*##o"t
0
Su((ess
-1
Error. he error (ode pease ,ets ro) the ,o5a varia5e errno.
NEW210
Notes
(,(1+( #e$=7"ite=a!=6e'=e/ P"otot'#e
int ped9'rite9)a(9;e+9e7Buint329t &ode< uint329t &aster/e+%D< uint329t Dest/e+%D< uint329t /e+"en< (onst void R/e+DataC6
F*n!tion
Write &A! ;e+ to PED
Pa"aete"
&ode
DEA9DE!*$P
/e+Dataisen(r+pted
/E$9VE*%$9NONE
No !he(; !ode
/E$9VE*%$9/V!
/V!
/E$9VE*%$9!&A!
!&A!
&aster/e+%D
&aster ;e+ inde7 ,vaue 0...1023.
Dest/e+%D
&A! ;e+ inde7 ,vaue 0...1023.
Ret*"n
/e+"en
/e+Data "en,th , /e+ data en,th @!he(; !ode "en,th(/V!、!&A! is 5+tes )
/e+Data
Painte7t >En(ipher /e+ Vaue @ !he(; !ode
0
Su((ess
-1
Error. h e error (ode p ease ,e ts r o) th e ,o5a varia5e errno.
S*##o"t
NEW210
Notes
he &A! ;e+ is en(r+pted 5+ &aster/e+< the [&ode= shoud 5e DEA9DE!*$P arith)eti( or 'ith one o /E$9VE*%$9NONE,/E$9VE*%$9/V!,/E$9VE*%$9!&A!6 he &A! ;e+ (annot 5e (ipherte7t< so the [&ode= shoud not 5e DEA9NONE6 % 'ith /V! (he( ; vaue< the /e+" en shoud 5e n @ ( nI1: sin,e DES,nI2: dou5e DES,nI3: tri5e DES) % 'ith !&A! (he(; vaue< then the /e+"en shoud 5e 32@ 5+tes< the 32 5+tes: t+pede stru(t U uint19t /e+"en6 >R /e+ en,th R> uint9t uint9t X DesSe(ret9t6
/e+2T6
>R /e+ vaue
R>
PadT6
(,(1,( #e$=7"ite=aste"=6e' P"otot'#e
int ped9'rite9)aster9;e+Buint329t &ode< uint329t &aster/e+%D< uint329t Dest/e+%D< uint329t /e+"en< (onst void R/e+DataC
F*n!tion
Write &aster ;e+ to PED
Pa"aete"
&ode
Ret*"n
DEA9DE!*$P
/e+Dataisen(r+pted
/E$9VE*%$9NONE /E$9VE*%$9/V!
No (he(; (ode /V!
/E$9VE*%$9!&A!
!&A!
&aster/e+%D
&aster ;e+ inde7 ,vaue 0...1023.
Dest/e+%D /e+"en
&aster /e+ %nde7 ,Vaue 0...1023. /e+Data "en,th , /e+ data en,th @!he(; !ode "en,th(/V!、!&A! is 5+tes )
/e+Data
Painte7t >En(ipher /e+ Vaue @ !he(; !ode
0
Su((ess
-1
Error. h e error (ode p ease ,e ts r o) th e ,o5a varia5e errno.
S*##o"t
NEW210
Notes
If the MasterKey is encrypted by another MasterKey, then the ‘Mode’ should be TDE!DE"#$%T arith&etic or 'ith one of KE$!(E#I)$!*+*E,KE$!(E#I)$!K(",KE$!(E#I)$!"M" If the MasterKey is plainte-t, then the ‘Mode’ should be TDE!*+*E If 'ith K(" chec. /alue, the Key0en should be 12n 3 4 5n678 sin9le DE:,n6;8 double DE:,n6<8 tri5e DE:= If 'ith "M" chec. /alue, then the Key0en should be <;34 bytes, the <; bytes8 t+pede stru(t U uint19t /e+"en6 >R /e+ en,th R> uint9t /e+2T6 >R /e+ vaue R> uint9t PadT6 X DesSe(ret9t6
(,(1( #e$=ine!t=#in=6e' P"otot'#e
int ped9ine(t9pin9;e+Buint329t Pin/e+%D< uint329t Pin/e+"en< (onst void RPin/e+C6
F*n!tion
%ne(t i7ed-P%N ;e+ to PED
Pa"aete"
Pin/e+%D
Ret*"n S*##o"t
Pin/e+"en
P%N ;e+ %nde7 ,Vaue 0...1023. P%N ;e+ en,th< 1 or 2 。
Pin/e+
Painte7t P%N /e+
0
Su((ess
-1
Error. he error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
Notes
(,(1:( #e$=ine!t=a!=6e' P"otot'#e
int ped9ine(t9)a(9;e+Buint329t &a(/e+%D< uint329t &a(/e+"en< (onst void R&a(/e+C6
F*n!tion
%ne(t painte7t i7ed-&a( ;e+
Pa"aete"
&a(/e+%D
&A! /e+ inde7 ,vaue 0...1023.
&a(/e+"en
&A! /e+ "en,th< 1 or 2 。
&a(/e+
Painte7t &A! ;e+ vaue.
Ret*"n S*##o"t
0
Su((ess
-1
Error. he error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
Notes
(,(19( #e$=!"eate=$*6#t=6e' P"otot'#e
int ped9(reate9du;pt9;e+Buint329t /e+%nde7< (onst void R%nit/e+<
F*n!tion
%ne(t D/P ;e+
Pa"aete"
/e+%nde7
uint329t /e+"en< (onst void R/snC6
%nit/e+ /e+"en /sn Ret*"n
S*##o"t Notes
D/P %nde7 0 ~14 %nitiaie ;e+ 1 5+tes /e+en,th ,1 105+tes/SN
0
Su((ess
-1
Error. he error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
(,(18( #e$=et=#in P"otot'#e
int ped9,et9pinBuint329t /e+%nde7< uint329t &ode< (onst (har RE7pe(tPin"en< (onst (har R!ardNo< void RPinMo(;C
F*n!tion
"et (ardhoder input P%N and !o)pute the P%N 5o(;.
Pa"aete"
/e+%nde7
P%N ;e+ %D< 0\1023.
E7pe(tPin"en
Ao'ed P%N entr+ en,th (hara(ter strin,< appi(ation enu)erates a ao'ed P%N entr+ en,th set and uses (o))a to separate then. E,. Appi(ation inputs F0<<G and it )eans appi(ation ao' (ardhoder to input no P%N< or our di,ita ;e+ or si7 di,ita ;e+. he en,th o 1<2<3 and on,er than 12 are or5idden.
!ardNo
1 5+tes (ard nu)5er. Fo"at 0?
1 5it (ard nu)5er ater shit BAS!%%< PAN is vaid in !ardNoT`!ardNo14TC. Fo"at EPS?
10 5+te strin,: the irst 5+tes is [123=< the ast
5+tes is %SN. &ode
P%N9M"O!/9O*&A90 >P%N9M"O!/9O*&A9EPS
PinMo(; Ret*"n
he P%N M"O!/ resut< 5+tes.
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
he deaut ti)eout is 120 se(onds. % +ou 'ant to set the ti)eout vaue< pease (a the AP% ped9set9pin9input9ti)eoutBC to set. Note: P%N input is sensitive servi(e< i the ti)e 5et'een t'o P%N input is too ast< the operation 'i 5e reused. So +ou (an (a ped9,et9sensitive9ti)erBC to ,et (urrent state< i the return vaue ar,e than 0Bet( nC< it )eans on+ ater n se(onds< +ou (an inpuit P%N a,ain.
!"pl#in $
9- %4*3 6;.F: standard5ormat /#*- as follow$ Data string format$9:;G H 3*4 >bytes? H #34>bytes?< 3f #34 not enough bytes, then fill I8J with ahead. Convert the string to KCD code, and use T# as the key to TD/%. :- %4*3 6F.L standard5ormat 8- as follow$ *tring 9 is “8888 with sui7 o card number last 9: charters. Convert string 9 to KCD bytes. *tring : is #34 length >%*C33, :bytes? H #34 >%*C33?< 3f string : not enough 9 bytes, add charter I5J to the tail, and convert string : to KCD bytes. 7se string 9 KCD 6M@ string : KCD then get L bytes number , use T# as TD/% key to encrypt , and then get the #341KBMC.
(,(1@( #e$=et=#in=%i/ P"otot'#e
int ped9,et9pin9i7Buint329t /e+%nde7< (onst (har RE7pe(tPin"en< (onst (har R!ardNo< uint329t &ode< void RPinMo(;C
F*n!tion
"et (ardhoder input P%N and !o)pute the P%N 5o(;< dierent ro) ped9,et9pin< this AP% use i7ed ;e+ hierar(h+.
Pa"aete"
/e+%nde7
P%N;e+%D.
E7pe(tPin"en
Ao'ed P%N entr+ en,th (hara(ter strin,< appi(ation enu)erates a ao'ed P%N entr+ en,th set and uses (o))a to separate then. E,. Appi(ation inputs F0<<G and it )eans appi(ation ao' (ardhoder to input no P%N< or our di,ita
;e+ or si7 di,ita ;e+. he en,th o 1<2<3 and on,er than 12 are or5idden. !ardNo
1 5+tes (ard nu)5er. Fo"at 0?
1 5it (ard nu)5er ater shit BAS!%%< PAN is vaid in !ardNoT`!ardNo14TC. Fo"at EPS?
10 5+te strin,: the irst 5+tes is [123=< the ast 5+tes is %SN. &ode
P%N9M"O!/9O*&A90 P%N9M"O!/9O*&A9EPS
PinMo(; Ret*"n
he P%N M"O!/ resut< 5+tes.
0
Su((ess
-1
Error. he e rror ( ode pease , ets ro) t he , o5a v aria5e errno.
S*##o"t
NEW210
Notes
*eer to ped9,et9pin
(,(20( #e$=et=#in=$*6#t P"otot'#e
int ped9,et9pin9du;ptBuint329t /e+%nde7< uint329t &ode< (onst (har RE7pe(tPin"en< (onst void R!ardNo< void RPinMo(;C
F*n!tion
"et (ardhoder input P%N and !o)pute the P%N 5o(;.
Pa"aete"
/e+%nde7
D/P ;e+ %D< ro) 0 to 14.
E7pe(tPin"en
Ao'ed P%N entr+ en,th (hara(ter strin,< appi(ation enu)erates a ao'ed P%N entr+ en,th set and uses (o))a to separate then. E,. Appi(ation inputs F0<<G and it )eans appi(ation ao' (ardhoder to input no P%N< or our di,ita ;e+ or si7 di,ita ;e+. he en,th o 1<2<3 and on,er than 12 are or5idden.
!ardNo
1 5+tes (ard nu)5er. Fo"at 0?
1 5it (ard nu)5er ater shit BAS!%%< PAN is vaid in !ardNoT`!ardNo14TC. Fo"at EPS?
10 5+te strin,: the irst 5+tes is [123=< the ast 5+tes is %SN. &ode
P%N9M"O!/9O*&A90 >P%N9M"O!/9O*&A9EPS
PinMo(;oT Ret*"n
he P%N M"O!/ resut.
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
*eer to ped9,et9pin
(,(21( #e$=i!!=o%%ine=#ain=#in P"otot'#e
int ped9i((9oine9pain9pinBint i((d< (onst (har RE7pe(tPin"en< (onst %((OinePinApdu9t Ri((< uint329t Rrspen< void RrspdataC
F*n!tion
#/D prompts cardholder to input #34. Mnce #/D kernel gets plainte)t #34, #/D kernel transfer it to plaint #34 KBMC and sends corresponding command to 3CC card in corresponding slot indicated by Card*lot for offline plainte)t authentication.
Pa"aete"
iccfd
3CCcarddevice3D.
/)pect#inBen
The input #34 ma) length is 9:. %llowed #34 entry length character string, application enumerates all allowed #34 entry length set and uses comma to separate then. /g. %pplication inputs “8,G, and it means application allow cardholder to input no #34, or 5our digital key or si) digital key.
icc
Check command structure >3nput? 5ormat$ CB%>34*>#9>#:>BC
rsplen
rspdatalength.
rspdata
Card respond code Two byte returned code$ *W%+*W%-
Ret*"n
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
%s for the length of #34 entr y control, please refer to the desc ription in online #34 entry. The format of #lainte)t offline #34 block showed following$ C
4#
#
#
#
#(
#(
#(
#(
#(
#(
#(
#(
5
5
5
5
5
5
5
5
5
5
%#me
lue
C
Control field
G bit binary I8898Jhe). :-
4
#34 length
G bit binary from I8898J to I9988J he) form IGJ to
IcJ#
#34
G bit binary from I8888J to I9889J he) form I8J to IFJ-
#(5
#34( pad bit
Decided by #34 length
5
#adding bit
G bit binary I9999Jhe). I5J-
Note: P%N input is sensitive servi(e< i the ti)e 5et'een t'o P%N input is too ast< the operation 'i 5e reused. So +ou (an (a ped9,et9sensitive9ti)erBC to ,et (urrent state< i the return vaue ar,e than 0Bet( nC< it )eans on+ ater n se(onds< +ou (an inpuit P%N a,ain. t+pede stru(t U uint329t )oden6 >> he )odue en,th o P%N en(r+ption pu5i( ;e+< uint9t ;e+< uint329t ;e+< uint9t
)od24T6 >> he )odue data o P%N en(r+ption pu5i( e7pen6 >> he e7ponet en,th o P%N en(r+ption pu5i( e7pT6
>> he e7ponet data o P%N en(r+ption pu5i(
;e+< uint9t i((rando)T6 >> he rando) data ro) %!! X *saPin/e+9t6 he stru(ture o %((OinePinApdu9t: t+pede stru(t U uint9t (a6 uint9t uint9t uint9t uint9t
ins6 p16 p26 e,6
uint9t e6 *saPin/e+9t rsa;e+6 X %((OinePinApdu9t6
(,(22( #e$=i!!=o%%ine=!i#.e"=#in P"otot'#e
int ped9i((9oine9(ipher9pinBint i((d< (onst (har RE7pe(tPin"en< (onst %((OinePinApdu9t Ri((< uint329t Rrspen< void RrspdataC
F*n!tion
#/D prompts cardholder to input #34. Mnce #/D kernel gets plainte)t #34, #/D kernel encrypted it to cipher #34 KBMC using @sa#iney according
to /2A supplied format and sends corresponding command to 3CC card in corresponding slot indicated by Card*lot for offline cipher authentication. Pa"aete"
iccfd >input?
3CC card device 3D.
/)pect#inBen
The input #34 ma) length is 9:. %llowed #34 entry length character string, application enumerates all allowed #34 entry length set and uses comma to separate then. /g. %pplication inputs “8,G, and it means application allow cardholder to input no #34, or 5our digital key or si) digital key.
icc>input?
Check command structure 5ormat$ CB%>34*>#9>#:>BC
@splen>output?
rspdata length.
@spdata>output?
Card respond code Two byte returned code$ *W%+*W%-
Ret*"n
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
9. The %#3 can be used in any status whether lock or not. :. Calling this %#3 needs sensitive service authority %#3 completes automatically;. encryption %lgorithm #/D uses @*%1#34/0 to encrypt the below data structure to generate Cipher #34 5ield4ame
length
'eader #34 KBMC @andom form 3C card
9 L
Description #34KBMC
L
7nit
8)N5
b b
@*%1#34/0 supplies the data
b
from 3C card #addingdata
43CO 9N
@*%1#34/0 supplies padding
b
data from application
Note: P%N input is sensitive servi(e< i the ti)e 5et'een t'o P%N input is too ast< the operation 'i 5e reused. So +ou (an (a ped9,et9sensitive9ti)erBC to ,et (urrent state< i the return vaue ar,e than 0Bet( nC< it )eans on+ ater n se(onds< +ou (an inpuit P%N a,ain. %((OinePinApdu9t : pease reer to ped9i((9oine9pain9pin
(,(2+( #e$=et=a! P"otot'#e
int ped9,et9)a(Buint329t /e+%nde7< uint329t Data"en< (onst void RData%n< void R&a(OutC
&ode<
uint329t
F*n!tion
!o)pute the input data=s &A! vaue.
Pa"aete"
/e+%nde7
&A! ;e+%D.
Data%n
he input data 'i 5e (o)puted the &A! vaue.
Data"en
>1>2>32>0>...
&ode
&A!9&ODE91 &A!9&ODE92 &A!9&ODE9E&V &A!9&ODE9!P
&a(Out Ret*"n
S*##o"t
he &A! resut< 5+tes.
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
Notes !"pl#in $ Algorit'm 1$
When Ben P L, only use data to do one D/*(;D/* encrypt. When Ben " L, we use the standard algorithm to encrypt 2%C data. The algorithm as follow$
D9Lbytes-
D:Lbytes-
D;Lbytes-
QQ
DnLbytes-
9
@9 :
@9
;
@;
n
@n
We use first L bytes data D9- as 9, and use the 2%C key TD/% encrypt 9 get result @9. @9 6M@ with the second L bytes data D:- then get the result :. 7se the 2%C key TD/% encrypt : get result @:QQ and so on, the last @n is the 2%C result. Algorit'm 2$
When Ben P L, only use data to do one D/*(;D/* encrypt. When Ben " L, we use the standard algorithm to encrypt 2%C data. The algorithm as follow$
D9Lbytes-
D:Lbytes-
D;Lbytes-
QQ
DnLbytes-
:
: : n
2%C !(&2))) Algorit'm$
/2A:888 %lgorithm is very like as %lgorithm 9. 3f 2%C key length is L bytes, that /2A:888 %lgorithm is same as %lgorithm 9< 3f 2%C key length is 9 bytes or :G bytes, there are some different, from the step 9 to the step n!9 are use Lbytes 2%C key to encrypt data, and the step n use 9 bytes or :G bytes 2%C key to encrypt data. C'in# *nion+#y #lgorit'm$
D9Lbytes-
D:Lbytes-
D;Lbytes-
QQ
DnLbytes-
:
: : n
Convert n to 9%*C33 char
5irstLchar
BastLchar
@9
@:
Convert @: to 9 %*C33 char The first L char is the result 2%C
5.4.24.
#e$=et=a!=%i/
P"otot'#e
int ped9,et9)a(9i7Buint329t /e+%nde7< uint329t &ode< uint329t Data"en< (onst void RData%n< void R&a(OutC
F*n!tion
!o)pute the input data=s &A! vaue.
Pa"aete"
/e+%nde7
&A! ;e+%D.
Data%n
he input data 'i 5e (o)puted the &A! vaue.
Data"en
>1>2>32>0>...
&ode
&A!9&ODE91 &A!9&ODE92
&A!9&ODE9E&V &A!9&ODE9!P &a(Out Ret*"n
S*##o"t
he &A! resut< 5+tes.
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
Notes
5.4.25.
#e$=et=a!=$*6#t
P"otot'#e
int ped9,et9)a(9du;ptBuint329t /e+%nde7< uint329t &ode< uint329t Data"en< (onst void RData%n< void R&a(Mo(;C
F*n!tion
!o)pute the input data=s &A! vaue 5+ usin, D/P ;e+.
Pa"aete"
/e+%nde7
D/P ;e+ %D< ro) 0 to 14.
Data%n Data"en
he &A! data need to (o)pute &A! vaue. he &A! data en,th. >1>2>32>0>...
&ode
&A!9&ODE91 &A!9&ODE92 &A!9&ODE9E&V &A!9&ODE9!P
&a(Mo(; Ret*"n
S*##o"t
&A! data (o)pute resut< 5+tes.
0
Su((ess
-1
Error. h e error (ode pease ,et ro) the ,o5a varia5e errno.
NEW210
Notes
(,(2:( #e$=ine!t=6e'=&'="oot P"otot'#e
int ped9ine(t9;e+95+9rootBuint329t !%D< uint329t /e++pe< uint329t /e+%nde7< uint329t /e+"en< (onst void RPainte7t/e+C6
F*n!tion
/e+ ine(tion 'ith root authorit+
Pa"aete"
!%D
!%D@%D
/e++pe
/e+ +pe
/e+%nde7
/e+%nde7
/e+"en
/e+en,th
Painte7t/e+
Painte7t ;e+ vaue
0 Su((ess
Ret*"n
1
Error. he error (ode pease ,et ro) the ,o5a varia5e errno.
S*##o"t
NEW210
Notes
sed to ine(t ;e+< this un(tion (an 5e (aed 5+ the root user on+.
(,(29( #e$=et=!on%i P"otot'#e
int ped9,et9(oni,BPed!oni,9t R(oni,C
F*n!tion
#et PED ter)ina s+ste) inor)ation.
Pa"aete"
!oni,outputT
Ret*"n
0
Su((ess
-1
Error. Pease , et t he e rror ( ode ro) t he , o5a
he Ped!oni,9t stru(ture pointer.
varia5e errno. S*##o"t
NEW210
Notes
he stru(ture as oo': t+pede stru(t U (har &ode1T6 (har H'Ver1T6 (har S'Ver1T6 uint329t Status6 uint329t &a7Mps6 uint329t uint329t
>> POS &ode >> Hard'are version >> Sot'are version >> PED status >> PED )a7 support 5auds.
&a7AppNu)6 >> PED )a7 support appi(ation nu)5er. &aster/e+Nu)6 >> Support )aster ;e+ nu)5er.
uint329t P%N/e+Nu)6 uint329t &A!/e+Nu)6
>> Support P%N ;e+ nu)5er. >> Support &A! ;e+ nu)5er.
uint329t i7P%N/e+Nu)6 >> Support i7ed P%N ;e+ nu)5er. uint329t i7&A!/e+Nu)6 >> Support i7ed &A! ;e+ nu)5er. uint329t Du;e+/e+Nu)6 >> Support D/P ;e+ nu)5er. uint329t !ti)e6 >> /e+ ,enerate ti)e. uint329t &a,/e+i)e6 >> )a,neti( strip (ard ;e+ ,en erate ti)e. uint329t &a,/e+Status6 >> )a,neti( strip (ard ;e+ v aid a,. uint9t *es10T6 >> reserved XPed!oni,9t6 >> 24 5+tes
((N20 e/te"na PINPAD AP% un(tions o this )odue 'as deined in the Fepp.hG6 Fi5epp.soG )ust 5e used 'hen in;in,.
((1(
o$*e a!"o $e%inition
Pease reer to ie Fepp.hG Qdeine /E$9$PE9&ASE* Qdeine Qdeine Qdeine Qdeine
0701
/E$9$PE9&A! 0702 /E$9$PE9P%N 0703 /E$9$PE9D/P9&A! 070 /E$9$PE9D/P9P%N 0704
Qdeine /E$9$PE9%ED9&A! 0710 Qdeine /E$9$PE9%ED9P%N 0711 Qdeine EPP%NO9P*OD!9NA&E Qdeine Qdeine Qdeine Qdeine
EPP%NO9HW9VE* EPP%NO9HW9!# EPP%NO9EPP9SN EPP%NO9!P9%D
0700
0701 0702 0703 070
Qdeine EPP%NO9MOO9VE* 0710 Qdeine EPP%NO9/E*NE"9VE* 0711 Qdeine EPP%NO9P*OO!O"9VE* 0720
enu) EPP9E**O*9!ODE U EPP9S!!ESS I 0< EPP9*E!V9PA!/E9E**O*I2001< EPP9PO*9OPEN9E**O*< EPP9SEND9PA!/E9E**O*< >> 3 EPP9PA!/E9"EN9E**O*< EPP9*E!V9%&EO< >> 4 EPP9PA!/E9"EN9OO9"ON#< EPP9!*!9!HE!/9E**O*< >> EPP9OPEN9%"E9E**O*< EPP9SEE/9%"E9E**O*< >> 8
EPP9W*%E9%"E9E**O*< EPP9*EAD9%"E9E**O*< >> 11 EPP9!ON%#*E9%NVA"%D< EPP9!ON%#*E9&A!9E**O*< >> 13 EPP9NO9P%N< EPP9SEND9!&D9E**O*< >> 14 EPP9*E!V9!&D9E**O*< EPP9*E!V9*E9E**O*< >> 1 EPP9*E!V9"EN9E**O*< EPP9&A!9!HE!/9E**O*< >> 18 EPP9AHEN9A%"ED< EPP9%NP9PA*A&9E**O*< >> 21 EPP9SE*9P*ESS9!AN!E"< EPP9%NP9!&D9E**O*< >> 23 EPP9%NP9/E$9%NDE9E**O*< EPP9%NP9&A!9"EN9E**O*< >> 24 EPP9%NP9&ODE9E**O*< EPP9/E$9$PE9E**O*< >> 2 EPP9/E$9%NDE9E**O*< EPP9&ASE*9/E$9%NDE9E**O*< >> 28 EPP9M&P9E**O*< EPP9P%N9!#9"AN#E9$PE9E**O*< >> 31 EPP9P%N9!#9S$&MO"9$PE9E**O*< EPP9%NP9DAA9"EN9E**O*< >> 33 EPP9SE9PO*9E**O*< EPP9!#9E**O*< >> 34 EPP9!"OSE9A%"ED< X6
enu) N209*E*N9!ODEU *E9E**O*9MASE I 2300< *E9PASSWO*D9E**O*< >> 1 *E9MOO9"EN9E**O*< *E9MOO9HASH9E**O*< >> 3 *E9MOO9&A!9E**O*< *E9NO9MS/< >> 4 *E9!HE!/9MS/9A%"ED< *E9!HE!/9/S/9A%"ED< >> *E9NO9"!/< *E9NO9AH< >> 8 *E9NO9"O#ON< *E9*E!V9A%"ED< >> 11 *E9AH9!HE!/9A%"ED<
*E9&A!9!HE!/9A%"ED< >> 13 *E9!*!9!HE!/9E**O*< *E9/V!9!HE!/9E**O*< >> 14 *E9NO9APP9*EE9SPA!E< *E9APP9NO9E%S< >> 1 *E9/E$9$PE9E**O*< *E9/E$9$PE9NO9SPPO*< >> 18 *E9&A!9"EN9E**O*< *E9&A%N9/E$9%NDE9E**O*< >> 21 *E9&A%N9/E$9NO9E%S< *E9/E$9%NDE9E**O*< >> 23 *E9/E$9"EN9E**O*< *E9/E$9ME9SE< >> 24 *E9&A%N9/E$9ME9SE< >> 2 *E9&A!9A"#9&ODE9E**O*< *E9/E$9#E9E**O*< *E9/E$9OVE*9"OW< >> 28 *E9/E$9SA&E9E**O*< *E9/E$9NO9E%S< >> 31 *E9/E$9&A!9!HE!/9A%"ED< *E9/E$9/SN9"EN9E**O*< >> 33 *E9/E$9MD/9"EN9E**O*< *E9SE*9P*ESS9!AN!E"9E%< >> 34 *E9SE*9%NP9%&E9O< *E9/SN9"EN9*E**O*< >> 3 *E9APP9N&9OVE*9"OW< *E9*W9"EN#H9E**O*< >> 38 *E9P%N9/E$9%&E9"O!/< *E9&A!9/E$9%&E9"O!/< >> 1 *E9SE9P%N9%&E9O9E**O*< *E9W*%E9EEP*O&9A%"ED< >> 3 *E9*E!V9"EN9E**O*< *E9PA*A&9E**O* >> 4 X6 t+pede stru(t U M$E AppNa)e32T6 M$E "(;1T6 M$E &te;2T6 M$E A;da;1T6 M$E A;ua;1T6 M$E &dte;2T6 M$E &ute;2T6 X EppAuth/e+9t6 >> 142 5+tes
((2(
o$*e st"*!t*"e
t+pede stru(t U M$E /e++pe6 >R ;e+ t+pe 0701:)aster ;e+? 0702:&A! ;e+? 0703:P%N ;e+? 0710:i7ed &A! ;e+? 0711:i7ed P%N ;e+? R> M$E &ode6>R Mit0`3 DEA9DE!*$P 0700 use de(r+ption )ethod to ,et e7press+ tar,et ;e+ DEA9NONE 0702 'rite into e7press+ tar,et ;e+ dire(t+Bis invaid to &A! ;e+ and P%N ;e+C Mit` PA*%$9NONE PA*%$9ODD
0700 no (he(; on the Bde(r+ptedC /e+ e7press 0710 odd parit+ on the Bde(r+ptedC ;e+ e7press
PA*%$9EVEN e7pressR>
0720
even parit+ on the Bde(r+ptedC ;e+
M$E /e+"en6 >> en,th o ;e+< vaid vaues is >1>2 M$E /e+%nde76 >> /e+ %nde71<100T M$E &aster/e+%nde76 >R)aster ;e+ inde71<100T< this para)eter is vaid ust 'hen ;e+ t+pe is &A! ;e+ or P%N ;e+R> M$E /e+Data2T6 >> (ontent o ;e+ X EppApp/e+9t6 t+pede stru(t 9EPP9!ON%#*E9
((+(
EPP9!#6
e##=o#en
P"otot'#e
EPP9!# Repp9openB(onst (har Riena)e< int oa,C
F*n!tion
Open the N20 EPP devi(e.
Pa"aete"
iena)e
N20 devi(e na)e a'a+s 'i 5eF>dev>tt+SGorF>dev>tt+SG 。
oa,
para)eter (an on+ 5e O9*DW*
N""
error return
other
EPP port para)eter hande
Ret*"n >e a##i!a&e
NEW110
in Notes
((,(
e##=!ose
P"otot'#e
int epp9(oseBEPP9!# R(,C
F*n!tion
(ose opened N20 devi(e
Pa"aete"
(,(input)
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
EPP devi(e hande 'hi(h is opened 5+ epp9open
a##i!a&e in Notes
(((
ater (ose< EPP port para)eter hande (, 'i 5e invaid and (an not use a,ain
e##=init
P"otot'#e
int epp9initBEPP9!# R(,< (onst EppAuth/e+9t Repp;e+C
F*n!tion
&odi+ (urrent ;e+ (oni,ure. 1、i use deaut (oni,ure< do not need to (a this intera(e ; 2 、 i don=t use deaut (oni,ure< initia (oni,uration ea(h ti)e 'hen startin, devi(e。
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
epp;e+
(oni,ure ;e+ epp;e+-L AppNa)e : appi(ation na)e have )a7 15+tes epp;e+-L"(; : 1 5+tes "!/ ;e+ epp;e+-L&E/ : 2 5+tes &E/ ;e+ epp;e+-LA/DA/ : 1 5+tes A/DA/ ;e+ epp;e+-LA/A/ : 1 5+tes A/A/ ;e+ epp;e+-L&DE/ :2 5+tes &DE/ ;e+ epp;e+-L&E/ :2 5+tes &E/ ;e+
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e
in Notes
((:(
e##=$o7noa$=!6=te6
P"otot'#e
int epp9do'noad9(;9)te;BEPP9!# R(,C
F*n!tion
%ne(t the "!/ and &E/ into the N20 P%NPAD. And the N20 EPP 'i e7e(ute or)at operation< and then save the "!/ and &E/.
Pa"aete"?
(,(input)
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
EPP devi(e hande 'hi(h is opened 5+ epp9open
a##i!a&e in Notes
((9(
e##=$o7noa$=ai6
P"otot'#e
int epp9do'noad9ai;BEPP9!# R(,C
F*n!tion
Save the (urrent A%/ to the N20 P%NP AD. A%/ in(udes ;e+s o AppNa)e and A/DA/>A/A/>&DE/>&E/ and et(. A the ;e+ o this appi(ation 'i 5e (eared.
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
5.5.,.
P"otot'#e
e##=$o7noa$=a##6e' int epp9do'noad9app;e+BEPP9!# Rapp;e+C
R(,<
(onst
EppApp/e+9t
F*n!tion
%ne(t one appi(ation ;e+ into e7terna N20 P%NPAD.
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
app;e+
B1Capp;e+ -L /e++pe :;e+ t+pe 0701 : &aster /e+6 0702 : &A! ;e+6 0703 : P%N ;e+6 0710 : i7ed &A! ;e+6 0711 : i7ed P%N ;e+6 B2Capp;e+ -L &ode : Mit0`3 DEA9DE!*$P 0700 %ne(t the ;e+ !ipher te7t and use the )aster ;e+ to de(r+pt it< thus ,et the ;e+ pain te7t and save it. DEA9NONE 0702 %ne(t the ;e+ Pain te7t. BE7(ept or &A! ;e+ and P%N ;e+C Mit` PA*%$9NONE 0700 he ;e+ pain te7t has no parit+. PA*%$9ODD 0710 he ;e+ pain te7t has odder parit+. PA*%$9EVEN 0720 he ;e+ pa in te7t has even parit+. B3C app;e+-L/e+"en :;e+ en,th< >1>26 BC app;e+-L /e+%nde7 :/e+ inde7 1<100T; B4C app;e+-L &aster/e+%nde7 : &aster ;e+ inde7 1<100T< When the ;e+ t+pe is not &A! ;e+ or P%N ;e+< this para)eter not ee(tive. BC app;e+-L /e+Data2T :(ontent o ;e+。
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((@(
e##=$o7noa$=$*6#t=6e'
P"otot'#e
int epp9do'noad9du;pt9;e+BEPP9!# R(,< uint329t /e+%nde7< (onst void RpMD/< (onst void Rp/SN< uint329t /SN"enC
F*n!tion
%ne(t D/P ;e+ into e7terna N20 P%NPAD. On+ the D/P version support.
Pa"aete"?
(, ( inp
EPP devi(e hande 'hi(h is opened 5+ epp9open
ut) /e+%nde 7
/e+ inde7< no use (urrent+. /e+ inde7 ust 5indin, to appi(ation na)e.
pMD/
1 5+tes 5ase deride ;e+ input< not diver,ent MD/
p/SN
(ontent o /SN
/SN"en
/SN en,th1<10T
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((10( e##=et=a! P"otot'#e
int epp9,et9)a(BEPP9!# R(,< uint329t /e++pe< uint329t /e+%nde7< uint329t &ode< (onst void RpData< sie9t Data"en< void Rp&a(OutC
F*n!tion
&A! operation AP% in e7terna N20 P%NPAD 。
Pa"aete"?
(, ( input
EPP devi(e hande 'hi(h is opened 5+ epp9open
)
/e++pe
;e+ t+pe< (an ,et vaues /E$9$PE9&A!(I0702) > /E$9$PE9%ED9&A! BI0710C > /E$9$PE9D/P9&A! BI070C 。
/e+%nde7
&A! ;e+ inde7. % the ;e+ is &A! or i7ed &A! the ;e+ inde7 vaue ro) 1 to 100. % the ;e+ is D/P &A!< this para)eter has no use.
&ode
A,orith) see(t 0700 A,orith) 1 0701 0702 0703
Pa"aete"?
A,orith) 2 E&V2000 A,orith) !P A,orith)
pData
&A! data
Data"en
&A! data en,th< ro) 1R to 243R 5+tes.
p&a(Ou
5+tes &A! resut< % the ;e+ t+pe is D/P9&A!9/E$<
(output)
this para)eter 'i output 5+tes &A! resut and 10 5+tes (urrent /SN.
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in
Notes
See 5eo'。
Notes: Ao"it. 1:
% "en I < do DES>3DES en(r+ption operation on Data one ti)e. % "en L < do standard &A! en(r+ption operation on data< a,orith) as sho'n: Lbytesstart-
Lbytes
Lbytes
QQ
Lbytesend-
encryption
encryption encryption
encryption
2%C
irst 5+tes do DES>3DES en(r+ption one ti)e< the resut 'i do 7or 'ith ne7t set o dataB 5+tesC< and do DES>3DES en(r+ption one ti)e a,ain<\ater the ina set o data have done one DES>3DES en(r+ption<,et &A! operation resutB 5+tesC. Ao"it. 2:
% "en I < do DES>3DES en(r+ption operation on Data one ti)e. % "en L < do standard &A! en(r+ption operation on data< a,orith) as sho'n:
Lbytesstart-
Lbytes
Lbytes
QQ
Lbytesend-
encryption
2%C
Ater 7or to a dataBever+ 5+tes 7or one ti)eC<ina+ do an DES>3DES en(r+ption on 7or resut<,et &A! operate resutB 5+tesC. T.e ao"it. %o*n$ EMV2000
his a,orith) is si)iar to a,orith)1.% ;e+ en,th is 5+tes< then this a,orith) is the sa)e as a,orith) 16 i ;e+ en,th is 1 5+tes or 2 5+tes< then there 'i 5e so)e dieren(e< assu)in, that it tota needs n steps o en(r+ption operat ion< then the dieren(e is the previous n-1 steps operation is a DES en(r+ption< and the ina one is 3DES operation. !hina &er(hants Man; use this a,orith). Ao"it. 7.i!. is %it to CUP?
his a,orith) is si)iar to a,orith) 2< put the data into 5+tes a se,e)ent< assu)in, that it has n se,e)ents< then 7or a these se,e)entsBust i;e a,orith)2C< ina+ ,et a 5+tes data Mo(;< then (han,e Mo(; into 1 AS!%% (hara(ters Mo(;1Bor e7a)pe< (han,e 07a into 2 (hara(ters [=<=A=C.
Lbytesstart-
Lbytes
Lbytes
QQ
Lbytesend-
Change into 9 %*C33 characters
5irst L characters
Bast L characters
encryption
encryption
Change into 9 %*C33 characters
first L characters is 2%C operation result
((11( e##=et=#in P"otot'#e
int epp9,et9pinBEPP9!# R(,< uint329t /e++pe< uint329t /e+%nde7< uint329t Dispa+&ode< uint329t A,&ode< (onst void Rp!ard%no< (onst void Rp"en%no< void RpPinMo(;OutC
F*n!tion
P%N 5o(; (o)pute AP% via into e7terna N20 P%NPAD@
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
/e++pe
/e+ t+pe: /E$9$PE9P%N > /E$9$PE9%ED9P%N > /E$9$PE9D/P
/e+%nde7
/e+ inde7. % the ;e+ t+pe is P%N or i7ed P%N< it vaue is ro) 1
to 100. % the ;e+ t+pe is D/P P%N< this para)eter is no usin,. Dispa+&ode
P%N dispa+ attri5ute. 0 : ro) et to ri,ht6 1 : ro) ri,ht to et6 2 : )idde.
A,&ode
A,orith) see(t. 0700 : )eans (hoose For)at0 )odeG a,orith)6 0701 : )eans (hoose For)at E&V )odeG a,orith)6 070a : )eans (hoose For)at EPS )odeG aorith).
p!ard%no
!ard inor)ation
p"en%no
P%N ;e+ en,th enu)eratio n (harter< support en,th ro) 0 to 12. We use the AS!%% (harter [0=< [1=< \\< [8=< [a=< [5=< [(= to represent 0`12. Su(h as the strin, [04a000000000= )eans support input P%N
pPinMo(;Out (output)
en,th are 0<< 4< < 10. 5+tes P%N (o)pute resut< 10 5+tes is (urrent /SN
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
Notes: B1C ANS% 3.82 standard is 5eo' ,or)at 0 )ode: or)at o data strin,:G123G@%SN 5+tesT@P%N5+tes 5itsT6 % the P%N ess than 5+tes< i [0= 5eore the P%N6 !han,e data strin, a5ove into M!D (ode< use P/ to do DES>3DES en(r+ption on M!D (ode. ANS% 8. standard is oo'< or)at EPS )ode: Strin, 1: F0000G add ast 12 5it o (ard nu)5er6 !han,e strin,1 into M!D (ode6 Strin, 2: P%N en,thAS! (ode< 2 5+tesT@P%NAS! (odeT6 % the strin,2 is ess than 1 5+tes<i [= ater strin,2< then (han,e it into M!D (ode6 Do 7or 5et'een strin,1=s M!D (ode and strin,2=s M!D (ode< use P/ to do DES>3DES en(r+ption on it . B2C or)at E&V )ode: ser input P%N (hara(ters@nu)5er o (hara(ters [=
strin, into 5+tes M!D (ode< and use P/ to do DES>3DES en(r+ption on it. On this )ode< (ard inor)ation is )eanin,ess.
((12( e##=et=t$ea P"otot'#e
int epp9,et9tdeaBEPP9!# R(,< uint329t &ode< uint329t /e++pe< uint329t /e+%nde7< (onst void RpData%n< sie9t Data"en< void RpDataOutC
F*n!tion
DEA a,orith) in the e7terna N20 P%NPAD.
Pa"aete"?
(, ( inp ut)
EPP devi(e hande 'hi(h is opened 5+ epp9open
&ode
a,orith) see(t. DEA9EN!*$P : En(r+pt DEA9DE!*$P : De(r+pt DEA9&ODE9E!M--- E!M a,orith) )ode DEA9&ODE9!M!--- !M! a,orith) )ode Pease reer to the NEW110 SD/ )a(ro deine.
/e++p e
/e+ t+pe 0701 : &aster ;e+6 0702 : P%N /e+6 0703 : &A! /e+6 070 : D/P &A! /e+6 0704 : D/P P%N /e+6 0710 : i7ed &A! /e+6 0711 : i7ed P%N /e+.
/e+%nde 7
/e+ inde7. % the ;e+ t+pe is &aster< &A!< P%N< i7ed &A! or i7ed P%N< it vaue is ro) 1 to 100. % the ;e+ t+pe is D/P &A! or D/P P%N< this para)eter is no usin,.
pData%n
!o)pute data.
Data"e n
data en,th< or 1R to 12R.
pDataO
!o)pute resut< the en,th is the sa)e as input data.
ut ( out put) Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e
in Notes
((1+( e##=set=# in=in#*t=tieo*t
P"otot'#e F*n!tion
int epp9set9pin9input9ti)eoutBEPP9!# R(,< uon, i)eout&sC Set P%N input ti)eout via e7terna N20 P%NPAD.
Pa"aete"?
(, ( input
EPP devi(e hande 'hi(h is opened 5+ epp9open
)
i)eout&s
ti)e out< unit )s @
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((1,( e##=set=t$es=iv P"otot'#e
int epp9set9tdes9ivBEPP9!# R(,< (onst void Rp%vDataC
F*n!tion
Set DES initia ve(tor o into e7terna N20 P%NPAD< on+ ee(t !M! a,orith).
Pa"aete"?
(, ( inp ut)
EPP devi(e hande 'hi(h is opened 5+ epp9open
p%vData
5+tes input ve(tor.
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
!a this intera(e to set initia ve(tor 'i ee(t !M! a,orith)=s initia ve(tor that is (aed 5+ epp9,et9tdeaBC< and it 'i not ee(t other intera(e< ater restart N20< initia ve(tor 'i re(over to ero.
((1( e##=et="an$ P"otot'#e
int epp9,et9randBEPP9!# R(,< void Rp*andMu< sie9t sieC
F*n!tion
#et rando) nu)5er ro) e7terna N20 P%NPAD.
Pa"aete"?
(,
EPP devi(e hande 'hi(h is opened 5+ epp9open
(input)
sie
output 5uer sie
p*andMu (output)
save ,ot rando) nu)5er
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
5.5.16.
e##=!ea"=6e'
P"otot'#e
int epp9(ear9;e+BEPP9!# R(,< uint329t /e++pe< uint329t /e+%nde7C
F*n!tion
!ear the desinated ;e+ o (urrent appi(ation in e7terna N20 P%NPAD.
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
/e++pe
;e+ t+pe 0701 : &aster ;e+6 0702 : &A! ;e+6 0703 : P%N ;e+6 0710 : i7ed &A! ;e+6 0711 : i7ed P%N ;e+6
/e+%nde7
/e+ inde7. % the ;e+ t+pe is &aster< &A!< P%N< i7ed &A! or i7ed P%N< it vaue is ro) 1 to 100. % the ;e+ t+pe is D/P &A! or D/P P%N< this para)eter is no usin,.
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((19( e##=!ea"=a##6e' P"otot'#e
int epp9(ear9app;e+BEPP9!# R(,C
F*n!tion
!ear a ;e+ o (urrent appi(ation in e7terna N20 P%NPAD.
Pa"aete"? Ret*"n
(,(input) EPP devi(e hande 'hi(h is opened 5+ epp9open pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((18( e##=%o"at=#e$ P"otot'#e
int epp9or)at9pedBEPP9!# R(,C
F*n!tion
or)at the N20 P%NPAD< in(ude (ear a ;e+ and restore the deaut (oni,ure.
Pa"aete"?
(,(input)
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
EPP devi(e hande 'hi(h is opened 5+ epp9open
a##i!a&e in Notes
((1@( e##=set=i$e=oo P"otot'#e
int epp9set9ide9o,oBEPP9!# R(,< (onst void RpM)p%de"o,o%nC
F*n!tion
pdate the %D"E "O#O in N20 P%NPAD @
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
pM)p%de"o,o %n
Data (ontent o )ono(hro)e M&P ie.he N20 EPP=s "!D resovin, is 122R32.
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((20( e##="es*e=$e%a*t=i$e=oo P"otot'#e
int epp9resu)e9deaut9ide9o,oBEPP9!# R(,C
F*n!tion
*estore the deaut %D"E "O#O. in N20 P%NPAD
Pa"aete"? Ret*"n
(,(input) EPP devi(e hande 'hi(h is opened 5+ epp9open pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((21( e##=$is#a'=oo P"otot'#e
int epp9dispa+9o,oBEPP9!# R(,< uint329t < uint329t $< (onst void
F*n!tion
RpM)p"o,o%nC dispa+ M&P )ono(hro)e pi(ture in e7terna N20 P%NPAD< the &A resovin, is 122R32.
Pa"aete"?
(, ( inp ut)
EPP devi(e hande 'hi(h is opened 5+ epp9open
start ro' BPi7eC
$
start ine BPi7eC
pM)p"o ,o%n
Data (ontent o (o)o(ro)e M&P ie.
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
5.5.22.
e##=$is#a'=st"in
P"otot'#e
int epp9dispa+9strin,BEPP9!# R(,< uint329t < uint329t $< uint329t i&ode< (onst void Rstr< uint329t iStr"enC
F*n!tion
Dispa+ strin, in N20 P%NPAD.
Pa"aete"?
(, ( in put)
EPP devi(e hande 'hi(h is opened 5+ epp9open
start ro' BPi7eC
$
start ine BPi7eC
&ode
the (hara(ter sie. AS!%% (hara(ter sie: 070 : R 0710 : R1
st
the dispa+ AS!%% (hara(ter
iStr"en
the (hara(ter en,th
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
5.5.23.
e##=!ea"=s!"een
P"otot'#e
int epp9(ear9s(reenBEPP9!# R(,C
F*n!tion
!ear s(reen o e7terna N20 P%NPAD
Pa"aete"?
(,
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
EPP devi(e hande 'hi(h is opened 5+ epp9open
a##i!a&e in Notes
5.5.24.
e##=et=s'ste=in%o
P"otot'#e
int epp9,et9s+ste)9inoBEPP9!# Rpv%noOutC
R(,<
uint329t
+pe<
F*n!tion
#et N20 P%NPAD ino. We are nor)a+ used this AP% to (he(; the N20 EPP (onne(t status.
Pa"aete"?
(, ( input
EPP devi(e hande 'hi(h is opened 5+ epp9open
)
+pe
uer+ t+pe. 0700 hard'are version6 0701 hard'are (oni,ure6 0702 the EPP seria nu)5er6 0703 !P SN6
void
0710 5oot version6 0711 /erne version6 0720 uer+ proto(o version. pv%noOut (output)
return ino< the 5u no ess then 1 5+tes.
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((2( e##=&ee# P"otot'#e
int epp95eepBEPP9!# R(,< uint329t reuen(+< uint329t i)e&sC
F*n!tion
Meeper (ontro un(tion o N20 P%NPAD.
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
reuen(+
reuen(+ (ontro para)eter. B1Ci the vaue is ro) 0 to < then the (orrespondin, reuen(+ is 10< 13< 2020< 212< 230< 200< 2800; B2Ci the vaue is 5i,,er than < then set reuen(+ a((ordin, to this vaue< or e7a)pe< the vaue is 1400
i)e&s
5eep ti)e< unit )s
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((2:( e##=i.t P"otot'#e
int epp9i,htBEPP9!# R(,< uint329t i)e&sC
F*n!tion
N20 P%NPAD=s "!D 5a(; i,ht (ontro.
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
i)e&s
K0: i,ht a the ti)e; I0: not i,ht a the ti)e ; L0: i,ht at the spe(iied ti)e
Ret*"n
pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
((29( e##=6&=et=st"in P"otot'#e
int epp9;59,et9strin,BEPP9!# R(,< uint329t i&ode< uint329t i&in"en< uint329t i&a7en< uint329t ii)eOut&s< void RstrMuC
F*n!tion
,et user ;e+stro;es on the pass'ord ;e+5oard o N20 P%NPAD
Pa"aete"?
(,(input)
EPP devi(e hande 'hi(h is opened 5+ epp9open
i&ode
D31 D8
\
rev
D
1(0 ) +es (no)ao' et input and ine dispa+
D
1 ( 0 ) +es ( no ) StrMu deaut (ontent ee(tive+
D
1(0) 5i,(itte)ont
D4
1(0) +es(no)input di,ita
D
1(0) +es(no)input (hara(ter
D3
1(0) +es(no)pass'ord 'a+
D2
1(0) et(ri,ht)ai,ned input
D1
1(0) +es(no)de(i)a point
D0
1(0) nor)a(reverse)dispa+
i&in"en
)in en,th
i&a7"en
)a7 en,th
ii)eOut&s strMu ( output
ti)eout ti)e (ontnet returned 5+ pass'ord ;e+5ord< 5uer is a((ordin, to )a7 en,th
Ret*"n
) pease reer to se(tion .12.1
>e
NEW110
a##i!a&e in Notes
(:(P"inte" Printer is a (hara(ter devi(e< usin, ,enera ie operationsBopen 、'rite、io(t、(oseC (an (o)pete operation on printer< or (onvenien(e o appi(ation deveoper< 'e pa(;a,e it <et operation on printer audio-visua+. Printer )odue provides 5o(;in, and non-5o(;in, operation.
%n the 5o(;in, )ode< 'hen the pro,ra) 'ritin, printed data into the printer< i the printer interna print 5uer is u< then the appi(ation 'rites data to the printerJs operation 'i 5o(; unti the printer 'i have printed so)e data< there is roo) or interna 5uer 5o(;ed 'hen the operation 'i 5e re-a'a;ened< (ontinue to 'rite data. %n the non-5o(;in, )ode< 'hen the pro,ra) 'i 'rite the data to 5e printed in the printer< i the printer interna print 5uer is u< then the appi(ation 'rites data to the printer=s operation 'i i))ediate+ aiure and returns< and 'ithout 5o(;in,.
Print )odue ust provide the atti(e data 'i 5e printed to print< as to ho' to popuate the atti(e data< se-(o)peted 5+ the deveoper< the printer is a shared devi(e< dierent appi(ations (an open the devi(e and print at the sa)e ti)e< thus )a+ (ause the print data (onusion< so the deveopers shoud open the devi(e to operate on+ 'hen it is need to (a< 'hen the operation is (o)pete the devi(e shoud 5e (osed i))ediate+. AP% un(tions o this )odue 'as deined in the Fprinter.hG< Fposapi.hG6 Fi5pos.soG )ust 5e used 'hen in;in,.
(:(1(
#"inte"=o#en
P"otot'#e
int printer9openB(onst (har Riena)e< int oa,sC
F*n!tion
open printer devi(e
Pa"aete"?
iena)e
printer devi(e na)e :F>dev>printer0Gdev>printer1G\\
oa,s
Wa+ to open the devi(e: 5o(;in, )ode use: O9W*ON"$ non-5o(;in, )ode use:O9W*ON"$ f O9NONM"O!/
Ret*"n
LI 0
open devi(e O/< return vaue is used to operate printer=s ie nu)5er
others
other error (ode
S*##o"t
NEW210
Notes
Printer devi(e=s nu)5er is up to 1< its devi(e na)e is >dev>printer_ ( _I0<1<2<\<14 ) , in deaut (ondition NEW210 ther)a printer devi(e na)e is>dev>printer0
(:(2(
#"inte"=!ose
P"otot'#e
int printer9(oseBint dC
F*n!tion
(ose printer devi(e
Pa"aete"
d
Ret*"n
0
(ose printer devi(e su((ess
others
other error (ode
opened de vi(e i e n u)5er th at pr inter9open un(tion returns
S*##o"t
NEW210
Notes
Ater (ain, this un(tion d 'i 5e invaid< 5eore openin, printer devi(e a,ain< (an not use this invaid d to operate printer.
5.6.3.
#"inte"="ea$ int printer9readBint d< void R5u< sie9t n5+tesC
P"otot'#e F*n!tion
d
Pa"aete"?
opened devi(e ie nu)5er that printer9open un(tion returns
5u n5+tes LI 0
Ret*"n
other
Printer a((epted 5+tes other error (ode
NEW210
S*##o"t Notes
(:(,(
#"inte"=7"ite
P"otot'#e
int printer9'riteBint d< (onst void R5u< sie9t n5+tesC
F*n!tion
put the data to 5e printed
Pa"aete"?
d
opened devi(e ie nu)5er that printer9open un(tion returns
5u Ret*"n
point to data 5uer to 5e printed
n5+tes
the nu)5er o printed data=s 5+tes
LI 0
the dire(t nu)5er o printer devi(e a(tua+ a((ept
others
other error (ode
S*##o"t
NEW210
Notes
Ater (ain, this un(tion< the printer 'i auto)ati(a+ 5e,in to print. %n the 5o(;in, )ode< the un(tion )a+ 5o(; unti the printer (an a((ept data< on no e7(eptiona (ondition< printer 'i (o)pete print su5)itted data< i an e7(eption o((ursBsu(h as printin, out o paper
(:((
#"inte"=et=stat*s
P"otot'#e
int printer9,et9statusBint d< printer9status9t RstatusC
F*n!tion
o ,et the status o the printer
Pa"aete"?
d
opened devi(e ie nu)5er that printer9open un(tion returns
status
status
State is represented 5+ the 32-5it: P*%NE*9SAS9MS$ 5it : printin, devi(e 5us+ a,. P*%NE*9SAS9H%#H9E&P 5it : te)perature is too hi,h P*%NE*9SAS9PAPE*9"A!/ 5it : out o paper P*%NE*9SAS9EED 5it: eedin, P*%NE*9SAS9P*%N 5it : printin, a, P*%NE*9SAS9O*!E9EED 5it :
or(e eed a, P*%NE*9SAS9POWE*9ON
5it :
print po'er on a,
Ret*"n
vota,e
vota,e o the (urrent print
te)perature
te)perature o (urrent print head
0
,et status su((essu+< the returned para)eter is avaia5e
others
Other error (ode
S*##o"t
NEW210
Notes
he ,ot status o printer is deined 5+ 5it< +ou shoud test statusLstatus ( 1KKP*%NE*9SAS9MS$ ) to deter)ine 'ether the printer is de
(:(:(
#"inte"=et=#a"a
P"otot'#e
int printer9,et9para)Bint d< printer9para)9t Rpara)C
F*n!tion
,et the (urrent print para)eters
Pa"aete"?
d
opened devi(e ie nu)5er
para)
ro9'idth
the dot nu)5er o ea(h ine dot )atri7 o printer
ro95its9per9pi7e
ho' )an+ 5its to e7pressed ea(h pi7e
r'9,ra+
Set
print
,ra+< s(ope:
40`400<
represent that print ,ra+ is nor)a 40g~400g r'9hi9te)p
hi,hest 'or; te)perature that print head ao'ed
r'9o9te)p
hi,hest t e)perature t hat p rint he ad ao'ed 'hen printin, a,ain ater over-te)perature printin,
Ret*"n
0
,et status su((essu+< the returned para)eter is avaia5e
others
Other error (ode
S*##o"t
NEW210
Notes
When printin, < i print head up to the vaue that r'9hi9te)p setted it 'i 5e status o Fover-te)peratureG< print 'i stop< unti te)perature redu(e to under r'9o9te)p it 'i (ontinue to print. % over-te)perature o((urs < data that have not 5een printed 'i a 5e dis(arded.
(:(9(
#"inte"=set=#a"a
P"otot'#e
int printer9set9para)Bint d< (onst printer9para)9t Rpara)C
F*n!tion
set (urrent print para)eter
Pa"aete"?
d
opened de vi(e i e nu )5er that pr inter9open un(tion returns
para)
ro9'idth
the nu)5er o ea(h ine dot )atri7 o printer
ro95its9per9pi7e
ho' )an+ 5its to e7pressed ea(h pi7e
r'9,ra+
Set print ,ra+< s(ope: 40`400< represent that print ,ra+ is nor)a 40g~400g
r'9hi9te)p
hi,hest 'or; te)perature that print head ao'ed
r'9o9te)p
hi,hest t e)perature t hat p rint h ead ao'ed 'hen printin, a,ain ater printin, over-te)perature
Ret*"n
0
Set O/
Others
Other error (ode
S*##o"t
NEW210
Notes
%n para)< para)eter 5e,ins 'ith Fro9G)eans that this para)eter (an not 5e set< it 'i not 'or; ater settin, up. Para)eter 5e,ins 'ith Fr'9G )eans that this para)eter (an 5e set.
(:(8(
#"inte"=%ee$=sta"t
P"otot'#e
int printer9eed9startBint d< uint329t stepC
F*n!tion
start the printer paper eed un(tion
Pa"aete"?
d
opened de vi(e i e nu )5er th at pr inter9open u n(tion returns
step
Steps o eedin, into the paper
Ret*"n
0
Set O/
others
Other error (ode
S*##o"t
NEW210
Notes
Ater (ain, this un(tion< i the printer is ide< then the printer 'i 5e,in to eed< there has a ar,est nu)5er o eed steps i)it inside the printer< i setted step is 5i,,er than the step< then it 'i eed
a((ordin, the interna )a7i)u) steps. When eedin,
(:(@(
#"inte"=%ee$=sto#
P"otot'#e
int printer9eed9stopBint dC
F*n!tion
stop the printer eedin,
Pa"aete"?
d
Ret*"n
0
OperateO/
others
Other error (ode
opened de vi(e i e n u)5er th at pr inter9open un(tion returns
S*##o"t
NEW210
Notes
% appi(ation deveoper have (aed printer9eed9 start< then (ain, this un(tion 'i stop the printer to eed6 i printer have stopped eedin,< (a this un(tion 'i do no 'or; on the printer.
(:(10( #"inte"="eset P"otot'#e
int printer9resetBint dC
F*n!tion
*eset a status o printer< (ear a the printer interna data
Pa"aete"?
d
Ret*"n
0
operatesu((ess
others
Other error (ode
S*##o"t
opened de vi(e i e n u)5er th at pr inter9open un(tion returns
NEW210
Notes
(:(11( #"int=s*"%a!e P"otot'#e
int print9sura(e Bint print9d< %Dire(tMSura(e R59sura(e< uint329t print9hei,htC
F*n!tion
output the (ontent o 59sura(e o printer
Pa"aete"?
print9d
opened devi(e ie nu)5er that printer9open un(tion returns
59sura(e
sura(e 'hi(h is to 5e printed
print9hei,ht Ret*"n
print hei,ht< (a(uated 5+ pi7e
0
Operatesu((ess
others
Other error (ode
S*##o"t
NEW210
Notes
his un(tion (an print (ontent o a sura(e 5+ printer<
the part o the sur a(e 'idth 'hi(h is 5i,,er than the printer 'i 5e trun(ated. % print9hei,ht is 5i,,er than 59sura(e=s 'idth< then 59sura(e=s hei,ht is the 5i,,est (orrespondin, hei,ht.
(9( Maneti! st"i#e )a,neti( stripe reader is a (hara(ter devi(e< use ,enera ie operationsBopen 、'rite 、io(t、(oseC (an (o)pete operation on )a,neti( stripe reader< or (onvenien(e to deveop< 'e pa(;a,e it <et )a,neti( (ard=s operation audio-visua+. &a,neti( (ard )odue provides 5o(;in, and non-5o(;in, operation.
%n the 5o(;in, )ode< 'hen the pro,ra) (ain, to read )a,neti( (ard data < i the )a,neti( stripe reader has no data< then the appi(ation 'i 5o(; unti user s'ipes (ard< 'hen )a,neti( (ard )odue re(eived data the 5o(;ed pro,ra) 'i 5e rea'a;ened< appi(ation 'i ,et data ro) )a,neti( (ard )odue. %n the non-5o(;in, )ode< 'hen the pro,ra) (ain, to read )a,neti( (ard data <
i the
)a,neti( stripe reader has no data < the appi (ation 'i not 5e 5o(;ed <(ain, the )a,stripe9read 'i eads to error and returns i))ediate+.Bnot the aut o )a,neti( (ard )odueC
or the (onvenien(e o deveoper< 'e aso provide read and 'rite un(tion 'ith ti)eout< i the reader (an not read and 'rite data at a set period o ti)e< un(tion 'i e7it. AP% un(tions o this )odue 'as deined in the F)a,stripe.hG6 Fi5pos.soG )ust 5e used 'hen in;in,.
(9(1(
ast"i#e=o#en
P"otot'#e
int )a,stripe9openB(onst (har Riena)e< int oa,sC
F*n!tion
open the )a,neti( stripe reader
Pa"aete"?
iena)e
)a,neti( stripe na)e:F>dev>)a,(ard0Gdev>)a,(ard1G\\
oa,s
Wa+ to open the devi(e: 5o(;in, )ode use: O9*DON"$
LI 0
open de vi(e O/ < re turn va ue is u sed to o perate (a rd de(odin, devi(e=s ie nu)5er
others
other error (ode
reader
non-5o(;in, )ode use:O9*DON"$ f O9NONM"O!/ Ret*"n
S*##o"t
NEW210
Notes
he nu)5er o )a,neti( stripe reader is up to 1< its devi(e na)e
is >dev>)a,(ard_ (_I0<1<2<\<14 ), in deaut (ondition NEW210 ther)a printer devi(e na)e is >dev>)a,(ard0
(9(2(
ast"i#e=!ose
P"otot'#e
int )a,stripe9(oseBint dC
F*n!tion
(ose )a,neti( stripe reader
Pa"aete"?
d
Ret*"n
0
(ose (ard de(odin, devi(e su((ess
others
Other error (ode
opened devi(e ie nu)5er that )a,stripe9open un(tion returns
S*##o"t
NEW210
Notes
Ater (ain, this un(tion< the d 'i 5e invaid< 5eore open )a,neti( stripe reader a,ain< this invaid d (an not 5e used to operate )a,neti( stripe reader
(9(+(
ast"i#e="ea$
P"otot'#e
int )a,stripe9readBint d< user9)a,(ard9ino9t R(ardinoC
F*n!tion
#et data o tra(; ro) )a,neti( stripe reader
Pa"aete"?
d
opened de vi(e i e nu )5er th at )a ,stripe9open u n(tion returns
(ardin o
)a,(ardtra( ; 0<1<2T
tra(;n o
ra(; nu)5er(0,1,2)
status
De(odin, state : &A#!A*D9DE!ODE9O/: su((ess &A#!A*D9DE!ODE9E**9*A W &A#!A*D9DE!ODE9E**9"* ! &A#!A*D9DE!ODE9E**9OD D
Ret*"n S*##o"t
sie
nu)5er o data 5+tes o the tra(;
data
store the tra(; data
L0
nu)5er o data 5+tes read ro) )a,neti( stripe reader
others
other error (ode
NEW210
Output para)eter (ardino data stru(t is 5eo': t+pede stru(t )a,(ard9ino U
Notes
int tra(;no6 %nt status6 %nt sie6 uint9t data2T6 X )a,(ard9ino9t6 t+pede stru(t user9)a,(ard9ino U )a,(ard9ino9t )a,(ardtra(;&A#!A*D9*A!/9N&T6 X user9)a,(ard9ino9t 6
(9(,(
ast"i#e="ea$=tieo*t
P"otot'#e
int )a,stripe9read9ti)eoutBint d< user9)a,(ard9ino9t R (ardino< unsi,ned on, )sC
F*n!tion
he sa)e as )a,stripe9read< add ti)eout un(tion.no )atter it is non-5o(;in, )ode or -5o(;in, )ode< 'hen the set ti)eout e7pires< the un(tion 'i e7it.
Pa"aete"?
d
opened de vi(e i e nu )5er th at )a ,stripe9open u n(tion returns
(ardin o
)a,(ardtra( ; 0<1<2T
tra(;n o
ra(; nu)5er(0,1,2)
status
De(odin, state : &A#!A*D9DE!ODE9O/: su((ess &A#!A*D9DE!ODE9E**9*A W &A#!A*D9DE!ODE9E**9"* ! &A#!A*D9DE!ODE9E**9OD D
)s Ret*"n
S*##o"t Notes
L0
sie
nu)5er o data 5+tes o the tra(;
data
store data o the tra(;
ti)eout ti)e
-E%&E
read ti)eout
others
other error (ode
NEW210
(9((
ast"i#e=7"ite
P"otot'#e
int )a,stripe9'riteBint d< (onst user9)a,(ard9ino9t R(ardinoC
F*n!tion
'rite tra(; data into )a,neti( stripe 5+ )a,neti( stripe reader
Pa"aete"?
d
opened devi(e ie nu)5er that )a,stripe9open un(tion returns
(ardino
)a,(ardtra(
tra(;no
ra(; nu)5er (0,1,2)
; 0<1<2T
status
i,nore
sie
nu)5er o d ata 5 +tes o t he tra(;
data Ret*"n
store data o the tra(;
L0
nu)5er o data 5+tes o 'ritin, into )a,neti( stripe reader
others
other error (ode
S*##o"t
none
Notes
NEW210 don=t support this un(tion (urrent+
(9(:(
ast"i#e=7"ite=tieo*t
P"otot'#e
int )a,stripe9'rite9ti)eoutBint d< (onst user9)a,(ard9ino9t R (ardino< unsi,ned on, )sC
F*n!tion
'rite tra(; data into )a,neti( (ard 5+ )a,neti( stripe reader
Pa"aete"?
d
opened devi(e ie nu)5er that )a,stripe9open un(tion returns
(ardino
)a,(ardtra(
tra(;no
ra(; nu)5er (0,1,2)
; 0<1<2T
status
i,nore
sie
nu)5er o d ata 5 +tes o t he
data
tra(; store data o the tra(;
)s Ret*"n
L0
ti)eout ti)e
-E%&E
read ti)eout
others
other error (ode
S*##o"t
none
Notes
NEW210 don=t support this un(tion (urrent+
(9(9(
ast"i#e=et=t"a!6set
P"otot'#e
int )a,stripe9,et9tra(;setBint d< user9tra(;9ino9t Rtra(;inoC
F*n!tion
,et en(odin, set o a tra(;s o (urrent )a,neti( stripe reader.
Pa"aete"?
d
opened devi(e ie nu)5er that )a,stripe9open un(tion returns
trad(;ino
5it9pre9(ode
!odin,5 it en,th
start9a,
Starta,
end9a,
Enda,
5ase
Masevaue
L0
Ret*"n
others
su((ess other error (ode
S*##o"t
NEW210
Notes
his un(tion is provided or deveopers 'ho ;no' 'e a5out )a,neti( (odin, standards< i deveoper don=t ;no' it 'e< it is not ne(essar+ to (a this un(tion.
(9(8(
ast"i#e=set=t"a!6set
P"otot'#e
int )a,stripe9set9tra(;setBint d< (onst user9tra(;9ino9t Rtra(;inoC
F*n!tion
set en(odin, standards o ever+ tra(; o (urrent )a,neti( stripe reader
Pa"aete"?
d
opened devi(e ie nu)5er that )a,stripe9open un(tion returns
trad(;ino
Ret*"n
5it9pre9(ode
!odin,5 it en,th
start9a,
Starta,
end9a, 5ase
End)ar; Masevaue
0
su((ess
others
other error (ode
S*##o"t
NEW210
Notes
his un(tion is provided or deveopers 'ho ;no' 'e a5out )a,neti( (odin, standards< i deveoper don=t ;no' it 'e< it is not ne(essar+ to (a this un(tion.
(8( IC !a" $ NEW210 support one user (ard sot and three PSA& (ard sots (urrent+< (orrespondin, (ard sot devi(e na)e are isted as oo': F>dev>user(ardG ----- user (ard sot F>dev>sa)(ard1G ------ PSA&1 (ard sot F>dev>sa)(ard2G ------ PSA&2 (ard sot F>dev>sa)(ard3G ------ PSA&3 (ard sot A5ove the) PSA& (ard sot ust supports I0 、 I1 as+n(hronous operation o !P (ard< and user (ard not on+ supports I0 、I1 as+n(hronous operation o !P (ard< 5ut aso supports various s+n(hroniation (ard< su(h as S"E2 、S"E2 and A2 series )e)or+ (ard. When deveopin, appi(ation< pease in(udes i((ard.h 、 se2.h 、 se2.h and at277.h。 Pease in; to i5i((ard.so i5 ie 'hen (o)piin,.
(8(1(
i!!a"$=o#en=!a"$sot
P"otot'#e
int i((ard9open9(ardsotB(onst (har Riena)eC
F*n!tion
Open (onta(t %! (ard devi(e
Pa"aete"?
iena)e
!onta(t %! (ard devi(e na)e< vaue 5eo': F>dev>user(ardG ----- user (ard sot F>dev>sa)(ard1G ------ SA&1 (ard sot F>dev>sa)(ard2G ------ SA&2 (ard sot F>dev>sa)(ard3G ------ SA&3 (ard sot
Ret*"n
LI 0
Open devi(e su((essu+< return ie nu)5er o u sin, to
-1
Open %! (ard sot aiure< pease ,et a(tua error vaue 5+ errno
operate (onta(t %! (ard devi(e
S*##o"t
NEW210
Notes
1、 NEW210 supports one user (ard sot and three SA& (ard sot 2、 Pease reer to i((ard.h
i!!a"$=!ose=!a"$sot
5.,.2.
P"otot'#e
int i((ard9(ose9(ardsotBint dC
F*n!tion
(ose (onta(t %! (ard devi(e
Pa"aete"?
d
Ret*"n
0
(ose (onta(t %! devi(e su((essu+
-1
!ose %! (ard sot aiure< pease ,et a(tua error vaue 5+ errno
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
S*##o"t
NEW210
Notes
1、 Ater (ain, this un(tion< 5 'i 5e invaid< 5eore restart (onta(t %! (ard devi(e< pro,ra))er (an=t use this invaid a to operate (onta(t %! (ard devi(e. 2、 Pease reer to i((ard.h
(8(+(
i!!a"$=!.e!6=!a"$=in=sot
P"otot'#e
int i((ard9(he(;9(ard9in9sotBint dC
F*n!tion
!he(; 'hether there is a %! (ard in desi,nated (onta(t %! (ard sot
Pa"aete"?
d
Ret*"n
0
!ardDete(ted
-1
!ard a5sent or other error< pease (he(; the )ista;e 5+ errno: EN%O:!ard a5sent Other vaue:other error
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
NEW210 1、 On+ user (ard supports (ard in pa(e (he(;< the other three SA& (ard sot a'a+s re,ards as (ard is e7ist. 2、 Pease reer to i((ard.h 。
S*##o"t Notes
(8(,(
i!!a"$=#o7e"=*#
P"otot'#e
int i((ard9po'er9upBint d< int v((< int )ode< int Ren< void RatrC
F*n!tion
po'er on and reset as+n(hronous !P (ard o %! (ard sot 'hen
(onta(tin, Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
v((
%! (ard 'or;in, vota,e< the vaue is 5eo': !V!!9199VO" 1.v operation !V!!939VO" 3v operation !V!!949VO" 4v operation
)ode
%! (ard 'or;in, )ode< the vaue is 5eo': E&V9&ODE ------ E&V 'or;in, )ode %SO9&ODE ----- %SO1 , 800MPS 'or;in, )ode(supports PPS proto(o) %SO918200 ------ %SO1 , 18200MPS 'or;in, )ode %SO9300 )ode
------
%SO1 , 300MPS 'or;in,
en ( outp ut)
A* en,th that %! (ard returns
atr ( outpu
A* inor)ation that %! (ard returns
t) Ret*"n
0 -1
po'er on and reset %! (ard su((ess Po'er on (ard aiure< pease ,et a(tua error vaue 5+ errno EN%O : is not %! (ard e7ist in (ard sot E%NVA" : input para)eter error E!O&& : %! (ard return data parit+ error or "*! parit+ error EP*OO : %! (ard return data does not )eet the E&V standard or %SO1 standard E%&E : ti)eout and no return Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to i((ard.h。
(8((
i!!a"$=e/!.ane=a#$*
P"otot'#e
int
i((ard9e7(han,e9apduBint d< uint329t senden< (onst Rsenddata< uint329t Rre(ven< Rre(vdataC
F*n!tion
e7(han,e data 'ith as+n(hronous (ard o (onta(tin, %! (ard sot
Pa"aete"?
d
void void
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
senden
the tota en,th o data to 5e sent
senddata
the data to 5e sent
re(ven(o
en,th o data that %! (ard returns
utput)
Ret*"n
re(vdata (output)
the data that %! (ard returns
0
po'er on and reset %! (ard su((ess
-1
E7(han,e d ata ' ith ( ard e rror< pease , et a (tua e rror vaue 5+ errno EN%O :is not %! (ard e7ist in (ard sot E%NVA" :input para)eter error E!O&& : %! (ard return data parit+ error or "*! parit+ error EP*OO : %! (ard return data does not )eet the E&V standard or %SO1 standard E%&E :ti)eout and no return EA!!ES : do not po'er on (ard Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to i((ard.h 。
(8(:(
i!!a"$=#o7e"=$o7n
P"otot'#e
int i((ard9po'er9do'nBint dC
F*n!tion
po'er o %! (ard o (onta(tin, %! (ard sot
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
Ret*"n
0
po'er o su((essu+
-1
po'er o ( ard a iure< p ease , et a( tua e rror va ue 5 + errno: EN%O :is not %! (ard e7ist in (ard sot Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to i((ard.h。
(@( SLE,,28 !a"$ o$* e inte"%a!e
(@(1(
se,,28=o#en
P"otot'#e
int se29openBint dC
F*n!tion
a(tive S"E2 (ard o %! (ard sot
Pa"aete"?
d
opened de vi(e i e nu )5er th at i( (ard9open9(ardsot un(tion returns
Ret*"n
0
A(tive operation su((ess
-1
A(tive S"E2 aiure
NEW210 1、Pease reer to se2.h。
S*##o"t Notes
(@(2(
se,,28=!ose
P"otot'#e
int se29(oseBint dC
F*n!tion
po'er o S"E2 (ard
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
Ret*"n
0
po'erosu((ess
-1
Po'er o S"E2 aiure< pease ,et a(tua error (ode 5+ errno
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(+(
se,,28="ea$
P"otot'#e
int se29readBint d
F*n!tion
read data ro) S"E2 (ard
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
start9addr
start address
en
en,th o data that 'i 5e read.
data ( out put)
data that 'i 5e read.
0
readoperatesu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: E%NVA" : input para)eter error EN%O : is not e7ist S"E2 (ard in (ard sot
Ret*"n
Other vaue :other error (ode S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(,(
se,,28="ea$=e""o"=!o*nt
P"otot'#e
int se29read9error9(ount Bint d
F*n!tion
read (ount o S"E2 (onse(utive pass'ord verii(ation aiures
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
(ount ( ou tput)
!ount o (onse(utive pass'ord verii(ation aiures
0
readoperatesu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: E%NVA" : input para)eter error EN%O : is not e7ist S"E2 (ard in (ard sot Other vaue :other error (ode
Ret*"n
S*##o"t
NEW210
Notes
7、 When (ount o (onse(utive pass'ord verii(ation aiures is up to < S"E2 (ard 'i 5e o(;ed (ard< and (an not do 'rite operation a,ain. 2、 Pease reer to se2.h。
(@((
se,,28=ve"i%'=#7$
P"otot'#e
int se29veri+9p'dBint d<(onst void Rp'dC
F*n!tion
S"E2 (ard pass'ord verii(ation
Pa"aete"?
d
opened de vi(e i e nu)5er that i((ard9open9(ardsot un(tion returns
p'd
S"E2 (ard pass'ord< 2 5+tes
Ret*"n
0
pass'ord verii(ation su((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: E%NVA" : input para)eter error EN%O : S"E2 (ard does not e7ist in (ard sot EP*OO : pass'ord verii(ation aiure E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(:(
se,,28=!.ane=6e'
Potot'#e
int se29(han,e9;e+Bint d<(onst void Rne'9p'dC
F*n!tion
)odi+ S"E2 (ard=s pass'ord
Pa"aete"?
d
opened d evi(e ie n u)5er t hat i ((ard9open9(ardsot un(tion returns
ne'9p'd
ne' S"E2 (ard pass'ord < 2 5+tes
Ret*"n
0
pass'ord )odi+ su((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: E%NVA" : input para)eter error EN%O : S"E2 (ard does not e7ist in (ard sot EP*OO : pass'ord )odi+ aiure E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(9(
se,,28=o!6
Potot'#e
int se29o(;Bint dC
F*n!tion
"o(; S"E2 (ard
Pa"aete"?
d
opened de vi(e i e nu )5er that i((ard9open9(ardsot un(tion returns
Ret*"n
0
o(;ed(ardsu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: EN%O : S"E2 (ard does not e7ist in (ard sot EP*OO : o(; (ard aiure E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(8(
se,,28="ea$=stat*s
P"otot'#e
int se29read9status Bint d
F*n!tion
read data status o an address o S"E2 (ard
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
addr
data address that 'i 5e de)anded
status(ou tput)
he data status< 0- (an not )odi+ 1- (an )odi+
0
readdatastatus su((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno:
Ret*"n
EN%O :S"E2 (ard does not e7ist in (ard sot E%NVA" : input para)eter error Other vaue :other error (ode S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(@(
se,,28=7"ite
P"otot'#e
int se29'riteBint d
F*n!tion
'rite data into S"E2
Pa"aete"?
d
opened d evi(e ie n u)5er t hat i ((ard9open9(ardsot un(tion returns
start9addr
data start address that 'i 5e 'ritten.
en
en,th o data to 5e 'ritten.
data
data that 'i 5e 'ritten.
0
'rite operation su((ess
Ret*"n
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: EN%O : S"E2 (ard does not e7ist in (ard sot E%NVA" : para)eter error EA!!ES: (an not )odi+ the address=s data E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(10( se,,28=7"ite=#"ote!t P"otot'#e
int se29'rite9prote(tBint d
F*n!tion
'rite data into S"E2< 'hie settin, data that (an not 5e (han,ed
Pa"aete"?
d
opened d evi(e ie n u)5er t hat i ((ard9open9(ardsot un(tion returns
start9addr
data start address that 'i 5e 'ritten
en
en,th o data that 'i 5e 'ritten
data
data that 'i 5e 'ritten
0
'rite operation su((essu+
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno:
Ret*"n
EN%O : S"E2 (ard does not e7ist in (ard sot E%NVA" : para)eter error EA!!ES: (an not )odi+ the address=s data E%&E : ti)eout Other vaue :other error (ode S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(@(11( se,,28=!.e!6=$ata P"otot'#e
int se29(he(;9data Bint d
F*n!tion
(o)pare spe(iied address data o S"E2 'ith input data< i the+ are a the sa)e< then settin, this address to (an not 5e (han,ed
Pa"aete"?
d
opened de vi(e i e nu)5er that i( (ard9open9(ardsot un(tion returns
addr
data address that 'i 5e (o)pared
data
data that 'i 5e (o)pared
Ret*"n
0
'ritesu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: EN%O :S"E2 (ard does not e7ist in (ard sot EP*OO : )odi+ aiure EA!!ES: (an not )odi+ the address=s data E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10( SLE,,,2 !a"$ o $*e inte"% a!e
(10(1( se,,,2=o#en P"otot'#e
int se29openBint dC
F*n!tion
a(tive S"E2(ard o %! (ard sot
Pa"aete"?
d
opened de vi(e i e nu )5er th at i( (ard9open9(ardsot un(tion returns
Ret*"n
0
A(tive operation su((ess
-1
Operate aiure
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(2( se,,,2=!ose P"otot'#e
int se29(oseBint dC
F*n!tion
po'er o S"E2(ard
Pa"aete"?
d
Ret*"n
0
po'erosu((ess
-1
Po'er o aiure< pease ,et a(tua error (ode 5+ errno
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(+( se,,,2=ve"i%' P"otot'#e
int se29veri+Bint d<(onst voidR p'dC
F*n!tion
S"E2 (ard pass'ord verii(ation
Pa"aete"?
d
opened de vi(e i e nu)5er that i((ard9open9(ardsot un(tion returns
Ret*"n
p'd
S"E2 (ard user pass'ord< 3 5+tes
0
pass'ord verii(ation su((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: E%NVA" : para)eter error EP*OO : pass'ord verii(ation aiure E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(,( se,,,2="ea$=e""o "=!o*nt P"otot'#e
int se29read9error9(ountBint d
F*n!tion
read (ount o S"E2 (onse(utive pass'ord verii(ation aiures
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
(ount ( ou tput)
!ount o (onse(utive pass'ord verii(ation aiures
0
readoperatesu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno:
Ret*"n
E%NVA" :para)eter error Other vaue :other error (ode S*##o"t
NEW210
Notes
7、 。When (ount o (onse(utive pass'ord verii(ation aiures is up to 3< S"E2 (ard 'i 5e o(;e d (ard< and (an not do 'rite operation a,ain. 2、 Pease reer to se2.h。
(10(( se,,,2=!.ane=6e' P"otot'#e
int se29(han,e9;e+Bint d<(onst void Rne'9p'dC
F*n!tion
)odi+ S"E2 (ard=s pass'ord
Pa"aete"?
d
opened d evi(e ie n u)5er t hat i ((ard9open9(ardsot un(tion returns
ne'9p'd
ne' S"E2 (ard pass'ord < 3 5+tes
Ret*"n
0
pass'ord )odi+ su((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: E%NVA" : para)eter error EP*OO : pass'ord )odi+ aiure E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(:( se,,,2=o!6 P"otot'#e
int se29o(;Bint dC
F*n!tion
S"E2 (ard o(;ed
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
Ret*"n
0
o(;ed(ardsu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: EN%O :S"E2 (ard does not e7ist in (ard sot EP*OO : o(; (ard aiure E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(9( se,,,2="ea$ P"otot'#e
int se29readBint d
F*n!tion Pa"aete"?
read data ro) S"E2 (ard d opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
Ret*"n
start9addr
start address
en
en,th o data that 'i 5e read.
data ( out put)
data that 'i 5e read.
0
readoperatesu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: E%NVA" : input para)eter error EN%O : S"E2 (ard does not e7ist in (ard sot Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(8( se,,,2=7"ite
P"otot'#e
int se29'riteBint d
F*n!tion
'rite data into S"E2
Pa"aete"?
d
opened d evi(e ie n u)5er t hat i ((ard9open9(ardsot un(tion returns
Ret*"n
start9addr
data start address that 'i 5e 'ritten.
en
en,th o data that 'i 5e 'ritten.
data
data that 'i 5e 'ritten.
0
'rite operation su((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: EN%O : S"E2 (ard does not e7ist in (ard sot E%NVA" : para)eter error E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(@( se,,,2="ea$=stat*s P"otot'#e
int se29read9statusBint d
F*n!tion
read prote(t 5it inor)ation o the desi,nated address o S"E2
Pa"aete"?
(ard d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
addr
data address that 'i 5e de)anded
status(ou tput)
Prote(t 5it inor)ation o the address: 0 5e prote(ted <(a n not 5e )odiied 1 not 5e prote(ted< (an 5e )odi ied
Ret*"n
0
readoperationsu((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: EN%O : S"E2 (ard does not e7ist in (ard sot E%NVA" : para)eter error Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(10(10( se,,,2=!.e!6=$ata
P"otot'#e
int se29(he(;9data Bint d
F*n!tion
Write data into the desi,nated address o S"E2=s prote(t one< and set its propert+ to (an not 5e (han,ed
Pa"aete"?
Ret*"n
d
opened de vi(e i e nu)5er that i( (ard9open9(ardsot un(tion returns
addr
data address that 'i 5e 'ritten.
data
data that 'i 5e 'ritten.
0
'rite operation su((ess
-1
Operate aiure< pease ,et a(tua error (ode 5+ errno: EN%O :S"E2 (ard does not e7ist in (ard sot EP*OO : )odi+ aiure EA!!ES: (an not )odi+ the address=s data E%&E : ti)eout Other vaue :other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to se2.h。
(11( Conta!t-ess IC !a"$ "ea$e" o$*e NEW210=s (onta(t-ess reader )odue devi(e na)e is G>dev>n(G 。 NEW210 supports +peA(%SO13-1、-2、-3、-)、+peM(%SO13-1、-2、-3、)and Son+ei!a proto(o (ard (urrent+. Spe(ii(a+ supports )iare !assi(BS40>S0C 、 )iare trai,ht 、 )iare DESire D0 、)iare DESire EV1 、)iare Pro and et(。 When deveopin, appi(ation< pease (ontains iso13.h 、 )ione.h、 )iu.hand desire.h。 When (o)piin, appi(ation< pease in;s to i5n(.so i5 ie.
(11(1(
ISO1,,,+ #"oto!o !oan$ inte"%a!e
(11(1(1( i%=o#en
P"otot'#e
int )i9openB(onst (har Riena)eC
F*n!tion
open the (onta(t-ess reader )odue
Pa"aete"?
iena)e
Ret*"n
LI 0
!onta(t-ess reader na)e :(urrent+ i7ed at G>dev>n(G open devi(e O/< returned vaue is used to operate (onta(t-ess reader un(tion=s ie nu)5er
-1
open aiure< pease ,et the a(tua error (ode 5+ errno
S*##o"t
NEW210
Notes
1、Pease reer to iso13.h。
(11(1(2( i%=!ose P"otot'#e
int )i9(oseBint dC
F*n!tion
(ose (onta(t-ess reader )odue
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
0
operatesu((ess
-1
!ose aiure< pease ,et the a(tua error (ode 5+ errno
S*##o"t
NEW210
Notes
1、Pease reer to iso13.h。
(11(1(+( i%=set=tieo*t
P"otot'#e
int )i9set9ti)eoutB(onst stru(t )i9ti)eout Rpti)eC
F*n!tion
set (orrespondin, ti)eout para)eter o (onta(t-ess reader )odue
Pa"aete"? Ret*"n
pti)e 0
stru(ture pointer to ti)eout para)eter operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error Other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(,( i%=et=tieo*t
P"otot'#e
int )i9,et9ti)eoutBstru(t )i9ti)eout Rpti)eC
F*n!tion
,et (orrespondin, ti)eout para)eter o (onta(t-ess reader )odue
Pa"aete"?
pti)e (output)
stru(ture pointer o (urrent ti)eout para)eter
Ret*"n
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error Other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(( iso1,,,+=$ea'=et* int iso139dea+9etuBint d
P"otot'#e F*n!tion Pa"aete"?
diT
opened devi(e ie nu)5er that )i9open un(tion returns
nu)oet u Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error Other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(:( iso1,,,+="eset=#i!! int iso139reset9pi((Bint dC
P"otot'#e F*n!tion Pa"aete"?
diT
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error Other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(9( i%=see!t=!a""ie"=t'#e
P"otot'#e
int )i9see(t9(arrier9t+peBint d< int329t t+peC
F*n!tion
set (onta(t-ess reader )odue (arrier )oduation t+pe
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
t+pe
&oduation t+pe< e7a(t vaue is 5eo': &%9$PE9A ------ %SO13 +peA )oduation &%9$PE9M ------- %SO13 +peM )oduation &%9$PE9!1 ------ Son+ ei!a so' )oduation B212;5psC &%9$PE9!2 -----Son+ ei!a hi,h )oduationB2;5psC
Ret*"n
S*##o"t
0
OperateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error Other vaue : other error (ode
NEW210
Notes
Pease reer to iso13.h。
(11(1(8( iso1,,,+=ReBA
P"otot'#e
int iso139*eABint d< void RataC
F*n!tion
reuest ide +pe A (ard in the indu(tive one
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ata ( outpu
(ard returned A^A inor)ation<2 5+tes
t) Ret*"n
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard returned data doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return E&"%HOP : )ore than one (ard e7ists in indu(tion one other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(@( iso1,,,+=W*#A P"otot'#e
int iso139*eABint d< void RataC
F*n!tion
'a;e up +peA (ard in %D"E state or HA" state in indu(tive one
Pa"aete"
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ata ( outpu
A^A inor)ation that (ard returned< 2 5+tes
t) Ret*"n
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return E&"%HOP : )ore than one (ards e7ist in indu(tion one other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(10(iso1,,,+=Anti!oision
P"otot'#e
int iso139Anti(oisionBint d
F*n!tion
+peA (ard anti-(oni(t )ana,e)ent< ,et %D inor)ation o +peA (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
se
anti-(oni(ta+er : 0783 ------ irst eve 0784 ------ se(ond eve 078 ------ third eve
uid ( output
his eve %D inor)ation that (ard returned< 4 t+pes
) 0
< t+pes %D@M!! operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t i7 %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return E&"%HOP : )ore than one (ard e7ists in indu(tion one other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(11( iso1,,,+=See!t
P"otot'#e
int iso139See(tBint d
F*n!tion
See(t the +peA (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
se
!hoosea+er : 0783 ------ irst eve 0784 ------ se(ond eve 078
------ third eve
uid
this eve %D inor)ation o (ard< 5+tes
sa; ( output
(ard returned (onir)ation< 1 5+te
) Ret*"n
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t i7 %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return E&"%HOP : )ore than one (ard e7ists in indu(tion one other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(12(Iso1,,+=et=t'#eA=*i$
int iso139,et9t+peA9uidBint d< uint9t Ruiden< void RuidC6
P"otot'#e F*n!tion Pa"aete"?
diT
Ret*"n
opened devi(e ie nu)5er that )i9open un(tion returns 0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(1+(Iso1,,+=et=!a"$t'#e uint9t iso139,et9(ardt+peBvoidC6
P"otot'#e F*n!tion Pa"aete"?
无
0 Su((ess
Ret*"n
- Operate aiure< pease ,et the a(tua error (ode 5+ errno: 1 E%NVA" : input para)eter error other vaue : other error (ode S*##o"t
NEW210
Notes
Pease reer to iso13.h 。
(11(1(1,(iso1,,,+=atA
P"otot'#e
int iso139HatABint dC
F*n!tion
&a;e +peA (ard dor)ant< enter HA" state.
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
0
operateO/
-1
Operate aiure< pease , et the a (tua error ( ode 5 + errno: E%O : read (ard (hip error other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(1( iso1,,,+=RATS
P"otot'#e
int iso139*ASBint d
F*n!tion
e7e(ute the (o))and o *euest Ans'er o See(t< or +peA (ard
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
(id
o,i( (ard nu)5er o (ard
sdi
he )a 7i)u) r a)e en,th (o ei(ient th at te r)ina (an re(ei,e< vaues are as oo's: 0 ---- 15+tes 1 ---- 25+tes 2 ---- 325+tes 3 ---- 05+tes ---- 5+tes 4 ---- 5+tes ---- 85+tes ---- 125+tes ---- 245+tes Other vaues ---- 245+tes
Ret*"n
atsen ( o utput)
en,th o AS inor)ation that ino9en returned
ats ( outp ut) 0
AS inor)ation that ino9en returned operateO/
-1
Operate aiure< pease , et the a (tua error ( ode via errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return E&"%HOP : (ard in indu(tion one is not a I!" (ard other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to iso13.h。
(11(1(1:(iso1,,,+=PPS
P"otot'#e
int iso139PPSBint d
F*n!tion
proto(o and para)eter see(t (o))and< +peA
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
(id
o,i( (ard nu)5er o (ard
5r
Mound rate para)eter o ter)ina and (ard< vaues are as oo's: the hi,h 5its is 5ound rate o ter)ina to (ard the o' 5its is 5ound rate o (ard to ter)ina 0 ---- 10;5ps 1 ---- 212;5ps 2 ---- 2;5ps 3 ---- ;5ps
Ret*"n
0
operateO/
-1
Operate error< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t i7 %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return E&"%HOP : (ard in indu(tion one is not a I!" (ard other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to iso13.h。
(11(1(19(iso1,,,+=ReB>
P"otot'#e
int iso139*eMBint Renoat5< void Rat5C
d
ai
F*n!tion
reuese %D"E +peM (ard in indu(tive one
Pa"aete"?
d
sotnu)
opened devi(e ie nu)5er that )i9open un(tion returns
ai
appi(ation identiier<0700 )eans a appi(ations
sotnu)
nu)5er o sots that (ard supports: 1 ---- 1 sot 1 ---- 2 sots 2 ---- sots 3 ---- sots ---- 1 sots
Ret*"n
enoat5 (output)
inor)ation en,th o A^M
at5 ( out put) 0
at5 inor)ation operateO/
-1 Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to iso13.h。
(11(1(18(iso1,,,+=W*#>
P"otot'#e
int
iso139WupMBint
F*n!tion
Renoat5< void Rat5C 'a;e up %D"E state o HA" state +pe M (ard in indu(tive one
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ai
appi(ation identiier<0700 )eans a appi(ations
sotnu)
nu)5er o sots that (ard supports: 0---- 1 sot 1 2 3
-------------
ai
2 sots sots sots 1 sots
enoat5
inor)ation en,th o A^M
(output) at5 ( out
at5 inor)ation
put) Ret*"n
d
0
operateO/
sotnu)
-1
Operate e rror< p ease , et t he a (tua e rror ( ode 5 + errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to iso13.h。
(11(1(1@(iso1,,,+=SotMa"6e"
P"otot'#e
int iso139Sot&ar;erBint d
F*n!tion
reuest (ard inor)ation o spe(iied ti)e sot
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
sot enoat5 (output)
Ret*"n
ti)e sot para)eter ,0`14 inor)ation en,th o A^M
at5 ( out put)
at5 inor)ation
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to iso13.h。
(11(1(20(iso1,,,+=Att"i>
P"otot'#e
int iso139AttriMBint d
sdi<(onst
void
F*n!tion
(hoose +peM (ard
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
(id
o,i( (ard nu)5er o (ard
sdi
he )a7i)u) ra)e en,th (oei(ient that ter)ina (an re(eive< vaues are as oo's: 0 ---- 15+tes 1 ---- 25+tes 2 ---- 325+tes 3 ---- 05+tes ---- 5+tes 4 ---- 5+tes ---- 85+tes ---- 125+tes ---- 245+tes Other vaue ---- 245+tes
uid
%D inor)ation o +peM (ard< 5+tes
5r
Mound rate para)eter o ter)ina and (ard< vaues are as oo's: the hi,h 5its is 5ound rate o ter)ina to (ard the o' 5its is 5ound rate o (ard to ter)ina 0 ---- 10;5ps 1 ---- 212;5ps 2 ---- 2;5ps 3 ---- ;5ps
ino9en
When it is used as input para)eter< ino9en )eans
(input> output)
en,th o Hi,her-a+er %N inor)ation o ArttriM (o))and When is used to output< ino9ens returns (ard=s response data en,th
Ret*"n
ino ( inp ut> output)
When is used to input< ino )eans Hi,her-a+er %N inor)ation o ArttriM (o))and When is used to output< ino returns (ard=s response data
0
operateO/
-1
Operate aiure< p ease , et t he a (tua e rror ( ode 5 + errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return other vaue : other error (ode S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(21(iso1,,,+=at>
P"otot'#e
int iso139HatMBint d<(onst void RuidC
F*n!tion
&a;e +peM (ard dor)ant< enter HA" state.
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
uid
%D inor)ation o +peM (ard< 5+tes
0
operateO/
-1
Operate aiure< p ease , et t he a (tua e rror ( ode 5 + errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(22(iso1,,,+=t!=#o
P"otot'#e
int
iso139t(9poBint
d
)ode
R(ardino9en
R(ardinoC F*n!tion
poin, indu(tive area i there e7ists I!" proto(o (ard< is there have < (hoose it
Pa"aete"?
d
opened d evi(e ie nu)5er t hat )i9open un(tion returns
)ode
Poin, )ode < vaues are as oo': 0 ------ ust poin, (ard o %D"E state 1 ------ poin, (ard o %D"E state and HA" state en,th o inor)ation that (ard returns
(ardino9en (output)
(ardino(ou tput) Ret*"n
(ard returned data
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return ENODAA : (ard in indu(tion one is not a I!" (ard E&"%HOP : )utipe (ards in indu(tive one other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(2+(iso1,,,+=t!=a!tive P"otot'#e
int iso139t(9a(tiveBint d< uint9t sdi
(id<
uint9t 5r
F*n!tion
a(tive I!" (ard in indu(tive one
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
(id
o,i( (ard nu)5er o (ard
5r
Mound rate para)eter o ter)ina and (ard< vaues are as oo's: the hi,h 5its is 5ound rate o ter)ina to (ard
the o' 5its is 5ound rate o (ard to ter)ina 0 ---- 10;5ps 1 ---- 212;5ps 2 ---- 2;5ps 3 ---- ;5ps sdi
he )a7i)u) ra)e en,th (oei(ient that ter)ina (an re(ei,e< vaues are as oo's: 0 ---- 15+tes 1 ---- 25+tes 2 ---- 325+tes 3 ---- 05+tes ---- 5+tes 4 ---- 5+tes ---- 85+tes ---- 125+tes ---- 245+tes Other vaue ---- 245+tes
ino9en (input>
+peA (ard: "en,th o AS inor)ation that ino9en returns
output)
+peM (ard: When is used to input< ino9en )eans en,th o Hi,hera+er %N inor)ation o ArttriM (o))and When is used to output< ino9ens returns (ard=s response data en,th
ino ( inp
+peA (ard:
ut> output)
AS inor)ation that ino9en returns +peM (ard: When is used to input< ino )eans Hi,her-a+er %N inor)ation o ArttriM (o))and When is used to output< ino returns (ard=s response data
Ret*"n
0
operateO/
-1
Operate aiure< p ease , et t he a (tua e rror ( ode 5 + errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return EA!!ES : (ard in indu(tion one is not a I!" (ard other vaue : other error (ode S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(2,(iso1,,,+=t!=e/!.ane
P"otot'#e
int iso139t(9e7(han,eBint d
F*n!tion
e7(han,e data 'ith (ard 5+ I!" proto(o
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
senden
en,th o data that ter)ina sends
senddata
data that ter)ina sends
re(ven(o utput)
en,th o data that ter)ina re(eived
re(vdata (output)
data that ter)ina re(eived
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+
Ret*"n
errno: E%NVA" : input para)eter error E%O : read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return EA!!ES : (ard in indu(tion one is not a I!" (ard other vaue : other error (ode S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(2(iso1,,,+=t!=$ea!tive
P"otot'#e
int iso139t(9dea(tiveBint dC
F*n!tion
(ose I!" proto(o (hanne< reset I!" (ard
Pa"aete"?
d
Ret*"n
0
opened devi(e ie nu)5er that )i9open un(tion returns operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(2:(iso1,,,+=no=t!=e/!.ane
P"otot'e#
int iso139no9t(9e7(han,eBint d
F*n!tion
Data e7(han,e 5et'een ter)ina and (ard< not I!" proto(o
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
senden
en,th o data that ter)ina sends
senddata
data that ter)ina sends
re(ven(o utput)
en,th o data that ter)ina re(eived
re(vdata (output)
data that ter)ina re(eived
ti)eout
ti)eout para)eter< unitBEC
0 -1
operateO/ Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" : input para)eter error E%O : read (ard (hip error
Ret*"n
E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E : ti)eout and no return other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(29(i%=!.e!6=*ti=!a"$
P"otot'#e
int )i9(he(;9)uti9(ardBint dC
F*n!tion
(he(; 'hether there are )utipe (ards in indu(tive one
Pa"aete"?
d
Ret*"n
0
operateO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno.
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ENODAA :no (ard indu(tive one E&"%HOP :)uti (ards indu(tive one EP*OO : data ro ) (ard no t )at(h %SO13
proto(o
EMADE :data en,th ro) (ard error Other vaue :other (ase S*##o"t
NEW210
Notes
Pease reer to iso13.h。
(11(1(28(%ei!a=e/!.ane
P"otot'#e
int ei(a9e7(han,eBint d
F*n!tion
Dete(t 'hether there is )uti-(ard (oni(t.
Pa"aete"
diT
opened devi(e ie nu)5er that )i9open un(tion returns
Senden iT Senddat aiT *e(eive enoT *e(eive dataoT i)eout iT Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(2@(ev=!onta!tess=a!tive
P"otot'#e
int e)v9(onta(tess9a(tive9pi((Bint dC6
F*n!tion
Open the ee(tro)a,neti( ied and (he(; (ard.
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+0(ev=!onta!tess=$ea!tive=#i!!
P"otot'#e
int e)v9(onta(tess9dea(tive9pi((Bint dC6
F*n!tion
"lose the electro&a9netic field Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
NEW210 Pease *eer iso13.h
S*##o"t? Notes
(11(1(+1(ev=!onta!tess=o&tain=stat*s
P"otot'#e
int e)v9(onta(tess9o5tain9statusBint d< int R statusC6
F*n!tion
#et status
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
status
status
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard
Ret*"n
EMADE : error o en,th o (ard returned data other vaue : other error (ode S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+2(ev=!onta!tess=et=aste""o" P"otot'#e
int e)v9(onta(tess9,et9asterrorBint d< int R errorC6
F*n!tion
#et error nu)5er
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
error
Errornu)5er
0
Su((ess
Ret*"n
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t Notes
NEW210 Pease *eer iso13.h
(11(1(++(ev=!onta!tess=e/!.ane=a#$*
P"otot'#e
int e)v9(onta(tess9e7(han,e9apduBint d< uint329t senden< (onst void Rsenddata< uint329t Rre(ven< void Rre(vdataC6
F*n!tion
E7e(ute Apdu (o))and
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
senden
Apdu !o))and "en,th
senddata
Apdu !o))and
re(ven
Apdu *esponse en,th
re(vdata
Apdu *esponse
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13
Ret*"n
standard EMADE : error o en,th o (ard returned data other vaue : other error (ode S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+,( !o#at=InATR
P"otot'#e
int (o)pat9%nA*Bint d< uint329t R*esp"en< void RA*%noC6
F*n!tion Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
*esp"en A*%no Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+(!o#at=InPSL
P"otot'#e
int (o)pat9%nPS"Bint d< uint9t M*it< uint9t M*tiC6
F*n!tion Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Mrit M*ti Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+:( Co#at=InListPassiveTa"et
P"otot'#e
int (o)pat9%n"istPassivear,etBint d< uint9t &ode< int %nit"en< (onst void R%nit%no< int R!ard%no"en< void Rp!ard%noC6
F*n!tion
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
&ode %nit"en %nit%no !ard%no"en p!ard%no Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+9(!o#at=InDataE/!.ane
P"otot'#e
int (o)pat9%nPS"Bint d< uint9t M*it< uint9t M*tiC6
F*n!tion Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Mrit M*ti Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+8(Co#at=InReease
P"otot'#e
void (o)pat9%n*eeaseBint dC6
F*n!tion Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(1(+@(!o#at=i%C.e!6On'OneCa"$
P"otot'#e
int (o)pat9)i!he(;On+One!ardBint d< uint9t &odeC6
F*n!tion Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
&ode Ret*"n
0
Su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard e7ists in indu(tive one E&"%HOP : e7ists )utipe (ards in indu(tive (ard EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
Pease *eer iso13.h
(11(2( i%a"e Cassi! S03S90 o$*e inte"%a!e
(11(2(1( i%a"e=one=#o
P"otot'#e
int )iare9one9poBint d< uint9t )ode< void Ruid
< uint9t
R(ardt+peC F*n!tion
po i there is )iare one (ard in indu(tive one< i +es< a(tive it.
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
)ode
Poin, )ode < vaues are as oo': 0 ------ ust poin, (ard o %D"E state 1 ------ poin, (ard o %D"E state and HA" state
uid ( output )
4 5+tes %D inor)ation that (ard returns< 5+tes %D@M!!
(ardt+pe ( o utput)
*eturned )iare one (ard t+pe< )a+ have the vaue 5eo': &%9&19S40 ----- )iare one S40 (ard &%9&19S0 ----- )iare one S0 (ard &%9P*O9S40 ---- +peA (ard that (o)pati5e 'ith I!" proto(o and S40 proto(o &%9P*O9S0 ---- +peA (ard that (o)pati5e 'ith I!" proto(o and S0 proto(o
Ret*"n
0
ind(ardsu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : no (ard in indu(tive (ard E&"%HOP : e7ist )utipe (ards in indu(tive one EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(2( i%a"e=one=.at
P"otot'#e
int )iare9one9hatBint dC
F*n!tion
*eset )iare one (ard in indu(tive one
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
0
reset O/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%O :read (ard (hip error other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(+( i%a"e=one=a*t.enti!ate
P"otot'#e
int )iare9one9authenti(ateBint d< uint9t 5o(;no< uint9t ;e+t+pe< (onst void R;e+< (onst void RuidC
F*n!tion
pass'ord authenti(ation a5out )iare one (ard=s a data 5o(;
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
5o(;no
Nu)5er o data 5o(; that 'i 5e authenti(ated< or S40 (ard
;e+t+pe
(ertii(ated ;e+ t+pe< vaues are as oo': [A= ---- (ertii(ate A ;e+ [M= ---- (ertii(ate M ;e+
Ret*"n
;e+ uid
5+tes ;e+ inor)ation 5+tes %D inor)ation
0
pass'ord authenti(ation su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(,( i%a"e=one="ea$=&o!6
P"otot'#e
int )iare9one9read95o(;Bint d< uint9t 5o(;no< void R5o(;dataC
F*n!tion
read a data 5o(; (ontent o )iare one (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
5o(;no
Nu)5er o d ata 5 o(; th at 'i 5 e re ad< or S4 0 (ard
Ret*"n
5o(;data ( o utput)
read (ontent o data 5o(;<1 5+tes
0
readdata5o(;su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(( i%a"e=one=7"ite=&o!6
P"otot'#e
int )iare9one9'rite95o(;Bint d< uint9t 5o(;no< (onst void R5o(;dataC
F*n!tion
)odi+ (ontent o a data 5o(; o )iare one (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
5o(;no
Nu)5er o d ata 5 o(; th at 'i 5 e re ad< o r S4 0 (ard
Ret*"n
5o(;data
(ontent o data 5o(; that 'i 5e 'ritten<1 5+tes
0
'ritedata5o(;su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(:( i%a"e=one=set=va*e
P"otot'#e
int )iare9one9set9vaueBint d< uint9t 5o(;no< uint329t vaueC
F*n!tion
set a data 5o(; o )iare one (ard to vaue 5o(;
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
5o(;no
Nu)5er o data 5 o(; that 'i 5e r ead< or S40 (ard
Ret*"n
vaue
initia vaue that 'i 5e ied in
0
initiaie vaue 5o(; su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(9( i%a"e=one=in!"eent
P"otot'#e
int )iare9one9in(re)entBint d< uint9t 5o(;no< uint329t vaueC
F*n!tion
vaue 5o(; vaue-added operation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
5o(;no
Nu)5er o data 5 o(; that 'i 5e r ead< or S40 (ard
vaue
vaue that 'i 5e added
0
vaue in(re)ent operation su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error ENOS$S :the 5o(; is not a vaue 5o(; other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(8( i%a"e=one=$e!"eent
P"otot'#e
int )iare9one9de(re)entBint d< uint9t 5o(;no< uint329t vaueC
F*n!tion
vaue 5o(; de(re)ent operation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
5o(;no
Nu)5er o data 5 o(; that 'i 5e r ead< or S40 (ard
vaue
vaue that 'i 5e i)paired
0
de(re)entoperation su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error ENOS$S :the 5o(; is not a vaue 5o(; other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(@( i%a"e=one="esto"e
P"otot'#e
int )iare9one9restoreBint d< uint9t 5o(;noC
F*n!tion
*estore vaue in the desi,nated 5o(;
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
5o(;no
Nu)5er o data 5 o(; that 'i 5e r ead< or S40 (ard
0
*estoreoperationsu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error ENOS$S :the 5o(; is not a vaue 5o(; other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(10(i%a"e=one=t"ans%e"
P"otot'#e
int )iare9one9transerBint d< uint9t 5o(;noC
F*n!tion
save the resut o vaue 5o(; operation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
5o(;no
Nu)5er o data 5 o(; that 'i 5e r ead< or S40 (ard
0
Save the resut o vaue 5o(; operation su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error ENOS$S :the 5o(; is not a vaue 5o(; other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(2(11( i%a"e=one=et=va*e
P"otot'#e
int )iare9one9,et9vaueBint d< uint9t 5o(;no< uint329t RvaueC
F*n!tion
,et the vaue o the desi,nated 5o(;
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
5o(;no
Nu)5er o d ata 5 o(; th at 'i 5 e re ad< or S4 0 (ard
vaue(outpu t)
vaue (ontent that (ard returns
0
,et the vaue o vaue 5o(; operation su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EA!!ES : is not a )iare one (ard in indu(tive one EPE*& : authenti(ation aiure EP*OO : !ard doesn=t (o)p+ 'ith )iare one proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE : en,th o data that (ard return ed is error ENOS$S :the 5o(; is not a vaue 5o(; other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )ione.h。
(11(+( i%a"e *t"ai.t !a"$ o$*e inte"%a!e
(11(+(1( i%a"e=*t"ai.t=#o
P"otot'#e
int )iare9utrai,ht9poBint d< uint9t )ode< void RuidC
F*n!tion
Po i there is )iare utrai,ht (ard in indu(tive one< i there is< a(tive it.
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
)ode
Poin, )ode < vaues are as oo': 0 ------ ust poin, (ard o %D"E state 1 ------ poin, (ard o %D"E state and HA" state
uid ( output
5+tes %D inor)ation that (ard returns
) Ret*"n
0
ind(ardsu((essu+
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : is not a )iare utrai,ht (ard in indu(tive one E&"%HOP : e7ist )utipe (ards in indu(tive one EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )iu.h。
(11(+(2( i%a"e=*t"ai.t=.at
P"otot'#e
int )iare9utrai,ht9hatBint dC
F*n!tion
hat )iare utrai,ht (ard in indu(tive one
Pa"aete"?
d
Ret*"n
0
resetO/
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%O :read (ard (hip error other vaue : other error (ode
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
S*##o"t Notes
NEW210 1、Pease reer to )iu.h。
(11(+(+( i%a"e=*t"ai.t="ea$=#ae
P"otot'#e
int )iare9utrai,ht9read9pa,eBint d
F*n!tion
read (ontent o a pa,e o )iare utrai,ht (ard< pa,es at one ti)e
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
pa,e
start pa,e nu)5er that 'i 5e read< 0`14
data ( output
pa,e (ontent that 5e read< 1 5+tes
) Ret*"n
0
readdata5o(; su((essu+
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : is not a )iare utrai,ht (ard in indu(tive one E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE :error o en,th o (ard returned data other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to )iu.h。
(11(+(,( i%a"e=*t"ai.t=7"ite=#ae
P"otot'#e
int )iare9utrai,ht9'rite9pa,eBint d
F*n!tion
'rite (ontent o a pa,e o )iare utrai,ht (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
pa,e
pa,e nu)5er that 'i 5e 'ritten< 0`14
data
pa,e data that 'i 5e 'ritten< 5+tes
0
'rite data 5o(; operation su((essu+
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno:
Ret*"n
ENODAA : is not a )iare utrai,ht (ard in indu(tive one EP*OO : !ard doesn=t (o)p+ 'ith )iare proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE :error o en,th o (ard returned data other vaue : other error (ode S*##o"t
NEW210
1、Pease reer to )iu.h。
Notes
(11(+(( i%a"e=*t"ai.t=7"ite=#ae1:
P"otot'#e
int )iare9utrai,ht9'rite9pa,e1Bint d
F*n!tion Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
pa,e data
Pa,enu)5er ,0`14 Datato'rite
0
Su((ess
-1
aied , Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : is not a )iare utrai,ht (ard in indu(tive one
Ret*"n
EP*OO :!ard doesn=t (o)p+ 'ith )iare proto(o E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he( ; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return EMADE :error o en,th o (ard returned data other vaue : other error (ode S*##o"t
NEW210
Notes
(11(,( Mi%a"e DESFi"e o$*e inte"%a!e
(11(,(1( $es%i"e=#o
P"otot'#e
int desire9poBint d
F*n!tion
Po i there is )iare DESire (ard in indu(tive one< i there is
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
)ode
Poin, )ode < vaues are as oo': 0 ------ ust poin, (ard o %D"E state
1 ------ poin, (ard o %D"E state and HA" state uid ( output )
5+tes %D inor)ation that (ard returns
atsen ( outp ut)
en,th o AS inor)ation that (ard returns
ats ( output
AS inor)ation that (ard returns
) Ret*"n
0
ind(ardsu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: ENODAA : is not a )iare )iare DESire in indu(tive one E&"%HOP : there is )utipe (ards in indu(tive one EP*OO : !ard doesn=t (o)p+ 'ith %SO13 proto(o EMADE :error o en,th o (ard returned data E%NVA" :para)eter error E!O&& : Parit+ error or !*! (he(; error o (ard returned data E%O :read (ard (hip error E%&E :ti)eout return other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(2( $es%i"e=$ea!tive
P"otot'#e
int desire9dea(tiveBint dC
F*n!tion
*eset )iare DESire (ard
Pa"aete"? Ret*"n
d 0
opened devi(e ie nu)5er that )i9open un(tion returns OperateO/
-1
Operate a iure< p ease ,e t th e a (tua er ror (o de 5+ errno:
>e
NEW210
a##i!a&e Notes
1、Pease reer to desire.h 。
(11(,(+( $es%i"e=a*t.enti!ate
P"otot'#e
int desire9authenti(ateBint d
F*n!tion
Do DES>3DES ;e+ authentii(ation on )iare DESire (ard
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
;e+no
;e+ nu)5er that 'i 5e (ertii(ated
;e+
;e+ inor)ation
0
operatesu((ess
-1
Operate aiure< p ease , et t he a (tua e rror ( ode 5 + errno:
Ret*"n
E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1. ;e+ inor)ation )ust 5e 1 t+pes< i a(tua ;e+ is 5+tes< then e7pandin, it to 1 5+tes as oo': ;e+ I od9;e+0\T ff od9;e+0\T 2、Pease reer to desire.h。
(11(,(,( $es%i"e=a*t.enti!ate=iso
P"otot'#e
int desire9authenti(ate9isoBint d
F*n!tion
do 3/DES ;e+ authentii(ation on )iare DESire (ard
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
;e+no
;e+ nu)5er that 'i 5e authenti(ated
;e+
;e+ inor)ation
0
operatesu((ess
Ret*"n
-1
Operate aiure< p ease , et t he a (tua e rror ( ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t i7 %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1. ;e+ inor)ation )ust 5e 2 t+pes< i a(t ua ;e+ is 5+tes< then e7pandin, it to 2 5+tes as oo': ;e+ I od9;e+0\T ff od9;e+0\T ff od9;e+0\T 2.:i a(tua ;e+ is 1 5+tes< then e7pandin, it to 2 5+tes as oo': ;e+ I od9;e+0\T ff od9;e+\14T ff od9;e+0\T 3、Pease reer to desire.h。
(11(,(( $es%i"e=a*t.enti!ate=aes
P"otot'#e
int desire9authenti(ate9aesBint d
F*n!tion
do AES ;e+ authenti(ation on )iare DESire (ard
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
;e+no
;e+ nu)5er that 'i 5e (ertii(ated
;e+
;e+ inor)ation
0
operatesu((ess
Ret*"n
-1
Operate aiure< p ease , et t he a (tua e rror ( ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、 Pease reer to desire.h; 2、 AES ;e+=s en,th is i7ed 1 5+tes.
(11(,(:( $es%i"e=!.ane=6e'=settins
P"otot'#e
int desire9(han,e9;e+9settin,sBint d
F*n!tion
)odi+ P%!! &aster /e+ set or Appi(ation &aster /e+ set
Pa"aete"?
d
opened d evi(e ie nu)5er t hat )i9open un(tion returns
;e+9settin,s
ne' &aster /e+ settin, para)eter
Ret*"n
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、 Pease reer to desire.h。
(11(,(9( $es%i"e=et=6e'=settins
P"otot'#e
int desire9,et9;e+9settin,sBint d
F*n!tion
,et P%!! &aster /e+ settin, or Appi(ation &aster /e+ settin,
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
;e+9settin,s (output)
&aster /e+ settin, para)eter that (ard returned
)a79;e+9nu)
)a7i)u) ;e+ nu)5er that (urrent appi(ation
(output)
supports
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error
Ret*"n
E!O&& :Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(8( $es%i"e=!.ane=#i!!=aste"6e'
P"otot'#e
int desire9(han,e9pi((9)aster;e+Bint d
F*n!tion
(han,e P%!! &aster /e+
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
t+pe
P%!! &aster /e+ ;e+ t+pe< vaues as oo': 0700 ---- DES>3DES ;e+ (1 5+tes) 0701 ---- 3/DES ;e+ (2 5+tes) 0702 ---- AES ;e+ (1 5+tes)
Ret*"n
;e+
;e+ inor)ation<1>2 5+tes
version
;e+ version inor)ation
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(@( $es%i"e=!.ane=a##=6e'
P"otot'#e
int desire9(han,e9app9;e+Bint d
F*n!tion
(han,e appi(ation ;e+
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
;e+settin,
appi(ation=s )aster ;e+ (oni,uration attri5ute para)eter
t+pe
P%!! &aster /e+ ;e+ t+pe ,vaues as oo':
;e+no
0700 ---- DES>3DES ;e+ (1 5+tes) 0701 ---- 3/DES ;e+ (2 5+tes ) 0702 ---- AES ;e+ (1 5+tes) ;e+ nu)5er that 'i 5e )odiied
od;e+
Ret*"n
ne';e+
od ;e+ inor)ation ,1>2 5+tes ne' ;e+ inor)ation ,1>2 5utes
version
;e+ version inor)ation
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(10($es%i"e=et=6e'=ve"sion
P"otot'#e
int desire9,et9;e+9versionBint d
F*n!tion
,et ;e+ version inor)ation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
;e+no
;e+nu)5er
version(out put)
;e+ version inor)ation that (ard returned
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+
Ret*"n
errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(11( $es%i"e=!"eate=a##i!ation
P"otot'#e
int desire9(reate9appi(ationBint d<(onst desire9appino RinoC
F*n!tion
(reate a su5-appi(ation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ino
appi(ation inor)ation
Ret*"n
0
operatesu((ess
-1
Operate aiure< p ease , et the a (tua error ( ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(12($es%i"e=$eete=a##i!ation
P"otot'#e
int desire9deete9appi(ationBint d<(onst void RaidC
F*n!tion
deete a su5-appi(ation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
aid
appi(ation A%D inor)ation< 3 5+tes
Ret*"n
0
operatesu((ess
-1
Operate aiure< p ease , et the a (tua error ( ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(1+($es%i"e=et=a##i!ation=i$s
P"otot'#e
int desire9,et9appi(ation9idsBint d
F*n!tion
,et a appi(ation=s A%D inor)ation o DESire (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
nu) ( outpu t)
appi(ation nu)5er that (ard (ontained
aid ( output
appi(ation A%D inor)ation< 3 5+tes ever+ appi(ation
) 0
operatesu((ess
Ret*"n
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(1,($es%i"e=et=$%naes
P"otot'#e
int desire9,et9dna)esBint d
F*n!tion
,et a appi(ation=s inor)ation o DESire
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
appnu) ( o utput)
appi(ation nu)5er that (ard (ontained
ino ( output
appi(ation inor)ation< ever+ appi(ation has a
)
dna)e9ino stru(t
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error
Ret*"n
E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(1($es%i"e=see!t=a##i!ation
P"otot'#e
int desire9see(t9appi(ationBint d<(onst void RaidC
F*n!tion
See(t a su5-appi(ation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
aid
appi(ation A%D inor)ation< 3 5+tes
Ret*"n
0
operatesu((ess
-1
Operate aiure< p ease , et the a (tua error ( ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(1:($es%i"e=%o"at=#i!!
P"otot'#e
int desire9or)at9pi((Bint dC
F*n!tion
or)at DESire (ard< deete a appi(ation and a appi(ation=s ;e+ and ie inor)ation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
Ret*"n
0
operatesu((ess
-1
Operate aiure< p ease , et t he a(tua e rror ( ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(19($es%i"e=et=ve"sion
P"otot'#e
int desire9,et9versionBint d< desire9version RversionC
F*n!tion
,et version inor)ation o )iare DESire (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
version(out put)
version inor)ation o )iare DESire (ard
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+
Ret*"n
errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(18($es%i"e=set=!on%i*"ation
P"otot'#e
int desire9set9(oni,urationBint d
F*n!tion
(oni,ure )iare DESire (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
option
(oni,uration i nor)ation o ption
en
(oni,uration inor)ation en,th
ino
(ontent o (oni,uration inor)ation
0
operatesu((ess
Ret*"n
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(1@($es%i"e=%"ee=eo"'
P"otot'#e
int desire9ree9)e)or+Bint d
F*n!tion
,et the sie o the avaia5e )e)or+ spa(e o )iare DESire (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
reesie(ou tput)
sie o the re)ainin, avaia5e spa(e o )iare DESire (ard
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+
Ret*"n
errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(20($es%i"e=et=!a"$=*i$
P"otot'#e
int desire9,et9(ard9uidBint d
F*n!tion
,et %D inor)ation o )iare DESire (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
uid ( output
%D inor)ation that )iare DESire (ard returns< 5+tes
Ret*"n
) 0
-1
operatesu((ess Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(21($es%i"e=et=%i$s
P"otot'#e
int desire9,et9idsBint d
F*n!tion
,et (urrent su5-appi(ation=s ie id inor)ation o )iare DESire (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
nu) 5 outpu
ie nu)5er o appi(ation
t=
Ret*"n
id 5 output =
id inor)ation o ie<1 5+te ever+ ie
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(22($es%i"e=et=iso=%i$s
P"otot'#e
int desire9,et9iso9idsBint d
F*n!tion
,et (urrent su5-appi(ation=s ie iso id inor)ation o )iare DESire (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
nu) ( outpu
ie nu)5er o appi(ation
t)
Ret*"n
id ( output ) 0
ie iso id inor)ation< 2 5+tes ever+ ie
-1
Operate aiure< pease ,et the a(tua error (ode 5+
operatesu((ess errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(2+($es%i"e=et=%iesettin
P"otot'#e
int desire9,et9iesettin,Bint d
F*n!tion
,et the desi,nated ie=s inor)ation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ieno
ienu)5er
iesettin, ( output)
returned ie inor)ation
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+
Ret*"n
errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(2,($es%i"e=!.ane=%iesettin
P"otot'#e
int desire9(han,e9iesettin,sBint d
ne'9(han,e9a((ess9;e+noC F*n!tion
)odi+ ie attri5ute inor)ation
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ie nu)5er
(o))9set
trans)ission )ode o the ie < vaues are as oo': 0700 ---- painte7t trans)ission 0703 ---- (ipherte7t trans)ission 0701 ---- trans)ission 'ith &A!
od9(han,e9a((ess9;e+no
od ;e+ nu)5er that is needed to 5e (ertii(ated 'hen )odi+in, ;e+
ne'9read9a((ess9;e+no
ne' ; e+ n u)5er t hat i s n eed t o 5e (ertii(ated 'hen readin, ie
ne'9'rite9a((ess9;e+no
ne' ;e + nu )5er th at is n eed to 5e (ertii(ated 'hen 'ritin, ie
ne'9read9'rite9a((ess9;e+no
ne'9(han,e9a((ess9;e+no
ne' ;e+ nu)5 er that is need to 5e (ertii(ation 'hen readin, and 'ritin, ie ne' ;e+ nu)5er that is n eed to 5e (ertii(ated 'hen )odi+in, ;e+
Ret*"n
0
operate su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE : error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(2($es%i"e=!"eate=st$=$ata%ie
P"otot'#e
int desire9(reate9std9dataieBint d
F*n!tion Pa"aete"?
(reate ,enera data ie d opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
ieno
ie nu)5er
ieino
,enera data ie inor)ation
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(2:($es%i"e=!"eate=&a!6*#=$ata%ie
P"otot'#e
int desire9(reate95a(;up9dataieBint d
F*n!tion
(reate a 5a(;up data ie
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ie nu)5er
ieino
5a(;up data ie inor)ation
0
operatesu((ess
Ret*"n
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he( ; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(29($es%i"e=!"eate=va*e%ie
P"otot'#e
int desire9(reate9vaueieBint d< uint9t ieno< (onst desire9vaue9ie9ino RieinoC
F*n!tion
(reate vaue ie
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ie nu)5er
Ret*"n
ieino
vaue ie inor)ation
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he( ; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(28($es%i"e=!"eate=inea"="e!o"$%ie
P"otot'#e
int desire9(reate9inear9re(ordieBint d
(onst desire9re(ord9ie9ino RieinoC F*n!tion
(reate inear o, ie
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ie nu)5er
ieino
inear o, ie inor)ation
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno:
Ret*"n
E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he( ; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(2@($es%i"e=!"eate=!'!i!="e!o"$%ie
P"otot'#e
int desire9(reate9(+(i(9re(ordieBint d
F*n!tion
(reate (+(e o, ies
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ie nu)5er
Ret*"n
ieino
(ir(uar o, ie inor)ation
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+0($es%i"e=$eete=%ie
P"otot'#e
int desire9deete9ieBint d
F*n!tion
deete a ie
Pa"aete"?
d
Ret*"n
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ie nu)5er
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+1($es%i"e="ea$=$ata
P"otot'#e
int desire9read9dataBint d< uint9t ieno< uint9t (o))9set< uint329t oset< uint329t en< uint329t Routen< void RdataoutC
F*n!tion
read data ro) ,enera data ie or 5a(;up data ie
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ienu)5er
(o))9set
trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission 0703 ----- (ipherte7t trans)ission
0701 ----- trans)ission 'ith &A! verii(ation
Ret*"n
oset
readstartaddress
en
e7pe(ten,ththat'i5eread
outen(output)
a(tua data en,th that have 5een read
dataout ( output )
a(tua data that have 5een read
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+2($es%i"e=7"ite=$ata
P"otot'#e
int desire9'rite9dataBint d< uint9t ieno< uint9t (o))9set< uint329t oset< uint329t en<
F*n!tion
(onst void RdatainC 'rite data into ,enera data ie or into 5a(;up data ie
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ieno
ienu)5er
(o))9set
trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission 0703 ----- (ipherte7t trans)ission 0701 ----- trans)ission 'ith &A! verii(ation
oset
start address that 'i 5e 'ritten
en
data en,th that 'i 5e 'ritten
datain
data that 'i 5e 'ritten
Ret*"n
0
operatesu((ess
-1
Operate aiure< p ease ,et t he a (tua error (ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(++($es%i"e=et=va*e
P"otot'#e
int desire9,et9vaueBint d
F*n!tion
,et the vaue o the spe(iied ie
Pa"aete"?
d ieno (o))9set
opened devi(e ie nu)5er that )i9open un(tion returns ienu)5er trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission 0703 ----- (ipherte7t trans)ission 0701 ----- trans)ission 'ith &A! verii(ation
vaue ( output Ret*"n
) 0
vaue sie o the vaue ie operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& :Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+,($es%i"e=!"e$it
P"otot'#e
int desire9(reditBint d
F*n!tion
re(har,e operation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ieno
ienu)5er
(o))9set
trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission 0703 ----- (ipherte7t trans)ission 0701 ----- trans)ission 'ith &A! verii(ation
Ret*"n
vaue
sie o re(har,e
0
operatesu((ess
-1
Operate aiure< p ease ,et t he a (tua error (ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+($es%i"e=$e&it
P"otot'#e
int desire9de5itBint d
F*n!tion
dedu(t vaue operation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ieno
ienu)5er
(o))9set
trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission 0703 ----- (ipherte7t trans)ission 0701 ----- trans)ission 'ith &A! verii(ation
vaue Ret*"n
0
Vaue to dedu(t operatesu((ess
-1
Operate aiure< p ease ,et t he a (tua error (ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data : !ard doesn=t (o)p+ 'ith %SO13
EP*OO
standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+:($es%i"e=iite$=!"e$it
P"otot'#e
int desire9i)ited9(reditBint d
F*n!tion
i)ited re(har,e operation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ieno
ienu)5er
(o))9set
trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission
uint329t vaueC
0703 ----- (ipherte7t trans)ission 0701 ----- trans)ission 'ith &A! verii(ation Ret*"n
vaue
sieore(har,e
0
operation
-1
Operate aiure< p ease ,et t he a (tua error (ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+9($es%i"e=7"ite="e!o"$
P"otot'#e
int desire9'rite9re(ordBint d< uint9t ieno< uint9t (o))9set< int oset< int en< (onst void RinoC
F*n!tion
'rite o, operation
Pa"aete"?
d
opened d evi(e ie n u)5er t hat ) i9open un(tion returns
ieno
ienu)5er
(o))9set
trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission 0703 ----- (ipherte7t trans)ission 0701 ----- trans)ission 'ith &A! verii(ation
Ret*"n
oset
start address o (urrent o,
en
en,th o data that 'i 5e 'ritten
ino
o, inor)ation that 'i 5e 'ritten
0
operatesu((ess
-1
Operate aiure< p ease ,et t he a (tua error (ode 5 + errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO
: !ard doesn=t (o)p+ 'ith %SO13
standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+8($es%i"e="ea$="e!o"$s
P"otot'#e
int desire9read9re(ordsBint d< uint9t ieno< uint9t (o))9set< uint329t re(ordsie< int irst< int nu)< uint329t Routen< void RinoC
F*n!tion Pa"aete"?
read o, operation d
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
ieno
ienu)5er
(o))9set
trans)ission )ode< vaues are as oo': 0700 ----- painte7t trans)ission 0703 ----- (ipherte7t trans)ission 0701 ----- trans)ission 'ith &A! verii(ation
re(ordsie
en,th o o,
irst
irst o, nu)5er that 'i 5e read
nu)
(ounto o,s that'i 5eread
outen ( output ) ino(output)
tota en,th o data that have 5een read
0
o, inor)ation that have 5een read operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO : !ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(+@($es%i"e=!ea"="e!o"$%ie
P"otot'#e
int desire9(ear9re(ordieBint d
F*n!tion
(ear a re(ord ies
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
ieno
ie nu)5er
0
operatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error
Ret*"n
E!O&& : Parit+ error or !*! (he(; a error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA :(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode >e
NEW210
a##i!ation in Notes
1、Pease reer to desire.h。
(11(,(,0($es%i"e=!oit=t"ansa!tion
P"otot'#e
int desire9(o))it9transa(tionBint dC
F*n!tion
(onir) and save a reated operations on (urrent appi(ation=s ies
Pa"aete"? Ret*"n
d 0
opened devi(e ie nu)5er that )i9open un(tion returns operate su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: E%NVA" :input para)eter error E%O :read (ard (hip error E!O&& : Parit+ error or !*! (he(; error o (ard returned data EP*OO :!ard doesn=t (o)p+ 'ith %SO13 standard EMADE :error o en,th o (ard returned data E%&E :ti)eout return ENODAA : (ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
(11(,(,1($es%i"e=a&o"t=t"ansa!tion
P"otot'#e
int desire9a5ort9transa(tionBint dC
F*n!tion
undo reated operations on (urrent appi(ation=s ies
Pa"aete"?
d
opened devi(e ie nu)5er that )i9open un(tion returns
Ret*"n
0 E%NVA"
operate su((ess inputpara)etererror
E%O
read(ard(hiperror
E!O&&
Parit+ error or !*! (he(; error o (ard returned data
EP*OO
!ard doesn=t (o)p+ 'ith %SO13 standard
EMADE
datao(ardreturnederror
EA!!ES
(ard in indu(tive is not a )iare DESire (ard or (ard had not 5een a(tivated
E%&E
ti)eoutandnoreturn
othervaue S*##o"t
NEW210
Notes
1、Pease reer to desire.h。
othererror(ode
(12( AT2,C !a"$ o$*e inte"%a!e
(12(1( at2,=o#en P"otot'#e
int at29openBint dC
F*n!tion
a(tive A277 series (ard o the desi,nated %! (ard sot
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
Ret*"n
0
a(tive operate su((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EN%O: do not e7ist A277 (ard in (ard sot other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to at277.h。
(12(2( at2,="ea$ P"otot'#e
int at29readBint d
F*n!tion
read inor)ation ro) A277 (ard
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot un(tion returns
(ard9t+pe
A2 (ard t+pe< reer to note
start9addr
start address
en
en,th o data that 'i 5e read
data ( out
read data
put) Ret*"n
0
readoperatesu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno: EN%O: do not e7ist A277 (ard in (ard sot E%NVA" :input para)eter error E%&E :ti)eout other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to at277.h。
(12(+( at2,=7"i te P"otot'#e
int at29'riteBint d
F*n!tion
'rite data into A277 (ard
Pa"aete"?
d
opened d evi(e ie n u)5er t hat i ((ard9open9(ardsot un(tion returns
(ard9t+pe
A2 (ard t+pe< reer to note
start9add
start address
r
Ret*"n
en
en,th o data that 'i 5e 'ritten into
data
data that is 'ritten into
0
'riteoperatesu((ess
-1
Operate aiure< p ease , et t he a (tua e rror ( ode 5 + errno: EN%O: do not e7ist A277 (ard in (ard sot E%NVA" :input para)eter error E%&E :ti)eout other vaue : other error (ode
S*##o"t
NEW210
Notes
1、Pease reer to at277.h。
(12(,( at2,=!ose P"otot'#e
int at29(oseBint dC
F*n!tion
!ose A2 series (ard
Pa"aete"?
d
opened devi(e ie nu)5er that i((ard9open9(ardsot
Ret*"n
0
un(tion returns po'erosu((ess
-1
Operate aiure< pease ,et the a(tua error (ode 5+ errno
S*##o"t
NEW210
Notes
1、Pease reer to at277.h。
(1+( Mo$e &ode) supports 12005ps and 2005ps s+n( dia< supports up to 330005ps as+n( dia< supports ppp dia.
Pease reer to PPPLoin PPPLoo* t an$ PPPC.e!6 to ,et the inor)ation or ppp dia. he oo'in, introdu(e the s+n( dia and as+n( dia.
(1+(1( Co""eative Ma!"o $e%inition o% t.is o$*e? Mo$e stat*s
De%inition &ODE&9SAE9NO9%N%
Des!"i#tion &ode) has not 5een initiaied< or %nitiaied aied. % initiaied su((essu+< )ode) 'i turn to &ODE&9SAE9NO9SE9&ODE auto)ati(a+.
&ODE&9SAE9NO9SE9&ODE
&ode) has 5een initiaied su((essu+< 5ut the )ode has not 5een set. At this state< appi(ation is per)itted to set dia para)eters. % the para)eters are set su((essu+< )ode) 'i &ODE&9SAE9D%S!ONNE!.
&ODE&9SAE9S$N!9&ODE
turn
to
he 5a(;,round is handin, ater the )ode is set to s+n( dia. % handed su((essu+< )ode) 'i turn to &ODE&9SAE9D%S!ONNE! auto)ati(a+.
&ODE&9SAE9AS$N9&ODE
he 5a(;,round is handin, ater the )ode is set to as+n( dia. % handed su((essu+< )ode) 'i turn to &ODE&9SAE9D%S!ONNE! auto)ati(a+.
&ODE&9SAE9D%S!ONNE!
&ode) is di s(onne(ted. %n thi s state< app i(ation is per)itted to dia< set dia para)eters< set sd( para)eters or dia o.
&ODE&9SAE9WA%%N#
&ODE&9SAE9DA%"%N#
&ode) turns to dia in state< 'aitin, or dia in. At this state< )ode) (an return to &ODE&9SAE9D%S!ONNE! via dia o or e7it dia in )ode. &ode) is d iain,. % d ias su ((essu+< )o de) turns to &ODE&9SAE9!ONNE!9SD"! Bs+n( )odeC< or turns to &ODE&9SAE9!ONNE! Bas+n( )odeC dire(t+. &ode) (an return &ODE&9SAE9D%S!ONNE! via dia o.
&ODE&9SAE9!ONNE!9SD"!
to
&ode) (onne(ts su((essu+< and the sd( is handsha;in,. % handsha;es su((essu+< )ode) 'i turn to &ODE&9SAE9!ONNE!< other'ise< it 'i turn &ODE&9SAE9D%S!ONNE!.
to
&ODE&9SAE9!ONNE!
he data in; is (onne(ted su((essu+. Appi(ation is per)itted to send>re(eive data in this state. % dias o< )ode) 'i return to &ODE&9SAE9D%S!ONNE!.
Mo$e state t"ansition $ia"a?
Dia o$es?
De%inition
Des!"i#tion
&ODE&9DA%"9D&
D&) ode
&ODE&9DA%"9P"SE
P"SE )ode
Mo$e !o*ni!ation o$es?
De%inition
Des!"i#tion
&ODE&9!O&&9AS$N!
As+n( )ode
&ODE&9!O&&9S$N!
S+n( SD"! )ode
Mo$e s#e!ia "et*"ns !o$es?
De%inition
Des!"i#tion
&ODE&9E**NO9O/
O/
&ODE&9E**NO9!ONNE!
"in; (onne(ted
&ODE&9E**NO9E**O*
*esponse error o A(o))and
&ODE&9E**NO9MS$
&ode)is5us+
&ODE&9E**NO9NO9D%A"ONE
No dia tone
&ODE&9E**NO9NO9!A**%E*
No (arrier
&ODE&9E**NO9NO9"%NE
Noinein
&ODE&9E**NO9NO9ANSWE*
No ans'er
&ODE&9E**NO9O9HOO/
Hand up 5+ the peer
&ODE&9E**NO9"%NE9%N9SE
"ine in use
&ODE&9E**NO9N9OMA%NAM"E
no5taina5e
&ODE&9E**NO9"%NE9*EVE*SA"
"ine reversa
&ODE&9E**NO9EENS%ON9%N9SE
E7tension phone is in use
Pease reer to the other return (odes in Kerror.hL Mo$e !onne!tin &a*$ "ate $e%inition?
De%inition
Des!"i#tion
&ODE&9!ONNE!91200MPS
12005ps
s+n(>as+n(
&ODE&9!ONNE!9200MPS
2005ps
s+n(>as+n(
&ODE&9!ONNE!900MPS &ODE&9!ONNE!9200MPS
005ps 2005ps
as+n( as+n(
&ODE&9!ONNE!9800MPS
8005ps
as+n(
&ODE&9!ONNE!912000MPS
120005ps
as+n(
&ODE&9!ONNE!9100MPS
1005ps
as+n(
&ODE&9!ONNE!9100MPS
1005ps
as+n(
&ODE&9!ONNE!918200MPS
182005ps
as+n(
&ODE&9!ONNE!92100MPS
21005ps
as+n(
&ODE&9!ONNE!92000MPS
20005ps
as+n(
&ODE&9!ONNE!9200MPS
2005ps
as+n(
&ODE&9!ONNE!9200MPS
2005ps
as+n(
&ODE&9!ONNE!931200MPS
312005ps
as+n(
&ODE&9!ONNE!93300MPS
33005ps
as+n(
&ODE&9!ONNE!9000MPS
0005ps
as+n(
&ODE&9!ONNE!94000MPS
40005ps
as+n(
Co*nt"' !o$e IDs?
!ountr+ (ode %Ds are deined in K)ode)9ia(e.hL< %t=s deined as &ode)*e,ionB\C< or e7a)pe< !hina deined as &ode)*e,ionB C.inaC.
(1+(2( $ata st"*!tion t+pede stru(t U int int int int
(onne(t9)ode6 (onne(t9speed6 dia9)ode6 dia9pause6
int int int *e,ion!ode9t
dia9ti)eo6 ide9ti)eo6 e7tension9(h;6 re,ion6
int reservedT6 X &ode)DiaPar)s9t6 his stru(ture is used to set )ode) dia para)eters. he )e)5er is deined as oo'in,: (onne(t9)ode: &ODE&9!O&&9AS$N! > &ODE&9!O&&9S$N! (onne(t9speed: Point out the e7pe(ted speed< reer to the deinition dia9)ode: &ODE&9DA%"9D& > &ODE&9DA%"9P"SE dia9pause: pause ti)e i there is [<= in the dia nu)5er strin, Bunit: se(ondC dia9ti)eo: ide9ti)eo:
Set the ti)eout o dia Bunit: se(ondC i)eout o ide. When there is no data send>re(eive in set ti)eout< )ode)
'i dia o auto)ati(a+. Set to 0 disa5e ide dete(t. e7tension9(h;: 1-(he(; 'hether the e7tension phone is in use 5eore dia6 0-don=t (he(; re,ion:
reserved:
!ountr+ (ode %Ds< in dierent (ountries or re,ions< the )odua5iit+ o teephone ine )a+ 5e dierent too< so +ou shoud set (ountr+ (ode in here. set to 0
T.e st"*!tion %o" sen$ AT !oan$ $i"e!t'?
t+pede stru(t U int19t uint9t
ti)eo6 reservedT6
(har
()d24T6
(har )a+5e0T6 (har rsp102T6 X &ode)At!)d9t6 ti)eo: ti)eout o 'aitin, A (o))and response< 0-;eep 'aitin,< K 0- don=t 'ait or reserved:
response had 5etter set to 0
()d: )a+5e:
A (o))and strin,< su(h as GAH0G he possi5e ;e+ 'ords o the response strin,< su(h as 2 0 700 indi(ate the
rps:
end o strin, or U[O=< [/=< [0=< [E=< [*=< [*=< [O=< [*=< [0=< [0=X to store the response ro) the )ode)
he stru(tion o SD"! para)eters: t+pede stru(t U unsi,ned int t16 unsi,ned int t26 unsi,ned int n26 unsi,ned int n2(ount6 unsi,ned int 'indo'6 unsi,ned int state6 unsi,ned int )ode6 X &ode)Sd(Par)s9t6 t1: he ti)eout o 'aitin, response ater send data. % ti)eout< the data 'i 5e t2: n2:
sent a,ain. he ti )eout o 'a itin, th e (o nir)ed a (;no'ed,e t he da ta r o) th e re(eiver. % ti)eout< the ** ra)e 'i 5e sent to report the )ode) status. *eate t o t 1< t he ) a7 t i)es i)it o r esend. % r ea(hed< t he in; ' i 5 e
'indo':
(osed. *eate to t1< the ( urrent resend ti)es % n2(ount LI n 2< the in; 'i 5e (osed. he nu)5er o sidin, 'indo's ran,e 1-T
state: )ode:
the (urrent status o sd( proto(o Bit is not re(o))ended to (han,eC the (urrent )ode o sd( proto(o Bread on+C
n2(ount:
his stru(ture is used to set>,et SD"! para)eters. he in(orre(t settin, 'i ead the proto(o 'or;s a5nor)a+. % +ou don=t ;no' the proto(o (ear+< pease don=t use this un(tion.
(1+(+( o$e=o#en P"otot'#e?
int )ode)9openB(onst (har Rpathna)e< int oa,sC
F*n!tion?
Open the )ode) devi(e< ,et the hande o )ode).
Pa"aete"?
pathna)eB%nput
he
C oa,sB%nputC
G>dev>tt+S1GBNEW210C or F>dev>)ode)0G BNEW110C Open )ode O9*DW* *ead>'rite BreuiredC
devi(e
na)e
o
&ode)<
O9NONM"O!/ Ret*"n?
LI0
su(h
as
non-5o(;in, BoptionaC
Open s u((essu+< t he ( ode i s t he h ande ' hi(h i s used or the su5seuent operation.
K0 >e
Openaied.*eertoKerrno.hL
NEW210
A##i!a&e In? Notes?
his un(tion is sa)e as the open o POS%. he dieren(e is this un(tion (an not use (reate ie )ode. So there are on+ 2 para)eters
in this un(tion. oa, (an 5e set to O9*DW* or BO9*DW* f O9NONM"O!/C % oa, is set to O9*DW*< )ode)9'rite and )ode)9read 'i ;eep 'aitin, unti 'rite>read su((essu+. % oa, is set to BO9*DW* f O9NONM"O!/C< )ode)9'rite 'i return i))ediate+ and send data 5a(;,round6 )ode)9read on+ (he(; the re(eive 5uer in the 5a(;,round. % this un(tion returns su((ess Breturn (ode LI 0C< appi(ation needs invo;e o$e=et=stat*s to 'ait inishin, initiaiation. % inish initiaiation su((essu+< )ode) 'i turn to &ODE&9SAE9NO9SE9&ODE< other'ise it 'i turn to &ODE&9SAE9NO9%N%.
E/a#e?
E/a#e 1?
int d6 i BBd I )ode)9openBF>dev>tt+S1G< O9*DW*C K 0C U >> error X E/a#e 2?
i BBd I )ode)9openBF>dev>tt+S1G< O9*DW* f O9NONM"O!/C K 0C U >> error X
(1+(,( o$e=!ose P"otot'#e?
int )ode)9(oseBint dC
F*n!tion?
!ose the )ode) devi(e.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
Ret*"n?
0 others
!ose)ode)devi(esu((essu+. !ose aied. *eer to Kerrno.hL
>e
NEW210
o$e=o#en.
A##i!a&e In? Notes?
his un(tion is sa)e as the (ose o POS%.
E/a#e?
(1+(( o$e=7"ite P"otot'#e?
ssie9t )ode)9'riteBint d< (onst void R5u< sie9t n5+tesC
F*n!tion?
Send data via )ode). !an 5e used in s+n( and as+n( )ode.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
5uB%nputC
he 5uer point to the data to send
n5+tesB%nputC
he 5+te en,th o 5uer to send
LI0
he 5+te en,th o 5uer 'hi(h are sended su((essu+
K0
aied.%nvo;e Posi/)ete""no to ,et the detai error.
Ret*"n? >e
o$e=o#en.
NEW210
A##i!a&e In? Notes?
his un(tion is the sa)e as the 'rite o POS%. his un(tion (an 5e invo;ed at state &ODE&9SAE9!ONNE!. % the )ode) is opened 5+ O9*DW*< this un(tion 'i not return unti a data are sent inished or the in; 5ro;en. % the )ode) is opened 5+ BO9*DW* f O9NONM"O!/C< this un(ti on 'i return i))ediate+. % the 5uer is u or the in; 5ro;en< this un(tion 'i return a ne,ative (ode. % the (ode eua to -1< and Posi/)ete""no returns EA#A%N< it indi(ates that the 5uer is u< this un(tion (an not send te)porar+.
E/a#e?
(1+(:( o$e=7"ite=tieo*t P"otot'#e?
ssie9t )ode)9'rite9ti)eoutBint d< (onst void R5u< sie9t n5+tes< uint329t ti)eout)sC
F*n!tion?
Send data via )ode) 'ith spe(iied ti)eout. !an 5e used in s+n( and
Pa"aete"?
as+n( )ode. dB%nputC
he hande o )ode) 'hi(h is ,et ro)
5uB%nputC
he 5uer to send
n5+tesB%nputC
he 5+te en,th o 5uer to send
ti)eout)sB%nput
i)eout Bunit: )sC
o$e=o#en.
C Ret*"n?
>e
LI0
he 5+te en,th o 5uer 'hi(h are sended su((essu+
K0
aied.%nvo;e Posi/)ete""no to ,et the detai error.
NEW210
A##i!a&e In? Notes?
his un(tion is sa)e as o$e=7"ite e7(ept the ti)eout (an 5e spe(iied. his un(tion (an 5e invo;ed at the state &ODE&9SAE9!ONNE!. his un(tion 'i return 5eore ti)eout even i the )ode) is opened 5+ 5o(;in, )ode BO9*DW*C. Meore ti)eout< this un(tion 'i tr+ to su5)it a data to the )ode) 5uer6 % a data are su5)itted (o)pete< the un(tion returns.
E/a#e?
(1+(9( o$e=7ait=*nti=sent P"otot'#e?
int )ode)9'ait9unti9sentBint dC
F*n!tion?
Wait or a data in the send 5uer are sent (o)pet+.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
Ret*"n?
0
O/
Others
aied. *eer to Kerrno.hL
>e
o$e=o#en.
NEW210
A##i!a&e In? Notes?
he data are not sent out i))edi ate+ 'hen the appi(ation invo;es o$e=7"ite and o$e=7"ite=tieo*t. Whie the data are stored into
the send 5uer and sent in the 5a(;,round. his un(tion is used to 'ait or data sent (o)pete. his un(tion 'on=t return unti a data are sent (o)pete. %t is re(o))ended to invo;e this un(tion to )a;e sure that a data are sent out 5eore hand up or (ose )ode) devi(e. E/a#e?
(1+(8( o$e="ea$ P"otot'#e?
ssie9t )ode)9readBint d< void R5u< sie9t n5+tesC
F*n!tion?
*e(eive data via )ode). !an 5e used in s+n( and as+n( )ode.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
5uBOutputC
he ,iven 5uer to store the re(eived data
n5+tesB%nputC
he e7pe(ted re(eive 5+te en,th
LI0
he a(tua re(eived 5+te en,th
K0
aied.%nvo;e Posi/)ete""no to ,et the detai error.
Ret*"n?
>e A##i!a&e
o$e=o#en.
NEW210
In? Notes?
his un(tion is sa)e as the read o POS%. his un(tion (an 5e invo;ed at state &ODE&9SAE9!ONNE!. % the )ode) is opened 5+ O9*DW*< this un(tion 'i not return unti a pa(;et data are re(eived inished or the in; 5ro;en. % the )ode) is opened 5+ BO9*DW* f O9NONM"O!/C< this un(ti on 'i return i))ediate+. % the 5uer is e)pt+ or the in; 5ro;en< this un(tion 'i return a ne,ative (ode. % the (ode eua to -1< and Posi/)ete""no return EA#A%N< it indi(ates that the 5uer is e)pt+< this un(tion (an not re(eive te)porar+.
E/a#e?
(1+(@( o$e="ea$=tieo*t P"otot'#e?
ssie9t )ode)9read9ti)eoutBint d< void R5u< sie9t n5+tes< uint329t ti)eout)sC
F*n!tion?
*e(eive data via )ode) 'ith spe(iied ti)eo ut. !an 5e used in s+n( and as+n( )ode.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
o$e=o#en.
5uBOutputC
he ,iven 5uer to store the re(eived data
n5+tesB%nputC
he e7pe(ted re(eive 5+te en,th
ti)eout)sB%nput
i)eout Bunit: )sC
C Ret*"n? >e
LI0
he a(tua re(eived 5+te en,th
K0
aied.%nvo;e Posi/)ete""no to ,et the detai error.
NEW210
A##i!a&e In? Notes?
his un(tion is sa)e as o$e="ea$ e7(ept the ti)eout (an 5e spe(iied. his un(tion (an 5e invo;ed at the state &ODE&9SAE9!ONNE!. his un(tion 'i return 5eore ti)eout even i the )ode) is opened 5+ 5o(;in, )ode BO9*DW*C. Meore ti)eout< this un(tion 'i tr+ to re(eive the e7pe(ted data en,th ro) the )ode) 5uer6 % the e7pe(ted en,th o data is re(eived (o)pete< the un(tion returns.
E/a#e?
(1+(10( o$e=$iain P"otot'#e?
int )ode)9diain,Bint d< (onst (har RteephoneC
F*n!tion?
diain,.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
teephoneB%nputC
he teephone nu)5er strin,.
0
O/
Others
aied< reer to Kerrno.hL
Ret*"n? >e
o$e=o#en.
NEW210
A##i!a&e In? Notes?
his un(tion (an 5e invo;ed at the state &ODE&9SAE9D%S!ONNE!< and 'i return i))ediate+ 'ithout 'aitin, dia (o)pete. Appi(ation (he(;s the dia resut via o$e=et=stat*s. Ater su((essu invo;e this un(tion< )ode) turns to the state &ODE&9SAE9DA%"%N#. % dia up su((essu+< )ode) turns to the state &ODE&9SAE9!ONNE!9SD"! or &ODE&9SAE9!ONNE!. % dia up aied< )ode) turns to the state &ODE&9SAE9D%S!ONNE!< and appi(ation (an ,et the detai via o$e=et=ast=e""no. he dia )ode is de(ided 5+ o$e=set=$ia=#a"s. T.e eanins o% tee#.one n*&e"?
0-8< R< Q< A-DT Y teephone nu)5er6
> aied to invo;e un(tion \\ X
E/a#e?
or B;eepI16 ;eep6 C U i BBretva I )ode)9,et9statusB)ode)< statusCCC U >> aied to invo;e un(tion \\ 5rea;6 X i Bstatus 070000000C >> operation not (o)peted (ontinue6 s'it(h Bstatus 07C U (ase &ODE&9SAE9!ONNE!9SD"!: >> no' sd( in; (onne(tin, 5rea;6 (ase &ODE&9SAE9!ONNE!: >> O/< in; is (onne(ted ;eep I 06 5rea;6 (ase &ODE&9SAE9D%S!ONNE!: deaut: >> error< aied to (onne(t \\ ;eep I 06 5rea;6 X X
(1+(11( o$e=.an*# P"otot'#e?
int )ode)9han,upBint dC
F*n!tion?
&ode) han,s up.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
Ret*"n?
0
Han,supsu((essu+.
o$e=o#en.
Others >e
aied< reer to Kerrno.hL
NEW210
A##i!a&e In? Notes?
his un(tion (an 5e invo;ed at the state &ODE&9SAE9D%S!ONNE!< &ODE&9SAE9DA%"%N#< &ODE&9SAE9!ONNE!9SD"! or &ODE&9SAE9!ONNE!< used to han, up the ine a(tive+. % Hand up happens in 5o(;in, )ode 'hi(h )a+ spends a5out 2- se(onds. %t depends on the (urrent )ode) status. % &ode) sta+s in state o &ODE&9SAE9D%S!ONNE!< it 'i returns i))ediate+ Bess than 1 se(ondC ater (a han,up un(tion6 'hie the )ode) sta+s in &ODE&9SAE9!ONNE!< it 'i ta;e )ore ti)eB2 se(ondsC to return ater (ain, )ode)9han,up. Ater su((essu han,up< the &ode) 'i sta+s in the status o &ODE&9SAE9D%S!ONNE!.
E/a#e?
(1+(12( o$e=et=stat*s P"otot'#e?
int )ode)9,et9statusBint d< int RstatusC
F*n!tion?
#et (urrent )ode) status.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
statusBOutputC
*eturn (urrent status
0
O/
others
aied. *eer to Kerrno.hL
Ret*"n? >e
o$e=o#en.
NEW210
A##i!a&e In? Notes?
% invo;ed su((essu+< this un(tion returns (urrent )ode) status via stat*s. he )ost si,nii(ant 5it o status indi(ates 'hether the 5a(;,round operation is inished. % the )ost si,nii(ant 5it eua to 1< it indi(ates that the 5a(;,round operation is not inished< the (urrent status is not sta5e. he other 5its indi(ates the devi(e status< pease reer to the deinition.
E/a#e?
stati( int )ode)9'ait9statusBint d< int Rstate< void BR'ait9un(CBvoid RC< void Rar,C U int retva< status6 'hie B1C U i BBretva I )ode)9,et9statusBd< statusCCC
5rea;6 i Bstatus 070000000C U >R 'aittin, operation (o)peted R> i B'ait9un(C 'ait9un(Bar,C6 (ontinue6 X Rstate I status 076 5rea;6 X return retva6 X
(1+(1+( o$e=et=ast=e""no P"otot'#e?
int )ode)9,et9ast9errnoBint d< int RerrC
F*n!tion?
#et (urrent )ode) error (ode.
Pa"aete"
dB%nputC
he
hande
o
)ode)
'hi(h
is
,et
ro)
o$e=o#en.
? Ret*"n? >e
errBOutputC
*eturn (urrent )ode) error (ode.
0
O/
Others
aied< reer to Kerrno.hL
NEW210
A##i!a&e In? Notes?
his un(tion is used to ,et errno ater )ode) operates aied not used to ,et error (ode ater send>re(eive aied. &ode) operation in(udes initiaiation< set dia para)eters< dia< set auto)ati( ans'er )ode< and hand up. his un(tion (an not 5e used to ,et error (ode ater o$e=7"ite or o$e="ea$ return error Buse Posi/)ete""no to ,et the (orrespondin, (odeC. % this un(tion return 0< the error (ode is stored in err. Peas e reer to the deinition o &ODE&9E**NO97777.
E/a#e?
(1+(1,( o$e=set=$ia=#a"s P"otot'#e?
int )ode)9set9dia9par)sBint d< (onst &ode)DiaPar)s9t RdpC
F*n!tion?
Set (urrent )ode) dia para)eters.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
Ret*"n?
dpB%nputC 0
he ,iven para)eters. O/
Others
aied< reer to Kerrno.hL
>e
o$e=o#en.
NEW210
A##i!a&e In? Notes?
his
un(tion
(an
on+
5e
invo;ed
at
the
state
&ODE&9SAE9NO9SE9&ODE and &ODE&9SAE9D%S!ONNE!. Ater this un(tion returns< )ode) 'i hande the para)eters at the 5a(;,round< and )ode) is at an unsta5e state. Appi(ation need invo;es o$e=et=stat*s to 'ait or the settin, (o)pete. % set (o)pete< )ode) turns to the state &ODE&9SAE9D%S!ONNE!. E/a#e?
(1+(1( o$e=et=$ia=#a"s P"otot'#e?
int )ode)9,et9dia9par)sBint d< &ode)DiaPar)s9t RdpC
F*n!tion?
#et (urrent dia para)eters.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
dpBOutputC
se to store (urrent dia para)eters
0
O/
Others
aied< reer to Kerrno.hL
Ret*"n? >e
o$e=o#en.
NEW210
A##i!a&e In? Notes? E/a#e?
his un(tion (an on+ 5e used at the state &ODE&9SAE9NO9SE9&ODE and &ODE&9SAE9D%S!ONNE!.
(1+(1:( o$e=et=s$!=#a"s P"otot'#e?
int )ode)9,et9sd(9par)sBint d< &ode)Sd(Par)s9t RspC
F*n!tion?
#et the (urrent para)eters o SD"! proto(o.
Pa"aete"?
dB%nputC spBOutputC
Ret*"n?
he
hande
o
)ode)
'hi(h
is
,et
ro)
o$e=o#en.
he spa(e to store the para)eters.
0
O/
Others
aied< reer to Kerrno.hL
NEW210
>e A##i!a&e In? Notes? E/a#e?
(1+(19( o$e=set=s$!=#a"s P"otot'#e?
int )ode)9set9sd(9par)sBint d< (onst &ode)Sd(Par)s9t RspC
F*n!tion?
Set the para)eters o SD"! proto(o.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
spB%nputC
he ,iven para)eters.
0
O/
Others
aied< reer to Kerrno.hL
Ret*"n? S*##o"t?
NEW210
Notes? E/a#e?
(1+(18( o$e=ente"=a*to=ans7e" P"otot'#e
int )ode)9enter9auto9ans'erBint dC6
F*n!tion Pa"aete"
d(%nput)
*eturn vaue o )ode)9open
Ret*"n
0
Su((ess
o$e=o#en.
Other
aied,Pease reer Kerrno.hL
NEW210
S*##o"t Notes
5.13.1-. o$e=e/it=a*to=ans7e"
int )ode)9e7it9auto9ans'erBint dC6
P"otot'#e F*n!tion Pa"aete"
d(%nput)
*eturn vaue o )ode)9open
Ret*"n
0
Su((ess
Other
aied,Pease reer Kerrno.hL
NEW210
S*##o"t Notes
(1+(20( o$e=!.e!6=e/tension P"otot'#e?
int )ode)9(he(;9e7tensionBint dC
F*n!tion?
!he(; the (urrent status o e7tension phone.
Pa"aete"?
dB%nputC
Ret*"n?
0
E7tensionisn=tinuseBon hoo;C
&ODE&9E**NO9EENS%ON9%N9SE &ODE&9E**NO9NO9"%NE
E7tension is in use Noinein
Others
aied
hehandeo)ode)'hi(his ,et ro) o$e=o#en.
>e
NEW210
A##i!a&e In? Notes?
his un(tion is used to (he(; the ine and e7tension. Meore dia via o$e=$iain< )ode) 'i (he(; auto)ati(a+. So appi(ation needn=t
(he(; 5eore dia. E/a#e?
(1+(21( o$e=e/e!=at=!oan$ P"otot'#e?
int )ode)9e7e(9at9(o))andBint d< &ode)At!)d9t RatC
F*n!tion?
Send A (o))and dire(t+.
Pa"aete"?
dB%nputC
he hande o )ode) 'hi(h is ,et ro)
AtB%nputC
%nput: at (o))and Output: response o at (o))and
0
O/
Others
aied< reer to Kerrno.hL
Ret*"n? >e
o$e=o#en.
NEW210
A##i!a&e In? Notes? E/a#e?
his un(tion provides an intera(e to (ontro )ode) 5+ the appi(ation. Pease noti(e that this un(tion is 5o(;in, )ode. int )ode)9onhoo;Bint dC U &ode)At!)d9t at6 int en I 0< retva6 )e)setBat< 0700< sieoBatCC6 at.ti)eo I 26 snprintBat.()d< sieoBat.()dC< AH0C6 en @I snprintBat.)a+5eenT< sieoBat.)a+5eC-en< rnO/rnC6 en @I snprintBat.)a+5een@1T< sieoBat.)a+5eC-en< rnE**O*rnC6 retva I )ode)9e7e(9at9(o))andBd< atC6 return retva6 X int )ode)9ohoo;Bint dC U &ode)At!)d9t at6 int en I 0< retva6 )e)setBat< 0700< sieoBatCC6 at.ti)eo I 26 snprintBat.()d< sieoBat.()dC< AH1C6 en @I snprintBat.)a+5eenT< sieoBat.)a+5eC-en< rnO/rnC6 en @I snprintBat.)a+5een@1T< sieoBat.)a+5eC-en< rnE**O*rnC6
retva I )ode)9e7e(9at9(o))andBd< atC6 return retva6 X
(1+(22( o$e=#o7e"=!ont"o P"otot'#e
int )ode)9po'er9(ontroBint onoC
F*n!tion
!ontro the po'er supp+ o )ode)
Pa"aete"?
ono(input)
Ret*"n
0
S*##o"t
NEW210
Notes
% +ou use a dia-up &ode) or PPP< +ou need to open the )ode) po'er< and (a this un(tion to (ose the )ode) po'er ater used6
1-po'er on 0-po'er o O/
When usin, )ode) s+n(hronous > as+n(hronous (o))uni(ation< )ode)9open BC 'i auto)ati(a+ open )ode) po'er supp+< need not to (a the un(tion. E/a#e?
(1,( PPP se PPP )odue< need to (ontain head ie Fppp.hG. PPP )odue supports these authenti(ation proto(o:
PAP !HAP &S!HAP V1>V2
*eturn (ode o PPP:
Ret*"n
Reason
0
Pppd has deta(hed< or other'ise the (onne(tion 'as su((essu+ esta5ished and ter)inated at the peer=s reuest.
-100
No ppp devi(e or pppd is startin,
-1032
ppp dia is pro(essin,
-001
An i))ediate+ ata error o so)e ;ind o((urred< su(h as an essentia
s+ste) (a aiin,< or runnin, out o virtua )e)or+. -002
An error 'as dete(ted in pro(essin, the options ,iven< su(h as t'o )utua+ e7(usive options 5ein, used.
-003
Pppd is not setuid-root and the invo;in, user is not root.
-00
he ;erne does not support PPP< or e7a)pe< the PPP ;erne driver is n ot in(uded or (annot 5e oaded.
-004
Pppd ter)inated 5e(ause it 'as sent a S%#%N< S% #E*& or S%#HP si,na.
-00
he seria port (oud not 5e o(;ed.
-00
he seria port (oud not 5e opened.
-00
he (onne(t s(ript aied Breturned a non-ero e7it statusC.
-008
he (o))and spe(iied as the ar,u)ent to the pt+ option (oud not 5e run.
-010
he PPP ne,otiation aied< that is< it didn=t rea(h the point 'here at east one net'or; proto(o Be.,. %PC 'as runnin,.
-011
he peer s+ste) aied Bor reusedC to authenti(ate itse.
-012
he in; 'as esta5ished su((essu+ and ter)inated 5e(ause it 'as ide.
-013
he in; 'a s es ta5ished su ((essu+ a nd t er)inated 5e (ause th e (o nne(t ti)e i)it 'as rea(hed.
-01
!a5a(; 'as ne,otiated and an in(o)in, (a shoud arrive short+.
-014
he in; 'as ter)inated 5e(ause the peer is not respondin, to e(ho reuests.
-01
he in; 'as ter)inated 5+ the )ode) han,in, up.
-01
he PPP ne,otiation aied 5e(ause seria oop5a(; 'as dete(ted.
-01
he init s(ript aied Breturned a non-ero e7it statusC.
-018
We aied to authenti(ate ourseves to the peer.
5.14.1.
pppopen
P"otot'#e
int ppp9openB(onst (har Rdevna)e< (onst (har R(hat< (onst (har Ruser< (onst (har Rpass'd< uint329t auth< int ti)eoutC
F*n!tion
5uid PPP in;in,
Pa"aete"?
devna)e
devi(e 'hi(h is used to 5uid ppp in;in,< or e7a)pe )ode) use G>dev>tt+S1G
(hat
intera(tive s (ript ' hi(h i s u sed t o p pp d iain,< r eer t o note
user
(ertii(ate needed user na)e
pass'd
(ertii(ate needed pass'ord
auth
authenti(ation: PPP9A"#9PAP PPP9A"#9!HAP PPP9A"#9&S!HAPV1 PPP9A"#9&S!HAPV2
ti)eout
ti)eout< unit: se(ond
Ret*"n
0 other
operatesu((ess returned (ode o operate aiure
S*##o"t
NEW210
Notes
(hat is ppp diain, intera(tive e7e(ute s(ript < e7a)pes o (hat s(ript is 5eo' &ODE& PPP (hat: (har )ode)9(hat9ieT I U AMO* JNO !A**%E*J AMO* JNO D%A"ONEJ AMO* JE**O*J AMO* JNO ANSWE*J AMO* JMS$J %&EO J0J JJ JA]J JO/J JAH0J
n n n n n
n
n
JO/J JAD818J J!ONNE!J JJ
n n
n X6 %&EO ine a5ove )eans diain, ti)eout< i (an not (onne(t to ppp in; unti ti)eout< then this ppp diain, 'i stop. AD818 )eans the nu)5er o ppp diain, is 818. hese A start is )ode)=s initiaiation (o))and< it 'i need to (oni,ure dierent (o))and a((ordin, to a(tua (ondition. #P*S PPP (hat (har ,prs9(hat9ieT I U AMO* JNO !A**%E*J AMO* AMO* AMO* AMO*
JNO D%A"ONEJ JE**O*J JNO ANSWE*J JMS$J
n n n n n
AMO* J%nvaid "o,inJ n AMO* J"o,in in(orre(tJ n %&EO J0J n JJ JA]J n JO/J
JA@!#D!ONI1<%P<!&NEJ n
JO/J JADR88RRR1QJ J!ONNE!J JJ
n n
X6 he sa)e as )ode) ppp< A start is a )odue initiaiation (o))and< the ine 5eore !ONNE! is nu)5er o PPP diain, :R88RRR1Q !D&A PPP (hat (har (d)a9(hat9ieT I U AMO* AMO* AMO*
JNO !A**%E*J JNO D%A"ONEJ JE**O*J
AMO* JNO ANSWE*J AMO* JMS$J %&EO J0J JJ JA]J JO/J JAH0J JO/J JADQJ J!ONNE!J JJ
n n n n n n n n n n
X6 he sa)e as )ode) ppp< A start is a )odue initiaiation (o))and< the ine 5eore !ONNE! is nu)5er o PPP diain, :Q E7a)pes a5ove is a e7a)pes o ppp diain, in (hina )ainand< i in other (ountries or re,ions< it 'i need to (oni,ure it a,ain on the 5asis o o(a (ondition. W.en MODEM PPP &e *se$ t.e !o*ni!ation $evi!e is G
>dev>tt+S1G; W.en )PRS3CDMA PPP &e *se 'o* s.o*$ !a 'net9,et)odino to o&tain t.e $ia $evi!e naeH Pppdev 'net9)odueino9t )odino6 )e)setB)odino< 0< sieoB'net9)odueino9tCC6 % B'net9,et)odinoB)odinoCC U >> 错误处理 X ...... *etva I ppp9openB)odino.Pppdev< ,prs9(hat9ie< F(ardG< F(ardG< PPP9A"#9PAP< 4C6 ......
(1,(2( ###=!ose P"otot'#e
int ppp9(oseB(onst (har Rdevna)eC
F*n!tion
(ose 5uit ppp in;in,
Pa"aete"?
devna)e
devi(e 'h i(h i s u sed t o 5u id pp p in;in,< o r e7 a)pe )ode) use G>dev>tt+S1G
Ret*"n
0
(ose su((ess< ppp in;in, 'i d is(onne(t
-ENEDOWN
is not e7ists ppp in;in,Bdo not 5uid ppp in;in,C
other
other error return (ode
S*##o"t
NEW210
Notes
% the appi(ation does not need to use ppp in;in, an+ )ore< +ou had 5etter (a this un(tion to 5rea; ppp in;in,< to avoid additiona (o))uni(ation (osts.
(1,(+( ###=!.e!6 P"otot'#e
int ppp9(he(;B(onst (har Rdevna)eC
F*n!tion
(he(; ppp in;in, state
Pa"aete"?
devna)e
devi(e ' hi(h i s u sed t o 5 uid p pp in;in,< or e7a)pe )ode) use G>dev>tt+S1G
Ret*"n
0
ppp in; have 5een 5uit< (an (o))uni(ate nor)a+
-PPP9"%N/9M%"D%N#
ppp in; is 5ein, 5uit.
-ENEDOWN
is not e7ists ppp in;
other
othererrorreturn(ode
S*##o"t Notes
NEW210
(1,(,( ###=set=$ns P"otot'#e
int ppp9set9dnsBint )odeC
F*n!tion
set a ne' DNS sever address
Pa"aete"?
)ode
0
re(overtheori,inadns server address
other
set assi,ned ppp in; dns address o (urrent dns server address
Ret*"n
0
S*##o"t
NEW210
Notes
his un(tion )ust 5e (aed ater ppp in; is su((essu 5uitB(a it ater have (aed ppp9(he(; and return 0C< ater set it a dns 'i 5e parsed 5+ ppp in; assi,ned dns server. % have (osed ppp in;< deveoper )ust (a this un(tion to re(over previous dns server address=s (oni,uration.
(1( )PRS3CDMA
(1(1( Ret*"n Co$es QdeineWNE9O/
B0C
Qdeine WNE9D"OPEN9E** Qdeine WNE9D"S$&9E** Qdeine WNE9%N%9E** Qdeine WNE9NO%N%9E** Qdeine WNE9PA*A&9E**
B-000C>>open i5777.so err B-001C>>,et un(tion point ro) i5777.so err B-002C>>'net init err B-003C>>'net do not init B-00C>>para) err
Qdeine WNE9#E9OP9E** Qdeine WNE9NO9N9E** Qdeine WNE9POWE*9DOWN9E** Qdeine WNE9MEEN9SE9E**
B-004C>>,et ,et9operation stru(t err B-00C>>not the un(tion 'hi(h 5eed (a B-00C>>'ent po'er do'n err B-00C>>'net have 5een userd no'
Qdeine WNE9SSPEND9E**
B-008C>>'net have 5een suspend no'
>>or si) (ard Qdeine WNE9S%&9NO%NSE*9E** Qdeine WNE9S%&9P%N9E** Qdeine WNE9S%&9P/9E**
B-010C>>si) (ard had not insert B-011C>>si) (ard pin err B-012C>>si) (ard pu; err
Qdeine WNE9NO9&OD"E9E**
B-4000C>>not 'n et )o due
Qdeine Qdeine Qdeine Qdeine
B-4001C>>re(eive ro) 'net ti)eout B-4002C>>user (a n(e B-4003C>>not used B-400C>>re(eive data ro) ' net e rr
WNE9*E!V9%&EO9E** WNE9SE*9!AN!E"9E** WNE9*E!V9DAA9E** WNE9&OD9*ESP9E**
Qdeine WNE9SEND9DAA9E** Qdeine WNE9!O&&9OPEN9E** Qdeine WNE9S&S9D%V9E**
B-4004C>>send data to 'net err B-400C>>series port open e rr B-400C>>not used
>>or ,prs net'or; Qdeine WE9DEA!HED9E** Qdeine WNE9AA!H%N#9E** station.
B-400C>> Detta(hed B-4008C>> the )odue is oo;in, or the 5ase
Qdeine WNE9AMNO*&A"9E** B-4010C>> a5nor)a error Qdeine WNE9!S^WEA/9E** B-4011C>> the si,na is too 'ea;< pease (he(; the antenna >>or phone Qdeine WE9E&E*#EN!$9E** B-4012C >> S%&>%& is in e)er,en(+ status Qdeine WE9*%N#9E** B-4013C >> dete(t rin,in, Qdeine WE9MS$9E** B-401C >> dete(t (a in pro,ress Qdeine WE9D%A"%N#9E** Qdeine WE9PPP9%NVA"%D9E**
B-4014C B-401C
>> diain, >> ppp (onne(t disa5e
>>or as+n( un(tion invo;e Qdeine WNE9AP%9*NN%N# (o)pete
B-001C >>have a api runnin,
Qdeine WNE9AP%9#E%N#9DAA B-002C>>ast api do not ,et the retva and outpu t data < so (an not e7e( (ur apiBuse or reuest api un(tionC Qdeine WNE9AP%9%NDE9E** errBuse or (he(; api un(tionC Qdeine WNE9AP%9&E&O*$9E**
(1(2( St"*!t*"e t+pede stru(tU int ar(n6 int r7ev6 int 5si(6 int (e9id6 int a(6 int )n(6 int )((6 int ai*ev4T6 XtMaseStation#P*S6
t+pede stru(tU int Mand!ass6
B-003C>>the api inde7 is not (ur api inde7 or pid B-00C>>)e)(or+ err Be, :)ao( aiedC
int !hanne6 int S%D6 int N%D6 int MaseStationP*ev6 int PiotPNoset6 int MaseStation%D6 int Sot!+(e%nde76 int *a'E(%o6 int *7Po'er6 int 7Po'er6 int 7Ad6 XtMaseStation!D&A6
t+pede stru(tU int ia,6 >> 1:#P*S< 2:!D&A unionU tMaseStation#P*S o#prs6 tMaseStation!D&A o!d)a6 X Wnet6 XtMaseStation6
t+pede stru(tU unsi,ned (har 5+"en,th6
>> nu)5er en,th
unsi,ned (har 5++pe6 >> t+pe<0781:internationa< 071:%nand unsi,ned (har a5+Nu)5er30T6 >> nu)5er (ontent Xte%no6
t+pede stru(tU (har strS(aT6 >> server (entra te nu)5er (har strDstAddrT6 >> Destination address unsi,ned (har 5+Pid6 >> Proto(o %D< the deaut vaue is 0700 unsi,ned (har 5+D(s6 >> De(ord Standard unsi,ned (har 5+niue%D6 >> De(ord Standard unsi,ned (har 5+pVp6 >> S&S Vaidit+ Period unsi,ned (har a5+Pdu+pe&A9S&S9N&ME*T6 >> PD t+pe int ai!ontent"en,th&A9S&S9N&ME*T6 >> the en,th o s)s (ontent int ai!o)press"en,th&A9S&S9N&ME*T6 >> the en,th o s)s (ontent (har str!ontentData&A9S&S9N&ME*RPD9S&S9!ONEN9"EN#HT6 the (ontent o s)s unsi,ned (har a5+*ev2T6 XtPduS)sSend6
>>
>>
t+pede stru(tU int inde76 >> the inde7 in the s)s )e)or+ (har strS(ts1T6 >> the ti)e o s)s server< i;e 120321240032 --- 2012-03-2 1:24:00 32 (har strS(aT6 >> server (entra te nu)5er (har strOaT6 >> Orient address unsi,ned (har 5+Status6 >> 0:*E! N*EAD< 1:*E! *EAD< 2:SO NSEN< 3:SO SEN< :A"" unsi,ned (har 5+Pdu+pe6 >> PD t+pe unsi,ned (har 5+Pid6 >> Proto(o %D unsi,ned (har 5+D(s6 >> De(ord Standard int i!ontent"en,th6 >> the en,th o s)s (ontent (har str!ontentData33T6 >> the (ontent o s)s XtPduS)s*e(v6
t+pede stru(tU int inde76 >> the inde7 in the s)s )e)or+ unsi,ned (har a5+i)eT6 >> the ti)e o s)s server< or)at:$$&&DDHH&&SS]]< ]] is one >> i;e 7127037271724700732700 --- 2012-03-2 1:24:00 32 te%no oS(a6 >> server (entra te nu)5er te%no oOa6 >> Orient address >> Su(h as 704710707----L100 >> Su(h as 70d77178277707----L1820 unsi,ned (har 5+Status6 >> 0:*E! N*EAD< 1:*E! *EAD< 2:SO NSEN< 3:SO SEN< :A"" unsi,ned (har 5+!ur%te)6 >> ro) 0 to otaNu)-1 unsi,ned (har 5+otaNu)6 >> otaNu) LI 1 unsi,ned (har 5+De(odeStandard6>> 0700:AS!%%6 070:!S2BN%!ODE 1C6 070:He7 data int iS)s"en,th6 >> the en,th o s)s (ontent unsi,ned (har a5+niue%D2T6 >> S&S uniue %D (har stS)sData10T6 >> the (ontent o s)s XtS)s*e(v6 >> 24 5+tes t+pede stru(tU te%no oS(a6 >> server (entra te nu)5er te%no oDstAddr6 int iS)s"en,th6 >> the en,th o s)s (ontent unsi,ned (har a5+S)sData300T6 >> the (ontent o s)s >> AS!%% &a7in en,th 300 5+tes
>> !S2 &a7in en,th 20 5+tes >> He7 &a7in en,th 20 5+tes
>R
unsi,ned (har 5+pVp6 >> S&S Vaidit+ Period P-VP vaue Vaidit+ period vaue
0700 to 07 BP-VP @ 0701C R 0704 )inutes hoursC
Bi.e. 4 )inutes intervas up to 12
0780 to 07a 070( hours @ BBP- VP - 07C R 071e )inu tesC 07a to 07( BP-VP - 07aC R 0701 da+ 07(4 to 07 BP-VP - 07(0C R 0701 'ee; R> unsi,ned (har 5+De(odeStandard6 >> 0700:AS!%%< 070:!S2BN%!ODE 1C< 070:He7 data unsi,ned (har 5+Staus*eport6 >> 1:need report send status< 0:not need report send status unsi,ned (har a5+*ev21T6 >> XtS)sSend6 >>
(1(+( 7net=#o7e"=o n P"otot'#e
int 'net9po'er9onBvoidC
F*n!tion
Po'er on the #P*S>!D&A )ode
In#*t
None
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
&ust (a this api to po'er on the )ode 5eore 'net9init.
(1(,( 7net=#o7e"=$ o7n P"otot'#e
int 'net9po'er9do'nBvoidC
F*n!tion
Po'er o the )ode
In#*t
None
Pa"aete"?
O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
Po'er o the )ode , )ust (a 'net9po'er9on to po'er on the )ode and (a 'net9init to initiaie the )ode 5eore use it.
(1(( 7net=init P"otot'#e
int 'net9initB(onst (har R(o))9devC
F*n!tion
%nitiaie the )ode< dete(t 'ireess )ode t+pe auto)ati(a+
In#*t
(o))9dev
Devi(e ie na)e G>var>)u70G
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
here are o,i( devi(es vaid< 'ith na)e G>var>)u70`3G. Note:he 'net9initBC input devi(e na)e 'i 5e not sa)e as the ppp9openBC input devi(e na)e.
(1(:( 7net="eset P"otot'#e
int 'net9resetBvoidC
F*n!tion In#*t
*eset the 'ireess )ode None
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
Ater this AP% (aed< the )odue peror) a ph+si(a reset< the PPP in;in, and (oni,ures are a invaid< the )odue is in a(tor+ state< 5eore ne7t usin,< 'net9init 'i 5e needed.
(1(9( 7net=set=atta!.e$ P"otot'#e
int 'net9set9atta(hedBint a,C
F*n!tion
Ruery and configure the network attachment ( detachment operation
In#*t Pa"aete"?
a,
O*t#*t
None
0-set deta(h)ent61-set atta(h)ent
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
4etwork detached or attached depends on the parameter “flag. need to call the function until the return success to ensure that the network is attached(detached correctly.
(1(8( 7net=sina P"otot'#e
int 'net9si,naBint Rsi,na9nu)C
F*n!tion
^uer+ the si,na strength.
In#*t
NONE
Pa"aete"? O*t#*t
si,na9nu)
*eturn the 'ireess si,na stren,th
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
he vaid si,na vaue is 0`31< the 88 is an invaid si,na vaue.
(1(@( 7net=!.e!6si P"otot'#e
int 'net9(he(;si)BvoidC
F*n!tion
!he(; 'hether the S%& (ard in sot or not
In#*t
None
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(10( 7net=etiei P"otot'#e
int 'net9,eti)eiB(har R%&E%C
F*n!tion
#et 'ireess )ode %&E%
In#*t
None
Pa"aete"? O*t#*t
%&E%
*eturn %&E%
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(11( 7net=eto$in%o P"otot'#e
int 'net9,et)odinoB'net9)odueino9t RinoC
F*n!tion
#et 'ireess )ode inor)ation
In#*t
None
Pa"aete"? O*t#*t
ino
%nor)ation o the 'ireess )ode t+pede stru(t U
Pa"aete"?
(har +pe6 >>Wireess )ode t+pe (har Na)eT6 >>Na)e (har &anua(turerT6>> &anua(ture (har VerT6 >> Version nu)5er (har *eserv24T6>>*eserve X'net9)odueino9t6 Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t?
NEW210
Notes
#et the inor)ation o the 'ireess )ode
(1(12( 7net=ss=etist P"otot'#e?
int 'net9s)s9,etistBint istt+pe< tS)s*e(v s)sT< int )a7no< int RS)sNu)C
F*n!tion?
*ead S&S ist
In#*t Pa"aete"?
istt+pe
S&S +pe:
0 1
NEWS&S *EADEDS&S
2
S&S NO SEN BNot SupportC
3
S&S SEN B Not SupportC
A""S&S
)a7no
&a7 nu)5er o S&S ite)s
O*t#*t
s)s
S&S)essa,e5uer
Pa"aete"?
S)sNu)
A(tua read S&S ite)s
Ret*"n?
*eer 4.14.1 *eturn !odes
S*##o"t?
NEW210
Notes?
(1(1+( 7net=ss=sen$ P"otot'#e
int 'net9s)s9sendB(onst tS)sSend Rs)sC
F*n!tion
Send a S&S
In#*t
s)s
&essa,e
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(1,( 7net=ss="ea$ P"otot'#e
int 'net9s)s9readBint inde7< tS)s*e(v Rs)sdataC
F*n!tion
*ead a S&S
In#*t
inde7
%nde7 o the S&S
s)s
&essa,e 5uer
Pa"aete"? O*t#*t
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(1( 7net=ss=$eete P"otot'#e
int 'net9s)s9deeteBint inde7C
F*n!tion
Deete a S&S
In#*t
inde7
%nde7 o the S&S to deete
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(1:( 7net=#.one=stat*s P"otot'#e
int 'net9phone9statusB(har R PhoneNu)5er< unsi,ned int uiMuSieC
F*n!tion
#et phone status
In#*t
uiMuSie
Muer sie
O*t#*t
PhoneNu)5
*e(eive (ain, phone nu)5er.
Pa"aete"? Ret*"n
er *eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
% in (ain,< 'i ,et the (ain, phone nu)5er.
Pa"aete"?
(1(19( 7net=#.one=ans7e" P"otot'#e
int 'net9phone9ans'erBvoidC
F*n!tion
Ans'er (a
In#*t
None
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(18( 7net=#.one=.an*# P"otot'#e
int 'net9phone9han,upBvoidC
F*n!tion
Han,up
In#*t
None
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(1@( 7net=#.one=!a P"otot'#e
int 'net9phone9(aBunsi,ned (har RPhoneNu)C
F*n!tion In#*t
!a a phone PhoneNu)
Phone nu)5er
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(20( 7net=et=&asestation=in%o P"otot'#e
int 'net9,et95asestation9inoBtMaseStation RpsMaseStation%noC
F*n!tion
#et 5asestation inor)ation
In#*t
None
Pa"aete"? O*t#*t Pa"aete"?
psMaseStation%n o
Mase station inor)ation
Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
% the return vaue is su((ess< it 'i ,et the ri,ht 5ase station ino.
(1(21( 7net=et=nei.&o*"&asestation=in%o P"otot'#e
int 'net9,et9nei,h5our5asestation9inoBtMaseStation
F*n!tion
RpsMaseStation%no< int iNu)< int RpiOutNu)C #et nei,h5our 5ase station inor)ation
In#*t
iNu)
&a75asestation(ount
psMaseStation%n o
Mase station inor)ation
Pa"aete"? Ret*"n
piOutNu)
*eturned 5ase station inor)ation (ounts
S*##o"t
*eer 4.14.1 *eturn !odes
Notes
NEW210
Pa"aete"? O*t#*t
(1(22( 7net="ea$=si!a"$ID P"otot'#e
int 'net9read9si)(ard%DB(har RpsSi)!ard%D< int i"e nC
F*n!tion
*ead %D ro) S%& !ard
In#*t
i"en
Muersie
psSi)!ard%D
Muer to save S%& !ard %D
Pa"aete"? O*t#*t Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(2+( 7net="ea$=si!a"$IMSI P"otot'#e
int 'net9read9si)(ard%&S%B(har R%&S%< int i"enC
F*n!tion
*ead %&S% ro) S%& !ard B%nternationa &o5ie Su5s(ri5er %dentit+C
In#*t
i"en
Muersie
%&S%
Muertosave%&S%oS%&!ard
Pa"aete"? O*t#*t Pa"aete"? Ret*"n
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
(1(2,( 7net=et=!*""ent=si P"otot'#e
int 'net9,et9(urrent9si)BvoidC
F*n!tion
#et the nu)5er o (urrent S%& (ard that used.
In#*t
None
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
0
1S%&
1 others
2S%& *eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
Meore see(t another S%& (ard< the deaut see(tion is 0 BS%& 1C
(1(2( 7net=see!t=si P"otot'#e
int 'net9see(t9si)Bint si)noC
F*n!tion
!han,e the S%& (ard that (urrent+ used.
In#*t
si)no
he nu)5er o S%&< ran,e: 0< 1T
Pa"aete"? O*t#*t
None
Pa"aete"? Ret*"n
0
Su((essu+
others
*eer 4.14.1 *eturn !odes
S*##o"t
NEW210
Notes
Meore (a this un(tion< the 'ireess )odue )ust 5e Fpo'er do'nG status< other'ise this un(tion 'i return WNE9POWE*9DOWN9E**. or e7a)pe: int si)no6 \\ si)no I 'net9,et9(urrent9si)BC6 i Bsi)no K 0C report9errorBC6 ese U si)no I 16 'net9po'er9do'nBC6 i B'net9see(t9si)Bsi)noCC report9errorBC6 X \\ Noti(e: % the ter)ina is not the Dua-S%& version< (a this un(tion has no ee(t< it a'a+s operate the sa)e S%& (ard.
(1:( >a"!o$e s!an Mar(ode s(anner< (an s(an a (orrespondin, one-di)ensiona > t'o-di)ensiona 5ar (ode.
5.16.1.
&a"=o#en
P"otot'#e?
int 5ar9openB(onst (har Rpathna)e< int oa,sC
F*n!tion?
Open the 5ar(ode s(anner devi(e< ,et the hande.
Pa"aete"?
Ret*"n?
>e
pathna)eB%nput C
he devi(e na)e o s(anner< su(h as G>dev>tt+S2GBNEW210C or F>dev>5ar0G BNEW110C
oa,sB%nputC
Open )ode
O9*DON"$
*ead on+ BreuiredC
O9NONM"O!/
non-5o(;in, BoptionaC
LI0
Open s u((essu+< t he ( ode i s t he h ande ' hi(h i s used or the su5seuent operation.
K0
Openaied.*eertoKerrno.hL
NEW210
A##i!a&e In? Notes?
E/a#e?
his un(tion is sa)e as the open o POS%. he dieren(e is this un(tion (an not use (reate ie )ode. So there are on+ 2 para)eters in this un(tion. oa, (an 5e set to O9*DON"$ or BO9*DON"$ f O9NONM"O!/C % oa, is set to O9*DON"$< 5ar9read 'i ;eep 'aitin, unti read su((essu+. % oa, is set to BO9*DON"$ f O9NONM"O!/C< 5ar9read on+ (he(; the re(eive 5uer in the 5a(;,round.
E/a#e 1?
int d6 i BBd I 5ar9openBF>dev>tt+S2G< O9*DON"$C K 0C U >> error X E/a#e 2?
i BBd I 5ar9openBF>dev>tt+S2G< O9*DON"$ f O9NONM"O!/C K 0C U >> error X
(1:(2( &a"=!ose P"otot'#e?
int 5ar9(oseBint dC
F*n!tion?
!ose the 5ar(ode s(anner devi(e.
Pa"aete"?
dB%nputC
he hande o s(anner 'hi(h is ,et ro)
Ret*"n?
0
!ose s(anner devi(e su((essu+.
others
!ose aied. *eer to Kerrno.hL
>e A##i!a&e In?
NEW210
&a"=o#en.
Notes?
his un(tion is sa)e as the (ose o POS%.
E/a#e?
5.16.3.
&a"=s!an
P"otot'#e?
ssie9t 5ar9s(anBint d< uint329t onoC
F*n!tion?
Start>Stop s(an.
Pa"aete"?
dB%nputC
he hande o s(anner 'hi(h is ,et ro)
onoB%nputC
0
stop s(annin,
non-ero Ret*"n? >e
&a"=o#en.
start to s(an
0
Su((essu+.
non-ero
aied. *eer to Kerrno.hL.
NEW210
A##i!a&e In? Notes?
% start to s(an< +ou (an (a Mar9s(an< and the ono is non-ero. % stop s(annin,< +ou (an (a Mar9s(an< and the ono is ero. %t returns i))ediate+ ater (ain, this un(tion o 5ar9s(an.
E/a#e?
5.16.4.
&a"="ea$
P"otot'#e?
ssie9t 5ar9readBint d< void R5u< sie9t n5+tesC
F*n!tion?
*e(eive 5ar(ode data ater s(annin,
Pa"aete"?
dB%nputC
he hande o s(anner 'hi(h is ,et ro)
5uBOutputC n5+tesB%nputC
he ,iven 5uer to store the re(eived data he e7pe(ted re(eive 5+te en,th
LI0
he a(tua re(eived 5+te en,th
K0
aied.*eertoKerrno.hL.
Ret*"n? >e
&a"=o#en.
NEW210
A##i!a&e In? Notes?
his un(tion is sa)e as the read o POS%. % the s(anner is opened 5+ O9*DON"$< this un(tion 'i not return unti a 5ar(ode data are re(eived inished. % the s(anner is opened 5+ BO9*DON"$ f O9NONM"O!/C< this un(tion 'i return i))ediate+.
E/a#e?
5.16.5.
&a"="ea$=tieo*t
P"otot'#e?
ssie9t 5ar9read9ti)eoutBint d< void R5u< sie9t n5+tes< uint329t ti)eout)sC
F*n!tion?
*e(eive 5ar(ode 'ith spe(iied ti)eout.
Pa"aete"?
dB%nputC
he hande o s(anner 'hi(h is ,et ro)
5uBOutputC
he ,iven 5uer to store the re(eived data
n5+tesB%nputC
he e7pe(ted re(eive 5+te en,th
ti)eout)sB%nput C
i)eout Bunit: )sC
LI0
he a(tua re(eived 5+te en,th
K0
aied.*eertoKerrno.hL.
Ret*"n? >e
&a"=o#en.
NEW210
A##i!a&e In? Notes?
his un(tion is sa)e as &a"="ea$ e7(ept the ti)eout (an 5e spe(iied. his un(tion 'i return 5eore ti)eout even i the s(anner is opened 5+ 5o(;in, )ode BO9*DON"$C. Meore ti)eout< this un(tion 'i tr+ to re(eive the e7pe(ted data en,th ro) the s(anner 5uer6 % the e7pe(ted en,th o data is re(eived (o)pete< the un(tion returns.
E/a#e?
(19( VPDN AP% un(tions o this )odue 'as deined in the Fvpdn.hG6 Fi5vpdn.soG )ust 5e used 'hen in;in,. t+pede enu) U VPDN9NO9E**O*< >R vpdn dia su((essu+ ,(onne(tion to server is esta5ished R> VPDN9%S9!ONNE!%N#< >R vpdn dia is on the 'a+ R> VPDN9%S9D%S!ONNE!ED< >R vpdn (onne(tion to server is dis(onne(ted R> VPDN9E**O*< >R other error R> VPDN9!E*9%"E9NAVA%"AM"E< >R vpdn (ertii(ation ie is unavaia5e R> VPDN9NO9DEA"9*OE< >R no deaut route to vpdn server R>
X *ES"9E**O*9EN&6
(19(1( v#$n=o#en P"otot'#e?
int vpdn9openBint de5u,9)odeC
F*n!tion? Pa"aete"?
Preare to vpdn dia de5u,9)ode 0 BinputC other
Ret*"n?
0
O/
other
aied< reer to Kerrno.hL
>e
Nor)a)ode "et vpdn i5rar+ run in de5u, )ode
NEW210
A##i!a&e In? Notes?
his AP% 'i (reate a (hanne to vpdn )ana,er pro(ess< the one +ou send (o))and to ater. his AP% )ust 5e (aed 5eore (ain, an+ other intera(e.
E/a#e?
(19(2( v#$n=!ose P"otot'#e?
int vpdn9(oseBvoidC
F*n!tion?
Deete the (hanne to vpdn )ana,er pro(ess
Pa"aete"?
None
Ret*"n?
0
O/
other
aied< reer to Kerrno.hL
>e
NEW210
A##i!a&e In? Notes?
his AP% 'i deete the (hanne to vpdn )ana,er pro(ess. Mut it does not dis(onne(t the (onne(tion to re)ote vpdn server. % +ou 'anna dis(onne(t the (onne(tion to re)ote vpdn server< [vpdn9dis(onne(t= )ust 5e (aed 5eore vpdn9(ose.
E/a#e?
(19(+( v#$n=!a=##t# P"otot'#e?
int vpdn9(a9pptpB(onst pptp9ar,9t Rar,< resut9noti+9un(9t un(C
F*n!tion?
vpdn dia-up 'ith PPP
Pa"aete"?
ar,
$ou need to spe(ia so)e ar,u)ent to )a;e pptp runin,. t+pede stru(t U stru(t in9addr server6 >R vpdn server ip address R> (har do)ain32T6 >R do)ain )a+ 5e need i the vpdn server is a 'indo's OS. Ese et it 5an;R> (har userna)eT6 >R spe(ia the userna)e R> (har pass'ord32T6 >R se(ret or the userna)e R> int en(r+pt6
>R *E or )s-(hapv2 )ppe-12< Other'ise no
en(r+ption。#enera+ +ou shoud set to *E 。R> X pptp9ar,9t6
un(
he un(tion 'hi(h 'i 5e (aed 'hen the diain, resut is sent 5a(; 5+ vpdn )ana,er pro(ess. Protot+pe: t+pede void BRresut9noti+9un(9tCBresut9ar,9t Rar,C6 t+pede stru(t U int
error6
>R
VPDN9NO9E**O*
)eans
O/.
See
*ES"9E**O*9EN& or detai Bo(ate at 238C R> (har int9na)eT6 >R vpdn intera(e na)e ,or e7a)pe< ppp1 R> int iinde76 int int9is9up6
>R vpdn intera(e inde7< +ou )a+ use it in so(;et R> >R vpdn intera(e status , *E or up< A"SE or
do'n R> X resut9ar,9t6
Ret*"n? >e
0
O/
other
aied< reer to Kerrno.hL
NEW210
A##i!a&e In? Notes?
he result_notify_func 'i 5e (a a,ain i vpdn dia (onne(tion is dis(onne(ted or the status o vpdn intera(e is (han,ed. here )ust 5e a deaut route to vpdn server 5eore diain, vpdn. A deaut route )a+ 5e ,enerate 5+ ethernet or #P*S< 5ut no !hina &o5ie=s #P*S net'or;. Deaut route 'i 5e (han,ed to vpdn net'or; ater diain, vpdn su((essu+.
E/a#e?
(19(,( v#$n=!a=2t#=#s6 P"otot'#e?
int vpdn9(a92tp9ps;B(onst 2tp9ps;9ar,9t Rar,< resut9noti+9un(9t un(C
F*n!tion?
se "2P 'ith pre-shared ;e+ to dia vpdn
Pa"aete"?
ar,
$ou need to spe(ia 2tp9ps;9ar,9t to (a: t+pede stru(t U
stru(t in9addr server6 >R vpdn server ip address R> (har do)ain32T6 >R do)ain )a+ 5e need i the vpdn server is a 'indo's OS. Ese et it 5an; R> (har userna)eT6 >R spe(ia the userna)e R> (har pass'ord32T6 >R se(ret or the userna)e R> (har ipse(9ps;9se(ret32T6 >R %PSe( Pre-Shared ;e+R> X 2tp9ps;9ar,9t6
Ret*"n? >e
un(
he un(tion ' hi(h ' i 5 e ( aed ' hen t he d iain, resut is sent 5a(; 5+ vpdn )ana,er pro(ess. sa,e or the un(tion is des(ripted in vpdn9(a9pptpBo(ate at 20C
0
O/
other
aied< reer to Kerrno.hL
NEW210
A##i!a&e In? Notes?
PS/: Pre-Shared /e+< is an en(r+ption o %PSe( 。here is no en(r+ption in "2P,it needs %PSe( to en(r+pt the transer data. he result_notify_func 'i 5e (a a,ain i vpdn dia (onne(tion is dis(onne(ted or the status o vpdn intera(e is (han,ed. here )ust 5e a deaut route to vpdn server 5eore diain, vpdn. A deaut route )a+ 5e ,enerate 5+ ethernet or #P*S. Deaut route 'i 5e (han,ed to vpdn net'or; ater vpdn (onne(tion esta5ished.
E/a#e?
(19(( v#$n=!a=2t#=!e"t P"otot'#e?
int vpdn9(a92tp9(ertB(onst 2tp9(ert9ar,9t Rar,< resut9noti+9un(9t un(C
F*n!tion?
se "2P 'ith (ertii(ates to dia vpdn t+pede stru(t U ar,
Pa"aete"?
stru(t in9addr server6 >R vpdn server ip address R> (har do)ain32T6
>R do)ain )a+ 5e need i the vpdn server is a 'indo's OS.
Ese et it 5an; R> (har userna)eT6 >R spe(ia the userna)e R> (har pass'ord32T6 >R se(ret or the userna)e R> (har (ert9path12T6 >R Dire(tor+ 'hi(h in(ude this ies: 1C (a(ert.pe) 2C vpn(ient9(ert.pe)< vpn(ient9;e+.pe)< 3C vpn,ate'a+9(ert.pe)< vpn,ate'a+9;e+.pe) R> (har (ert9(ient9p'32T6 >R se(ret or the vpn(ient9(ert.pe) R>
(har (ert9server9p'32T6 >R se(ret or the vpn,ate'a+9(ert.pe) R> X 2tp9(ert9ar,9t6
un(
he un(tion 'h i(h 'i 5e (a ed 'h en th e di ain, re sut is sent 5a(; 5+ vpdn )ana,er pro(ess. sa,e or the un(tion is des(ripted in vpdn9(a9pptpBo(ate at 20C
Ret*"n?
0
O/
>e
other aied< reer to Kerrno.hL NEW210
A##i!a&e In? Notes?
%PSe( (ertii(ate en(r+ption has a Oi(ia na)e .408. So)eti)es it is (aed *SA. A(tua+ .408 is 5ased on *SA. he user need to oer root !A< o(a !A and server !A , see 2tp9(ert9ar,9t or detai. he result_notify_func 'i 5e (a a,ain i vpdn dia (onne(tion is dis(onne(ted or the status o vpdn intera(e is (han,ed. here )ust 5e a deaut route to vpdn server 5eore diain, vpdn. A deaut route )a+ 5e ,enerate 5+ ethernet or #P*S. Deaut route 'i 5e (han,ed to vpdn net'or; ater diain, vpdn su((essu+.
E/a#e?
(19(:( v#$n=$is!onne!t P"otot'#e?
int vpdn9dis(onne(tBresut9noti+9un(9t un(C
F*n!tion?
Dis(onne(t vpdn to the re)ote server
Pa"aete"?
un(
he un(tion 'hi(h 'i 5e (aed 'hen the diain, resut is sent 5a(; 5+ vpdn )ana,er pro(ess. sa,e
Ret*"n? >e
or
the
un(tion
0
vpdn9(a9pptpBo(ate at 20C O/
other
aied< reer to Kerrno.hL
is
des(ripted
in
NEW210
A##i!a&e In? Notes?
Dis(one(t a ;ind o vpdn (onne(tion esta5ished 5+ pptp< 2tp>ipse( ps; and 2tp>ipse( (ert. he deaut route to vpdn net'or; is deeted< and the od deaut route is re(overed.
E/a#e?
6. *#rt
7art device file name$ (dev(tty*;
:(1(tt'=#"o#e"t'=!on%i P"otot'#e?
int tt+9propert+9(oni,Bint d< int 5audrate< int data5its< int parit+< int stop5its< int o'C
F*n!tion?
art para)eter settin,
Pa"aete"?
id
artiehande
5audrate
Maudrate
data5its
Mits
parit+
Parit+
stop5its o'
Stop5its o'
Ret*"n S*##o"t?
NEW210>NEW110P
Notes?
. %et/ork +rogr#m *ocket TC#(3# #lease refer linu) network program documents ssl #lease refer openssl documents.
,. 0ile Aess #lease refer linu) c(cHH documents.