HCNetSDK.cs 221 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace DeviceCenter
  4. {
  5. public class CHCNetSDK
  6. {
  7. #region HCNetSDK.dll macro definition
  8. //macro definition
  9. #region common use
  10. /*******************Global Error Code**********************/
  11. public const int NET_DVR_NOERROR = 0; //No Error
  12. public const int NET_DVR_PASSWORD_ERROR = 1;//Username or Password error
  13. public const int NET_DVR_NOENOUGHPRI = 2;//Don't have enough authority
  14. public const int NET_DVR_NOINIT = 3;//have not Initialized
  15. public const int NET_DVR_CHANNEL_ERROR = 4;//Channel number error
  16. public const int NET_DVR_OVER_MAXLINK = 5;//Number of clients connecting to DVR beyonds the Maximum
  17. public const int NET_DVR_VERSIONNOMATCH = 6;//Version is not matched
  18. public const int NET_DVR_NETWORK_FAIL_CONNECT = 7;//Connect to server failed
  19. public const int NET_DVR_NETWORK_SEND_ERROR = 8;//Send data to server failed
  20. public const int NET_DVR_NETWORK_RECV_ERROR = 9;//Receive data from server failed
  21. public const int NET_DVR_NETWORK_RECV_TIMEOUT = 10;//Receive data from server timeout
  22. public const int NET_DVR_NETWORK_ERRORDATA = 11;//Transferred data has error
  23. public const int NET_DVR_ORDER_ERROR = 12;//Wrong Sequence of invoking API
  24. public const int NET_DVR_OPERNOPERMIT = 13;//No such authority.
  25. public const int NET_DVR_COMMANDTIMEOUT = 14;//Execute command timeout
  26. public const int NET_DVR_ERRORSERIALPORT = 15;//Serial port number error
  27. public const int NET_DVR_ERRORALARMPORT = 16;//Alarm port error
  28. public const int NET_DVR_PARAMETER_ERROR = 17;//Parameters error
  29. public const int NET_DVR_CHAN_EXCEPTION = 18;//Server channel in error status
  30. public const int NET_DVR_NODISK = 19;//No hard disk
  31. public const int NET_DVR_ERRORDISKNUM = 20;//Hard disk number error
  32. public const int NET_DVR_DISK_FULL = 21;//Server's hard disk is full
  33. public const int NET_DVR_DISK_ERROR = 22;//Server's hard disk error
  34. public const int NET_DVR_NOSUPPORT = 23;//Server doesn't support
  35. public const int NET_DVR_BUSY = 24;//Server is busy
  36. public const int NET_DVR_MODIFY_FAIL = 25;//Server modification failed
  37. public const int NET_DVR_PASSWORD_FORMAT_ERROR = 26;///Input format of Password error
  38. public const int NET_DVR_DISK_FORMATING = 27;//Hard disk is formating, cannot execute.
  39. public const int NET_DVR_DVRNORESOURCE = 28;//DVR don't have enough resource
  40. public const int NET_DVR_DVROPRATEFAILED = 29;//DVR Operation failed
  41. public const int NET_DVR_OPENHOSTSOUND_FAIL = 30;//Open PC audio failed
  42. public const int NET_DVR_DVRVOICEOPENED = 31;///Server's talk channel is occupied
  43. public const int NET_DVR_TIMEINPUTERROR = 32;//Time input is not correct
  44. public const int NET_DVR_NOSPECFILE = 33;//Can't playback the file that does not exist in Server
  45. public const int NET_DVR_CREATEFILE_ERROR = 34;//Create file error
  46. public const int NET_DVR_FILEOPENFAIL = 35;///Open file error
  47. public const int NET_DVR_OPERNOTFINISH = 36; //The previous operation is not finished yet
  48. public const int NET_DVR_GETPLAYTIMEFAIL = 37;//Get current playing time error
  49. public const int NET_DVR_PLAYFAIL = 38;//Playback error
  50. public const int NET_DVR_FILEFORMAT_ERROR = 39;//Wrong file format
  51. public const int NET_DVR_DIR_ERROR = 40;//Wrong directory
  52. public const int NET_DVR_ALLOC_RESOURCE_ERROR = 41;//Assign resource error
  53. public const int NET_DVR_AUDIO_MODE_ERROR = 42;//Audio card mode error
  54. public const int NET_DVR_NOENOUGH_BUF = 43;///Buffer is too small
  55. public const int NET_DVR_CREATESOCKET_ERROR = 44;//Create SOCKET error
  56. public const int NET_DVR_SETSOCKET_ERROR = 45;//Setup SOCKET error
  57. public const int NET_DVR_MAX_NUM = 46;//Reach the maximum number
  58. public const int NET_DVR_USERNOTEXIST = 47;//User does not exist
  59. public const int NET_DVR_WRITEFLASHERROR = 48;//Write to FLASH error
  60. public const int NET_DVR_UPGRADEFAIL = 49;//DVR update failed
  61. public const int NET_DVR_CARDHAVEINIT = 50;//Decoding Card has been initialized already
  62. public const int NET_DVR_PLAYERFAILED = 51;//Invoke API of player library error
  63. public const int NET_DVR_MAX_USERNUM = 52;//Reach the maximum number of Users
  64. public const int NET_DVR_GETLOCALIPANDMACFAIL = 53;//Failed to get Client software's IP or MAC address
  65. public const int NET_DVR_NOENCODEING = 54;//No encoding on this channel
  66. public const int NET_DVR_IPMISMATCH = 55;//IP address is not matched
  67. public const int NET_DVR_MACMISMATCH = 56;//MAC address is not matched
  68. public const int NET_DVR_USER_LOCKED = 153;
  69. /*******************END**********************/
  70. public const int NET_DVR_DEV_ADDRESS_MAX_LEN = 129; //device address max length
  71. public const int NET_DVR_LOGIN_USERNAME_MAX_LEN = 64; //login username max length
  72. public const int NET_DVR_LOGIN_PASSWD_MAX_LEN = 64; //login password max length
  73. public const int SERIALNO_LEN = 48; //serial number length
  74. public const int STREAM_ID_LEN = 32;
  75. public const int MAX_AUDIO_V40 = 8;
  76. public const int LOG_INFO_LEN = 11840; // log append information
  77. public const int MAX_NAMELEN = 16; //DVR's local Username
  78. public const int MAX_DOMAIN_NAME = 64; // max domain name length
  79. public const int MAX_ETHERNET = 2; // device
  80. public const int NAME_LEN = 32;// name length
  81. public const int PASSWD_LEN = 16;//password length
  82. public const int MAX_RIGHT = 32; //Authority permitted by Device (1- 12 for local authority, 13- 32 for remote authority)
  83. public const int MACADDR_LEN = 6;//mac adress length
  84. public const int DEV_TYPE_NAME_LEN = 24;
  85. public const int MAX_ANALOG_CHANNUM = 32; //32 analog channels in total
  86. public const int MAX_IP_CHANNEL = 32; //9000 DVR can connect 32 IP channels
  87. public const int MAX_CHANNUM_V30 = (MAX_ANALOG_CHANNUM + MAX_IP_CHANNEL); //64
  88. public const int MAX_CHANNUM_V40 = 512;
  89. public const int MAX_IP_DEVICE_V40 = 64; //Maximum number of IP devices that can be added, the value is 64, including IVMS-2000
  90. public const int DEV_ID_LEN = 32;
  91. public const int MAX_IP_DEVICE = 32;//9000 DVR can connect 32 IP devices
  92. public const int MAX_IP_ALARMIN_V40 = 4096;//Maximum number of alarm input channels that can be added
  93. public const int MAX_IP_ALARMOUT_V40 = 4096;//Maximum number of alarm output channels that can be added
  94. public const int MAX_IP_ALARMIN = 128;//Maximum number of alarm input channels that can be added
  95. public const int MAX_IP_ALARMOUT = 64;//Maximum number of alarm output channels that can be added
  96. public const int URL_LEN = 240; //URL length
  97. public const int MAX_AUDIOOUT_PRO_TYPE = 8;
  98. public const int ACS_ABILITY = 0x801; //acs ability
  99. public const int NET_DVR_CLEAR_ACS_PARAM = 2118; //clear acs host parameters
  100. public const int NET_DVR_GET_ACS_EVENT = 2514; //clear acs host parameters
  101. #endregion
  102. #region acs event upload
  103. public const int COMM_ALARM_ACS = 0x5002; //access card alarm
  104. public const int NET_SDK_GET_NEXT_STATUS_SUCCESS = 1000;
  105. public const int NET_SDK_GET_NEXT_STATUS_NEED_WAIT = 1001;
  106. public const int NET_SDK_GET_NEXT_STATUS_FINISH = 1002;
  107. public const int NET_SDK_GET_NEXT_STATUS_FAILED = 1003;
  108. /* Alarm */
  109. // Main Type
  110. public const int MAJOR_ALARM = 0x1;
  111. // Hypo- Type
  112. public const int MINOR_ALARMIN_SHORT_CIRCUIT = 0x400; // region short circuit
  113. public const int MINOR_ALARMIN_BROKEN_CIRCUIT = 0x401; // region broken circuit
  114. public const int MINOR_ALARMIN_EXCEPTION = 0x402; // region exception
  115. public const int MINOR_ALARMIN_RESUME = 0x403; // region resume
  116. public const int MINOR_HOST_DESMANTLE_ALARM = 0x404; // host desmantle alarm
  117. public const int MINOR_HOST_DESMANTLE_RESUME = 0x405; // host desmantle resume
  118. public const int MINOR_CARD_READER_DESMANTLE_ALARM = 0x406; // card reader desmantle alarm
  119. public const int MINOR_CARD_READER_DESMANTLE_RESUME = 0x407; // card reader desmantle resume
  120. public const int MINOR_CASE_SENSOR_ALARM = 0x408; // case sensor alarm
  121. public const int MINOR_CASE_SENSOR_RESUME = 0x409; // case sensor resume
  122. public const int MINOR_STRESS_ALARM = 0x40a; // stress alarm
  123. public const int MINOR_OFFLINE_ECENT_NEARLY_FULL = 0x40b; // offline ecent nearly full
  124. public const int MINOR_CARD_MAX_AUTHENTICATE_FAIL = 0x40c; // card max authenticate fall
  125. public const int MINOR_SD_CARD_FULL = 0x40d; // SD card is full
  126. public const int MINOR_LINKAGE_CAPTURE_PIC = 0x40e; // lingage capture picture
  127. public const int MINOR_SECURITY_MODULE_DESMANTLE_ALARM = 0x40f; //Door control security module desmantle alarm
  128. public const int MINOR_SECURITY_MODULE_DESMANTLE_RESUME = 0x410; //Door control security module desmantle resume
  129. public const int MINOR_POS_START_ALARM = 0x411; // POS Start
  130. public const int MINOR_POS_END_ALARM = 0x412; // POS end
  131. public const int MINOR_FACE_IMAGE_QUALITY_LOW = 0x413; // face image quality low
  132. public const int MINOR_FINGE_RPRINT_QUALITY_LOW = 0x414; // finger print quality low
  133. public const int MINOR_FIRE_IMPORT_SHORT_CIRCUIT = 0x415; // Fire import short circuit
  134. public const int MINOR_FIRE_IMPORT_BROKEN_CIRCUIT = 0x416; // Fire import broken circuit
  135. public const int MINOR_FIRE_IMPORT_RESUME = 0x417; // Fire import resume
  136. public const int MINOR_FIRE_BUTTON_TRIGGER = 0x418; // fire button trigger
  137. public const int MINOR_FIRE_BUTTON_RESUME = 0x419; // fire button resume
  138. public const int MINOR_MAINTENANCE_BUTTON_TRIGGER = 0x41a; // maintenance button trigger
  139. public const int MINOR_MAINTENANCE_BUTTON_RESUME = 0x41b; // maintenance button resume
  140. public const int MINOR_EMERGENCY_BUTTON_TRIGGER = 0x41c; // emergency button trigger
  141. public const int MINOR_EMERGENCY_BUTTON_RESUME = 0x41d; // emergency button resume
  142. public const int MINOR_DISTRACT_CONTROLLER_ALARM = 0x41e; // distract controller alarm
  143. public const int MINOR_DISTRACT_CONTROLLER_RESUME = 0x41f; // distract controller resume
  144. public const int MINOR_CHANNEL_CONTROLLER_DESMANTLE_ALARM = 0x422; //channel controller desmantle alarm
  145. public const int MINOR_CHANNEL_CONTROLLER_DESMANTLE_RESUME = 0x423; //channel controller desmantle resume
  146. public const int MINOR_CHANNEL_CONTROLLER_FIRE_IMPORT_ALARM = 0x424; //channel controller fire import alarm
  147. public const int MINOR_CHANNEL_CONTROLLER_FIRE_IMPORT_RESUME = 0x425; //channel controller fire import resume
  148. public const int MINOR_PRINTER_OUT_OF_PAPER = 0x440; //printer no paper
  149. public const int MINOR_LEGAL_EVENT_NEARLY_FULL = 0x442; //Legal event nearly full
  150. /* Exception*/
  151. // Main Type
  152. public const int MAJOR_EXCEPTION = 0x2;
  153. // Hypo- Type
  154. public const int MINOR_NET_BROKEN = 0x27; // Network disconnected
  155. public const int MINOR_RS485_DEVICE_ABNORMAL = 0x3a; // RS485 connect status exception
  156. public const int MINOR_RS485_DEVICE_REVERT = 0x3b; // RS485 connect status exception recovery
  157. public const int MINOR_DEV_POWER_ON = 0x400; // device power on
  158. public const int MINOR_DEV_POWER_OFF = 0x401; // device power off
  159. public const int MINOR_WATCH_DOG_RESET = 0x402; // watch dog reset
  160. public const int MINOR_LOW_BATTERY = 0x403; // low battery
  161. public const int MINOR_BATTERY_RESUME = 0x404; // battery resume
  162. public const int MINOR_AC_OFF = 0x405; // AC off
  163. public const int MINOR_AC_RESUME = 0x406; // AC resume
  164. public const int MINOR_NET_RESUME = 0x407; // Net resume
  165. public const int MINOR_FLASH_ABNORMAL = 0x408; // FLASH abnormal
  166. public const int MINOR_CARD_READER_OFFLINE = 0x409; // card reader offline
  167. public const int MINOR_CARD_READER_RESUME = 0x40a; // card reader resume
  168. public const int MINOR_INDICATOR_LIGHT_OFF = 0x40b; // Indicator Light Off
  169. public const int MINOR_INDICATOR_LIGHT_RESUME = 0x40c; // Indicator Light Resume
  170. public const int MINOR_CHANNEL_CONTROLLER_OFF = 0x40d; // channel controller off
  171. public const int MINOR_CHANNEL_CONTROLLER_RESUME = 0x40e; // channel controller resume
  172. public const int MINOR_SECURITY_MODULE_OFF = 0x40f; // Door control security module off
  173. public const int MINOR_SECURITY_MODULE_RESUME = 0x410; // Door control security module resume
  174. public const int MINOR_BATTERY_ELECTRIC_LOW = 0x411; // battery electric low
  175. public const int MINOR_BATTERY_ELECTRIC_RESUME = 0x412; // battery electric resume
  176. public const int MINOR_LOCAL_CONTROL_NET_BROKEN = 0x413; // Local control net broken
  177. public const int MINOR_LOCAL_CONTROL_NET_RSUME = 0x414; // Local control net resume
  178. public const int MINOR_MASTER_RS485_LOOPNODE_BROKEN = 0x415; // Master RS485 loop node broken
  179. public const int MINOR_MASTER_RS485_LOOPNODE_RESUME = 0x416; // Master RS485 loop node resume
  180. public const int MINOR_LOCAL_CONTROL_OFFLINE = 0x417; // Local control offline
  181. public const int MINOR_LOCAL_CONTROL_RESUME = 0x418; // Local control resume
  182. public const int MINOR_LOCAL_DOWNSIDE_RS485_LOOPNODE_BROKEN = 0x419; // Local downside RS485 loop node broken
  183. public const int MINOR_LOCAL_DOWNSIDE_RS485_LOOPNODE_RESUME = 0x41a; // Local downside RS485 loop node resume
  184. public const int MINOR_DISTRACT_CONTROLLER_ONLINE = 0x41b; // distract controller online
  185. public const int MINOR_DISTRACT_CONTROLLER_OFFLINE = 0x41c; // distract controller offline
  186. public const int MINOR_ID_CARD_READER_NOT_CONNECT = 0x41d; // Id card reader not connected(intelligent dedicated)
  187. public const int MINOR_ID_CARD_READER_RESUME = 0x41e; //Id card reader connection restored(intelligent dedicated)
  188. public const int MINOR_FINGER_PRINT_MODULE_NOT_CONNECT = 0x41f; // fingerprint module is not connected(intelligent dedicated)
  189. public const int MINOR_FINGER_PRINT_MODULE_RESUME = 0x420; // The fingerprint module connection restored(intelligent dedicated)
  190. public const int MINOR_CAMERA_NOT_CONNECT = 0x421; // Camera not connected
  191. public const int MINOR_CAMERA_RESUME = 0x422; // Camera connection restored
  192. public const int MINOR_COM_NOT_CONNECT = 0x423; // COM not connected
  193. public const int MINOR_COM_RESUME = 0x424;// COM connection restored
  194. public const int MINOR_DEVICE_NOT_AUTHORIZE = 0x425; // device are not authorized
  195. public const int MINOR_PEOPLE_AND_ID_CARD_DEVICE_ONLINE = 0x426; // people and ID card device online
  196. public const int MINOR_PEOPLE_AND_ID_CARD_DEVICE_OFFLINE = 0x427;// people and ID card device offline
  197. public const int MINOR_LOCAL_LOGIN_LOCK = 0x428; // local login lock
  198. public const int MINOR_LOCAL_LOGIN_UNLOCK = 0x429; //local login unlock
  199. public const int MINOR_SUBMARINEBACK_COMM_BREAK = 0x42a; //submarineback communicate break
  200. public const int MINOR_SUBMARINEBACK_COMM_RESUME = 0x42b; //submarineback communicate resume
  201. public const int MINOR_MOTOR_SENSOR_EXCEPTION = 0x42c; //motor sensor exception
  202. public const int MINOR_CAN_BUS_EXCEPTION = 0x42d; //can bus exception
  203. public const int MINOR_CAN_BUS_RESUME = 0x42e; //can bus resume
  204. public const int MINOR_GATE_TEMPERATURE_OVERRUN = 0x42f; //gate temperature over run
  205. public const int MINOR_IR_EMITTER_EXCEPTION = 0x430; //IR emitter exception
  206. public const int MINOR_IR_EMITTER_RESUME = 0x431; //IR emitter resume
  207. public const int MINOR_LAMP_BOARD_COMM_EXCEPTION = 0x432; //lamp board communicate exception
  208. public const int MINOR_LAMP_BOARD_COMM_RESUME = 0x433; //lamp board communicate resume
  209. public const int MINOR_IR_ADAPTOR_COMM_EXCEPTION = 0x434; //IR adaptor communicate exception
  210. public const int MINOR_IR_ADAPTOR_COMM_RESUME = 0x435; //IR adaptor communicate resume
  211. public const int MINOR_PRINTER_ONLINE = 0x436; //printer online
  212. public const int MINOR_PRINTER_OFFLINE = 0x437; //printer offline
  213. public const int MINOR_4G_MOUDLE_ONLINE = 0x438; //4G module online
  214. public const int MINOR_4G_MOUDLE_OFFLINE = 0x439; //4G module offline
  215. /* Operation */
  216. // Main Type
  217. public const int MAJOR_OPERATION = 0x3;
  218. // Hypo- Type
  219. public const int MINOR_LOCAL_UPGRADE = 0x5a; // Upgrade (local)
  220. public const int MINOR_REMOTE_LOGIN = 0x70; // Login (remote)
  221. public const int MINOR_REMOTE_LOGOUT = 0x71; // Logout (remote)
  222. public const int MINOR_REMOTE_ARM = 0x79; // On guard (remote)
  223. public const int MINOR_REMOTE_DISARM = 0x7a; // Disarm (remote)
  224. public const int MINOR_REMOTE_REBOOT = 0x7b; // Reboot (remote)
  225. public const int MINOR_REMOTE_UPGRADE = 0x7e; // upgrade (remote)
  226. public const int MINOR_REMOTE_CFGFILE_OUTPUT = 0x86; // Export Configuration (remote)
  227. public const int MINOR_REMOTE_CFGFILE_INTPUT = 0x87; // Import Configuration (remote)
  228. public const int MINOR_REMOTE_ALARMOUT_OPEN_MAN = 0xd6; // remote mamual open alarmout
  229. public const int MINOR_REMOTE_ALARMOUT_CLOSE_MAN = 0xd7; // remote mamual close alarmout
  230. public const int MINOR_REMOTE_OPEN_DOOR = 0x400; // remote open door
  231. public const int MINOR_REMOTE_CLOSE_DOOR = 0x401; // remote close door (controlled)
  232. public const int MINOR_REMOTE_ALWAYS_OPEN = 0x402; // remote always open door (free)
  233. public const int MINOR_REMOTE_ALWAYS_CLOSE = 0x403; // remote always close door (forbiden)
  234. public const int MINOR_REMOTE_CHECK_TIME = 0x404; // remote check time
  235. public const int MINOR_NTP_CHECK_TIME = 0x405; // ntp check time
  236. public const int MINOR_REMOTE_CLEAR_CARD = 0x406; // remote clear card
  237. public const int MINOR_REMOTE_RESTORE_CFG = 0x407; // remote restore configure
  238. public const int MINOR_ALARMIN_ARM = 0x408; // alarm in arm
  239. public const int MINOR_ALARMIN_DISARM = 0x409; // alarm in disarm
  240. public const int MINOR_LOCAL_RESTORE_CFG = 0x40a; // local configure restore
  241. public const int MINOR_REMOTE_CAPTURE_PIC = 0x40b; // remote capture picture
  242. public const int MINOR_MOD_NET_REPORT_CFG = 0x40c; // modify net report cfg
  243. public const int MINOR_MOD_GPRS_REPORT_PARAM = 0x40d; // modify GPRS report param
  244. public const int MINOR_MOD_REPORT_GROUP_PARAM = 0x40e; // modify report group param
  245. public const int MINOR_UNLOCK_PASSWORD_OPEN_DOOR = 0x40f; // unlock password open door
  246. public const int MINOR_AUTO_RENUMBER = 0x410; // auto renumber
  247. public const int MINOR_AUTO_COMPLEMENT_NUMBER = 0x411; // auto complement number
  248. public const int MINOR_NORMAL_CFGFILE_INPUT = 0x412; // normal cfg file input
  249. public const int MINOR_NORMAL_CFGFILE_OUTTPUT = 0x413; // normal cfg file output
  250. public const int MINOR_CARD_RIGHT_INPUT = 0x414; // card right input
  251. public const int MINOR_CARD_RIGHT_OUTTPUT = 0x415; // card right output
  252. public const int MINOR_LOCAL_USB_UPGRADE = 0x416; // local USB upgrade
  253. public const int MINOR_REMOTE_VISITOR_CALL_LADDER = 0x417; // visitor call ladder
  254. public const int MINOR_REMOTE_HOUSEHOLD_CALL_LADDER = 0x418; // household call ladder
  255. public const int MINOR_REMOTE_ACTUAL_GUARD = 0x419; //remote actual guard
  256. public const int MINOR_REMOTE_ACTUAL_UNGUARD = 0x41a; //remote actual unguard
  257. public const int MINOR_REMOTE_CONTROL_NOT_CODE_OPER_FAILED = 0x41b; //remote control not code operate failed
  258. public const int MINOR_REMOTE_CONTROL_CLOSE_DOOR = 0x41c; //remote control close door
  259. public const int MINOR_REMOTE_CONTROL_OPEN_DOOR = 0x41d; //remote control open door
  260. public const int MINOR_REMOTE_CONTROL_ALWAYS_OPEN_DOOR = 0x41e; //remote control always open door
  261. /* Additional Log Info*/
  262. // Main Type
  263. public const int MAJOR_EVENT = 0x5;/*event*/
  264. // Hypo- Type
  265. public const int MINOR_LEGAL_CARD_PASS = 0x01; // legal card pass
  266. public const int MINOR_CARD_AND_PSW_PASS = 0x02; // swipe and password pass
  267. public const int MINOR_CARD_AND_PSW_FAIL = 0x03; // swipe and password fail
  268. public const int MINOR_CARD_AND_PSW_TIMEOUT = 0x04; // swipe and password timeout
  269. public const int MINOR_CARD_AND_PSW_OVER_TIME = 0x05; // swipe and password over time
  270. public const int MINOR_CARD_NO_RIGHT = 0x06; // card no right
  271. public const int MINOR_CARD_INVALID_PERIOD = 0x07; // invalid period
  272. public const int MINOR_CARD_OUT_OF_DATE = 0x08; // card out of date
  273. public const int MINOR_INVALID_CARD = 0x09; // invalid card
  274. public const int MINOR_ANTI_SNEAK_FAIL = 0x0a; // anti sneak fail
  275. public const int MINOR_INTERLOCK_DOOR_NOT_CLOSE = 0x0b; // interlock door doesn't close
  276. public const int MINOR_NOT_BELONG_MULTI_GROUP = 0x0c; // card no belong multi group
  277. public const int MINOR_INVALID_MULTI_VERIFY_PERIOD = 0x0d; // invalid multi verify period
  278. public const int MINOR_MULTI_VERIFY_SUPER_RIGHT_FAIL = 0x0e; // have no super right in multi verify mode
  279. public const int MINOR_MULTI_VERIFY_REMOTE_RIGHT_FAIL = 0x0f; // have no remote right in multi verify mode
  280. public const int MINOR_MULTI_VERIFY_SUCCESS = 0x10; // success in multi verify mode
  281. public const int MINOR_LEADER_CARD_OPEN_BEGIN = 0x11; // leader card begin to open
  282. public const int MINOR_LEADER_CARD_OPEN_END = 0x12; // leader card end to open
  283. public const int MINOR_ALWAYS_OPEN_BEGIN = 0x13; // always open begin
  284. public const int MINOR_ALWAYS_OPEN_END = 0x14; // always open end
  285. public const int MINOR_LOCK_OPEN = 0x15; // lock open
  286. public const int MINOR_LOCK_CLOSE = 0x16; // lock close
  287. public const int MINOR_DOOR_BUTTON_PRESS = 0x17; // press door open button
  288. public const int MINOR_DOOR_BUTTON_RELEASE = 0x18; // release door open button
  289. public const int MINOR_DOOR_OPEN_NORMAL = 0x19; // door open normal
  290. public const int MINOR_DOOR_CLOSE_NORMAL = 0x1a; // door close normal
  291. public const int MINOR_DOOR_OPEN_ABNORMAL = 0x1b; // open door abnormal
  292. public const int MINOR_DOOR_OPEN_TIMEOUT = 0x1c; // open door timeout
  293. public const int MINOR_ALARMOUT_ON = 0x1d; // alarm out turn on
  294. public const int MINOR_ALARMOUT_OFF = 0x1e; // alarm out turn off
  295. public const int MINOR_ALWAYS_CLOSE_BEGIN = 0x1f; // always close begin
  296. public const int MINOR_ALWAYS_CLOSE_END = 0x20; // always close end
  297. public const int MINOR_MULTI_VERIFY_NEED_REMOTE_OPEN = 0x21; // need remote open in multi verify mode
  298. public const int MINOR_MULTI_VERIFY_SUPERPASSWD_VERIFY_SUCCESS = 0x22; // superpasswd verify success in multi verify mode
  299. public const int MINOR_MULTI_VERIFY_REPEAT_VERIFY = 0x23; // repeat verify in multi verify mode
  300. public const int MINOR_MULTI_VERIFY_TIMEOUT = 0x24; // timeout in multi verify mode
  301. public const int MINOR_DOORBELL_RINGING = 0x25; // doorbell ringing
  302. public const int MINOR_FINGERPRINT_COMPARE_PASS = 0x26; // fingerprint compare pass
  303. public const int MINOR_FINGERPRINT_COMPARE_FAIL = 0x27; // fingerprint compare fail
  304. public const int MINOR_CARD_FINGERPRINT_VERIFY_PASS = 0x28; // card and fingerprint verify pass
  305. public const int MINOR_CARD_FINGERPRINT_VERIFY_FAIL = 0x29; // card and fingerprint verify fail
  306. public const int MINOR_CARD_FINGERPRINT_VERIFY_TIMEOUT = 0x2a; // card and fingerprint verify timeout
  307. public const int MINOR_CARD_FINGERPRINT_PASSWD_VERIFY_PASS = 0x2b; // card and fingerprint and passwd verify pass
  308. public const int MINOR_CARD_FINGERPRINT_PASSWD_VERIFY_FAIL = 0x2c; // card and fingerprint and passwd verify fail
  309. public const int MINOR_CARD_FINGERPRINT_PASSWD_VERIFY_TIMEOUT = 0x2d; // card and fingerprint and passwd verify timeout
  310. public const int MINOR_FINGERPRINT_PASSWD_VERIFY_PASS = 0x2e; // fingerprint and passwd verify pass
  311. public const int MINOR_FINGERPRINT_PASSWD_VERIFY_FAIL = 0x2f; // fingerprint and passwd verify fail
  312. public const int MINOR_FINGERPRINT_PASSWD_VERIFY_TIMEOUT = 0x30; // fingerprint and passwd verify timeout
  313. public const int MINOR_FINGERPRINT_INEXISTENCE = 0x31; // fingerprint inexistence
  314. public const int MINOR_CARD_PLATFORM_VERIFY = 0x32; // card platform verify
  315. public const int MINOR_CALL_CENTER = 0x33; // call center
  316. public const int MINOR_FIRE_RELAY_TURN_ON_DOOR_ALWAYS_OPEN = 0x34; // fire relay turn on door always open
  317. public const int MINOR_FIRE_RELAY_RECOVER_DOOR_RECOVER_NORMAL = 0x35; // fire relay recover door recover normal
  318. public const int MINOR_FACE_AND_FP_VERIFY_PASS = 0x36; // face and finger print verify pass
  319. public const int MINOR_FACE_AND_FP_VERIFY_FAIL = 0x37; // face and finger print verify fail
  320. public const int MINOR_FACE_AND_FP_VERIFY_TIMEOUT = 0x38; // face and finger print verify timeout
  321. public const int MINOR_FACE_AND_PW_VERIFY_PASS = 0x39; // face and password verify pass
  322. public const int MINOR_FACE_AND_PW_VERIFY_FAIL = 0x3a; // face and password verify fail
  323. public const int MINOR_FACE_AND_PW_VERIFY_TIMEOUT = 0x3b; // face and password verify timeout
  324. public const int MINOR_FACE_AND_CARD_VERIFY_PASS = 0x3c; // face and card verify pass
  325. public const int MINOR_FACE_AND_CARD_VERIFY_FAIL = 0x3d; // face and card verify fail
  326. public const int MINOR_FACE_AND_CARD_VERIFY_TIMEOUT = 0x3e; // face and card verify timeout
  327. public const int MINOR_FACE_AND_PW_AND_FP_VERIFY_PASS = 0x3f; // face and password and finger print verify pass
  328. public const int MINOR_FACE_AND_PW_AND_FP_VERIFY_FAIL = 0x40; // face and password and finger print verify fail
  329. public const int MINOR_FACE_AND_PW_AND_FP_VERIFY_TIMEOUT = 0x41; // face and password and finger print verify timeout
  330. public const int MINOR_FACE_CARD_AND_FP_VERIFY_PASS = 0x42; // face and card and finger print verify pass
  331. public const int MINOR_FACE_CARD_AND_FP_VERIFY_FAIL = 0x43; // face and card and finger print verify fail
  332. public const int MINOR_FACE_CARD_AND_FP_VERIFY_TIMEOUT = 0x44; // face and card and finger print verify timeout
  333. public const int MINOR_EMPLOYEENO_AND_FP_VERIFY_PASS = 0x45; // employee and finger print verify pass
  334. public const int MINOR_EMPLOYEENO_AND_FP_VERIFY_FAIL = 0x46; // employee and finger print verify fail
  335. public const int MINOR_EMPLOYEENO_AND_FP_VERIFY_TIMEOUT = 0x47; // employee and finger print verify timeout
  336. public const int MINOR_EMPLOYEENO_AND_FP_AND_PW_VERIFY_PASS = 0x48; // employee and finger print and password verify pass
  337. public const int MINOR_EMPLOYEENO_AND_FP_AND_PW_VERIFY_FAIL = 0x49; // employee and finger print and password verify fail
  338. public const int MINOR_EMPLOYEENO_AND_FP_AND_PW_VERIFY_TIMEOUT = 0x4a; // employee and finger print and password verify timeout
  339. public const int MINOR_FACE_VERIFY_PASS = 0x4b; // face verify pass
  340. public const int MINOR_FACE_VERIFY_FAIL = 0x4c; // face verify fail
  341. public const int MINOR_EMPLOYEENO_AND_FACE_VERIFY_PASS = 0x4d; // employee no and face verify pass
  342. public const int MINOR_EMPLOYEENO_AND_FACE_VERIFY_FAIL = 0x4e; // employee no and face verify fail
  343. public const int MINOR_EMPLOYEENO_AND_FACE_VERIFY_TIMEOUT = 0x4f; // employee no and face verify time out
  344. public const int MINOR_FACE_RECOGNIZE_FAIL = 0x50; // face recognize fail
  345. public const int MINOR_FIRSTCARD_AUTHORIZE_BEGIN = 0x51; // first card authorize begin
  346. public const int MINOR_FIRSTCARD_AUTHORIZE_END = 0x52; // first card authorize end
  347. public const int MINOR_DOORLOCK_INPUT_SHORT_CIRCUIT = 0x53; // door lock input short circuit
  348. public const int MINOR_DOORLOCK_INPUT_BROKEN_CIRCUIT = 0x54; // door lock input broken circuit
  349. public const int MINOR_DOORLOCK_INPUT_EXCEPTION = 0x55; // door lock input exception
  350. public const int MINOR_DOORCONTACT_INPUT_SHORT_CIRCUIT = 0x56; // door contact input short circuit
  351. public const int MINOR_DOORCONTACT_INPUT_BROKEN_CIRCUIT = 0x57; // door contact input broken circuit
  352. public const int MINOR_DOORCONTACT_INPUT_EXCEPTION = 0x58; // door contact input exception
  353. public const int MINOR_OPENBUTTON_INPUT_SHORT_CIRCUIT = 0x59; // open button input short circuit
  354. public const int MINOR_OPENBUTTON_INPUT_BROKEN_CIRCUIT = 0x5a; // open button input broken circuit
  355. public const int MINOR_OPENBUTTON_INPUT_EXCEPTION = 0x5b; // open button input exception
  356. public const int MINOR_DOORLOCK_OPEN_EXCEPTION = 0x5c; // door lock open exception
  357. public const int MINOR_DOORLOCK_OPEN_TIMEOUT = 0x5d; // door lock open timeout
  358. public const int MINOR_FIRSTCARD_OPEN_WITHOUT_AUTHORIZE = 0x5e; // first card open without authorize
  359. public const int MINOR_CALL_LADDER_RELAY_BREAK = 0x5f; // call ladder relay break
  360. public const int MINOR_CALL_LADDER_RELAY_CLOSE = 0x60; // call ladder relay close
  361. public const int MINOR_AUTO_KEY_RELAY_BREAK = 0x61; // auto key relay break
  362. public const int MINOR_AUTO_KEY_RELAY_CLOSE = 0x62; // auto key relay close
  363. public const int MINOR_KEY_CONTROL_RELAY_BREAK = 0x63; // key control relay break
  364. public const int MINOR_KEY_CONTROL_RELAY_CLOSE = 0x64; // key control relay close
  365. public const int MINOR_EMPLOYEENO_AND_PW_PASS = 0x65; // minor employee no and password pass
  366. public const int MINOR_EMPLOYEENO_AND_PW_FAIL = 0x66; // minor employee no and password fail
  367. public const int MINOR_EMPLOYEENO_AND_PW_TIMEOUT = 0x67; // minor employee no and password timeout
  368. public const int MINOR_HUMAN_DETECT_FAIL = 0x68; // human detect fail
  369. public const int MINOR_PEOPLE_AND_ID_CARD_COMPARE_PASS = 0x69; // the comparison with people and id card success
  370. public const int MINOR_PEOPLE_AND_ID_CARD_COMPARE_FAIL = 0x70; // the comparison with people and id card failed
  371. public const int MINOR_CERTIFICATE_BLACK_LIST = 0x71; // black list
  372. public const int MINOR_LEGAL_MESSAGE = 0x72; // legal message
  373. public const int MINOR_ILLEGAL_MESSAGE = 0x73; // illegal messag
  374. public const int MINOR_MAC_DETECT = 0x74; // mac detect
  375. public const int MINOR_DOOR_OPEN_OR_DORMANT_FAIL = 0x75; //door open or dormant fail
  376. public const int MINOR_AUTH_PLAN_DORMANT_FAIL = 0x76; //auth plan dormant fail
  377. public const int MINOR_CARD_ENCRYPT_VERIFY_FAIL = 0x77; //card encrypt verify fail
  378. public const int MINOR_SUBMARINEBACK_REPLY_FAIL = 0x78; //submarineback reply fail
  379. public const int MINOR_DOOR_OPEN_OR_DORMANT_OPEN_FAIL = 0x82; //door open or dormant open fail
  380. public const int MINOR_DOOR_OPEN_OR_DORMANT_LINKAGE_OPEN_FAIL = 0x84; //door open or dormant linkage open fail
  381. public const int MINOR_TRAILING = 0x85; //trailing
  382. public const int MINOR_HEART_BEAT = 0x83; //heart beat event
  383. public const int MINOR_REVERSE_ACCESS = 0x86; //reverse access
  384. public const int MINOR_FORCE_ACCESS = 0x87; //force access
  385. public const int MINOR_CLIMBING_OVER_GATE = 0x88; //climbing over gate
  386. public const int MINOR_PASSING_TIMEOUT = 0x89; //passing timeout
  387. public const int MINOR_INTRUSION_ALARM = 0x8a; //intrusion alarm
  388. public const int MINOR_FREE_GATE_PASS_NOT_AUTH = 0x8b; //free gate pass not auth
  389. public const int MINOR_DROP_ARM_BLOCK = 0x8c; //drop arm block
  390. public const int MINOR_DROP_ARM_BLOCK_RESUME = 0x8d; //drop arm block resume
  391. public const int MINOR_LOCAL_FACE_MODELING_FAIL = 0x8e; //device upgrade with module failed
  392. public const int MINOR_STAY_EVENT = 0x8f; //stay event
  393. public const int MINOR_PASSWORD_MISMATCH = 0x97; //password mismatch
  394. public const int MINOR_EMPLOYEE_NO_NOT_EXIST = 0x98; //employee no not exist
  395. public const int MINOR_COMBINED_VERIFY_PASS = 0x99; //combined verify pass
  396. public const int MINOR_COMBINED_VERIFY_TIMEOUT = 0x9a; //combined verify timeout
  397. public const int MINOR_VERIFY_MODE_MISMATCH = 0x9b; //verify mode mismatch
  398. #endregion
  399. #region card parameters configuration
  400. public const int CARD_PARAM_CARD_VALID = 0x00000001; //card valid parameter
  401. public const int CARD_PARAM_VALID = 0x00000002; //valid period parameter
  402. public const int CARD_PARAM_CARD_TYPE = 0x00000004; //card type parameter
  403. public const int CARD_PARAM_DOOR_RIGHT = 0x00000008; //door right parameter
  404. public const int CARD_PARAM_LEADER_CARD = 0x00000010; //leader card parameter
  405. public const int CARD_PARAM_SWIPE_NUM = 0x00000020; //max swipe time parameter
  406. public const int CARD_PARAM_GROUP = 0x00000040; //belong group parameter
  407. public const int CARD_PARAM_PASSWORD = 0x00000080; //card password parameter
  408. public const int CARD_PARAM_RIGHT_PLAN = 0x00000100; //card right plan parameter
  409. public const int CARD_PARAM_SWIPED_NUM = 0x00000200; //has swiped card time parameter
  410. public const int CARD_PARAM_EMPLOYEE_NO = 0x00000400; //employee no
  411. public const int ACS_CARD_NO_LEN = 32; //access card No. len
  412. public const int MAX_DOOR_NUM_256 = 256; //max door num
  413. public const int MAX_GROUP_NUM_128 = 128; //The largest number of grou
  414. public const int CARD_PASSWORD_LEN = 8; // card password len
  415. public const int MAX_CARD_RIGHT_PLAN_NUM = 4; //max card right plan number
  416. public const int MAX_DOOR_CODE_LEN = 8; //room code length
  417. public const int MAX_LOCK_CODE_LEN = 8; //lock code length
  418. public const int MAX_CASE_SENSOR_NUM = 8; //max case sensor number
  419. public const int MAX_CARD_READER_NUM_512 = 512; //max card reader num
  420. public const int MAX_ALARMHOST_ALARMIN_NUM = 512; //Max number of alarm host alarm input ports
  421. public const int MAX_ALARMHOST_ALARMOUT_NUM = 512; //Max number of alarm host alarm output ports
  422. public const int NET_DVR_GET_ACS_WORK_STATUS_V50 = 2180; //Access door host working condition (V50)
  423. public const int NET_DVR_GET_CARD_CFG_V50 = 2178; //Parameters to acquire new CARDS (V50)
  424. public const int NET_DVR_SET_CARD_CFG_V50 = 2179; //Setting up the new parameters (V50)
  425. #endregion
  426. public const int NET_DVR_GET_TIMECFG = 118;//get device time
  427. public const int NET_DVR_SET_TIMECFG = 119;//set device time
  428. public const int NET_DVR_GET_AUDIOIN_VOLUME_CFG = 6355; //get audio in volume
  429. public const int NET_DVR_SET_AUDIOIN_VOLUME_CFG = 6356; //set audio in volume
  430. public const int NET_DVR_GET_AUDIOOUT_VOLUME_CFG = 6369; //get audio out volume
  431. public const int NET_DVR_SET_AUDIOOUT_VOLUME_CFG = 6370; //set audio out volume
  432. #region door parameters configuration
  433. public const int DOOR_NAME_LEN = 32;//door name len
  434. public const int STRESS_PASSWORD_LEN = 8;//stress password len
  435. public const int SUPER_PASSWORD_LEN = 8;//super password len
  436. public const int UNLOCK_PASSWORD_LEN = 8;
  437. public const int MAX_DOOR_NUM = 32;
  438. public const int MAX_GROUP_NUM = 32;
  439. public const int LOCAL_CONTROLLER_NAME_LEN = 32;
  440. public const int NET_DVR_GET_DOOR_CFG = 2108; //get door parameter
  441. public const int NET_DVR_SET_DOOR_CFG = 2109; //set door parameter
  442. #endregion
  443. #region GetAcsEvent
  444. public const int NET_SDK_MONITOR_ID_LEN = 64;
  445. public const int WM_MSG_ADD_ACS_EVENT_TOLIST = 1002;
  446. public const int WM_MSG_GET_ACS_EVENT_FINISH = 1003;
  447. #endregion
  448. #region group configuration
  449. public const int GROUP_NAME_LEN = 32;
  450. public const int NET_DVR_GET_GROUP_CFG = 2112; //get group parameter
  451. public const int NET_DVR_SET_GROUP_CFG = 2113; //set group parameter
  452. #endregion
  453. #region user parameters configuration
  454. public const int MAX_ALARMHOST_VIDEO_CHAN = 64;
  455. public const int NET_DVR_GET_DEVICECFG_V40 = 1100;//Get extended device parameters
  456. public const int NET_DVR_SET_DEVICECFG_V40 = 1101;//Set extended device parameters
  457. #endregion
  458. #region cardreader configuration
  459. public const int CARD_READER_DESCRIPTION = 32; //card reader description
  460. public const int NET_DVR_GET_CARD_READER_CFG_V50 = 2505; //get card reader configure v50
  461. public const int NET_DVR_SET_CARD_READER_CFG_V50 = 2506; //set card reader configure v50
  462. #endregion
  463. #region face configuration
  464. public const int MAX_FACE_NUM = 2; //max face number
  465. public const int NET_DVR_GET_FACE_PARAM_CFG = 2507; //get face param configure
  466. public const int NET_DVR_SET_FACE_PARAM_CFG = 2508; //set face param configure
  467. public const int NET_DVR_DEL_FACE_PARAM_CFG = 2509; //delete face param configure
  468. public const int NET_DVR_CAPTURE_FACE_INFO = 2510; //capture face information
  469. #endregion
  470. #region fingerprint configuration
  471. public const int MAX_FINGER_PRINT_LEN = 768; //max finger print len
  472. public const int MAX_FINGER_PRINT_NUM = 10; //max finger print num
  473. public const int ERROR_MSG_LEN = 32;
  474. public const int NET_SDK_EMPLOYEE_NO_LEN = 32;
  475. public const int NET_DVR_GET_FINGERPRINT_CFG = 2150; //get fingerprint parameter
  476. public const int NET_DVR_SET_FINGERPRINT_CFG = 2151; //set fingerprint parameter
  477. public const int NET_DVR_DEL_FINGERPRINT_CFG = 2152; //delete fingerprint parameter
  478. public const int NET_DVR_GET_FINGERPRINT_CFG_V50 = 2183; //get fingerprint parameter V50
  479. public const int NET_DVR_SET_FINGERPRINT_CFG_V50 = 2184; //set fingerprint parameter V50
  480. public const int NET_DVR_CAPTURE_FINGERPRINT_INFO = 2504;
  481. #endregion
  482. #region plan configuration
  483. public const int MAX_DAYS = 7; //The number of days in a week
  484. public const int MAX_TIMESEGMENT_V30 = 8; //Maximum number of time segments in 9000 DVR's guard schedule
  485. public const int HOLIDAY_GROUP_NAME_LEN = 32; //holiday group name len
  486. public const int MAX_HOLIDAY_PLAN_NUM = 16; //holiday max plan number
  487. public const int TEMPLATE_NAME_LEN = 32; //plan template name len
  488. public const int MAX_HOLIDAY_GROUP_NUM = 16; //plan template max group number
  489. public const int NET_DVR_GET_WEEK_PLAN_CFG = 2100; //get door status week plan config
  490. public const int NET_DVR_SET_WEEK_PLAN_CFG = 2101; //set door status week plan config
  491. public const int NET_DVR_GET_DOOR_STATUS_HOLIDAY_PLAN = 2102; //get door status holiday week plan config
  492. public const int NET_DVR_SET_DOOR_STATUS_HOLIDAY_PLAN = 2103; //set door status holiday week plan config
  493. public const int NET_DVR_GET_DOOR_STATUS_HOLIDAY_GROUP = 2104; //get door holiday group parameter
  494. public const int NET_DVR_SET_DOOR_STATUS_HOLIDAY_GROUP = 2105; //set door holiday group parameter
  495. public const int NET_DVR_GET_DOOR_STATUS_PLAN_TEMPLATE = 2106; //get door status plan template parameter
  496. public const int NET_DVR_SET_DOOR_STATUS_PLAN_TEMPLATE = 2107; //set door status plan template parameter
  497. public const int NET_DVR_GET_VERIFY_WEEK_PLAN = 2124; //get reader card verfy week plan
  498. public const int NET_DVR_SET_VERIFY_WEEK_PLAN = 2125; //set reader card verfy week plan
  499. public const int NET_DVR_GET_CARD_RIGHT_WEEK_PLAN = 2126; //get card right week plan
  500. public const int NET_DVR_SET_CARD_RIGHT_WEEK_PLAN = 2127; //set card right week plan
  501. public const int NET_DVR_GET_VERIFY_HOLIDAY_PLAN = 2128; //get card reader verify holiday plan
  502. public const int NET_DVR_SET_VERIFY_HOLIDAY_PLAN = 2129; //set card reader verify holiday plan
  503. public const int NET_DVR_GET_CARD_RIGHT_HOLIDAY_PLAN = 2130; //get card right holiday plan
  504. public const int NET_DVR_SET_CARD_RIGHT_HOLIDAY_PLAN = 2131; //set card right holiday plan
  505. public const int NET_DVR_GET_VERIFY_HOLIDAY_GROUP = 2132; //get card reader verify holiday group
  506. public const int NET_DVR_SET_VERIFY_HOLIDAY_GROUP = 2133; //set card reader verify holiday group
  507. public const int NET_DVR_GET_CARD_RIGHT_HOLIDAY_GROUP = 2134; //get card right holiday group
  508. public const int NET_DVR_SET_CARD_RIGHT_HOLIDAY_GROUP = 2135; //set card right holiday group
  509. public const int NET_DVR_GET_VERIFY_PLAN_TEMPLATE = 2136; //get card reader verify plan template
  510. public const int NET_DVR_SET_VERIFY_PLAN_TEMPLATE = 2137; //set card reader verify plan template
  511. public const int NET_DVR_GET_CARD_RIGHT_PLAN_TEMPLATE = 2138; //get card right plan template
  512. public const int NET_DVR_SET_CARD_RIGHT_PLAN_TEMPLATE = 2139; //set card right plan template
  513. // V50
  514. public const int NET_DVR_GET_CARD_RIGHT_WEEK_PLAN_V50 = 2304; //Access card right V50 weeks plan parameters
  515. public const int NET_DVR_SET_CARD_RIGHT_WEEK_PLAN_V50 = 2305; //Set card right V50 weeks plan parameters
  516. public const int NET_DVR_GET_CARD_RIGHT_HOLIDAY_PLAN_V50 = 2310; //Access card right parameters V50 holiday plan
  517. public const int NET_DVR_SET_CARD_RIGHT_HOLIDAY_PLAN_V50 = 2311; //Set card right parameters V50 holiday plan
  518. public const int NET_DVR_GET_CARD_RIGHT_HOLIDAY_GROUP_V50 = 2316; //Access card right parameters V50 holiday group
  519. public const int NET_DVR_SET_CARD_RIGHT_HOLIDAY_GROUP_V50 = 2317; //Set card right parameters V50 holiday group
  520. public const int NET_DVR_GET_CARD_RIGHT_PLAN_TEMPLATE_V50 = 2322; //Access card right parameters V50 plan template
  521. public const int NET_DVR_SET_CARD_RIGHT_PLAN_TEMPLATE_V50 = 2323; //Set card right parameters V50 plan template
  522. #endregion
  523. #region card reader verification mode and door status planning parameters configuration
  524. public const int NET_DVR_GET_DOOR_STATUS_PLAN = 2110; //get door status plan parameter
  525. public const int NET_DVR_SET_DOOR_STATUS_PLAN = 2111; //set door status plan parameter
  526. public const int NET_DVR_GET_CARD_READER_PLAN = 2142; //get card reader verify plan parameter
  527. public const int NET_DVR_SET_CARD_READER_PLAN = 2143; //get card reader verify plan parameter
  528. #endregion
  529. #region card number associated with the user information parameter configuration
  530. public const int NET_DVR_GET_CARD_USERINFO_CFG = 2163; //get card userinfo cfg
  531. public const int NET_DVR_SET_CARD_USERINFO_CFG = 2164; //set card userinfo cfg
  532. #endregion
  533. #region event card linkage
  534. public const int NET_DVR_GET_EVENT_CARD_LINKAGE_CFG_V50 = 2181; //get event card linkage cfg
  535. public const int NET_DVR_SET_EVENT_CARD_LINKAGE_CFG_V50 = 2182; //set event card linkage cfg
  536. #endregion
  537. public const int NET_DVR_DEL_FINGERPRINT_CFG_V50 = 2517; //delete fingerprint parameter V50
  538. public const int NET_DVR_GET_EVENT_CARD_LINKAGE_CFG_V51 = 2518; //get event card linkage cfg V51
  539. public const int NET_DVR_SET_EVENT_CARD_LINKAGE_CFG_V51 = 2519; //set event card linkage cfg V51
  540. public const int NET_DVR_JSON_CONFIG = 2550;
  541. public const int NET_DVR_FACE_DATA_RECORD = 2551;
  542. public const int NET_DVR_FACE_DATA_SEARCH = 2552;
  543. public const int NET_DVR_FACE_DATA_MODIFY = 2553;
  544. public const int NET_DVR_CAPTURE_DATA_SEARCH = 2554;
  545. #region net configuration
  546. public const int NET_DVR_GET_NETCFG_V30 = 1000;//Get network parameter configuration
  547. public const int NET_DVR_SET_NETCFG_V30 = 1001;//Set network parameter configuration
  548. public const int NET_DVR_GET_NETCFG_V50 = 1015; //Get network parameter configuration (V50)
  549. public const int NET_DVR_SET_NETCFG_V50 = 1016; //Set network parameter configuration (V50)
  550. #endregion
  551. #region video call
  552. public const int NET_DVR_VIDEO_CALL_SIGNAL_PROCESS = 16032; //video call signal process
  553. #endregion
  554. #endregion // HCNetSDK.dll macro definition
  555. #region ACS_FACE_PARAM
  556. public const int WM_MSG_SET_FACE_PARAM_FINISH = 1002;
  557. public const int WM_MSG_GET_FACE_PARAM_FINISH = 1003;
  558. public const int WM_MSG_ADD_FACE_PARAM_TOLIST = 1004;
  559. #endregion
  560. #region HCNetSDK.dll structure definition
  561. //structure definition
  562. #region common use
  563. [StructLayoutAttribute(LayoutKind.Sequential)]
  564. public struct NET_DVR_DATE
  565. {
  566. public ushort wYear; //year
  567. public byte byMonth; //month
  568. public byte byDay; //day
  569. }
  570. [StructLayoutAttribute(LayoutKind.Sequential)]
  571. public struct NET_DVR_SIMPLE_DAYTIME
  572. {
  573. public byte byHour; //hour
  574. public byte byMinute; //minute
  575. public byte bySecond; //second
  576. public byte byRes;
  577. }
  578. // Time correction structure
  579. [StructLayoutAttribute(LayoutKind.Sequential)]
  580. public struct NET_DVR_TIME
  581. {
  582. public int dwYear;
  583. public int dwMonth;
  584. public int dwDay;
  585. public int dwHour;
  586. public int dwMinute;
  587. public int dwSecond;
  588. }
  589. [StructLayoutAttribute(LayoutKind.Sequential)]
  590. public struct NET_DVR_TIME_EX
  591. {
  592. public ushort wYear;
  593. public byte byMonth;
  594. public byte byDay;
  595. public byte byHour;
  596. public byte byMinute;
  597. public byte bySecond;
  598. public byte byRes;
  599. }
  600. // Long config callback type
  601. public enum NET_SDK_CALLBACK_TYPE
  602. {
  603. NET_SDK_CALLBACK_TYPE_STATUS = 0, // Status
  604. NET_SDK_CALLBACK_TYPE_PROGRESS, // Progress
  605. NET_SDK_CALLBACK_TYPE_DATA // Data
  606. }
  607. // Long config status value
  608. public enum NET_SDK_CALLBACK_STATUS_NORMAL
  609. {
  610. NET_SDK_CALLBACK_STATUS_SUCCESS = 1000, // Success
  611. NET_SDK_CALLBACK_STATUS_PROCESSING, // Processing
  612. NET_SDK_CALLBACK_STATUS_FAILED, // Failed
  613. NET_SDK_CALLBACK_STATUS_EXCEPTION, // Exception
  614. NET_SDK_CALLBACK_STATUS_LANGUAGE_MISMATCH, // Language mismatch
  615. NET_SDK_CALLBACK_STATUS_DEV_TYPE_MISMATCH, // Device type mismatch
  616. NET_DVR_CALLBACK_STATUS_SEND_WAIT, // send wait
  617. }
  618. public enum LONG_CFG_SEND_DATA_TYPE_ENUM
  619. {
  620. ENUM_DVR_VEHICLE_CHECK = 1, //vehicle Black list check
  621. ENUM_MSC_SEND_DATA = 2, //screen control data type
  622. ENUM_ACS_SEND_DATA = 3, //access card data type
  623. ENUM_TME_CARD_SEND_DATA = 4, //Parking Card data type
  624. ENUM_TME_VEHICLE_SEND_DATA = 5, //TME Vehicle Info data type
  625. ENUM_DVR_DEBUG_CMD = 6, //Debug Cmd
  626. ENUM_DVR_SCREEN_CTRL_CMD = 7, //Screen interactive
  627. ENUM_CVR_PASSBACK_SEND_DATA = 8, //CVR get passback task executable data type
  628. ENUM_ACS_INTELLIGENT_IDENTITY_DATA = 9, //intelligent identity data type
  629. ENUM_VIDEO_INTERCOM_SEND_DATA = 10, //video intercom send data
  630. ENUM_SEND_JSON_DATA = 11 //send json data
  631. }
  632. public enum ENUM_UPGRADE_TYPE
  633. {
  634. ENUM_UPGRADE_DVR = 0, //other device
  635. ENUM_UPGRADE_ACS = 1, //acs device
  636. }
  637. public enum NET_SDK_GET_NEXT_STATUS
  638. {
  639. NET_SDK_GET_NEXT_STATUS_SUCCESS = 1000, // Get data successfully, Call API NET_DVR_RemoteConfigGetNext after processing this data.
  640. NET_SDK_GET_NETX_STATUS_NEED_WAIT, // Need wait, keep calling NET_DVR_RemoteConfigGetNext
  641. NET_SDK_GET_NEXT_STATUS_FINISH, // Get data finish, call API NET_DVR_StopRemoteConfig
  642. NET_SDK_GET_NEXT_STATUS_FAILED, // Get data failed, call API NET_DVR_StopRemoteConfig
  643. }
  644. public enum LONG_CFG_RECV_DATA_TYPE_ENUM
  645. {
  646. ENUM_DVR_ERROR_CODE = 1, //Error code
  647. ENUM_MSC_RECV_DATA = 2, //screen control data type
  648. ENUM_ACS_RECV_DATA = 3 //ACS control data type
  649. }
  650. public enum ACS_DEV_SUBEVENT_ENUM
  651. {
  652. EVENT_ACS_HOST_ANTI_DISMANTLE = 0,
  653. EVENT_ACS_OFFLINE_ECENT_NEARLY_FULL,
  654. EVENT_ACS_NET_BROKEN,
  655. EVENT_ACS_NET_RESUME,
  656. EVENT_ACS_LOW_BATTERY,
  657. EVENT_ACS_BATTERY_RESUME,
  658. EVENT_ACS_AC_OFF,
  659. EVENT_ACS_AC_RESUME,
  660. EVENT_ACS_SD_CARD_FULL,
  661. EVENT_ACS_LINKAGE_CAPTURE_PIC,
  662. EVENT_ACS_IMAGE_QUALITY_LOW,
  663. EVENT_ACS_FINGER_PRINT_QUALITY_LOW,
  664. EVENT_ACS_BATTERY_ELECTRIC_LOW,
  665. EVENT_ACS_BATTERY_ELECTRIC_RESUME,
  666. EVENT_ACS_FIRE_IMPORT_SHORT_CIRCUIT,
  667. EVENT_ACS_FIRE_IMPORT_BROKEN_CIRCUIT,
  668. EVENT_ACS_FIRE_IMPORT_RESUME,
  669. EVENT_ACS_MASTER_RS485_LOOPNODE_BROKEN,
  670. EVENT_ACS_MASTER_RS485_LOOPNODE_RESUME,
  671. EVENT_ACS_LOCAL_CONTROL_OFFLINE,
  672. EVENT_ACS_LOCAL_CONTROL_RESUME,
  673. EVENT_ACS_LOCAL_DOWNSIDE_RS485_LOOPNODE_BROKEN,
  674. EVENT_ACS_LOCAL_DOWNSIDE_RS485_LOOPNODE_RESUME,
  675. EVENT_ACS_DISTRACT_CONTROLLER_ONLINE,
  676. EVENT_ACS_DISTRACT_CONTROLLER_OFFLINE,
  677. EVENT_ACS_FIRE_BUTTON_TRIGGER,
  678. EVENT_ACS_FIRE_BUTTON_RESUME,
  679. EVENT_ACS_MAINTENANCE_BUTTON_TRIGGER,
  680. EVENT_ACS_MAINTENANCE_BUTTON_RESUME,
  681. EVENT_ACS_EMERGENCY_BUTTON_TRIGGER,
  682. EVENT_ACS_EMERGENCY_BUTTON_RESUME,
  683. EVENT_ACS_MAC_DETECT
  684. }
  685. public enum ACS_ALARM_SUBEVENT_ENUM
  686. {
  687. EVENT_ACS_ALARMIN_SHORT_CIRCUIT = 0,
  688. EVENT_ACS_ALARMIN_BROKEN_CIRCUIT,
  689. EVENT_ACS_ALARMIN_EXCEPTION,
  690. EVENT_ACS_ALARMIN_RESUME,
  691. EVENT_ACS_CASE_SENSOR_ALARM,
  692. EVENT_ACS_CASE_SENSOR_RESUME
  693. }
  694. public enum ACS_DOOR_SUBEVENT_ENUM
  695. {
  696. EVENT_ACS_LEADER_CARD_OPEN_BEGIN = 0,
  697. EVENT_ACS_LEADER_CARD_OPEN_END,
  698. EVENT_ACS_ALWAYS_OPEN_BEGIN,
  699. EVENT_ACS_ALWAYS_OPEN_END,
  700. EVENT_ACS_ALWAYS_CLOSE_BEGIN,
  701. EVENT_ACS_ALWAYS_CLOSE_END,
  702. EVENT_ACS_LOCK_OPEN,
  703. EVENT_ACS_LOCK_CLOSE,
  704. EVENT_ACS_DOOR_BUTTON_PRESS,
  705. EVENT_ACS_DOOR_BUTTON_RELEASE,
  706. EVENT_ACS_DOOR_OPEN_NORMAL,
  707. EVENT_ACS_DOOR_CLOSE_NORMAL,
  708. EVENT_ACS_DOOR_OPEN_ABNORMAL,
  709. EVENT_ACS_DOOR_OPEN_TIMEOUT,
  710. EVENT_ACS_REMOTE_OPEN_DOOR,
  711. EVENT_ACS_REMOTE_CLOSE_DOOR,
  712. EVENT_ACS_REMOTE_ALWAYS_OPEN,
  713. EVENT_ACS_REMOTE_ALWAYS_CLOSE,
  714. EVENT_ACS_NOT_BELONG_MULTI_GROUP,
  715. EVENT_ACS_INVALID_MULTI_VERIFY_PERIOD,
  716. EVENT_ACS_MULTI_VERIFY_SUPER_RIGHT_FAIL,
  717. EVENT_ACS_MULTI_VERIFY_REMOTE_RIGHT_FAIL,
  718. EVENT_ACS_MULTI_VERIFY_SUCCESS,
  719. EVENT_ACS_MULTI_VERIFY_NEED_REMOTE_OPEN,
  720. EVENT_ACS_MULTI_VERIFY_SUPERPASSWD_VERIFY_SUCCESS,
  721. EVENT_ACS_MULTI_VERIFY_REPEAT_VERIFY_FAIL,
  722. EVENT_ACS_MULTI_VERIFY_TIMEOUT,
  723. EVENT_ACS_REMOTE_CAPTURE_PIC,
  724. EVENT_ACS_DOORBELL_RINGING,
  725. EVENT_ACS_SECURITY_MODULE_DESMANTLE_ALARM,
  726. EVENT_ACS_CALL_CENTER,
  727. EVENT_ACS_FIRSTCARD_AUTHORIZE_BEGIN,
  728. EVENT_ACS_FIRSTCARD_AUTHORIZE_END,
  729. EVENT_ACS_DOORLOCK_INPUT_SHORT_CIRCUIT,
  730. EVENT_ACS_DOORLOCK_INPUT_BROKEN_CIRCUIT,
  731. EVENT_ACS_DOORLOCK_INPUT_EXCEPTION,
  732. EVENT_ACS_DOORCONTACT_INPUT_SHORT_CIRCUIT,
  733. EVENT_ACS_DOORCONTACT_INPUT_BROKEN_CIRCUIT,
  734. EVENT_ACS_DOORCONTACT_INPUT_EXCEPTION,
  735. EVENT_ACS_OPENBUTTON_INPUT_SHORT_CIRCUIT,
  736. EVENT_ACS_OPENBUTTON_INPUT_BROKEN_CIRCUIT,
  737. EVENT_ACS_OPENBUTTON_INPUT_EXCEPTION,
  738. EVENT_ACS_DOORLOCK_OPEN_EXCEPTION,
  739. EVENT_ACS_DOORLOCK_OPEN_TIMEOUT,
  740. EVENT_ACS_FIRSTCARD_OPEN_WITHOUT_AUTHORIZE,
  741. EVENT_ACS_CALL_LADDER_RELAY_BREAK,
  742. EVENT_ACS_CALL_LADDER_RELAY_CLOSE,
  743. EVENT_ACS_AUTO_KEY_RELAY_BREAK,
  744. EVENT_ACS_AUTO_KEY_RELAY_CLOSE,
  745. EVENT_ACS_KEY_CONTROL_RELAY_BREAK,
  746. EVENT_ACS_KEY_CONTROL_RELAY_CLOSE,
  747. EVENT_ACS_REMOTE_VISITOR_CALL_LADDER,
  748. EVENT_ACS_REMOTE_HOUSEHOLD_CALL_LADDER,
  749. EVENT_ACS_LEGAL_MESSAGE,
  750. EVENT_ACS_ILLEGAL_MESSAGE
  751. }
  752. public enum ACS_CARD_READER_SUBEVENT_ENUM
  753. {
  754. EVENT_ACS_STRESS_ALARM = 0,
  755. EVENT_ACS_CARD_READER_DESMANTLE_ALARM,
  756. EVENT_ACS_LEGAL_CARD_PASS,
  757. EVENT_ACS_CARD_AND_PSW_PASS,
  758. EVENT_ACS_CARD_AND_PSW_FAIL,
  759. EVENT_ACS_CARD_AND_PSW_TIMEOUT,
  760. EVENT_ACS_CARD_MAX_AUTHENTICATE_FAIL,
  761. EVENT_ACS_CARD_NO_RIGHT,
  762. EVENT_ACS_CARD_INVALID_PERIOD,
  763. EVENT_ACS_CARD_OUT_OF_DATE,
  764. EVENT_ACS_INVALID_CARD,
  765. EVENT_ACS_ANTI_SNEAK_FAIL,
  766. EVENT_ACS_INTERLOCK_DOOR_NOT_CLOSE,
  767. EVENT_ACS_FINGERPRINT_COMPARE_PASS,
  768. EVENT_ACS_FINGERPRINT_COMPARE_FAIL,
  769. EVENT_ACS_CARD_FINGERPRINT_VERIFY_PASS,
  770. EVENT_ACS_CARD_FINGERPRINT_VERIFY_FAIL,
  771. EVENT_ACS_CARD_FINGERPRINT_VERIFY_TIMEOUT,
  772. EVENT_ACS_CARD_FINGERPRINT_PASSWD_VERIFY_PASS,
  773. EVENT_ACS_CARD_FINGERPRINT_PASSWD_VERIFY_FAIL,
  774. EVENT_ACS_CARD_FINGERPRINT_PASSWD_VERIFY_TIMEOUT,
  775. EVENT_ACS_FINGERPRINT_PASSWD_VERIFY_PASS,
  776. EVENT_ACS_FINGERPRINT_PASSWD_VERIFY_FAIL,
  777. EVENT_ACS_FINGERPRINT_PASSWD_VERIFY_TIMEOUT,
  778. EVENT_ACS_FINGERPRINT_INEXISTENCE,
  779. EVENT_ACS_FACE_VERIFY_PASS,
  780. EVENT_ACS_FACE_VERIFY_FAIL,
  781. EVENT_ACS_FACE_AND_FP_VERIFY_PASS,
  782. EVENT_ACS_FACE_AND_FP_VERIFY_FAIL,
  783. EVENT_ACS_FACE_AND_FP_VERIFY_TIMEOUT,
  784. EVENT_ACS_FACE_AND_PW_VERIFY_PASS,
  785. EVENT_ACS_FACE_AND_PW_VERIFY_FAIL,
  786. EVENT_ACS_FACE_AND_PW_VERIFY_TIMEOUT,
  787. EVENT_ACS_FACE_AND_CARD_VERIFY_PASS,
  788. EVENT_ACS_FACE_AND_CARD_VERIFY_FAIL,
  789. EVENT_ACS_FACE_AND_CARD_VERIFY_TIMEOUT,
  790. EVENT_ACS_FACE_AND_PW_AND_FP_VERIFY_PASS,
  791. EVENT_ACS_FACE_AND_PW_AND_FP_VERIFY_FAIL,
  792. EVENT_ACS_FACE_AND_PW_AND_FP_VERIFY_TIMEOUT,
  793. EVENT_ACS_FACE_AND_CARD_AND_FP_VERIFY_PASS,
  794. EVENT_ACS_FACE_AND_CARD_AND_FP_VERIFY_FAIL,
  795. EVENT_ACS_FACE_AND_CARD_AND_FP_VERIFY_TIMEOUT,
  796. EVENT_ACS_EMPLOYEENO_AND_FP_VERIFY_PASS,
  797. EVENT_ACS_EMPLOYEENO_AND_FP_VERIFY_FAIL,
  798. EVENT_ACS_EMPLOYEENO_AND_FP_VERIFY_TIMEOUT,
  799. EVENT_ACS_EMPLOYEENO_AND_FP_AND_PW_VERIFY_PASS,
  800. EVENT_ACS_EMPLOYEENO_AND_FP_AND_PW_VERIFY_FAIL,
  801. EVENT_ACS_EMPLOYEENO_AND_FP_AND_PW_VERIFY_TIMEOUT,
  802. EVENT_ACS_EMPLOYEENO_AND_FACE_VERIFY_PASS,
  803. EVENT_ACS_EMPLOYEENO_AND_FACE_VERIFY_FAIL,
  804. EVENT_ACS_EMPLOYEENO_AND_FACE_VERIFY_TIMEOUT,
  805. EVENT_ACS_FACE_RECOGNIZE_FAIL,
  806. EVENT_ACS_EMPLOYEENO_AND_PW_PASS,
  807. EVENT_ACS_EMPLOYEENO_AND_PW_FAIL,
  808. EVENT_ACS_EMPLOYEENO_AND_PW_TIMEOUT,
  809. EVENT_ACS_HUMAN_DETECT_FAIL
  810. }
  811. [StructLayoutAttribute(LayoutKind.Sequential)]
  812. public struct NET_DVR_XML_CONFIG_INPUT
  813. {
  814. public uint dwSize; //size of NET_DVR_XML_CONFIG_INPUT
  815. public IntPtr lpRequestUrl; //command string
  816. public uint dwRequestUrlLen; //command string length
  817. public IntPtr lpInBuffer; //input buffer ,XML format
  818. public uint dwInBufferSize; //input buffer length
  819. public uint dwRecvTimeOut; //receive timeout,unit:ms,0 represent 5s
  820. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
  821. public byte[] byRes; //reserve
  822. }
  823. [StructLayoutAttribute(LayoutKind.Sequential)]
  824. public struct NET_DVR_XML_CONFIG_OUTPUT
  825. {
  826. public uint dwSize; //size of NET_DVR_XML_CONFIG_OUTPUT
  827. public IntPtr lpOutBuffer; //output buffer,XMLformat
  828. public uint dwOutBufferSize; //input buffer length
  829. public uint dwReturnedXMLSize; //the real receive Xml size
  830. public IntPtr lpStatusBuffer; //return status(XML format),no assignment with success, If you don't care about it ,just set it NULL
  831. public uint dwStatusSize; //status length(unit byte)
  832. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
  833. public byte[] byRes; //reserve
  834. }
  835. [StructLayoutAttribute(LayoutKind.Sequential)]
  836. public struct NET_DVR_JSON_DATA_CFG
  837. {
  838. public uint dwSize; //size of NET_DVR_JSON_DATA_CFG
  839. public IntPtr lpJsonData; //Json data
  840. public uint dwJsonDataSize; //Json data size
  841. public IntPtr lpPicData; //picture data
  842. public uint dwPicDataSize; //picture data size
  843. public uint dwInfraredFacePicSize; //infrared picture data size
  844. public IntPtr lpInfraredFacePicBuffer; //infrared picture data
  845. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 248)]
  846. public byte[] byRes; //reserve
  847. }
  848. #endregion
  849. #region acs event upload
  850. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
  851. public struct NET_DVR_LOG_V30
  852. {
  853. public NET_DVR_TIME strLogTime;
  854. public uint dwMajorType;//Main type 1- alarm; 2- abnormal; 3- operation; 0xff- all
  855. public uint dwMinorType; //Hypo- Type 0- all;
  856. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NAMELEN, ArraySubType = UnmanagedType.I1)]
  857. public byte[] sPanelUser;//user ID for local panel operation
  858. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NAMELEN, ArraySubType = UnmanagedType.I1)]
  859. public byte[] sNetUser;//user ID for network operation
  860. public NET_DVR_IPADDR struRemoteHostAddr;//remote host IP
  861. public uint dwParaType;//parameter type, for 9000 series MINOR_START_VT/MINOR_STOP_VT, channel of the voice talking
  862. public uint dwChannel;//channel number
  863. public uint dwDiskNumber;//HD number
  864. public uint dwAlarmInPort;//alarm input port
  865. public uint dwAlarmOutPort;//alarm output port
  866. public uint dwInfoLen;
  867. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = LOG_INFO_LEN)]
  868. public string sInfo;
  869. }
  870. // ACS event informations
  871. public struct NET_DVR_ACS_EVENT_INFO
  872. {
  873. public uint dwSize;
  874. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  875. public byte[] byCardNo; // card No, 0 means invalid
  876. public byte byCardType; // card type,1-ordinary card,2-disable card,3-black list card, 4-patrol card,5-stress card,6-super card,7-client card, 0 means invalid
  877. public byte byWhiteListNo; // white list No, 1-8, 0 means invalid
  878. public byte byReportChannel; // report channel, 1-alarmin updata, 2-center group 1, 3-center group 2, 0 means invalid
  879. public byte byCardReaderKind; // card reader type: 0-invalid, 1-IC card reader, 2-Id card reader, 3-Qr code reader, 4-Fingerprint head
  880. public uint dwCardReaderNo; // card reader No, 0 means invalid
  881. public uint dwDoorNo; // door No(floor No), 0 means invalid
  882. public uint dwVerifyNo; // mutilcard verify No. 0 means invalid
  883. public uint dwAlarmInNo; // alarm in No, 0 means invalid
  884. public uint dwAlarmOutNo; // alarm out No 0 means invalid
  885. public uint dwCaseSensorNo; // case sensor No 0 means invalid
  886. public uint dwRs485No; // RS485 channel,0 means invalid
  887. public uint dwMultiCardGroupNo; // multicard group No.
  888. public ushort wAccessChannel; // Staff channel number
  889. public byte byDeviceNo; // device No,0 means invalid
  890. public byte byDistractControlNo; // distract control,0 means invalid
  891. public uint dwEmployeeNo; // employee No,0 means invalid
  892. public ushort wLocalControllerID; // On the controller number, 0 - access the host, 1-64 on behalf of the local controller
  893. public byte byInternetAccess; // Internet access ID (1-uplink network port 1, 2-uplink network port 2,3- downstream network interface 1
  894. public byte byType; // protection zone type, 0-real time, 1-24 hours, 2-delay, 3-internal, 4-the key, 5-fire, 6-perimeter, 7-24 hours of silent
  895. // 8-24 hours auxiliary, 9-24 hours vibration, 10-door emergency open, 11-door emergency shutdown, 0xff-null
  896. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
  897. public byte[] byMACAddr; // mac addr 0 means invalid
  898. public byte bySwipeCardType;// swipe card type, 0-invalid,1-Qr code
  899. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 13, ArraySubType = UnmanagedType.I1)]
  900. public byte[] byRes;
  901. }
  902. // Entrance guard alarm information structure
  903. public struct NET_DVR_ACS_ALARM_INFO
  904. {
  905. public uint dwSize;
  906. public uint dwMajor; // alarm major, reference to macro
  907. public uint dwMinor; // alarm minor, reference to macro
  908. public NET_DVR_TIME struTime;
  909. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_NAMELEN, ArraySubType = UnmanagedType.I1)]
  910. public byte[] sNetUser; // net operator user
  911. public NET_DVR_IPADDR struRemoteHostAddr; // remote host address
  912. public NET_DVR_ACS_EVENT_INFO struAcsEventInfo;
  913. public uint dwPicDataLen; // picture length, when 0 ,means has no picture
  914. public IntPtr pPicData; // picture data
  915. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 24, ArraySubType = UnmanagedType.I1)]
  916. public byte[] byRes;
  917. }
  918. //Alarm Device Infor
  919. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
  920. public struct NET_DVR_ALARMER
  921. {
  922. public byte byUserIDValid; /* Whether userID is valid, 0- invalid 1- valid. */
  923. public byte bySerialValid; /* Whether serial number is valid, 0- invalid 1- valid. */
  924. public byte byVersionValid; /* Whether version number is valid, 0- invalid 1- valid. */
  925. public byte byDeviceNameValid; /* Whether device name is valid, 0- invalid 1- valid. */
  926. public byte byMacAddrValid; /* Whether MAC address is valid, 0- invalid 1- valid. */
  927. public byte byLinkPortValid; /* Whether login port number is valid, 0- invalid 1- valid. */
  928. public byte byDeviceIPValid; /* Whether device IP is valid, 0- invalid 1- valid.*/
  929. public byte bySocketIPValid; /* Whether socket IP is valid, 0- invalid 1- valid. */
  930. public int lUserID; /* NET_DVR_Login () effective when establishing alarm upload channel*/
  931. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
  932. public byte[] sSerialNumber; /* Serial number. */
  933. public uint dwDeviceVersion; /* Version number, 2 high byte means the major version, 2 low byte means the minor version*/
  934. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = NAME_LEN)]
  935. public string sDeviceName; /* Device name. */
  936. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
  937. public byte[] byMacAddr; /* MAC address */
  938. public ushort wLinkPort; /* link port */
  939. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 128)]
  940. public string sDeviceIP; /* IP address */
  941. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 128)]
  942. public string sSocketIP; /* alarm push- mode socket IP address. */
  943. public byte byIpProtocol; /* IP protocol: 0- IPV4; 1- IPV6. */
  944. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 11, ArraySubType = UnmanagedType.I1)]
  945. public byte[] byRes2;
  946. }
  947. //Alarm protection structure parameters
  948. [StructLayoutAttribute(LayoutKind.Sequential)]
  949. public struct NET_DVR_SETUPALARM_PARAM
  950. {
  951. public uint dwSize;
  952. public byte byLevel; //Arming priority: 0-high, 1-middle, 2-low
  953. public byte byAlarmInfoType;//Upload alarm information types(Intelligent traffic camera support):0- old(NET_DVR_PLATE_RESULT),1- new(NET_ITS_PLATE_RESULT)
  954. public byte byRetAlarmTypeV40; //0- Ret NET_DVR_ALARMINFO_V30 or Older, 1- if Device Support NET_DVR_ALARMINFO_V40, Ret NET_DVR_ALARMINFO_V40, else Ret NET_DVR_ALARMINFO_V30 Or NET_DVR_ALARMINFO
  955. public byte byRetDevInfoVersion; //CVR alarm 0-COMM_ALARM_DEVICE, 1-COMM_ALARM_DEVICE_V40
  956. public byte byRetVQDAlarmType; //Exptected VQD alarm type,0-upload NET_DVR_VQD_DIAGNOSE_INFO,1-upload NET_DVR_VQD_ALARM
  957. //1-(INTER_FACE_DETECTION),0-(INTER_FACESNAP_RESULT)
  958. public byte byFaceAlarmDetection;
  959. //Bit0 - indicates whether the secondary protection to upload pictures: 0 - upload, 1 - do not upload
  960. //Bit1 - said open data upload confirmation mechanism; 0 - don't open, 1 - to open
  961. public byte bySupport;
  962. //broken Net Http
  963. //bit0-Vehicle Detection(IPC) (0 - not continuingly, 1 - continuingly)
  964. //bit1-PDC(IPC) (0 - not continuingly, 1 - continuingly)
  965. //bit2-HeatMap(IPC) (0 - not continuingly, 1 - continuingly)
  966. public byte byBrokenNetHttp;
  967. public ushort wTaskNo;//Tasking number and the (field dwTaskNo corresponding data upload NET_DVR_VEHICLE_RECOG_RESULT the same time issued a task structure NET_DVR_VEHICLE_RECOG_COND corresponding fields in dwTaskNo
  968. public byte byDeployType;//deploy type:0-client deploy,1-real time deploy
  969. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  970. public byte[] byRes1;
  971. public byte byAlarmTypeURL;//bit0-(NET_DVR_FACESNAP_RESULT),0-binary,1-URL
  972. public byte byCustomCtrl;//Bit0- Support the copilot face picture upload: 0-Upload,1-Do not upload
  973. }
  974. #endregion
  975. #region card parameters configuration
  976. [StructLayoutAttribute(LayoutKind.Sequential)]
  977. public struct NET_DVR_VALID_PERIOD_CFG
  978. {
  979. public byte byEnable; //whether to enable , 0-disable 1-enable
  980. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  981. public byte[] byRes1;
  982. public NET_DVR_TIME_EX struBeginTime; //valid begin time
  983. public NET_DVR_TIME_EX struEndTime; //valid end time
  984. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  985. public byte[] byRes2;
  986. }
  987. [StructLayoutAttribute(LayoutKind.Sequential)]
  988. public struct NET_DVR_CARD_CFG_V50
  989. {
  990. public uint dwSize;
  991. public uint dwModifyParamType;
  992. // 需要修改的卡参数,设置卡参数时有效,按位表示,每位代表一种参数,1为需要修改,0为不修改
  993. // #define CARD_PARAM_CARD_VALID 0x00000001 //卡是否有效参数
  994. // #define CARD_PARAM_VALID 0x00000002 //有效期参数
  995. // #define CARD_PARAM_CARD_TYPE 0x00000004 //卡类型参数
  996. // #define CARD_PARAM_DOOR_RIGHT 0x00000008 //门权限参数
  997. // #define CARD_PARAM_LEADER_CARD 0x00000010 //首卡参数
  998. // #define CARD_PARAM_SWIPE_NUM 0x00000020 //最大刷卡次数参数
  999. // #define CARD_PARAM_GROUP 0x00000040 //所属群组参数
  1000. // #define CARD_PARAM_PASSWORD 0x00000080 //卡密码参数
  1001. // #define CARD_PARAM_RIGHT_PLAN 0x00000100 //卡权限计划参数
  1002. // #define CARD_PARAM_SWIPED_NUM 0x00000200 //已刷卡次数
  1003. // #define CARD_PARAM_EMPLOYEE_NO 0x00000400 //工号
  1004. // #define CARD_PARAM_NAME 0x00000800 //姓名
  1005. // #define CARD_PARAM_DEPARTMENT_NO 0x00001000 //部门编号
  1006. // #define CARD_SCHEDULE_PLAN_NO 0x00002000 //排班计划编号
  1007. // #define CARD_SCHEDULE_PLAN_TYPE 0x00004000 //排班计划类型
  1008. // #define CARD_ROOM_NUMBER 0x00008000 //房间号
  1009. // #define CARD_SIM_NO 0x00010000 //SIM卡号(手机号)
  1010. // #define CARD_FLOOR_NUMBER 0x00020000 //楼层号
  1011. // #define CARD_USER_TYPE 0x00040000 //用户类型
  1012. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1013. public byte[] byCardNo; //卡号
  1014. public byte byCardValid; //卡是否有效,0-无效,1-有效(用于删除卡,设置时置为0进行删除,获取时此字段始终为1)
  1015. public byte byCardType; //卡类型,1-普通卡,2-残疾人卡,3-黑名单卡,4-巡更卡,5-胁迫卡,6-超级卡,7-来宾卡,8-解除卡,9-员工卡,10-应急卡,11-应急管理卡(用于授权临时卡权限,本身不能开门),默认普通卡
  1016. public byte byLeaderCard; //是否为首卡,1-是,0-否
  1017. public byte byUserType; // 0 – 普通用户1 - 管理员用户;
  1018. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  1019. public byte[] byDoorRight; //门权限(楼层权限、锁权限),按位表示,1为有权限,0为无权限,从低位到高位表示对门(锁)1-N是否有权限
  1020. public NET_DVR_VALID_PERIOD_CFG struValid; //有效期参数
  1021. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_GROUP_NUM_128, ArraySubType = UnmanagedType.I1)]
  1022. public byte[] byBelongGroup; //所属群组,按字节表示,1-属于,0-不属于
  1023. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = CARD_PASSWORD_LEN, ArraySubType = UnmanagedType.I1)]
  1024. public byte[] byCardPassword; //卡密码
  1025. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256 * MAX_CARD_RIGHT_PLAN_NUM, ArraySubType = UnmanagedType.U2)]
  1026. public ushort[] wCardRightPlan; //卡权限计划,取值为计划模板编号,同个门(锁)不同计划模板采用权限或的方式处理
  1027. public uint dwMaxSwipeTime; //最大刷卡次数,0为无次数限制(开锁次数)
  1028. public uint dwSwipeTime; //已刷卡次数
  1029. public ushort wRoomNumber; //房间号
  1030. public ushort wFloorNumber; //层号
  1031. public uint dwEmployeeNo; //工号(用户ID)
  1032. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  1033. public byte[] byName; //姓名
  1034. public ushort wDepartmentNo; //部门编号
  1035. public ushort wSchedulePlanNo; //排班计划编号
  1036. public byte bySchedulePlanType; //排班计划类型:0-无意义、1-个人、2-部门
  1037. public byte byRightType; //下发权限类型:0-普通发卡权限、1-二维码权限、2-蓝牙权限(可视对讲设备二维码权限配置项:房间号、卡号(虚拟卡号)、最大刷卡次数(开锁次数)、有效期参数;蓝牙权限:卡号(萤石APP账号)、其他参数配置与普通发卡权限一致)
  1038. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  1039. public byte[] byRes2;
  1040. public uint dwLockID; //锁ID
  1041. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_LOCK_CODE_LEN, ArraySubType = UnmanagedType.I1)]
  1042. public byte[] byLockCode; //锁代码
  1043. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_CODE_LEN, ArraySubType = UnmanagedType.I1)]
  1044. public byte[] byRoomCode; //房间代码
  1045. //按位表示,0-无权限,1-有权限
  1046. //第0位表示:弱电报警
  1047. //第1位表示:开门提示音
  1048. //第2位表示:限制客卡
  1049. //第3位表示:通道
  1050. //第4位表示:反锁开门
  1051. //第5位表示:巡更功能
  1052. public uint dwCardRight; //卡权限
  1053. public uint dwPlanTemplate; //计划模板(每天)各时间段是否启用,按位表示,0--不启用,1-启用
  1054. public uint dwCardUserId; //持卡人ID
  1055. public byte byCardModelType; //0-空,1- MIFARE S50,2- MIFARE S70,3- FM1208 CPU卡,4- FM1216 CPU卡,5-国密CPU卡,6-身份证,7- NFC
  1056. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 51, ArraySubType = UnmanagedType.I1)]
  1057. public byte[] byRes3;
  1058. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  1059. public byte[] bySIMNum; //SIM卡号(手机号)
  1060. public void Init()
  1061. {
  1062. byCardNo = new byte[CHCNetSDK.ACS_CARD_NO_LEN];
  1063. byDoorRight = new byte[CHCNetSDK.MAX_DOOR_NUM_256];
  1064. byBelongGroup = new byte[CHCNetSDK.MAX_GROUP_NUM_128];
  1065. byCardPassword = new byte[CHCNetSDK.CARD_PASSWORD_LEN];
  1066. wCardRightPlan = new ushort[CHCNetSDK.MAX_DOOR_NUM_256 * CHCNetSDK.MAX_CARD_RIGHT_PLAN_NUM];
  1067. byName = new byte[CHCNetSDK.NAME_LEN];
  1068. byRes2 = new byte[3];
  1069. byLockCode = new byte[CHCNetSDK.MAX_LOCK_CODE_LEN];
  1070. byRoomCode = new byte[CHCNetSDK.MAX_DOOR_CODE_LEN];
  1071. byRes3 = new byte[83];
  1072. }
  1073. }
  1074. [StructLayoutAttribute(LayoutKind.Sequential)]
  1075. public struct NET_DVR_CARD_CFG_COND
  1076. {
  1077. public uint dwSize;
  1078. public uint dwCardNum; //card number, 0xffffffff means to get all card information when getting
  1079. public byte byCheckCardNo; //whether to verify card No. 0-not to verify, 1-verify
  1080. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1081. public byte[] byRes1;
  1082. public ushort wLocalControllerID; //On-site controller serial number, said to the local controller issued offline card parameters, 0 is access control host
  1083. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  1084. public byte[] byRes2;
  1085. public uint dwLockID; //lock ID
  1086. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 20, ArraySubType = UnmanagedType.I1)]
  1087. public byte[] byRes3;
  1088. }
  1089. [StructLayoutAttribute(LayoutKind.Sequential)]
  1090. public struct NET_DVR_CARD_CFG_SEND_DATA
  1091. {
  1092. public uint dwSize;
  1093. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1094. public byte[] byCardNo; //card No
  1095. public uint dwCardUserId;
  1096. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 12, ArraySubType = UnmanagedType.I1)]
  1097. public byte[] byRes;
  1098. }
  1099. [StructLayoutAttribute(LayoutKind.Sequential)]
  1100. public struct NET_DVR_FACE_PARAM_COND
  1101. {
  1102. public uint dwSize;
  1103. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1104. public byte[] byCardNo; //card No
  1105. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1106. public byte[] byEnableCardReader; //enable card reader:0-invalid,1-valid
  1107. public uint dwFaceNum; //face number
  1108. public byte byFaceID; //face id:1-2,0xff present this card all face
  1109. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 127, ArraySubType = UnmanagedType.I1)]
  1110. public byte[] byRes;
  1111. public void Init()
  1112. {
  1113. byCardNo = new byte[ACS_CARD_NO_LEN];
  1114. byEnableCardReader = new byte[MAX_CARD_READER_NUM_512];
  1115. byRes = new byte[127];
  1116. }
  1117. }
  1118. [StructLayoutAttribute(LayoutKind.Sequential)]
  1119. public struct NET_DVR_FACE_PARAM_CFG
  1120. {
  1121. public uint dwSize;
  1122. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1123. public byte[] byCardNo; //card No
  1124. public uint dwFaceLen; //face length
  1125. public IntPtr pFaceBuffer; //face buffer
  1126. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1127. public byte[] byEnableCardReader; //enable card reader:0-invalid,1-valid
  1128. public byte byFaceID; //face id:1-2,0xff present this card all face
  1129. public byte byFaceDataType; //face data type:0-module(default),1-picture
  1130. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 126, ArraySubType = UnmanagedType.I1)]
  1131. public byte[] byRes;
  1132. public void Init()
  1133. {
  1134. byCardNo = new byte[ACS_CARD_NO_LEN];
  1135. byEnableCardReader = new byte[MAX_CARD_READER_NUM_512];
  1136. byRes = new byte[126];
  1137. }
  1138. }
  1139. [StructLayoutAttribute(LayoutKind.Sequential)]
  1140. public struct NET_DVR_FACE_PARAM_STATUS
  1141. {
  1142. public uint dwSize;
  1143. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1144. public byte[] byCardNo; //card No
  1145. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1146. public byte[] byCardReaderRecvStatus; //card reader receive status:0-fail,1-success,2-face of poor quality,3-memory full,4-face already exist,5-illegal face ID
  1147. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ERROR_MSG_LEN, ArraySubType = UnmanagedType.I1)]
  1148. public byte[] byErrorMsg; //error message:when byCardReaderRecvStatus is 4,present face already exist correspond card number
  1149. public uint dwCardReaderNo; //card reader No
  1150. public byte byTotalStatus; //total status:0-not set all card readers face,1-set all card readers face
  1151. public byte byFaceID; //face id:1-2
  1152. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 130, ArraySubType = UnmanagedType.I1)]
  1153. public byte[] byRes;
  1154. }
  1155. [StructLayoutAttribute(LayoutKind.Sequential)]
  1156. public struct NET_DVR_CAPTURE_FACE_COND
  1157. {
  1158. public uint dwSize;
  1159. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
  1160. public byte[] byRes;
  1161. }
  1162. [StructLayoutAttribute(LayoutKind.Sequential)]
  1163. public struct NET_DVR_CAPTURE_FACE_CFG
  1164. {
  1165. public uint dwSize;
  1166. public uint dwFaceTemplate1Size;
  1167. public IntPtr pFaceTemplate1Buffer;
  1168. public uint dwFaceTemplate2Size;
  1169. public IntPtr pFaceTemplate2Buffer;
  1170. public uint dwFacePicSize;
  1171. public IntPtr pFacePicBuffer;
  1172. public byte byFaceQuality1;
  1173. public byte byFaceQuality2;
  1174. public byte byCaptureProgress;
  1175. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 125, ArraySubType = UnmanagedType.I1)]
  1176. public byte[] byRes;
  1177. }
  1178. [StructLayoutAttribute(LayoutKind.Sequential)]
  1179. public struct NET_DVR_ACS_PARAM_TYPE
  1180. {
  1181. public uint dwSize;
  1182. public uint dwParamType;
  1183. //parameter type,bitwise representation
  1184. //#define ACS_PARAM_DOOR_STATUS_WEEK_PLAN 0x00000001 //door status week plan
  1185. //#define ACS_PARAM_VERIFY_WEEK_PALN 0x00000002 //card reader week plan
  1186. //#define ACS_PARAM_CARD_RIGHT_WEEK_PLAN 0x00000004 //card right week plan
  1187. //#define ACS_PARAM_DOOR_STATUS_HOLIDAY_PLAN 0x00000008 //door status holiday plan
  1188. //#define ACS_PARAM_VERIFY_HOLIDAY_PALN 0x00000010 //card reader holiday plan
  1189. //#define ACS_PARAM_CARD_RIGHT_HOLIDAY_PLAN 0x00000020 //card right holiday plan
  1190. //#define ACS_PARAM_DOOR_STATUS_HOLIDAY_GROUP 0x00000040 //door status holiday group plan
  1191. //#define ACS_PARAM_VERIFY_HOLIDAY_GROUP 0x00000080 //card reader verify holiday group plan
  1192. //#define ACS_PARAM_CARD_RIGHT_HOLIDAY_GROUP 0x00000100 //card right holiday group plan
  1193. //#define ACS_PARAM_DOOR_STATUS_PLAN_TEMPLATE 0x00000200 // door status plan template
  1194. //#define ACS_PARAM_VERIFY_PALN_TEMPLATE 0x00000400 //card reader verify plan template
  1195. //#define ACS_PARAM_CARD_RIGHT_PALN_TEMPLATE 0x00000800 //card right plan template
  1196. //#define ACS_PARAM_CARD 0x00001000 //card configure
  1197. //#define ACS_PARAM_GROUP 0x00002000 //group configure
  1198. //#define ACS_PARAM_ANTI_SNEAK_CFG 0x00004000 //anti-sneak configure
  1199. //#define ACS_PAPAM_EVENT_CARD_LINKAGE 0x00008000 //event linkage card
  1200. //#define ACS_PAPAM_CARD_PASSWD_CFG 0x00010000 //open door by password
  1201. public ushort wLocalControllerID; //On-site controller serial number[1,64],0 represent guard host
  1202. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30)]
  1203. public byte[] byRes;
  1204. }
  1205. #endregion
  1206. #region door parameters configuration
  1207. [StructLayoutAttribute(LayoutKind.Sequential)]
  1208. public struct NET_DVR_DOOR_CFG
  1209. {
  1210. public uint dwSize;
  1211. [MarshalAs(UnmanagedType.ByValArray, SizeConst = DOOR_NAME_LEN, ArraySubType = UnmanagedType.I1)]
  1212. public byte[] byDoorName;//door name
  1213. public byte byMagneticType;//magnetic type, 0-always close 1-always open
  1214. public byte byOpenButtonType;//open button type, 0-always close 1-always open
  1215. public byte byOpenDuration;//open duration time, 1-255s(ladder control relay action time)
  1216. public byte byDisabledOpenDuration;//disable open duration , 1-255s
  1217. public byte byMagneticAlarmTimeout;//magnetic alarm time out , 0-255s,0 means not to alarm
  1218. public byte byEnableDoorLock;//whether to enable door lock, 0-disable, 1-enable
  1219. public byte byEnableLeaderCard;//whether to enable leader card , 0-disable, 1-enable
  1220. public byte byLeaderCardMode;//First card mode, 0 - first card function is not enabled, and 1 - the first card normally open mode, 2 - the first card authorization mode (using this field, the byEnableLeaderCard is invalid )
  1221. public uint dwLeaderCardOpenDuration;//leader card open duration 1-1440min
  1222. [MarshalAs(UnmanagedType.ByValArray, SizeConst = STRESS_PASSWORD_LEN, ArraySubType = UnmanagedType.I1)]
  1223. public byte[] byStressPassword;//stress ppassword
  1224. [MarshalAs(UnmanagedType.ByValArray, SizeConst = SUPER_PASSWORD_LEN, ArraySubType = UnmanagedType.I1)]
  1225. public byte[] bySuperPassword; //super password
  1226. [MarshalAs(UnmanagedType.ByValArray, SizeConst = UNLOCK_PASSWORD_LEN, ArraySubType = UnmanagedType.I1)]
  1227. public byte[] byUnlockPassword;
  1228. public byte byUseLocalController; //Read-only, whether the connection on the local controller, 0 - no, 1 - yes
  1229. public byte byRes1;
  1230. public ushort wLocalControllerID; //Read-only, on-site controller serial number, 1-64, 0 on behalf of unregistered
  1231. public ushort wLocalControllerDoorNumber; //Read-only, on-site controller door number, 1-4, 0 represents the unregistered
  1232. public ushort wLocalControllerStatus; //Read-only, on-site controller online status: 0 - offline, 1 - online, 2 - loop of RS485 serial port 1 on 1, 3 - loop of RS485 serial port 2 on 2, 4 - loop of RS485 serial port 1, 5 - loop of RS485 serial port 2, 6 - loop 3 of RS485 serial port 1, 7 - the loop on the RS485 serial port on the 3 4 2, 8 - loop on the RS485 serial port 1, 9 - loop 4 of RS485 serial port 2 (read-only)
  1233. public byte byLockInputCheck; //Whether to enable the door input detection (1 public byte, 0 is not enabled, 1 is enabled, is not enabled by default)
  1234. public byte byLockInputType; //Door lock input type
  1235. public byte byDoorTerminalMode; //Gate terminal working mode
  1236. public byte byOpenButton; //Whether to enable the open button
  1237. public byte byLadderControlDelayTime; //ladder control delay time,1-255min
  1238. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 43, ArraySubType = UnmanagedType.I1)]
  1239. public byte[] byRes2;
  1240. public void Init()
  1241. {
  1242. byDoorName = new byte[DOOR_NAME_LEN];
  1243. byStressPassword = new byte[STRESS_PASSWORD_LEN];
  1244. bySuperPassword = new byte[SUPER_PASSWORD_LEN];
  1245. byUnlockPassword = new byte[UNLOCK_PASSWORD_LEN];
  1246. byRes2 = new byte[43];
  1247. }
  1248. }
  1249. #endregion
  1250. #region group parameters configuration
  1251. [StructLayoutAttribute(LayoutKind.Sequential)]
  1252. public struct NET_DVR_GROUP_CFG
  1253. {
  1254. public uint dwSize;
  1255. public byte byEnable;
  1256. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1257. public byte[] byRes1;
  1258. public NET_DVR_VALID_PERIOD_CFG struValidPeriodCfg;
  1259. [MarshalAs(UnmanagedType.ByValArray, SizeConst = GROUP_NAME_LEN, ArraySubType = UnmanagedType.I1)]
  1260. public byte[] byGroupName;
  1261. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  1262. public byte[] byRes2;
  1263. }
  1264. #endregion
  1265. #region user parameters configuration
  1266. [StructLayoutAttribute(LayoutKind.Sequential)]
  1267. public struct NET_DVR_ALARM_DEVICE_USER
  1268. {
  1269. public uint dwSize; //Structure size
  1270. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  1271. public byte[] sUserName;
  1272. [MarshalAs(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
  1273. public byte[] sPassword;
  1274. public NET_DVR_IPADDR struUserIP;//User IP (0 stands for no IP restriction)
  1275. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
  1276. public byte[] byAMCAddr;
  1277. public byte byUserType; //0- general user, 1- administrator user
  1278. public byte byAlarmOnRight;//Arming authority
  1279. public byte byAlarmOffRight; //Disarming authority
  1280. public byte byBypassRight; //Bypass authority
  1281. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_RIGHT, ArraySubType = UnmanagedType.I1)]
  1282. public byte[] byOtherRight;//Other authority
  1283. // 0 -- log
  1284. // 1 -- reboot/shutdown
  1285. // 2 -- set parameter
  1286. // 3 -- get parameter
  1287. // 4 -- resume
  1288. // 5 -- siren
  1289. // 6 -- PTZ
  1290. // 7 -- remote upgrade
  1291. // 8 -- preview
  1292. // 9 -- manual record
  1293. // 10 --remote playback
  1294. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_VIDEO_CHAN / 8, ArraySubType = UnmanagedType.I1)]
  1295. public byte[] byNetPreviewRight;// preview channels,eg. bit0-channel 1,0-no permission 1-permission enable
  1296. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_VIDEO_CHAN / 8, ArraySubType = UnmanagedType.I1)]
  1297. public byte[] byNetRecordRight; // record channels,eg. bit0-channel 1,0-no permission 1-permission enable
  1298. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_VIDEO_CHAN / 8, ArraySubType = UnmanagedType.I1)]
  1299. public byte[] byNetPlaybackRight; // playback channels,eg. bit0-channel 1,0-no permission 1-permission enable
  1300. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_VIDEO_CHAN / 8, ArraySubType = UnmanagedType.I1)]
  1301. public byte[] byNetPTZRight; // PTZ channels,eg. bit0-channel 1,0-no permission 1-permission enable
  1302. [MarshalAs(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
  1303. public byte[] sOriginalPassword; // Original password
  1304. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 152, ArraySubType = UnmanagedType.I1)]
  1305. public byte[] byRes2;
  1306. }
  1307. #endregion
  1308. #region cardreader configuration
  1309. [StructLayoutAttribute(LayoutKind.Sequential)]
  1310. public struct NET_DVR_CARD_READER_CFG_V50
  1311. {
  1312. public uint dwSize;
  1313. public byte byEnable; //whether to enable, 1-enable, 0-disable
  1314. public byte byCardReaderType; //card reader type,1-DS-K110XM/MK/C/CK,2-DS-K192AM/AMP,3-DS-K192BM/BMP,4-DS-K182AM/AMP,5-DS-K182BM/BMP,6-DS-K182AMF/ACF,7-wiegand or 485 not online,8- DS-K1101M/MK,9- DS-K1101C/CK,10- DS-K1102M/MK/M-A
  1315. //11- DS-K1102C/CK,12- DS-K1103M/MK,13- DS-K1103C/CK,14- DS-K1104M/MK,15- DS-K1104C/CK,16- DS-K1102S/SK/S-A,17- DS-K1102G/GK,18- DS-K1100S-B,19- DS-K1102EM/EMK,20- DS-K1102E/EK,
  1316. //21- DS-K1200EF,22- DS-K1200MF,23- DS-K1200CF,24- DS-K1300EF,25- DS-K1300MF,26- DS-K1300CF,27- DS-K1105E,28- DS-K1105M,29- DS-K1105C,30- DS-K182AMF,31- DS-K196AMF,32-DS-K194AMP
  1317. //33-DS-K1T200EF/EF-C/MF/MF-C/CF/CF-C,34-DS-K1T300EF/EF-C/MF/MF-C/CF/CF-C,35-DS-K1T105E/E-C/M/M-C/C/C-C,36-DS-K1T803F/MF/SF/EF,37-DS-K1A801F/MF/SF/EF,38-DS-K1107M/MK,39-DS-K1107E/EK,
  1318. //40-DS-K1107S/SK,41-DS-K1108M/MK,42-DS-K1108E/EK,43-DS-K1108S/SK,44-DS-K1200F,45-DS-K1S110-I,46-DS-K1T200M-PG/PGC,47-DS-K1T200M-PZ/PZC,48-DS-K1109H
  1319. public byte byOkLedPolarity; //OK LED polarity,0-negative,1-positive
  1320. public byte byErrorLedPolarity; //Error LED polarity,0-negative,1-positive
  1321. public byte byBuzzerPolarity; //buzzer polarity,0-negative,1-positive
  1322. public byte bySwipeInterval; //swipe interval, unit: second
  1323. public byte byPressTimeout; //press time out, unit:second
  1324. public byte byEnableFailAlarm; //whether to enable fail alarm, 0-disable 1-enable
  1325. public byte byMaxReadCardFailNum; //max reader card fail time
  1326. public byte byEnableTamperCheck; //whether to support tamper check, 0-disable ,1-enable
  1327. public byte byOfflineCheckTime; //offline check time, Uint second
  1328. public byte byFingerPrintCheckLevel; //fingerprint check lever,1-1/10,2-1/100,3-1/1000,4-1/10000,5-1/100000,6-1/1000000,7-1/10000000,8-1/100000000,9-3/100,10-3/1000,11-3/10000,12-3/100000,13-3/1000000,14-3/10000000,15-3/100000000,16-Automatic Normal,17-Automatic Secure,18-Automatic More Secure
  1329. public byte byUseLocalController; //read only,weather connect with local control:0-no,1-yes
  1330. public byte byRes1;
  1331. public ushort wLocalControllerID; //read only,local controller ID, byUseLocalController=1 effective,1-64,0 present not register
  1332. public ushort wLocalControllerReaderID; //read only,local controller reader ID,byUseLocalController=1 effective,0 present not register
  1333. public ushort wCardReaderChannel; //read only,card reader channel,byUseLocalController=1 effective,0-wiegand or offline,1-RS485A,2-RS485B
  1334. public byte byFingerPrintImageQuality; //finger print image quality,0-no effective,1-weak qualification(V1),2-moderate qualification(V1),3-strong qualification(V1),4-strongest qualification(V1),5-weak qualification(V2),6-moderate qualification(V2),7-strong qualification(V2),8-strongest qualification(V2)
  1335. public byte byFingerPrintContrastTimeOut; //finger print contrast time out,0-no effective,1-20 present:1s-20s,0xff-infinite
  1336. public byte byFingerPrintRecogizeInterval; //finger print recognize interval,0-no effective,1-10 present:1s-10s,0xff-no delay
  1337. public byte byFingerPrintMatchFastMode; //finger print match fast mode,0-no effective,1-5 present:fast mode 1-fast mode 5,0xff-auto
  1338. public byte byFingerPrintModuleSensitive; //finger print module sensitive,0-no effective,1-8 present:sensitive level 1-sensitive level 8
  1339. public byte byFingerPrintModuleLightCondition; //finger print module light condition,0-no effective,1-out door,2-in door
  1340. public byte byFaceMatchThresholdN; //range 0-100
  1341. public byte byFaceQuality; //face quality,range 0-100
  1342. public byte byFaceRecogizeTimeOut; //face recognize time out,1-20 present:1s-20s,0xff-infinite
  1343. public byte byFaceRecogizeInterval; //face recognize interval,0-no effective,1-10 present:1s-10s,0xff-no delay
  1344. public ushort wCardReaderFunction; //read only,card reader function
  1345. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CARD_READER_DESCRIPTION, ArraySubType = UnmanagedType.I1)]
  1346. public byte[] byCardReaderDescription; //read only,card reader description
  1347. public ushort wFaceImageSensitometry; //face image sensitometry,range 0-65535
  1348. public byte byLivingBodyDetect; //living body detect,0-no effective,1-disable,2-enable
  1349. public byte byFaceMatchThreshold1; //range 0-100
  1350. public ushort wBuzzerTime; //buzzer time,range 0-5999(s) 0 present yowl
  1351. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 254, ArraySubType = UnmanagedType.I1)]
  1352. public byte[] byRes;
  1353. public void Init()
  1354. {
  1355. byCardReaderDescription = new byte[CARD_READER_DESCRIPTION];
  1356. byRes = new byte[254];
  1357. }
  1358. }
  1359. #endregion
  1360. #region fingerprint configuration
  1361. [StructLayoutAttribute(LayoutKind.Sequential)]
  1362. public struct NET_DVR_FINGER_PRINT_CFG
  1363. {
  1364. public uint dwSize;
  1365. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1366. public byte[] byCardNo; //card NO
  1367. public uint dwFingerPrintLen; //fingerprint len
  1368. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1369. public byte[] byEnableCardReader; //the card reader which finger print send to,according to the values,0-not send,1-send
  1370. public byte byFingerPrintID; //finger print ID,[1,10]
  1371. public byte byFingerType; //finger type 0-normal,1-stress
  1372. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30, ArraySubType = UnmanagedType.I1)]
  1373. public byte[] byRes1;
  1374. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_FINGER_PRINT_LEN, ArraySubType = UnmanagedType.I1)]
  1375. public byte[] byFingerData;
  1376. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
  1377. public byte[] byRes;
  1378. public void Init()
  1379. {
  1380. byCardNo = new byte[ACS_CARD_NO_LEN];
  1381. byEnableCardReader = new byte[MAX_CARD_READER_NUM_512];
  1382. byRes1 = new byte[30];
  1383. byFingerData = new byte[MAX_FINGER_PRINT_LEN];
  1384. byRes = new byte[64];
  1385. }
  1386. }
  1387. [StructLayoutAttribute(LayoutKind.Sequential)]
  1388. public struct NET_DVR_FINGER_PRINT_STATUS
  1389. {
  1390. public uint dwSize;
  1391. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1392. public byte[] byCardNo;
  1393. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1394. public byte[] byCardReaderRecvStatus; //Fingerprint reader state, press the public bytes, 0 - failure, 1 -, 2 - the fingerprint module is not online, 3 - try again or poor quality of fingerprint, 4 - memory is full, 5 - existing the fingerprints, 6 - existing the fingerprint ID, illegal fingerprint ID, 7-8 - don't need to configure the fingerprint module
  1395. public byte byFingerPrintID; //finger print ID,[1,10]
  1396. public byte byFingerType; //finger type 0-normal,1-stress
  1397. public byte byTotalStatus; //
  1398. public byte byRes1;
  1399. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ERROR_MSG_LEN, ArraySubType = UnmanagedType.I1)]
  1400. public byte[] byErrorMsg; //Issued false information, when the byCardReaderRecvStatus is 5, said existing fingerprint matching card number
  1401. public uint dwCardReaderNo; //Grain number card reader, can be used to return issued by mistake
  1402. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24, ArraySubType = UnmanagedType.I1)]
  1403. public byte[] byRes;
  1404. public void Init()
  1405. {
  1406. byCardNo = new byte[ACS_CARD_NO_LEN];
  1407. byCardReaderRecvStatus = new byte[MAX_CARD_READER_NUM_512];
  1408. byErrorMsg = new byte[ERROR_MSG_LEN];
  1409. byRes = new byte[24];
  1410. }
  1411. }
  1412. [StructLayoutAttribute(LayoutKind.Sequential)]
  1413. public struct NET_DVR_FINGER_PRINT_INFO_COND
  1414. {
  1415. public uint dwSize;
  1416. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1417. public byte[] byCardNo;
  1418. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1419. public byte[] byEnableCardReader; //which card reader to send,according to the values
  1420. public uint dwFingerPrintNum; //the number send or get. if get,0xffffffff means all
  1421. public byte byFingerPrintID; //finger print ID,[1,10], 0xff means all
  1422. public byte byCallbackMode; //
  1423. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 26, ArraySubType = UnmanagedType.I1)]
  1424. public byte[] byRes1;
  1425. public void Init()
  1426. {
  1427. byCardNo = new byte[ACS_CARD_NO_LEN];
  1428. byEnableCardReader = new byte[MAX_CARD_READER_NUM_512];
  1429. byRes1 = new byte[26];
  1430. }
  1431. }
  1432. [StructLayoutAttribute(LayoutKind.Sequential)]
  1433. public struct NET_DVR_FINGER_PRINT_CFG_V50
  1434. {
  1435. public uint dwSize;
  1436. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1437. public byte[] byCardNo; //card NO
  1438. public uint dwFingerPrintLen; //fingerprint len
  1439. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1440. public byte[] byEnableCardReader; //the card reader which finger print send to,according to the values,0-not send,1-send
  1441. public byte byFingerPrintID; //finger print ID,[1,10]
  1442. public byte byFingerType; //finger type 0-normal,1-stress
  1443. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 30, ArraySubType = UnmanagedType.I1)]
  1444. public byte[] byRes1;
  1445. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_FINGER_PRINT_LEN, ArraySubType = UnmanagedType.I1)]
  1446. public byte[] byFingerData;
  1447. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1448. public byte[] byEmployeeNo;
  1449. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  1450. public byte[] byLeaderFP;
  1451. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
  1452. public byte[] byRes;
  1453. public void Init()
  1454. {
  1455. byCardNo = new byte[ACS_CARD_NO_LEN];
  1456. byEnableCardReader = new byte[MAX_CARD_READER_NUM_512];
  1457. byRes1 = new byte[30];
  1458. byFingerData = new byte[MAX_FINGER_PRINT_LEN];
  1459. byEmployeeNo = new byte[NET_SDK_EMPLOYEE_NO_LEN];
  1460. byLeaderFP = new byte[MAX_DOOR_NUM_256];
  1461. byRes = new byte[128];
  1462. }
  1463. }
  1464. [StructLayoutAttribute(LayoutKind.Sequential)]
  1465. public struct NET_DVR_FINGER_PRINT_STATUS_V50
  1466. {
  1467. public uint dwSize;
  1468. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1469. public byte[] byCardNo;
  1470. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1471. public byte[] byCardReaderRecvStatus; //Fingerprint reader state, press the public bytes, 0 - failure, 1 -, 2 - the fingerprint module is not online, 3 - try again or poor quality of fingerprint, 4 - memory is full, 5 - existing the fingerprints, 6 - existing the fingerprint ID, illegal fingerprint ID, 7-8 - don't need to configure the fingerprint module
  1472. public byte byFingerPrintID; //finger print ID,[1,10]
  1473. public byte byFingerType; //finger type 0-normal,1-stress
  1474. public byte byTotalStatus; //
  1475. public byte byRecvStatus;
  1476. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ERROR_MSG_LEN, ArraySubType = UnmanagedType.I1)]
  1477. public byte[] byErrorMsg; //Issued false information, when the byCardReaderRecvStatus is 5, said existing fingerprint matching card number
  1478. public uint dwCardReaderNo; //Grain number card reader, can be used to return issued by mistake
  1479. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1480. public byte[] byEmployeeNo;
  1481. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1482. public byte[] byErrorEmployeeNo;
  1483. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
  1484. public byte[] byRes;
  1485. public void Init()
  1486. {
  1487. byCardNo = new byte[ACS_CARD_NO_LEN];
  1488. byCardReaderRecvStatus = new byte[MAX_CARD_READER_NUM_512];
  1489. byErrorMsg = new byte[ERROR_MSG_LEN];
  1490. byEmployeeNo = new byte[NET_SDK_EMPLOYEE_NO_LEN];
  1491. byErrorEmployeeNo = new byte[NET_SDK_EMPLOYEE_NO_LEN];
  1492. byRes = new byte[128];
  1493. }
  1494. }
  1495. [StructLayoutAttribute(LayoutKind.Sequential)]
  1496. public struct NET_DVR_FINGER_PRINT_INFO_COND_V50
  1497. {
  1498. public uint dwSize;
  1499. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1500. public byte[] byCardNo;
  1501. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1502. public byte[] byEnableCardReader; //which card reader to send,according to the values
  1503. public uint dwFingerPrintNum; //the number send or get. if get,0xffffffff means all
  1504. public byte byFingerPrintID; //finger print ID,[1,10], 0xff means all
  1505. public byte byCallbackMode; //
  1506. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  1507. public byte[] byRes2;
  1508. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1509. public byte[] byEmployeeNo;
  1510. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
  1511. public byte[] byRes1;
  1512. public void Init()
  1513. {
  1514. byCardNo = new byte[ACS_CARD_NO_LEN];
  1515. byEnableCardReader = new byte[MAX_CARD_READER_NUM_512];
  1516. byRes2 = new byte[2];
  1517. byEmployeeNo = new byte[NET_SDK_EMPLOYEE_NO_LEN];
  1518. byRes1 = new byte[128];
  1519. }
  1520. }
  1521. [StructLayoutAttribute(LayoutKind.Sequential)]
  1522. public struct NET_DVR_FINGER_PRINT_BYCARD
  1523. {
  1524. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1525. public byte[] byCardNo;
  1526. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1527. public byte[] byEnableCardReader; //be enable card reader,according to the values
  1528. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_FINGER_PRINT_NUM, ArraySubType = UnmanagedType.I1)]
  1529. public byte[] byFingerPrintID; //finger print ID,according to the values,0-not delete,1-delete
  1530. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 34, ArraySubType = UnmanagedType.I1)]
  1531. public byte[] byRes1;
  1532. }
  1533. [StructLayoutAttribute(LayoutKind.Sequential)]
  1534. public struct NET_DVR_FINGER_PRINT_BYREADER
  1535. {
  1536. public uint dwCardReaderNo;
  1537. public byte byClearAllCard; //clear all card,0-delete by card,1-delete all card
  1538. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1539. public byte[] byRes1;
  1540. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1541. public byte[] byCardNo;
  1542. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 548, ArraySubType = UnmanagedType.I1)]
  1543. public byte[] byRes;
  1544. }
  1545. [StructLayoutAttribute(LayoutKind.Sequential)]
  1546. public struct NET_DVR_FINGER_PRINT_INFO_CTRL_BYCARD
  1547. {
  1548. public uint dwSize;
  1549. public byte byMode; //delete mode,0-delete by card,1-delete by reader
  1550. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  1551. public byte[] byRes1;
  1552. public NET_DVR_FINGER_PRINT_BYCARD struByCard; //delete by card
  1553. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
  1554. public byte[] byRes;
  1555. }
  1556. [StructLayoutAttribute(LayoutKind.Sequential)]
  1557. public struct NET_DVR_FINGER_PRINT_INFO_CTRL_BYREADER
  1558. {
  1559. public uint dwSize;
  1560. public byte byMode; //delete mode,0-delete by card,1-delete by reader
  1561. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  1562. public byte[] byRes1;
  1563. public NET_DVR_FINGER_PRINT_BYREADER struByReader; //delete by reader
  1564. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
  1565. public byte[] byRes;
  1566. }
  1567. [StructLayoutAttribute(LayoutKind.Sequential)]
  1568. public struct NET_DVR_FINGER_PRINT_BYCARD_V50
  1569. {
  1570. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1571. public byte[] byCardNo;
  1572. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1573. public byte[] byEnableCardReader; //be enable card reader,according to the values
  1574. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_FINGER_PRINT_NUM, ArraySubType = UnmanagedType.I1)]
  1575. public byte[] byFingerPrintID; //finger print ID,according to the values,0-not delete,1-delete
  1576. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  1577. public byte[] byRes1;
  1578. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1579. public byte[] byEmployeeNo;
  1580. }
  1581. [StructLayoutAttribute(LayoutKind.Sequential)]
  1582. public struct NET_DVR_FINGER_PRINT_BYREADER_V50
  1583. {
  1584. public uint dwCardReaderNo;
  1585. public byte byClearAllCard; //clear all card,0-delete by card,1-delete all card
  1586. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1587. public byte[] byRes1;
  1588. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1589. public byte[] byCardNo;
  1590. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1591. public byte[] byEmployeeNo;
  1592. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 516, ArraySubType = UnmanagedType.I1)]
  1593. public byte[] byRes;
  1594. }
  1595. [StructLayoutAttribute(LayoutKind.Sequential)]
  1596. public struct NET_DVR_FINGER_PRINT_INFO_CTRL_BYCARD_V50
  1597. {
  1598. public uint dwSize;
  1599. public byte byMode; //delete mode,0-delete by card,1-delete by reader
  1600. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  1601. public byte[] byRes1;
  1602. public NET_DVR_FINGER_PRINT_BYCARD_V50 struByCard; //delete by card
  1603. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
  1604. public byte[] byRes;
  1605. }
  1606. [StructLayoutAttribute(LayoutKind.Sequential)]
  1607. public struct NET_DVR_FINGER_PRINT_INFO_CTRL_BYREADER_V50
  1608. {
  1609. public uint dwSize;
  1610. public byte byMode; //delete mode,0-delete by card,1-delete by reader
  1611. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  1612. public byte[] byRes1;
  1613. public NET_DVR_FINGER_PRINT_BYREADER_V50 struByReader; //delete by reader
  1614. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
  1615. public byte[] byRes;
  1616. }
  1617. [StructLayoutAttribute(LayoutKind.Sequential)]
  1618. public struct NET_DVR_FINGER_PRINT_INFO_STATUS_V50
  1619. {
  1620. public uint dwSize;
  1621. public uint dwCardReaderNo; //card reader no
  1622. public byte byStatus; //status:0-invalid,1-processing,2-failed,3-success
  1623. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)]
  1624. public byte[] byRes;
  1625. }
  1626. [StructLayoutAttribute(LayoutKind.Sequential)]
  1627. public struct NET_DVR_CAPTURE_FINGERPRINT_COND
  1628. {
  1629. public int dwSize;
  1630. public byte byFingerPrintPicType; //图片类型:0-无意义
  1631. public byte byFingerNo; //手指编号,范围1-10
  1632. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 126)]
  1633. public byte[] byRes;
  1634. public void init()
  1635. {
  1636. byRes = new byte[126];
  1637. }
  1638. }
  1639. [StructLayoutAttribute(LayoutKind.Sequential)]
  1640. public struct NET_DVR_CAPTURE_FINGERPRINT_CFG
  1641. {
  1642. public int dwSize;
  1643. public int dwFingerPrintDataSize; //指纹数据大小
  1644. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.MAX_FINGER_PRINT_LEN)]
  1645. public byte[] byFingerData; //指纹数据内容
  1646. public int dwFingerPrintPicSize; //指纹图片大小,等于0时,代表无指纹图片数据
  1647. public IntPtr pFingerPrintPicBuffer; //指纹图片缓存
  1648. public byte byFingerNo; //手指编号,范围1-10
  1649. public byte byFingerPrintQuality; //指纹质量,范围1-100
  1650. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 62)]
  1651. public byte[] byRes;
  1652. public void init()
  1653. {
  1654. byFingerData = new byte[CHCNetSDK.MAX_FINGER_PRINT_LEN];
  1655. byRes = new byte[62];
  1656. }
  1657. }
  1658. //[StructLayoutAttribute(LayoutKind.Sequential)]
  1659. //public const int DEL_FINGER_PRINT_MODE_LEN = 588; //联合体大小
  1660. //public union NET_DVR_DEL_FINGER_PRINT_MODE
  1661. //{
  1662. // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 588, ArraySubType = UnmanagedType.I1)]
  1663. // public byte[] uLen;
  1664. // public NET_DVR_FINGER_PRINT_BYCARD struByCard; //delete by card
  1665. // public NET_DVR_FINGER_PRINT_BYREADER struByReader; //delete by reader
  1666. //}
  1667. //[StructLayoutAttribute(LayoutKind.Sequential)]
  1668. //public struct NET_DVR_FINGER_PRINT_INFO_CTRL
  1669. //{
  1670. // public uint dwSize;
  1671. // public byte byMode; //delete mode,0-delete by card,1-delete by reader
  1672. // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1673. // public byte[] byRes1;
  1674. // public NET_DVR_DEL_FINGER_PRINT_MODE struProcessMode; //delete mode
  1675. // [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
  1676. // public byte[] byRes;
  1677. //}
  1678. #endregion
  1679. #region Acs_Face_Param
  1680. [StructLayoutAttribute(LayoutKind.Sequential)]
  1681. public struct NET_DVR_FAILED_FACE_INFO
  1682. {
  1683. public int dwSize;
  1684. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN)]
  1685. public byte[] byCardNo;
  1686. public byte byErrorCode;
  1687. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 127)]
  1688. public byte[] byRes;
  1689. }
  1690. [StructLayoutAttribute(LayoutKind.Sequential)]
  1691. public struct NET_DVR_FACE_PARAM_CTRL_ByCard
  1692. {
  1693. public int dwSize;
  1694. public byte byMode;//0 del by card,1 del by card reader
  1695. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1696. public byte[] byRes1;
  1697. public NET_DVR_FACE_PARAM_BYCARD struProcessMode;
  1698. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
  1699. public byte[] byRes;
  1700. public void Init()
  1701. {
  1702. byRes1 = new byte[3];
  1703. byRes = new byte[64];
  1704. struProcessMode = new NET_DVR_FACE_PARAM_BYCARD();
  1705. struProcessMode.Init();
  1706. }
  1707. }
  1708. [StructLayoutAttribute(LayoutKind.Sequential)]
  1709. public struct NET_DVR_FACE_PARAM_CTRL_ByReader
  1710. {
  1711. public int dwSize;
  1712. public byte byMode;
  1713. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1714. public byte[] byRes1;
  1715. public NET_DVR_FACE_PARAM_BYREADER struProcessMode;
  1716. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
  1717. public byte[] byRes;
  1718. public void Init()
  1719. {
  1720. byRes1 = new byte[3];
  1721. byRes = new byte[64];
  1722. struProcessMode = new NET_DVR_FACE_PARAM_BYREADER();
  1723. struProcessMode.Init();
  1724. }
  1725. }
  1726. [StructLayoutAttribute(LayoutKind.Sequential)]
  1727. public struct NET_DVR_FACE_PARAM_BYCARD
  1728. {
  1729. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1730. public byte[] byCardNo;
  1731. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  1732. public byte[] byEnableCardReader;
  1733. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.MAX_FACE_NUM, ArraySubType = UnmanagedType.I1)]
  1734. public byte[] byFaceID;
  1735. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 42, ArraySubType = UnmanagedType.I1)]
  1736. public byte[] byRes1;
  1737. public void Init()
  1738. {
  1739. byCardNo = new byte[CHCNetSDK.ACS_CARD_NO_LEN];
  1740. byEnableCardReader = new byte[CHCNetSDK.MAX_CARD_READER_NUM_512];
  1741. byFaceID = new byte[CHCNetSDK.MAX_FACE_NUM];
  1742. byRes1 = new byte[42];
  1743. }
  1744. }
  1745. [StructLayoutAttribute(LayoutKind.Sequential)]
  1746. public struct NET_DVR_FACE_PARAM_BYREADER
  1747. {
  1748. public int dwCardReaderNo;
  1749. public byte byClearAllCard;
  1750. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1751. public byte[] byRes1;
  1752. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  1753. public byte[] byCardNo;
  1754. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 548, ArraySubType = UnmanagedType.I1)]
  1755. public byte[] byRes;
  1756. public void Init()
  1757. {
  1758. byRes1 = new byte[3];
  1759. byCardNo = new byte[CHCNetSDK.ACS_CARD_NO_LEN];
  1760. byRes = new byte[548];
  1761. }
  1762. }
  1763. #endregion
  1764. #region plan configuration
  1765. [StructLayoutAttribute(LayoutKind.Sequential)]
  1766. public struct NET_DVR_TIME_SEGMENT
  1767. {
  1768. public NET_DVR_SIMPLE_DAYTIME struBeginTime; //begin time
  1769. public NET_DVR_SIMPLE_DAYTIME struEndTime; //end time
  1770. }
  1771. [StructLayoutAttribute(LayoutKind.Sequential)]
  1772. public struct NET_DVR_SINGLE_PLAN_SEGMENT
  1773. {
  1774. public byte byEnable; //whether to enable, 1-enable, 0-disable
  1775. public byte byDoorStatus; //door status(control ladder status),0-invaild, 1-always open(free), 2-always close(forbidden), 3-ordinary status(used by door plan)
  1776. public byte byVerifyMode; //verify method, 0-invaild, 1-swipe card, 2-swipe card +password(used by card verify ) 3-swipe card(used by card verify) 4-swipe card or password(used by card verify)
  1777. //5-fingerprint, 6-fingerprint and passwd, 7-fingerprint or swipe card, 8-fingerprint and swipe card, 9-fingerprint and passwd and swipe card,
  1778. //10-face or finger print or swipe card or password,11-face and finger print,12-face and password,13-face and swipe card,14-face,15-employee no and password,
  1779. //16-finger print or password,17-employee no and finger print,18-employee no and finger print and password,
  1780. //19-face and finger print and swipe card,20-face and password and finger print,21-employee no and face,22-face or face and swipe card
  1781. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.I1)]
  1782. public byte[] byRes;
  1783. public NET_DVR_TIME_SEGMENT struTimeSegment; //time segment parameter
  1784. public void Init()
  1785. {
  1786. byRes = new byte[5];
  1787. }
  1788. }
  1789. [StructLayoutAttribute(LayoutKind.Sequential)]
  1790. public struct NET_DVR_WEEK_PLAN_CFG
  1791. {
  1792. public uint dwSize;
  1793. public byte byEnable; //whether to enable, 1-enable, 0-disable
  1794. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1795. public byte[] byRes1;
  1796. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_DAYS * MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
  1797. public NET_DVR_SINGLE_PLAN_SEGMENT[] struPlanCfg; //week plan parameter
  1798. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.I1)]
  1799. public byte[] byRes2;
  1800. public void Init()
  1801. {
  1802. struPlanCfg = new NET_DVR_SINGLE_PLAN_SEGMENT[MAX_DAYS * MAX_TIMESEGMENT_V30];
  1803. foreach (NET_DVR_SINGLE_PLAN_SEGMENT singlStruPlanCfg in struPlanCfg)
  1804. {
  1805. singlStruPlanCfg.Init();
  1806. }
  1807. byRes1 = new byte[3];
  1808. byRes2 = new byte[16];
  1809. }
  1810. }
  1811. [StructLayoutAttribute(LayoutKind.Sequential)]
  1812. public struct NET_DVR_HOLIDAY_PLAN_CFG
  1813. {
  1814. public uint dwSize;
  1815. public byte byEnable; //whether to enable, 1-enable, 0-disable
  1816. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1817. public byte[] byRes1;
  1818. public NET_DVR_DATE struBeginDate; //holiday begin date
  1819. public NET_DVR_DATE struEndDate; //holiday end date
  1820. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_TIMESEGMENT_V30, ArraySubType = UnmanagedType.Struct)]
  1821. public NET_DVR_SINGLE_PLAN_SEGMENT[] struPlanCfg; //time segment parameter
  1822. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
  1823. public byte[] byRes2;
  1824. public void Init()
  1825. {
  1826. struPlanCfg = new NET_DVR_SINGLE_PLAN_SEGMENT[MAX_TIMESEGMENT_V30];
  1827. foreach (NET_DVR_SINGLE_PLAN_SEGMENT singlStruPlanCfg in struPlanCfg)
  1828. {
  1829. singlStruPlanCfg.Init();
  1830. }
  1831. byRes1 = new byte[3];
  1832. byRes2 = new byte[16];
  1833. }
  1834. }
  1835. [StructLayoutAttribute(LayoutKind.Sequential)]
  1836. public struct NET_DVR_HOLIDAY_GROUP_CFG
  1837. {
  1838. public uint dwSize;
  1839. public byte byEnable; //whether to enable, 1-enable, 0-disable
  1840. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1841. public byte[] byRes1;
  1842. [MarshalAs(UnmanagedType.ByValArray, SizeConst = HOLIDAY_GROUP_NAME_LEN, ArraySubType = UnmanagedType.I1)]
  1843. public byte[] byGroupName; //holiday group name
  1844. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_HOLIDAY_PLAN_NUM, ArraySubType = UnmanagedType.U4)]
  1845. public uint[] dwHolidayPlanNo; //holiday plan No. fill in from the front side, invalid when meet zero.
  1846. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  1847. public byte[] byRes2;
  1848. public void Init()
  1849. {
  1850. byGroupName = new byte[HOLIDAY_GROUP_NAME_LEN];
  1851. dwHolidayPlanNo = new uint[MAX_HOLIDAY_PLAN_NUM];
  1852. byRes1 = new byte[3];
  1853. byRes2 = new byte[32];
  1854. }
  1855. }
  1856. [StructLayoutAttribute(LayoutKind.Sequential)]
  1857. public struct NET_DVR_PLAN_TEMPLATE
  1858. {
  1859. public uint dwSize;
  1860. public byte byEnable; //whether to enable, 1-enable, 0-disable
  1861. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  1862. public byte[] byRes1;
  1863. [MarshalAs(UnmanagedType.ByValArray, SizeConst = TEMPLATE_NAME_LEN, ArraySubType = UnmanagedType.I1)]
  1864. public byte[] byTemplateName; //template name
  1865. public uint dwWeekPlanNo; //week plan no. 0 invalid
  1866. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_HOLIDAY_GROUP_NUM, ArraySubType = UnmanagedType.U4)]
  1867. public uint[] dwHolidayGroupNo; //holiday group. fill in from the front side, invalid when meet zero.
  1868. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  1869. public byte[] byRes2;
  1870. public void Init()
  1871. {
  1872. byTemplateName = new byte[TEMPLATE_NAME_LEN];
  1873. dwHolidayGroupNo = new uint[MAX_HOLIDAY_GROUP_NUM];
  1874. byRes1 = new byte[3];
  1875. byRes2 = new byte[32];
  1876. }
  1877. }
  1878. [StructLayoutAttribute(LayoutKind.Sequential)]
  1879. public struct NET_DVR_HOLIDAY_PLAN_COND
  1880. {
  1881. public uint dwSize;
  1882. public uint dwHolidayPlanNumber; //Holiday plan number
  1883. public ushort wLocalControllerID; //On the controller serial number [1, 64]
  1884. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 106, ArraySubType = UnmanagedType.I1)]
  1885. public byte[] byRes;
  1886. public void Init()
  1887. {
  1888. byRes = new byte[106];
  1889. }
  1890. }
  1891. [StructLayoutAttribute(LayoutKind.Sequential)]
  1892. public struct NET_DVR_WEEK_PLAN_COND
  1893. {
  1894. public uint dwSize;
  1895. public uint dwWeekPlanNumber; //Week plan number
  1896. public ushort wLocalControllerID; //On the controller serial number [1, 64]
  1897. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 106, ArraySubType = UnmanagedType.I1)]
  1898. public byte[] byRes;
  1899. public void Init()
  1900. {
  1901. byRes = new byte[106];
  1902. }
  1903. }
  1904. [StructLayoutAttribute(LayoutKind.Sequential)]
  1905. public struct NET_DVR_HOLIDAY_GROUP_COND
  1906. {
  1907. public uint dwSize;
  1908. public uint dwHolidayGroupNumber; //Holiday group number
  1909. public ushort wLocalControllerID; //On the controller serial number [1, 64]
  1910. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 106, ArraySubType = UnmanagedType.I1)]
  1911. public byte[] byRes;
  1912. public void Init()
  1913. {
  1914. byRes = new byte[106];
  1915. }
  1916. }
  1917. [StructLayoutAttribute(LayoutKind.Sequential)]
  1918. public struct NET_DVR_PLAN_TEMPLATE_COND
  1919. {
  1920. public uint dwSize;
  1921. public uint dwPlanTemplateNumber; //Plan template number, starting from 1, the maximum value from the entrance guard capability sets
  1922. public ushort wLocalControllerID; //On the controller serial number[1,64], 0 is invalid
  1923. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 106, ArraySubType = UnmanagedType.I1)]
  1924. public byte[] byRes;
  1925. public void Init()
  1926. {
  1927. byRes = new byte[106];
  1928. }
  1929. }
  1930. #endregion
  1931. #region card reader verification mode and door status planning parameters configuration
  1932. [StructLayout(LayoutKind.Sequential)]
  1933. public struct NET_DVR_DOOR_STATUS_PLAN
  1934. {
  1935. public uint dwSize;
  1936. public uint dwTemplateNo; // plan template No. 0 means cancel relation,resolve default status(ordinary status)
  1937. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
  1938. public byte[] byRes;
  1939. public void Init()
  1940. {
  1941. byRes = new byte[64];
  1942. }
  1943. }
  1944. [StructLayout(LayoutKind.Sequential)]
  1945. public struct NET_DVR_CARD_READER_PLAN
  1946. {
  1947. public uint dwSize;
  1948. public uint dwTemplateNo; // plan template No. 0 means cancel relation,resolve default status(swipe card)
  1949. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
  1950. public byte[] byRes;
  1951. public void Init()
  1952. {
  1953. byRes = new byte[64];
  1954. }
  1955. }
  1956. #endregion
  1957. #region card number associated with the user information parameter configuration
  1958. [StructLayoutAttribute(LayoutKind.Sequential)]
  1959. public struct NET_DVR_CARD_USER_INFO_CFG
  1960. {
  1961. public uint dwSize;
  1962. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN)]
  1963. public byte[] byUsername;// user name
  1964. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
  1965. public byte[] byRes2; // byRes2[0]--user number for alarm host
  1966. }
  1967. #endregion
  1968. #region user login managed
  1969. [StructLayoutAttribute(LayoutKind.Sequential)]
  1970. public struct NET_DVR_DEVICEINFO_V30
  1971. {
  1972. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
  1973. public byte[] sSerialNumber; //serial number
  1974. public byte byAlarmInPortNum; //Number of Alarm input
  1975. public byte byAlarmOutPortNum; //Number of Alarm Output
  1976. public byte byDiskNum; //Number of Hard Disk
  1977. public byte byDVRType; //DVR Type, 1: DVR 2: ATM DVR 3: DVS ......
  1978. public byte byChanNum; //Number of Analog Channel
  1979. public byte byStartChan; //The first Channel No. E.g. DVS- 1, DVR- 1
  1980. public byte byAudioChanNum; //Number of Audio Channel
  1981. public byte byIPChanNum; //Maximum number of IP Channel low
  1982. public byte byZeroChanNum; //Zero channel encoding number//2010- 01- 16
  1983. public byte byMainProto; //Main stream transmission protocol 0- private, 1- rtsp,2-both private and rtsp
  1984. public byte bySubProto; //Sub stream transmission protocol 0- private, 1- rtsp,2-both private and rtsp
  1985. public byte bySupport; //Ability, the 'AND' result by bit: 0- not support; 1- support
  1986. //bySupport & 0x1, smart search
  1987. //bySupport & 0x2, backup
  1988. //bySupport & 0x4, get compression configuration ability
  1989. //bySupport & 0x8, multi network adapter
  1990. //bySupport & 0x10, support remote SADP
  1991. //bySupport & 0x20 support Raid card
  1992. //bySupport & 0x40 support IPSAN directory search
  1993. public byte bySupport1; //Ability expand, the 'AND' result by bit: 0- not support; 1- support
  1994. //bySupport1 & 0x1, support snmp v30
  1995. //bySupport1& 0x2,support distinguish download and playback
  1996. //bySupport1 & 0x4, support deployment level
  1997. //bySupport1 & 0x8, support vca alarm time extension
  1998. //bySupport1 & 0x10, support muti disks(more than 33)
  1999. //bySupport1 & 0x20, support rtsp over http
  2000. //bySupport1 & 0x40, support delay preview
  2001. //bySuppory1 & 0x80 support NET_DVR_IPPARACFG_V40, in addition support License plate of the new alarm information
  2002. public byte bySupport2; //Ability expand, the 'AND' result by bit: 0- not support; 1- support
  2003. //bySupport & 0x1, decoder support get stream by URL
  2004. //bySupport2 & 0x2, support FTPV40
  2005. //bySupport2 & 0x4, support ANR
  2006. //bySupport2 & 0x20, support get single item of device status
  2007. //bySupport2 & 0x40, support stream encryt
  2008. public ushort wDevType; //device type
  2009. public byte bySupport3; //Support epresent by bit, 0 - not support 1 - support
  2010. //bySupport3 & 0x1-muti stream support
  2011. //bySupport3 & 0x8 support use delay preview parameter when delay preview
  2012. //bySupport3 & 0x10 support the interface of getting alarmhost main status V40
  2013. public byte byMultiStreamProto; //support multi stream, represent by bit, 0-not support ;1- support; bit1-stream 3 ;bit2-stream 4, bit7-main stream, bit8-sub stream
  2014. public byte byStartDChan; //Start digital channel
  2015. public byte byStartDTalkChan; //Start digital talk channel
  2016. public byte byHighDChanNum; //Digital channel number high
  2017. public byte bySupport4; //Support epresent by bit, 0 - not support 1 - support
  2018. //bySupport4 & 0x4 whether support video wall unified interface
  2019. // bySupport4 & 0x80 Support device upload center alarm enable
  2020. public byte byLanguageType; //support language type by bit,0-support,1-not support
  2021. //byLanguageType 0 -old device
  2022. //byLanguageType & 0x1 support chinese
  2023. //byLanguageType & 0x2 support english
  2024. public byte byVoiceInChanNum; //voice in chan num
  2025. public byte byStartVoiceInChanNo; //start voice in chan num
  2026. public byte bySupport5; //0-no support,1-support,bit0-muti stream
  2027. //bySupport5 &0x01support wEventTypeEx
  2028. //bySupport5 &0x04support sence expend
  2029. public byte bySupport6;
  2030. public byte byMirrorChanNum; //mirror channel num,<it represents direct channel in the recording host
  2031. public ushort wStartMirrorChanNo; //start mirror chan
  2032. public byte bySupport7; //Support epresent by bit, 0 - not support 1 - support
  2033. //bySupport7 & 0x1- supports INTER_VCA_RULECFG_V42 extension
  2034. // bySupport7 & 0x2 Supports HVT IPC mode expansion
  2035. // bySupport7 & 0x04 Back lock time
  2036. // bySupport7 & 0x08 Set the pan PTZ position, whether to support the band channel
  2037. // bySupport7 & 0x10 Support for dual system upgrade backup
  2038. // bySupport7 & 0x20 Support OSD character overlay V50
  2039. // bySupport7 & 0x40 Support master slave tracking (slave camera)
  2040. // bySupport7 & 0x80 Support message encryption
  2041. public byte byRes2;
  2042. }
  2043. [StructLayout(LayoutKind.Sequential)]
  2044. public struct NET_DVR_DEVICEINFO_V40
  2045. {
  2046. public NET_DVR_DEVICEINFO_V30 struDeviceV30;
  2047. public byte bySupportLock; //the device support lock function,this byte assigned by SDK.when bySupportLock is 1,dwSurplusLockTime and byRetryLoginTime is valid
  2048. public byte byRetryLoginTime; //retry login times
  2049. public byte byPasswordLevel; //PasswordLevel,0-invalid,1-default password,2-valid password,3-risk password
  2050. public byte byProxyType; //Proxy Type,0-not use proxy, 1-use socks5 proxy, 2-use EHome proxy
  2051. public uint dwSurplusLockTime; //surplus locked time
  2052. public byte byCharEncodeType; //character encode type
  2053. public byte byRes1;
  2054. public byte bySupport; //能力集扩展,位与结果:0- 不支持,1- 支持
  2055. // bySupport & 0x1: 0-保留
  2056. // bySupport & 0x2: 0-不支持变化上报 1-支持变化上报
  2057. public byte byRes;
  2058. public uint dwOEMCode;
  2059. public byte bySupportDev5;//Support v50 version of the device parameters, device name and device type name length is extended to 64 bytes
  2060. public byte byLoginMode; //登录模式 0-Private登录 1-ISAPI登录
  2061. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 246)]
  2062. public byte[] byRes2;
  2063. }
  2064. //DVR device parameters
  2065. [StructLayout(LayoutKind.Sequential)]
  2066. public struct NET_DVR_DEVICECFG_V40
  2067. {
  2068. public uint dwSize;
  2069. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN)]
  2070. public byte[] sDVRName;//DVR name
  2071. public uint dwDVRID; //DVR ID //V1.4 (0- 99) , V1.5 (0- 255)
  2072. public uint dwRecycleRecord; //cycle record, 0-disable, 1-enable
  2073. //the following to the end is Read-only
  2074. [MarshalAs(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN)]
  2075. public byte[] sSerialNumber;//SN
  2076. public uint dwSoftwareVersion; //Software version,Major version:16 MSB,minor version:16 LSB
  2077. public uint dwSoftwareBuildDate; //Build, 0xYYYYMMDD
  2078. public uint dwDSPSoftwareVersion; //DSP Version: 16 high bit is the major version, and 16 low bit is the minor version
  2079. public uint dwDSPSoftwareBuildDate; // DSP Build, 0xYYYYMMDD
  2080. public uint dwPanelVersion; // Front panel version,Major version:16 MSB,minor version:16 LSB
  2081. public uint dwHardwareVersion; // Hardware version,Major version:16 MSB,minor version:16 LSB
  2082. public byte byAlarmInPortNum; //DVR Alarm input
  2083. public byte byAlarmOutPortNum; //DVR Alarm output
  2084. public byte byRS232Num; //DVR 232 port number
  2085. public byte byRS485Num; //DVR 485 port number
  2086. public byte byNetworkPortNum; //Network port number
  2087. public byte byDiskCtrlNum; //DVR HDD number
  2088. public byte byDiskNum; //DVR disk number
  2089. public byte byDVRType; //DVRtype, 1:DVR 2:ATM DVR 3:DVS ......
  2090. public byte byChanNum; //DVR channel number
  2091. public byte byStartChan; //start,e.g.1: DVR 2: ATM DVR 3: DVS ......- -
  2092. public byte byDecordChans; //DVR decoding channels
  2093. public byte byVGANum; //VGA interface number
  2094. public byte byUSBNum; //USB interface number
  2095. public byte byAuxoutNum; //Aux output number
  2096. public byte byAudioNum; //voice interface number
  2097. public byte byIPChanNum; //Max. IP channel number 8 LSB ,8 MSB with byHighIPChanNum
  2098. public byte byZeroChanNum; //Zero channel number
  2099. public byte bySupport; //Ability set,0 represent not support ,1 represent support,
  2100. //bySupport & 0x1, smart search
  2101. //bySupport & 0x2, backup
  2102. //bySupport & 0x4, compression ability set
  2103. //bySupport & 0x8, multiple network adapter
  2104. //bySupport & 0x10, remote SADP
  2105. //bySupport & 0x20, support Raid
  2106. //bySupport & 0x40, support IPSAN
  2107. //bySupport & 0x80, support RTP over RTSP
  2108. public byte byEsataUseage; //Default E-SATA: 0- backup, 1- record
  2109. public byte byIPCPlug; //0- disable plug-and-play, 1- enable plug-and-play
  2110. public byte byStorageMode; //Hard Disk Mode:0-group,1-quota,2-draw frame,3-Auto
  2111. public byte bySupport1; //Ability set,0 represent not support ,1 represent support,
  2112. //bySupport1 & 0x1, support snmp v30
  2113. //bySupport1 & 0x2, support distinguish download and playback
  2114. //bySupport1 & 0x4, support deployment level
  2115. //bySupport1 & 0x8, support vca alarm time extension
  2116. //bySupport1 & 0x10, support muti disks(more than 33)
  2117. //bySupport1 & 0x20, support rtsp over http
  2118. public ushort wDevType;//Device type
  2119. [MarshalAs(UnmanagedType.ByValArray, SizeConst = DEV_TYPE_NAME_LEN)]
  2120. public byte[] byDevTypeName;//Device model name
  2121. public byte bySupport2; //The ability to set extension, bit 0 indicates does not support one expressed support for
  2122. //bySupport2 & 0x1, Whether to support extended the OSD character overlay (terminal and capture machine expansion distinguish)
  2123. public byte byAnalogAlarmInPortNum; //Analog alarm in number
  2124. public byte byStartAlarmInNo; //Analog alarm in Start No.
  2125. public byte byStartAlarmOutNo; //Analog alarm Out Start No.
  2126. public byte byStartIPAlarmInNo; //IP alarm in Start No. 0-Invalid
  2127. public byte byStartIPAlarmOutNo; //IP Alarm Out Start No. 0-Invalid
  2128. public byte byHighIPChanNum; //Ip Chan Num High 8 Bit
  2129. public byte byEnableRemotePowerOn;//enable the equipment in a dormant state remote boot function, 0- is not enabled, the 1- enabled
  2130. public ushort wDevClass; //device class
  2131. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
  2132. public byte[] byRes2;
  2133. }
  2134. /* Asynchronous login callback function
  2135. * [out] lUserID - NET_DVR_Login_V40 return value
  2136. * [out] dwResult - asynchronous login status, 0:failed,1:success
  2137. * [out] NET_DVR_DEVICEINFO_V30 - device informations
  2138. * [out] pUser - user input data
  2139. */
  2140. public delegate void LoginResultCallBack(int lUserID, uint dwResult, ref NET_DVR_DEVICEINFO_V30 lpDeviceInfo, IntPtr pUser);
  2141. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
  2142. public struct NET_DVR_USER_LOGIN_INFO
  2143. {
  2144. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = NET_DVR_DEV_ADDRESS_MAX_LEN)]
  2145. public string sDeviceAddress;
  2146. public byte byUseTransport;
  2147. public ushort wPort;
  2148. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = NET_DVR_LOGIN_USERNAME_MAX_LEN)]
  2149. public string sUserName;
  2150. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = NET_DVR_LOGIN_PASSWD_MAX_LEN)]
  2151. public string sPassword;
  2152. public LoginResultCallBack cbLoginResult;
  2153. public IntPtr pUser;
  2154. public bool bUseAsynLogin;
  2155. public byte byProxyType;
  2156. public byte byUseUTCTime;
  2157. public byte byLoginMode; //登录模式 0-Private 1-ISAPI 2-自适应(默认不采用自适应是因为自适应登录时,会对性能有较大影响,自适应时要同时发起ISAPI和Private登录)
  2158. public byte byHttps; //ISAPI登录时,是否使用HTTPS,0-不使用HTTPS,1-使用HTTPS 2-自适应(默认不采用自适应是因为自适应登录时,会对性能有较大影响,自适应时要同时发起HTTP和HTTPS)
  2159. public int iProxyID;
  2160. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 120, ArraySubType = UnmanagedType.I1)]
  2161. public byte[] byRes3;
  2162. }
  2163. [StructLayoutAttribute(LayoutKind.Sequential)]
  2164. public struct NET_DVR_PREVIEWINFO
  2165. {
  2166. public int lChannel; //Channel no.
  2167. public uint dwStreamType; //Stream type 0-main stream,1-sub stream,2-third stream,3-forth stream, and so on
  2168. public uint dwLinkMode; //Protocol type: 0-TCP, 1-UDP, 2-Muticast, 3-RTP,4-RTP/RTSP, 5-RSTP/HTTP
  2169. public IntPtr hPlayWnd; //Play window's handle; set NULL to disable preview
  2170. public uint bBlocked; //If data stream requesting process is blocked or not: 0-no, 1-yes
  2171. //if true, the SDK Connect failure return until 5s timeout , not suitable for polling to preview.
  2172. public uint bPassbackRecord; //0- not enable ,1 enable
  2173. public byte byPreviewMode; //Preview mode 0-normal preview,2-delay preview
  2174. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = STREAM_ID_LEN, ArraySubType = UnmanagedType.I1)]
  2175. public byte[] byStreamID; //Stream ID
  2176. public byte byProtoType; //0-private,1-RTSP
  2177. public byte byRes1;
  2178. public byte byVideoCodingType;
  2179. public uint dwDisplayBufNum; //soft player display buffer size(number of frames), range:1-50, default:1
  2180. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 216, ArraySubType = UnmanagedType.I1)]
  2181. public byte[] byRes;
  2182. }
  2183. #endregion
  2184. #region network configuration
  2185. /*IP address*/
  2186. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
  2187. public struct NET_DVR_IPADDR
  2188. {
  2189. /// char[16]
  2190. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = 16)]
  2191. public string sIpV4;
  2192. /// BYTE[128]
  2193. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
  2194. public byte[] byIPv6;
  2195. public void Init()
  2196. {
  2197. byIPv6 = new byte[128];
  2198. }
  2199. }
  2200. /* Network structure(sub struct)(9000 extension)*/
  2201. [StructLayoutAttribute(LayoutKind.Sequential)]
  2202. public struct NET_DVR_ETHERNET_V30
  2203. {
  2204. public NET_DVR_IPADDR struDVRIP;//DVR IP address
  2205. public NET_DVR_IPADDR struDVRIPMask;//DVR IP address mask
  2206. public uint dwNetInterface;//net card: 1-10MBase-T 2-10MBase-T Full duplex 3-100MBase-TX 4-100M Full duplex 5-10M/100M adaptive
  2207. public ushort wDVRPort;//port
  2208. public ushort wMTU;//MTU default:1500。
  2209. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
  2210. public byte[] byMACAddr;// mac address
  2211. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  2212. public byte[] byRes;// reserve
  2213. }
  2214. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
  2215. public struct NET_DVR_PPPOECFG
  2216. {
  2217. public uint dwPPPOE;//0-disable,1-enable
  2218. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2219. public byte[] sPPPoEUser;//PPPoE user name
  2220. [MarshalAsAttribute(UnmanagedType.ByValTStr, SizeConst = PASSWD_LEN)]
  2221. public string sPPPoEPassword;// PPPoE password
  2222. public NET_DVR_IPADDR struPPPoEIP;//PPPoE IP address
  2223. }
  2224. //network configuration struct(9000 extension)
  2225. [StructLayoutAttribute(LayoutKind.Sequential)]
  2226. public struct NET_DVR_NETCFG_V30
  2227. {
  2228. public uint dwSize;
  2229. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ETHERNET, ArraySubType = UnmanagedType.Struct)]
  2230. public NET_DVR_ETHERNET_V30[] struEtherNet;//Ethernet
  2231. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.Struct)]
  2232. public NET_DVR_IPADDR[] struRes1;//reserve
  2233. public NET_DVR_IPADDR struAlarmHostIpAddr;// alarm host IP address
  2234. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.U2)]
  2235. public ushort[] wRes2;
  2236. public ushort wAlarmHostIpPort;
  2237. public byte byUseDhcp;
  2238. public byte byIPv6Mode;//IPv6 distribute methods,0-Routing announcement,1-manually,2-Enable the DHCP allocation
  2239. public NET_DVR_IPADDR struDnsServer1IpAddr; // primary dns server
  2240. public NET_DVR_IPADDR struDnsServer2IpAddr; // secondary dns server
  2241. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
  2242. public byte[] byIpResolver;
  2243. public ushort wIpResolverPort;
  2244. public ushort wHttpPortNo;
  2245. public NET_DVR_IPADDR struMulticastIpAddr; // Multicast group address
  2246. public NET_DVR_IPADDR struGatewayIpAddr; // The gateway address
  2247. public NET_DVR_PPPOECFG struPPPoE;
  2248. public byte byEnablePrivateMulticastDiscovery; //Private multicast search,0~default,1~enable ,2-disable
  2249. public byte byEnableOnvifMulticastDiscovery; //Onvif multicast search,0~default,1~enable,2-disable
  2250. public byte byEnableDNS; //DNS Atuo enable, 0-Res,1-open, 2-close
  2251. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 61, ArraySubType = UnmanagedType.I1)]
  2252. public byte[] byRes;
  2253. public void Init()
  2254. {
  2255. struEtherNet = new NET_DVR_ETHERNET_V30[MAX_ETHERNET];
  2256. struAlarmHostIpAddr = new NET_DVR_IPADDR();
  2257. struDnsServer1IpAddr = new NET_DVR_IPADDR();
  2258. struDnsServer2IpAddr = new NET_DVR_IPADDR();
  2259. byIpResolver = new byte[MAX_DOMAIN_NAME];
  2260. struMulticastIpAddr = new NET_DVR_IPADDR();
  2261. struGatewayIpAddr = new NET_DVR_IPADDR();
  2262. struPPPoE = new NET_DVR_PPPOECFG();
  2263. }
  2264. }
  2265. //Network Configure Structure(V50)
  2266. [StructLayoutAttribute(LayoutKind.Sequential)]
  2267. public struct NET_DVR_NETCFG_V50
  2268. {
  2269. public uint dwSize;
  2270. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ETHERNET, ArraySubType = UnmanagedType.Struct)]
  2271. public NET_DVR_ETHERNET_V30[] struEtherNet; //Network Port
  2272. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.Struct)]
  2273. public NET_DVR_IPADDR[] struRes1; /*reserve*/
  2274. public NET_DVR_IPADDR struAlarmHostIpAddr; /* IP address of remote management host */
  2275. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I1)]
  2276. public byte[] byRes2; /* reserve */
  2277. public ushort wAlarmHostIpPort; /* Port of remote management Host */
  2278. public byte byUseDhcp; /* Whether to enable the DHCP 0xff- invalid 0- enabled 1- not enabled */
  2279. public byte byIPv6Mode; //IPv6 allocation, 0- routing announcement, 1- manually, 2- enable DHCP allocation
  2280. public NET_DVR_IPADDR struDnsServer1IpAddr; /* IP address of the domain name server 1 */
  2281. public NET_DVR_IPADDR struDnsServer2IpAddr; /* IP address of the domain name server 2 */
  2282. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
  2283. public byte[] byIpResolver; /* IP parse server domain name or IP address */
  2284. public ushort wIpResolverPort; /* Parsing IP server port number */
  2285. public ushort wHttpPortNo; /* HTTP port number */
  2286. public NET_DVR_IPADDR struMulticastIpAddr; /* Multicast group address */
  2287. public NET_DVR_IPADDR struGatewayIpAddr; /* Gateway address */
  2288. public NET_DVR_PPPOECFG struPPPoE;
  2289. public byte byEnablePrivateMulticastDiscovery; //Private multicast search, 0- default, 1- enabled, 2 - disabled
  2290. public byte byEnableOnvifMulticastDiscovery; //Onvif multicast search, 0- default, 1- enabled, 2 - disabled
  2291. public ushort wAlarmHost2IpPort; /* Alarm host 2 port */
  2292. public NET_DVR_IPADDR struAlarmHost2IpAddr; /* Alarm host 2 IP addresses */
  2293. public byte byEnableDNS; //DNS Enabled, 0-close,1-open
  2294. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 599, ArraySubType = UnmanagedType.I1)]
  2295. public byte[] byRes;
  2296. public void Init()
  2297. {
  2298. struEtherNet = new NET_DVR_ETHERNET_V30[MAX_ETHERNET];
  2299. struRes1 = new NET_DVR_IPADDR[2];
  2300. struAlarmHostIpAddr = new NET_DVR_IPADDR();
  2301. struAlarmHost2IpAddr = new NET_DVR_IPADDR();
  2302. struDnsServer1IpAddr = new NET_DVR_IPADDR();
  2303. struDnsServer2IpAddr = new NET_DVR_IPADDR();
  2304. byIpResolver = new byte[MAX_DOMAIN_NAME];
  2305. struMulticastIpAddr = new NET_DVR_IPADDR();
  2306. struGatewayIpAddr = new NET_DVR_IPADDR();
  2307. struPPPoE = new NET_DVR_PPPOECFG();
  2308. byRes = new byte[599];
  2309. }
  2310. }
  2311. [StructLayoutAttribute(LayoutKind.Sequential)]
  2312. public struct NET_DVR_IPDEVINFO_V31
  2313. {
  2314. public byte byEnable;//Valid status for IP device
  2315. public byte byProType; //Protocol type, 0- private (default) , 1- Panasonic, 2- SONY
  2316. public byte byEnableQuickAdd; //0- does not support quick adding of IP device; 1- enable quick adding of IP device
  2317. //Quick add of device IP and protocol, fill in the other parameters as system default
  2318. public byte byRes1; //reserved as 0
  2319. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2320. public byte[] sUserName;//user name
  2321. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
  2322. public byte[] sPassword;//Password
  2323. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
  2324. public byte[] byDomain;//Domain name of the device
  2325. public NET_DVR_IPADDR struIP;//IP
  2326. public ushort wDVRPort;// Port number
  2327. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = DEV_ID_LEN, ArraySubType = UnmanagedType.I1)]
  2328. public byte[] szDeviceID; //Device ID
  2329. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  2330. public byte[] byRes2; //Reserved as 0
  2331. public void Init()
  2332. {
  2333. sUserName = new byte[NAME_LEN];
  2334. sPassword = new byte[PASSWD_LEN];
  2335. byDomain = new byte[MAX_DOMAIN_NAME];
  2336. szDeviceID = new byte[DEV_ID_LEN];
  2337. byRes2 = new byte[2];
  2338. }
  2339. }
  2340. #endregion
  2341. #region event card linkage
  2342. [StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
  2343. public struct NET_DVR_EVENT_CARD_LINKAGE_COND
  2344. {
  2345. public uint dwSize;
  2346. public uint dwEventID; //Event ID
  2347. public ushort wLocalControllerID; //On the controller serial number [1, 64]
  2348. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 106, ArraySubType = UnmanagedType.I1)]
  2349. public byte[] byRes;
  2350. }
  2351. [StructLayoutAttribute(LayoutKind.Sequential)]
  2352. public struct NET_DVR_EVENT_LINKAGE_INFO
  2353. {
  2354. public ushort wMainEventType; //main event type,0-device,1-alarmin,2-door,3-card reader
  2355. public ushort wSubEventType; //sub event type
  2356. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 28, ArraySubType = UnmanagedType.I1)]
  2357. public byte[] byRes;
  2358. }
  2359. [StructLayoutAttribute(LayoutKind.Explicit)]
  2360. public struct NET_DVR_EVETN_CARD_LINKAGE_UNION
  2361. {
  2362. [FieldOffsetAttribute(0)]
  2363. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  2364. public byte[] byRes;
  2365. //[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  2366. //[FieldOffsetAttribute(0)]
  2367. //public byte[] byCardNo;
  2368. //[FieldOffsetAttribute(0)]
  2369. //public NET_DVR_EVENT_LINKAGE_INFO struEventLinkage;
  2370. //[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MACADDR_LEN, ArraySubType = UnmanagedType.I1)]
  2371. //[FieldOffsetAttribute(0)]
  2372. //public byte[] byMACAddr;
  2373. //[MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  2374. //[FieldOffsetAttribute(0)]
  2375. //public byte[] byEmployeeNo;
  2376. }
  2377. [StructLayoutAttribute(LayoutKind.Sequential)]
  2378. public struct NET_DVR_EVENT_CARD_LINKAGE_CFG_V50
  2379. {
  2380. public uint dwSize;
  2381. public byte byProMode; //linkage type,0-by event,1-by card, 2-by mac
  2382. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  2383. public byte[] byRes1;
  2384. public uint dwEventSourceID; //event source ID,when the main event is device ,it not use; when the main event is door ,it is the door No; when the main event is card reader ,it is the card reader No; when the main event is alarmin,it is the alarmin ID; 0xffffffff means all
  2385. public NET_DVR_EVETN_CARD_LINKAGE_UNION uLinkageInfo; //Linkage mode parameters
  2386. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMOUT_NUM, ArraySubType = UnmanagedType.I1)]
  2387. public byte[] byAlarmout; //linkage alarmout NO,according to the values,0-not linkage,1-linkage
  2388. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  2389. public byte[] byRes2;
  2390. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2391. public byte[] byOpenDoor; //whether linkage open door,according to the values,0-not linkage,1-linkage
  2392. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2393. public byte[] byCloseDoor; //whether linkage close door,according to the values,0-not linkage,1-linkage
  2394. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2395. public byte[] byNormalOpen; //whether linkage normal open door,according to the values,0-not linkage,1-linkage
  2396. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2397. public byte[] byNormalClose; //whether linkage normal close door,according to the values,0-not linkage,1-linkage
  2398. public byte byMainDevBuzzer; //whether linkage main device buzzer, 0-not linkage,1-linkage
  2399. public byte byCapturePic; //whether linkage capture picture, 0-no, 1-yes
  2400. public byte byRecordVideo; //whether linkage record video, 0-no, 1-yes
  2401. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 29, ArraySubType = UnmanagedType.I1)]
  2402. public byte[] byRes3;
  2403. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  2404. public byte[] byReaderBuzzer; //linkage reader buzzer,according to the values,0-not linkage,1-linkage
  2405. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMOUT_NUM, ArraySubType = UnmanagedType.I1)]
  2406. public byte[] byAlarmOutClose; //Associated alarm output shut down, in bytes, 0-not linkage,1-linkage
  2407. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMIN_NUM, ArraySubType = UnmanagedType.I1)]
  2408. public byte[] byAlarmInSetup; //Associated slip protection, in bytes, 0-not linkage,1-linkage
  2409. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMIN_NUM, ArraySubType = UnmanagedType.I1)]
  2410. public byte[] byAlarmInClose; //Removal associated protection zones, in bytes, 0-not linkage,1-linkage
  2411. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 500, ArraySubType = UnmanagedType.I1)]
  2412. public byte[] byRes;
  2413. public void Init()
  2414. {
  2415. byRes1 = new byte[3];
  2416. byAlarmout = new byte[MAX_ALARMHOST_ALARMOUT_NUM];
  2417. byOpenDoor = new byte[MAX_DOOR_NUM_256];
  2418. byCloseDoor = new byte[MAX_DOOR_NUM_256];
  2419. byNormalOpen = new byte[MAX_DOOR_NUM_256];
  2420. byNormalClose = new byte[MAX_DOOR_NUM_256];
  2421. byRes3 = new byte[29];
  2422. byReaderBuzzer = new byte[MAX_CARD_READER_NUM_512];
  2423. byAlarmOutClose = new byte[MAX_ALARMHOST_ALARMOUT_NUM];
  2424. byAlarmInSetup = new byte[MAX_ALARMHOST_ALARMIN_NUM];
  2425. byAlarmInClose = new byte[MAX_ALARMHOST_ALARMIN_NUM];
  2426. byRes = new byte[500];
  2427. }
  2428. }
  2429. [StructLayoutAttribute(LayoutKind.Sequential)]
  2430. public struct NET_DVR_EVENT_CARD_LINKAGE_CFG_V51
  2431. {
  2432. public uint dwSize;
  2433. public byte byProMode; //linkage type,0-by event,1-by card, 2-by mac, 3-by employee No
  2434. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  2435. public byte[] byRes1;
  2436. public uint dwEventSourceID; //event source ID,when the main event is device ,it not use; when the main event is door ,it is the door No; when the main event is card reader ,it is the card reader No; when the main event is alarmin,it is the alarmin ID; 0xffffffff means all
  2437. public NET_DVR_EVETN_CARD_LINKAGE_UNION uLinkageInfo; //Linkage mode parameters
  2438. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMOUT_NUM, ArraySubType = UnmanagedType.I1)]
  2439. public byte[] byAlarmout; //linkage alarmout NO,according to the values,0-not linkage,1-linkage
  2440. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  2441. public byte[] byRes2;
  2442. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2443. public byte[] byOpenDoor; //whether linkage open door,according to the values,0-not linkage,1-linkage
  2444. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2445. public byte[] byCloseDoor; //whether linkage close door,according to the values,0-not linkage,1-linkage
  2446. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2447. public byte[] byNormalOpen; //whether linkage normal open door,according to the values,0-not linkage,1-linkage
  2448. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2449. public byte[] byNormalClose; //whether linkage normal close door,according to the values,0-not linkage,1-linkage
  2450. public byte byMainDevBuzzer; //whether linkage main device buzzer, 0-not linkage,1-linkage
  2451. public byte byCapturePic; //whether linkage capture picture, 0-no, 1-yes
  2452. public byte byRecordVideo; //whether linkage record video, 0-no, 1-yes
  2453. public byte byMainDevStopBuzzer; //whether linkage record video, 0-no, 1-yes
  2454. public ushort wAudioDisplayID;
  2455. public byte byAudioDisplayMode;
  2456. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 25, ArraySubType = UnmanagedType.I1)]
  2457. public byte[] byRes3;
  2458. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  2459. public byte[] byReaderBuzzer; //linkage reader buzzer,according to the values,0-not linkage,1-linkage
  2460. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMOUT_NUM, ArraySubType = UnmanagedType.I1)]
  2461. public byte[] byAlarmOutClose; //Associated alarm output shut down, in bytes, 0-not linkage,1-linkage
  2462. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMIN_NUM, ArraySubType = UnmanagedType.I1)]
  2463. public byte[] byAlarmInSetup; //Associated slip protection, in bytes, 0-not linkage,1-linkage
  2464. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMIN_NUM, ArraySubType = UnmanagedType.I1)]
  2465. public byte[] byAlarmInClose; //Removal associated protection zones, in bytes, 0-not linkage,1-linkage
  2466. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  2467. public byte[] byReaderStopBuzzer; //Removal associated protection zones, in bytes, 0-not linkage,1-linkage
  2468. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 512, ArraySubType = UnmanagedType.I1)]
  2469. public byte[] byRes;
  2470. public void Init()
  2471. {
  2472. byRes1 = new byte[3];
  2473. byAlarmout = new byte[MAX_ALARMHOST_ALARMOUT_NUM];
  2474. byRes2 = new byte[32];
  2475. byOpenDoor = new byte[MAX_DOOR_NUM_256];
  2476. byCloseDoor = new byte[MAX_DOOR_NUM_256];
  2477. byNormalOpen = new byte[MAX_DOOR_NUM_256];
  2478. byNormalClose = new byte[MAX_DOOR_NUM_256];
  2479. byRes3 = new byte[25];
  2480. byReaderBuzzer = new byte[MAX_CARD_READER_NUM_512];
  2481. byAlarmOutClose = new byte[MAX_ALARMHOST_ALARMOUT_NUM];
  2482. byAlarmInSetup = new byte[MAX_ALARMHOST_ALARMIN_NUM];
  2483. byAlarmInClose = new byte[MAX_ALARMHOST_ALARMIN_NUM];
  2484. byReaderStopBuzzer = new byte[MAX_CARD_READER_NUM_512];
  2485. byRes = new byte[512];
  2486. }
  2487. }
  2488. #endregion
  2489. #region DVR IP channel configuration
  2490. /* Alarm output parameters */
  2491. /* Alarm output channel */
  2492. [StructLayoutAttribute(LayoutKind.Sequential)]
  2493. public struct NET_DVR_IPALARMOUTINFO
  2494. {
  2495. public byte byIPID; /* ID of IP device, the range: 1 to MAX_IP_DEVICE */
  2496. public byte byAlarmOut; /* Alarm output NO. */
  2497. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 18, ArraySubType = UnmanagedType.I1)]
  2498. public byte[] byRes; /* Reserved */
  2499. }
  2500. /* IP Alarm output configuration */
  2501. [StructLayoutAttribute(LayoutKind.Sequential)]
  2502. public struct NET_DVR_IPALARMOUTCFG
  2503. {
  2504. public uint dwSize; /*struct size */
  2505. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_ALARMOUT, ArraySubType = UnmanagedType.Struct)]
  2506. public NET_DVR_IPALARMOUTINFO[] struIPAlarmOutInfo; /* IP alarm output */
  2507. }
  2508. [StructLayoutAttribute(LayoutKind.Sequential)]
  2509. public struct NET_DVR_IPALARMOUTINFO_V40
  2510. {
  2511. public uint dwIPID; /* ID of IP device, the range: 1 to MAX_IP_DEVICE*/
  2512. public uint dwAlarmOut; /* Alarm Out NO. */
  2513. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  2514. public byte[] byRes; /* Reserved */
  2515. }
  2516. [StructLayoutAttribute(LayoutKind.Sequential)]
  2517. public struct NET_DVR_IPALARMOUTCFG_V40
  2518. {
  2519. public uint dwSize;
  2520. public uint dwCurIPAlarmOutNum;
  2521. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_ALARMIN_V40, ArraySubType = UnmanagedType.Struct)]
  2522. public NET_DVR_IPALARMOUTINFO_V40[] struIPAlarmOutInfo;
  2523. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)]
  2524. public byte[] byRes;
  2525. }
  2526. /* IP Alarm input configuration */
  2527. [StructLayoutAttribute(LayoutKind.Sequential)]
  2528. public struct NET_DVR_IPALARMININFO
  2529. {
  2530. public byte byIPID; /* ID of IP device, the range: 1 to MAX_IP_DEVICE */
  2531. public byte byAlarmIn; /* Alarm input NO. */
  2532. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 18, ArraySubType = UnmanagedType.I1)]
  2533. public byte[] byRes; /* Reserved */
  2534. }
  2535. [StructLayoutAttribute(LayoutKind.Sequential)]
  2536. public struct NET_DVR_IPALARMINCFG
  2537. {
  2538. public uint dwSize; /*struct size */
  2539. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_ALARMIN, ArraySubType = UnmanagedType.Struct)]
  2540. public NET_DVR_IPALARMININFO[] struIPAlarmInInfo; /* IP alarm input */
  2541. }
  2542. [StructLayoutAttribute(LayoutKind.Sequential)]
  2543. public struct NET_DVR_IPALARMININFO_V40
  2544. {
  2545. public uint dwIPID; /* ID of IP device, the range: 1 to MAX_IP_DEVICE */
  2546. public uint dwAlarmIn; /* Alarm input NO. */
  2547. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.I1)]
  2548. public byte[] byRes;
  2549. }
  2550. [StructLayoutAttribute(LayoutKind.Sequential)]
  2551. public struct NET_DVR_IPALARMINCFG_V40
  2552. {
  2553. public uint dwSize;
  2554. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_IP_ALARMIN_V40, ArraySubType = UnmanagedType.Struct)]
  2555. public NET_DVR_IPALARMININFO_V40[] struIPAlarmInInfo;/* IP alarmin */
  2556. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)]
  2557. public byte[] byRes;
  2558. }
  2559. /* IP Channel parameters */
  2560. [StructLayout(LayoutKind.Sequential)]
  2561. public struct NET_DVR_IPCHANINFO
  2562. {
  2563. public byte byEnable; //0- Failed to connect IP device; 1- Successfully;
  2564. public byte byIPID; //ID of IP device, low 8 bit
  2565. public byte byChannel; //Channel No.
  2566. public byte byIPIDHigh; //ID of IP device, high 8 bit
  2567. public byte byTransProtocol; //Trans Protocol Type 0-TCP/auto (Determined by the device),1-UDP 2-Multicast 3-only TCP 4-auto
  2568. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 31, ArraySubType = UnmanagedType.I1)]
  2569. public byte[] byres; /* Reserved */
  2570. }
  2571. [StructLayout(LayoutKind.Sequential)]
  2572. public struct NET_DVR_IPSERVER_STREAM
  2573. {
  2574. public byte byEnable; //Is enable
  2575. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  2576. public byte[] byRes;
  2577. public NET_DVR_IPADDR struIPServer; //IPServer Address
  2578. public ushort wPort; //IPServer port
  2579. public ushort wDvrNameLen; //DVR Name Length
  2580. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2581. public byte[] byDVRName; //DVR Name
  2582. public ushort wDVRSerialLen; //Serial Length
  2583. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.U2)]
  2584. public ushort[] byRes1; //reserved
  2585. [MarshalAs(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
  2586. public byte[] byDVRSerialNumber; //DVR Serial
  2587. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2588. public byte[] byUserName; //DVR User name
  2589. [MarshalAs(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
  2590. public byte[] byPassWord; //DVR User password
  2591. public byte byChannel; //DVR channel
  2592. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11, ArraySubType = UnmanagedType.I1)]
  2593. public byte[] byRes2; //Reserved
  2594. public void Init()
  2595. {
  2596. byRes = new byte[3];
  2597. byRes1 = new ushort[2];
  2598. byUserName = new byte[NAME_LEN];
  2599. byPassWord = new byte[PASSWD_LEN];
  2600. byDVRSerialNumber = new byte[SERIALNO_LEN];
  2601. byDVRName = new byte[NAME_LEN];
  2602. byRes2 = new byte[11];
  2603. }
  2604. }
  2605. /*the configuration of stream server*/
  2606. [StructLayout(LayoutKind.Sequential)]
  2607. public struct NET_DVR_STREAM_MEDIA_SERVER_CFG
  2608. {
  2609. public byte byValid; //Is enable
  2610. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  2611. public byte[] byRes1;
  2612. public NET_DVR_IPADDR struDevIP; //stream server IP
  2613. public ushort wDevPort; //stream server Port
  2614. public byte byTransmitType; //Protocol: 0-TCP, 1-UDP
  2615. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 69, ArraySubType = UnmanagedType.I1)]
  2616. public byte[] byRes2;
  2617. public void Init()
  2618. {
  2619. byRes1 = new byte[3];
  2620. byRes2 = new byte[69];
  2621. }
  2622. }
  2623. //device information
  2624. [StructLayout(LayoutKind.Sequential)]
  2625. public struct NET_DVR_DEV_CHAN_INFO
  2626. {
  2627. public NET_DVR_IPADDR struIP; //DVR IP address
  2628. public ushort wDVRPort; //DVR PORT
  2629. public byte byChannel; //Channel
  2630. public byte byTransProtocol; //Transmit protocol:0-TCP,1-UDP
  2631. public byte byTransMode; //Stream mode: 0-mian stream 1-sub stream
  2632. public byte byFactoryType; /*IPC factory type*/
  2633. public byte byDeviceType; //Device type(Used by videoplatfom VCA card),1-decoder(use decode channel No. or display channel depends on byVcaSupportChanMode in videoplatform ability struct),2-coder
  2634. public byte byDispChan;//Display channel No. used by VCA configuration
  2635. public byte bySubDispChan;//Display sub channel No. used by VCA configuration
  2636. public byte byResolution; //Resolution: 1-CIF 2-4CIF 3-720P 4-1080P 5-500w used by big screen controler
  2637. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  2638. public byte[] byRes;
  2639. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_DOMAIN_NAME, ArraySubType = UnmanagedType.I1)]
  2640. public byte[] byDomain; //Device domain name
  2641. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2642. public byte[] sUserName; //Remote device user name
  2643. [MarshalAs(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
  2644. public byte[] sPassword; //Remote device password
  2645. public void Init()
  2646. {
  2647. byRes = new byte[2];
  2648. byDomain = new byte[MAX_DOMAIN_NAME];
  2649. sUserName = new byte[NAME_LEN];
  2650. sPassword = new byte[PASSWD_LEN];
  2651. }
  2652. }
  2653. [StructLayout(LayoutKind.Sequential)]
  2654. public struct NET_DVR_PU_STREAM_CFG
  2655. {
  2656. public uint dwSize;
  2657. public NET_DVR_STREAM_MEDIA_SERVER_CFG struStreamMediaSvrCfg;
  2658. public NET_DVR_DEV_CHAN_INFO struDevChanInfo;
  2659. }
  2660. [StructLayout(LayoutKind.Sequential)]
  2661. public struct NET_DVR_DDNS_STREAM_CFG
  2662. {
  2663. public byte byEnable; //Is Enable.
  2664. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  2665. public byte[] byRes1;
  2666. NET_DVR_IPADDR struStreamServer; //Stream server IP
  2667. public ushort wStreamServerPort; //Stream server Port
  2668. public byte byStreamServerTransmitType; //Stream protocol
  2669. public byte byRes2;
  2670. NET_DVR_IPADDR struIPServer; //IPserver IP
  2671. public ushort wIPServerPort; //IPserver Port
  2672. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  2673. public byte[] byRes3;
  2674. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2675. public byte[] sDVRName; //DVR Name
  2676. public ushort wDVRNameLen; //DVR Name Len
  2677. public ushort wDVRSerialLen; //Serial Len
  2678. [MarshalAs(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
  2679. public byte[] sDVRSerialNumber; //Serial number
  2680. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2681. public byte[] sUserName; //the user name which is used to login DVR.
  2682. [MarshalAs(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
  2683. public byte[] sPassWord; //the password which is used to login DVR.
  2684. public ushort wDVRPort; //DVR port
  2685. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  2686. public byte[] byRes4;
  2687. public byte byChannel; //channel
  2688. public byte byTransProtocol; //protocol
  2689. public byte byTransMode; //transform mode
  2690. public byte byFactoryType; //The type of factory who product the device.
  2691. public void Init()
  2692. {
  2693. byRes1 = new byte[3];
  2694. byRes3 = new byte[2];
  2695. sDVRSerialNumber = new byte[SERIALNO_LEN];
  2696. sUserName = new byte[NAME_LEN];
  2697. sPassWord = new byte[PASSWD_LEN];
  2698. byRes4 = new byte[2];
  2699. }
  2700. }
  2701. [StructLayout(LayoutKind.Sequential)]
  2702. public struct NET_DVR_PU_STREAM_URL
  2703. {
  2704. public byte byEnable;
  2705. [MarshalAs(UnmanagedType.ByValArray, SizeConst = URL_LEN, ArraySubType = UnmanagedType.I1)]
  2706. public byte[] strURL;
  2707. public byte byTransPortocol; // transport protocol type 0-tcp 1-UDP
  2708. public ushort wIPID; //Device ID,wIPID = iDevInfoIndex + iGroupNO*64 +1
  2709. public byte byChannel; //channel NO.
  2710. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7, ArraySubType = UnmanagedType.I1)]
  2711. public byte[] byRes;
  2712. public void Init()
  2713. {
  2714. byRes = new byte[7];
  2715. strURL = new byte[URL_LEN];
  2716. }
  2717. }
  2718. [StructLayout(LayoutKind.Sequential)]
  2719. public struct NET_DVR_HKDDNS_STREAM
  2720. {
  2721. public byte byEnable; //Is enable
  2722. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.I1)]
  2723. public byte[] byRes;
  2724. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
  2725. public byte[] byDDNSDomain; // hiDDNS domain
  2726. public ushort wPort; //IPServer port
  2727. public ushort wAliasLen; //Alias Length
  2728. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2729. public byte[] byAlias; //Alias
  2730. public ushort wDVRSerialLen; //Serial Length
  2731. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  2732. public byte[] byRes1; //reserved
  2733. [MarshalAs(UnmanagedType.ByValArray, SizeConst = SERIALNO_LEN, ArraySubType = UnmanagedType.I1)]
  2734. public byte[] byDVRSerialNumber; //DVR Serial
  2735. [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2736. public byte[] byUserName; //DVR User name
  2737. [MarshalAs(UnmanagedType.ByValArray, SizeConst = PASSWD_LEN, ArraySubType = UnmanagedType.I1)]
  2738. public byte[] byPassWord; //DVR User passward
  2739. public byte byChannel; //DVR channel
  2740. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11, ArraySubType = UnmanagedType.I1)]
  2741. public byte[] byRes2; //Reserved
  2742. public void Init()
  2743. {
  2744. byRes = new byte[3];
  2745. byDDNSDomain = new byte[64];
  2746. byAlias = new byte[NAME_LEN];
  2747. byRes1 = new byte[2];
  2748. byDVRSerialNumber = new byte[SERIALNO_LEN];
  2749. byUserName = new byte[NAME_LEN];
  2750. byPassWord = new byte[PASSWD_LEN];
  2751. byRes2 = new byte[11];
  2752. }
  2753. }
  2754. public const int NET_DVR_GET_IPPARACFG_V40 = 1062;
  2755. public const int NET_DVR_SET_IPPARACFG_V40 = 1063;
  2756. [StructLayout(LayoutKind.Sequential)]
  2757. public struct NET_DVR_IPCHANINFO_V40
  2758. {
  2759. public byte byEnable; /* Enable */
  2760. public byte byRes1;
  2761. public ushort wIPID; //IP ID
  2762. public uint dwChannel; //channel
  2763. public byte byTransProtocol; //Trans protocol,0-TCP,1-UDP
  2764. public byte byTransMode; //Trans mode 0-main, 1-sub
  2765. public byte byFactoryType; /*Factory type*/
  2766. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 241, ArraySubType = UnmanagedType.I1)]
  2767. public byte[] byRes;
  2768. public void Init()
  2769. {
  2770. byRes = new byte[241];
  2771. }
  2772. }
  2773. [StructLayout(LayoutKind.Sequential)]
  2774. public struct NET_DVR_GET_STREAM_UNION
  2775. {
  2776. public NET_DVR_IPCHANINFO struChanInfo; //Get stream from Device.
  2777. public NET_DVR_IPSERVER_STREAM struIPServerStream; // //Get stream from Device which register the IPServer
  2778. public NET_DVR_PU_STREAM_CFG struPUStream; //Get stream from stream server.
  2779. public NET_DVR_DDNS_STREAM_CFG struDDNSStream; //Get stream by IPserver and stream server.
  2780. public NET_DVR_PU_STREAM_URL struStreamUrl; //get stream through stream server by url.
  2781. public NET_DVR_HKDDNS_STREAM struHkDDNSStream; //get stream through hiDDNS
  2782. public NET_DVR_IPCHANINFO_V40 struIPChan; //Get stream from device(Extend)
  2783. }
  2784. [StructLayout(LayoutKind.Sequential)]
  2785. public struct NET_DVR_STREAM_MODE
  2786. {
  2787. public byte byGetStreamType; //the type of gettin stream:0-Get stream from Device, 1-Get stream fram stream server,
  2788. //2-Get stream from Device which register the IPServer, 3.Get stream by IPserver and stream server
  2789. //4-get stream by url,5-hkDDNS,6-Get stream from Device,NET_DVR_IPCHANINFO_V40,7- Get Stream by Rtsp Protocal
  2790. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
  2791. public byte[] byRes;
  2792. public NET_DVR_GET_STREAM_UNION uGetStream; //the union of different getting stream type.
  2793. }
  2794. [StructLayout(LayoutKind.Sequential)]
  2795. public struct NET_DVR_IPPARACFG_V40
  2796. {
  2797. public uint dwSize;
  2798. public uint dwGroupNum; //The number of group
  2799. public uint dwAChanNum; //The number of simulate channel
  2800. public uint dwDChanNum; //the number of IP channel
  2801. public uint dwStartDChan; //the begin NO. of IP channel
  2802. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30)]
  2803. public byte[] byAnalogChanEnable; //Is simulate channel enable? represent by bit
  2804. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_IP_DEVICE_V40)]
  2805. public NET_DVR_IPDEVINFO_V31[] struIPDevInfo;
  2806. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_CHANNUM_V30)]
  2807. public NET_DVR_STREAM_MODE[] struStreamMode;
  2808. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
  2809. public byte[] byRes2;
  2810. }
  2811. #endregion
  2812. #region Remote Control
  2813. [StructLayoutAttribute(LayoutKind.Sequential)]
  2814. public struct NET_DVR_JPEGPARA
  2815. {
  2816. /*Note: If encoding resolution is VGA, it supports grabbing 0=CIF, 1=QCIF, 2=D1 image.
  2817. But if encoding resolution is 3=UXGA (1600x1200) , 4=SVGA (800x600) , 5=HD720p (1280x720) , 6=VGA, 7=XVGA, and 8=HD900p it only support grabbing image with current resolution*/
  2818. /*
  2819. 0-CIF, 1-QCIF, 2-D1, 3-UXGA(1600x1200), 4-SVGA(800x600),5-HD720p(1280x720),
  2820. 6-VGA, 7-XVGA, 8-HD900p, 9-HD1080, 10-2560*1920,
  2821. 11-1600*304, 12-2048*1536, 13-2448*2048, 14-2448*1200, 15-2448*800,
  2822. 16-XGA(1024*768), 17-SXGA(1280*1024),18-WD1(960*576/960*480), 19-1080i, 20-576*576,
  2823. 21-1536*1536, 22-1920*1920, 23-320*240, 24-720*720, 25-1024*768,
  2824. 26-1280*1280, 27-1600*600, 28-2048*768, 29-160*120, 55-3072*2048,
  2825. 64-3840*2160, 70-2560*1440, 75-336*256,
  2826. 78-384*256, 79-384*216, 80-320*256, 82-320*192, 83-512*384,
  2827. 127-480*272, 128-512*272, 161-288*320, 162-144*176, 163-480*640,
  2828. 164-240*320, 165-120*160, 166-576*720, 167-720*1280, 168-576*960,
  2829. 180-180*240, 181-360*480, 182-540*720, 183-720*960, 184-960*1280,
  2830. 185-1080*1440 215-1080*720(occupied untested), 216-360x640(occupied untested),
  2831. 500-384*288,
  2832. 0xff-Auto(Use resolution of current stream)
  2833. */
  2834. public short wPicSize;
  2835. public short wPicQuality;/* 0 - the best, 1 - better, 2 - average; */
  2836. }
  2837. #endregion
  2838. [StructLayoutAttribute(LayoutKind.Sequential)]
  2839. public struct NET_DVR_ACS_WORK_STATUS_V50
  2840. {
  2841. public uint dwSize;
  2842. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2843. public byte[] byDoorLockStatus;//door lock status(relay status), 0 normally closed,1 normally open, 2 damage short - circuit alarm, 3 damage breaking alarm, 4 abnormal alarm
  2844. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2845. public byte[] byDoorStatus; //Door status(floor status), 1 - dormancy, 2 - normally open state, 3 - normally closed state, 4 - ordinary state
  2846. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  2847. public byte[] byMagneticStatus; //magnetic status 0 normally closed,1 normally open, 2 damage short - circuit alarm, 3 damage breaking alarm, 4 abnormal alarm
  2848. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CASE_SENSOR_NUM, ArraySubType = UnmanagedType.I1)]
  2849. public byte[] byCaseStatus; //case status, 0-no input, 1-input
  2850. public ushort wBatteryVoltage; //vattery voltage , multiply 10, unit: V
  2851. public byte byBatteryLowVoltage; //Is battery in low voltage, 0-no 1-yes
  2852. public byte byPowerSupplyStatus; //power supply status, 1-alternating current supply, 2-battery supply
  2853. public byte byMultiDoorInterlockStatus;//multi door interlock status, 0-close 1-open
  2854. public byte byAntiSneakStatus; //anti sneak status, 0-close 1-open
  2855. public byte byHostAntiDismantleStatus; //host anti dismantle status, 0-close, 1-open
  2856. public byte byIndicatorLightStatus; //Indicator Light Status 0-offLine,1-Online
  2857. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  2858. public byte[] byCardReaderOnlineStatus; //card reader online status, 0-offline 1-online
  2859. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  2860. public byte[] byCardReaderAntiDismantleStatus; //card reader anti dismantle status, 0-close 1-open
  2861. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_CARD_READER_NUM_512, ArraySubType = UnmanagedType.I1)]
  2862. public byte[] byCardReaderVerifyMode; //card reader verify mode, 1-swipe 2-swipe+password 3-swipe card 4-swipe card or password
  2863. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMIN_NUM, ArraySubType = UnmanagedType.I1)]
  2864. public byte[] bySetupAlarmStatus;//alarm in setup alarm status,0- alarm in disarm status, 1 - alarm in arm status
  2865. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMIN_NUM, ArraySubType = UnmanagedType.I1)]
  2866. public byte[] byAlarmInStatus; //alarm in status, 0-alarm in no alarm, 1-alarm in has alarm
  2867. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_ALARMHOST_ALARMOUT_NUM, ArraySubType = UnmanagedType.I1)]
  2868. public byte[] byAlarmOutStatus; //alarm out status, 0-alarm out no alarm, 1-alarm out has alarm
  2869. public uint dwCardNum; //add card number
  2870. public byte byFireAlarmStatus; //Fire alarm status is displayed: 0 - normal, short-circuit alarm 1 -, 2 - disconnect the alarm
  2871. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 123, ArraySubType = UnmanagedType.I1)]
  2872. public byte[] byRes2;
  2873. public void Init()
  2874. {
  2875. byDoorLockStatus = new byte[MAX_DOOR_NUM_256];
  2876. byDoorStatus = new byte[MAX_DOOR_NUM_256];
  2877. byMagneticStatus = new byte[MAX_DOOR_NUM_256];
  2878. byCaseStatus = new byte[MAX_CASE_SENSOR_NUM];
  2879. byCardReaderOnlineStatus = new byte[MAX_CARD_READER_NUM_512];
  2880. byCardReaderAntiDismantleStatus = new byte[MAX_CARD_READER_NUM_512];
  2881. byCardReaderVerifyMode = new byte[MAX_CARD_READER_NUM_512];
  2882. bySetupAlarmStatus = new byte[MAX_ALARMHOST_ALARMIN_NUM];
  2883. byAlarmInStatus = new byte[MAX_ALARMHOST_ALARMIN_NUM];
  2884. byAlarmOutStatus = new byte[MAX_ALARMHOST_ALARMOUT_NUM];
  2885. byRes2 = new byte[123];
  2886. }
  2887. }
  2888. [StructLayout(LayoutKind.Sequential)]
  2889. public struct NET_DVR_ACS_EVENT_COND
  2890. {
  2891. public uint dwSize;
  2892. public uint dwMajor;
  2893. public uint dwMinor;
  2894. public CHCNetSDK.NET_DVR_TIME struStartTime;
  2895. public CHCNetSDK.NET_DVR_TIME struEndTime;
  2896. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  2897. public byte[] byCardNo;
  2898. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.NAME_LEN, ArraySubType = UnmanagedType.I1)]
  2899. public byte[] byName;
  2900. public uint dwBeginSerialNo;
  2901. public byte byPicEnable;
  2902. public byte byTimeType;
  2903. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.I1)]
  2904. public byte[] byRes2;
  2905. public uint dwEndSerialNo;
  2906. public uint dwIOTChannelNo;
  2907. public ushort wInductiveEventType;
  2908. public byte bySearchType;
  2909. public byte byRes1;
  2910. [MarshalAs(UnmanagedType.ByValTStr, SizeConst = CHCNetSDK.NET_SDK_MONITOR_ID_LEN)]
  2911. public string szMonitorID;
  2912. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.NET_SDK_EMPLOYEE_NO_LEN, ArraySubType = UnmanagedType.I1)]
  2913. public byte[] byEmployeeNo;
  2914. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 140, ArraySubType = UnmanagedType.I1)]
  2915. public byte[] byRes;
  2916. public void Init()
  2917. {
  2918. byCardNo = new byte[CHCNetSDK.ACS_CARD_NO_LEN];
  2919. byName = new byte[CHCNetSDK.NAME_LEN];
  2920. byRes2 = new byte[2];
  2921. byEmployeeNo = new byte[CHCNetSDK.NET_SDK_EMPLOYEE_NO_LEN];
  2922. byRes = new byte[140];
  2923. }
  2924. }
  2925. [StructLayout(LayoutKind.Sequential)]
  2926. public struct NET_DVR_ACS_EVENT_CFG
  2927. {
  2928. public uint dwSize;
  2929. public uint dwMajor;
  2930. public uint dwMinor;
  2931. public CHCNetSDK.NET_DVR_TIME struTime;
  2932. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.MAX_NAMELEN)]
  2933. public byte[] sNetUser;
  2934. public CHCNetSDK.NET_DVR_IPADDR struRemoteHostAddr;
  2935. public CHCNetSDK.NET_DVR_ACS_EVENT_DETAIL struAcsEventInfo;
  2936. public uint dwPicDataLen;
  2937. public IntPtr pPicData; // picture data
  2938. public ushort wInductiveEventType;
  2939. public byte byTimeType;
  2940. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 61)]
  2941. public byte[] byRes;
  2942. public void init()
  2943. {
  2944. sNetUser = new byte[CHCNetSDK.MAX_NAMELEN];
  2945. struRemoteHostAddr.Init();
  2946. struAcsEventInfo.init();
  2947. byRes = new byte[61];
  2948. }
  2949. }
  2950. public struct NET_DVR_ACS_EVENT_DETAIL
  2951. {
  2952. public uint dwSize;
  2953. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.ACS_CARD_NO_LEN)]
  2954. public byte[] byCardNo;
  2955. public byte byCardType;
  2956. public byte byWhiteListNo;
  2957. public byte byReportChannel;
  2958. public byte byCardReaderKind;
  2959. public uint dwCardReaderNo;
  2960. public uint dwDoorNo;
  2961. public uint dwVerifyNo;
  2962. public uint dwAlarmInNo;
  2963. public uint dwAlarmOutNo;
  2964. public uint dwCaseSensorNo;
  2965. public uint dwRs485No;
  2966. public uint dwMultiCardGroupNo;
  2967. public ushort wAccessChannel;//word
  2968. public byte byDeviceNo;
  2969. public byte byDistractControlNo;
  2970. public uint dwEmployeeNo;
  2971. public ushort wLocalControllerID;//word
  2972. public byte byInternetAccess;
  2973. public byte byType;
  2974. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.MACADDR_LEN)]
  2975. public byte[] byMACAddr;
  2976. public byte bySwipeCardType;
  2977. public byte byRes2;
  2978. public uint dwSerialNo;
  2979. public byte byChannelControllerID;
  2980. public byte byChannelControllerLampID;
  2981. public byte byChannelControllerIRAdaptorID;
  2982. public byte byChannelControllerIREmitterID;
  2983. public uint dwRecordChannelNum;
  2984. public uint pRecordChannelData;
  2985. public byte byUserType;
  2986. public byte byCurrentVerifyMode;
  2987. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
  2988. public byte[] byRe2;
  2989. [MarshalAs(UnmanagedType.ByValArray, SizeConst = CHCNetSDK.NET_SDK_EMPLOYEE_NO_LEN)]
  2990. public byte[] byEmployeeNo;
  2991. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
  2992. public byte[] byRes;
  2993. public void init()
  2994. {
  2995. byCardNo = new byte[CHCNetSDK.ACS_CARD_NO_LEN];
  2996. byMACAddr = new byte[CHCNetSDK.MACADDR_LEN];
  2997. byRe2 = new byte[2];
  2998. byEmployeeNo = new byte[CHCNetSDK.NET_SDK_EMPLOYEE_NO_LEN];
  2999. byRes = new byte[64];
  3000. }
  3001. }
  3002. #region video call struct
  3003. [StructLayoutAttribute(LayoutKind.Sequential)]
  3004. public struct NET_DVR_VIDEO_CALL_COND
  3005. {
  3006. public uint dwSize;
  3007. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
  3008. public byte[] byRes;
  3009. public void Init()
  3010. {
  3011. byRes = new byte[128];
  3012. }
  3013. }
  3014. [StructLayoutAttribute(LayoutKind.Sequential)]
  3015. public struct NET_DVR_VIDEO_CALL_PARAM
  3016. {
  3017. public uint dwSize;
  3018. public uint dwCmdType;//command type:0-request call;1-cancel this call;2-answer this call;3-deny local call;4-called timeout;5-finish this call;6-device is busy;7-client is busy;8-indoor offline
  3019. public ushort wPeriod;//period number
  3020. public ushort wBuildingNumber;//building number
  3021. public ushort wUnitNumber;//unit number
  3022. public ushort wFloorNumber;//floor number
  3023. public ushort wRoomNumber;//room number
  3024. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 118, ArraySubType = UnmanagedType.I1)]
  3025. public byte[] byRes;
  3026. public void Init()
  3027. {
  3028. byRes = new byte[118];
  3029. }
  3030. }
  3031. public struct NET_DVR_CLIENTINFO
  3032. {
  3033. public Int32 lChannel;
  3034. public uint lLinkMode;
  3035. public IntPtr hPlayWnd;
  3036. public string sMultiCastIP;
  3037. }
  3038. [StructLayout(LayoutKind.Sequential)]
  3039. public struct NET_DVR_VOLUME_CFG
  3040. {
  3041. public uint dwSize;
  3042. [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_AUDIOOUT_PRO_TYPE)]
  3043. public ushort[] wVolume;
  3044. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
  3045. public byte[] byRes;
  3046. }
  3047. #endregion
  3048. #endregion //HCNetSDK.dll structure definition
  3049. #region HCNetSDK.dll function definition
  3050. // function definition
  3051. /* The SDK initialization function */
  3052. [DllImport(@"HCNetSDK.dll")]
  3053. public static extern bool NET_DVR_Init();
  3054. /* Release the SDK resources, before the end of the procedure call*/
  3055. [DllImport(@"HCNetSDK.dll")]
  3056. public static extern bool NET_DVR_Cleanup();
  3057. /* Enable to write the log file function
  3058. * [in] nLogLevel(default 0) - log level, 0:close, 1:ERROR, 2:ERROR and DEBUG, 3-ALL
  3059. * [in] strLogDir - file directory to save, default:"C:\\SdkLog\\"(win)and "/home/sdklog/"(linux)
  3060. * [in] bAutoDel - whether to delete log file by auto, TRUE is default
  3061. */
  3062. [DllImport(@"HCNetSDK.dll")]
  3063. public static extern bool NET_DVR_SetLogToFile(int nLogLevel, string strLogDir, bool bAutoDel);
  3064. /* Returns the last error code of the operation */
  3065. [DllImport(@"HCNetSDK.dll")]
  3066. public static extern uint NET_DVR_GetLastError();
  3067. /* Returns the last error code information of the operation */
  3068. [DllImport(@"HCNetSDK.dll")]
  3069. public static extern IntPtr NET_DVR_GetErrorMsg(ref int pErrorNo);
  3070. /* Alarm host device user configuration function(following two:get and set)
  3071. * [in] lUserID - NET_DVR_Login_V40 return value
  3072. * [in] lUserIndex - index of user
  3073. * [in] lpDeviceUser - lookup NET_DVR_ALARM_DEVICE_USER definition
  3074. */
  3075. [DllImport(@"HCNetSDK.dll")]
  3076. public static extern bool NET_DVR_SetAlarmDeviceUser(int lUserID, int lUserIndex, ref NET_DVR_ALARM_DEVICE_USER lpDeviceUser);
  3077. [DllImport(@"HCNetSDK.dll")]
  3078. public static extern bool NET_DVR_GetAlarmDeviceUser(int lUserID, int lUserIndex, ref NET_DVR_ALARM_DEVICE_USER lpDeviceUser);
  3079. /* Get device configuration information function
  3080. * [in] lUserID - NET_DVR_Login_V40 return value
  3081. * [in] dwCommand - the configuration command(usually with NET_DVR_ prefix)
  3082. * [in] lChannel - channel number with command related, 0xFFFFFFFF represent invalid
  3083. * [out] lpOutBuffer - a pointer to a buffer to receive data
  3084. * [in] dwOutBufferSize- the receive data buffer size, don't assign 0, unit:byte
  3085. * [out] lpBytesReturned - pointer to the length of the data received, e.g. a int type pointer, can't be NULL
  3086. */
  3087. [DllImport(@"HCNetSDK.dll")]
  3088. public static extern bool NET_DVR_GetDVRConfig(int lUserID, uint dwCommand, int lChannel, IntPtr lpOutBuffer, uint dwOutBufferSize, ref uint lpBytesReturned);
  3089. /* Set device configuration information function
  3090. * [in] lUserID - NET_DVR_Login_V40 return value
  3091. * [in] dwCommand - the configuration command(usually with NET_DVR_ prefix)
  3092. * [in] lChannel - channel number with command related, 0xFFFFFFFF represent invalid
  3093. * [in] lpInBuffer - a pointer to a buffer of send data
  3094. * [in] dwInBufferSize- the send data buffer size, unit:byte
  3095. */
  3096. [DllImport(@"HCNetSDK.dll")]
  3097. public static extern bool NET_DVR_SetDVRConfig(int lUserID, uint dwCommand, int lChannel, IntPtr lpInBuffer, uint dwInBufferSize);
  3098. /* Long connection call back function
  3099. * [out] dwType - refer enum NET_SDK_CALLBACK_TYPE
  3100. * [out] lpBuffer - pointer to data buffer(user manual for more details)
  3101. * [out] dwBufLen - the buffer size
  3102. * [out] pUserData - pointer to user input data
  3103. */
  3104. public delegate void RemoteConfigCallback(uint dwType, IntPtr lpBuffer, uint dwBufLen, IntPtr pUserData);
  3105. // Long connection configuration function
  3106. /* Start the remote configuration
  3107. * [in] lUserID - NET_DVR_Login_V40 return value
  3108. * [in] dwCommand - the configuration command(usually with NET_DVR_ prefix)
  3109. * [in] lpInBuffer - a pointer to a buffer of send data
  3110. * [in] dwInBufferLen - the send data buffer size, unit:byte
  3111. * [in] cbStateCallback - the callback function
  3112. * [in] pUserData - pointer to user input data
  3113. */
  3114. [DllImportAttribute(@"HCNetSDK.dll")]
  3115. public static extern int NET_DVR_StartRemoteConfig(int lUserID, uint dwCommand, IntPtr lpInBuffer, Int32 dwInBufferLen, RemoteConfigCallback cbStateCallback, IntPtr pUserData);
  3116. /* Send a long connection data
  3117. * [in] lHandle - handle ,NET_DVR_StartRemoteConfig return value
  3118. * [in] dwDataType - refer enum LONG_CFG_SEND_DATA_TYPE_ENUM, associated with NET_DVR_StartRemoteConfig command parameters
  3119. * (user manual for more details)
  3120. * [in] pSendBuf - a pointer to a buffer of send data, associated with dwDataType
  3121. * [in] dwBufSize - the send data buffer size, unit:byte
  3122. */
  3123. [DllImportAttribute(@"HCNetSDK.dll")]
  3124. public static extern bool NET_DVR_SendRemoteConfig(int lHandle, uint dwDataType, IntPtr pSendBuf, uint dwBufSize);
  3125. // stop a long connection
  3126. // [in] lHandle - handle ,NET_DVR_StartRemoteConfig return value
  3127. [DllImportAttribute(@"HCNetSDK.dll")]
  3128. public static extern bool NET_DVR_StopRemoteConfig(int lHandle);
  3129. [DllImportAttribute(@"HCNetSDK.dll")]
  3130. public static extern int NET_DVR_Upgrade_V40(int lUserID, uint dwUpgradeType, string sFileName, IntPtr pInbuffer, Int32 dwInBufferLen);
  3131. [DllImportAttribute(@"HCNetSDK.dll")]
  3132. public static extern int NET_DVR_GetUpgradeProgress(int lUpgradeHandle);
  3133. [DllImportAttribute(@"HCNetSDK.dll")]
  3134. public static extern int NET_DVR_CloseUpgradeHandle(int lUpgradeHandle);
  3135. /* get long connection configuration status
  3136. * [in] lHandle - handle ,NET_DVR_StartRemoteConfig return value
  3137. * [out] pState - the return status pointer
  3138. */
  3139. [DllImportAttribute(@"HCNetSDK.dll")]
  3140. public static extern bool NET_DVR_GetRemoteConfigState(int lHandle, IntPtr pState);
  3141. /* obtain the result of the information one by one
  3142. * [in] lHandle - handle ,NET_DVR_StartRemoteConfig return value
  3143. * [out] lpOutBuff - a pointer to a buffer to receive data(user manual for more details)
  3144. * [in] dwOutBuffSize- the receive data buffer size, unit:byte
  3145. */
  3146. [DllImportAttribute(@"HCNetSDK.dll")]
  3147. public static extern int NET_DVR_GetNextRemoteConfig(int lHandle, ref CHCNetSDK.NET_DVR_ACS_EVENT_CFG lpOutBuff, int dwOutBuffSize);
  3148. /* Batch for device configuration information (with sending data)
  3149. * [in] lUserID - NET_DVR_Login_V40 return value
  3150. * [in] dwCommand - the configuration command(usually with NET_DVR_ prefix)
  3151. * [in] dwCount - the number of configuration at a time, 0 and 1 represent one, in order to increase, maximum:64
  3152. * [in] lpInBuffer - a pointer to conditions buffer(user manual for more details)
  3153. * [in] dwInBufferSize- the conditions buffer size, unit:byte
  3154. * [out] lpStatusList - a pointer to the error code list, One to one correspondence(user manual for more details)
  3155. * [out] lpOutBuffer - a pointer to receive data buffer, One to one correspondence(user manual for more details)
  3156. * [in] dwOutBufferSize- the receive data buffer size, unit:byte
  3157. */
  3158. [DllImport(@"HCNetSDK.dll")]
  3159. public static extern bool NET_DVR_GetDeviceConfig(int lUserID, uint dwCommand, uint dwCount, IntPtr lpInBuffer, uint dwInBufferSize, IntPtr lpStatusList, IntPtr lpOutBuffer, uint dwOutBufferSize);
  3160. /* Batch for device configuration information (with sending data)
  3161. * [in] lUserID - NET_DVR_Login_V40 return value
  3162. * [in] dwCommand - the configuration command(usually with NET_DVR_ prefix)
  3163. * [in] dwCount - the number of configuration at a time, 0 and 1 represent one, in order to increase, maximum:64
  3164. * [in] lpInBuffer - a pointer to conditions buffer(user manual for more details)
  3165. * [in] dwInBufferSize- the conditions buffer size, unit:byte
  3166. * [out] lpStatusList - a pointer to the error code list, One to one correspondence(user manual for more details)
  3167. * [out] lpInParamBuffer - a pointer to set parameters for the device buffer, One to one correspondence(user manual for more details)
  3168. * [in] dwInParamBufferSize- the correspond data buffer size, unit:byte
  3169. */
  3170. [DllImport(@"HCNetSDK.dll")]
  3171. public static extern bool NET_DVR_SetDeviceConfig(int lUserID, uint dwCommand, uint dwCount, IntPtr lpInBuffer, uint dwInBufferSize, IntPtr lpStatusList, IntPtr lpInParamBuffer, uint dwInParamBufferSize);
  3172. /* The remote control function
  3173. * [in] lUserID - NET_DVR_Login_V40 return value
  3174. * [in] dwCommand - the configuration command(usually with NET_DVR_ prefix)
  3175. * [in] dwCount - the number of configuration at a time, 0 and 1 represent one, in order to increase, maximum:64
  3176. * [in] lpInBuffer - a pointer to send data buffer(user manual for more details)
  3177. * [in] dwInBufferSize- the correspond buffer size, unit:byte
  3178. */
  3179. [DllImport(@"HCNetSDK.dll")]
  3180. public static extern bool NET_DVR_RemoteControl(int lUserID, uint dwCommand, IntPtr lpInBuffer, uint dwInBufferSize);
  3181. /* login
  3182. * [in] pLoginInfo - login parameters
  3183. * [in] lpDeviceInfo - device informations
  3184. */
  3185. [DllImport(@"HCNetSDK.dll")]
  3186. public static extern int NET_DVR_Login_V40(ref NET_DVR_USER_LOGIN_INFO pLoginInfo, ref NET_DVR_DEVICEINFO_V40 lpDeviceInfo);
  3187. [DllImport(@"HCNetSDK.dll")]
  3188. public static extern bool NET_DVR_Logout_V30(Int32 lUserID);
  3189. public delegate void RealDataCallBack(int lPlayHandle, uint dwDataType, IntPtr pBuffer, uint dwBufSize, IntPtr pUser);
  3190. [DllImport(@"HCNetSDK.dll")]
  3191. public static extern int NET_DVR_RealPlay_V40(int lUserID, ref NET_DVR_PREVIEWINFO lpPreviewInfo, RealDataCallBack fRealDataCallBack_V30, IntPtr pUser);
  3192. // alarm
  3193. /* Set up alarm upload channel, to obtain the information such as alarm*/
  3194. [DllImport(@"HCNetSDK.dll")]
  3195. public static extern int NET_DVR_SetupAlarmChan(int lUserID);
  3196. [DllImport(@"HCNetSDK.dll")]
  3197. public static extern int NET_DVR_SetupAlarmChan_V30(int lUserID);
  3198. [DllImport(@"HCNetSDK.dll")]
  3199. public static extern int NET_DVR_SetupAlarmChan_V41(int lUserID, ref NET_DVR_SETUPALARM_PARAM lpSetupParam);
  3200. /* shut down alarm upload channel, to obtain the information such as alarm*/
  3201. [DllImport(@"HCNetSDK.dll")]
  3202. public static extern bool NET_DVR_CloseAlarmChan(int lAlarmHandle);
  3203. [DllImport(@"HCNetSDK.dll")]
  3204. public static extern bool NET_DVR_CloseAlarmChan_V30(int lAlarmHandle);
  3205. /* Alarm information callback function
  3206. * [out] lCommand - message type upload(user manual for more details) entrance guard device : COMM_ALARM_ACS
  3207. * [out] pAlarmer - information of alarm device
  3208. * [out] pAlarmInfo - alarm information (NET_DVR_ACS_ALARM_INFO)
  3209. * [out] dwBufLen - size of pAlarmInfo
  3210. * [out] pUser - user data
  3211. */
  3212. public delegate void MSGCallBack(int lCommand, ref NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser);
  3213. public delegate bool MSGCallBack_V31(int lCommand, ref NET_DVR_ALARMER pAlarmer, IntPtr pAlarmInfo, uint dwBufLen, IntPtr pUser);
  3214. /* Alarm information registered callback function
  3215. * [in] iIndex - iIndex, scope:[0,15]
  3216. * [in] fMessageCallBack - callback function
  3217. * [in] pUser - user data
  3218. */
  3219. [DllImport(@"HCNetSDK.dll")]
  3220. public static extern bool NET_DVR_SetDVRMessageCallBack_V50(int iIndex, MSGCallBack fMessageCallBack, IntPtr pUser);
  3221. [DllImport(@"HCNetSDK.dll")]
  3222. public static extern bool NET_DVR_SetDVRMessageCallBack_V31(MSGCallBack_V31 fMessageCallBack, IntPtr pUser);
  3223. /* NET_DVR_GetDeviceAbility get device ability
  3224. * [in] lUserID - NET_DVR_Login_V40 return value
  3225. * [in] dwAbilityType - the configuration command(ACS_ABILITY)
  3226. * [in] pInBuf - a pointer to send data buffer(user manual for more details)
  3227. * [in] dwInLength - the correspond buffer size, unit:byte
  3228. * [out] pOutBuf- out buff(ACS_ABILITY is described with XML)
  3229. * [in] dwOutLength - the correspond buffer size, unit:byte
  3230. */
  3231. [DllImport(@"HCNetSDK.dll")]
  3232. public static extern bool NET_DVR_GetDeviceAbility(int lUserID, uint dwAbilityType, IntPtr pInBuf, uint dwInLength, IntPtr pOutBuf, uint dwOutLength);
  3233. /* Get to the SDK version information*/
  3234. [DllImport(@"HCNetSDK.dll")]
  3235. public static extern uint NET_DVR_GetSDKVersion();
  3236. /* Get version number of the SDK and build information*/
  3237. [DllImport(@"HCNetSDK.dll")]
  3238. public static extern uint NET_DVR_GetSDKBuildVersion();
  3239. /** remote control gateway
  3240. * [in] lUserID - NET_DVR_Login_V40 return value
  3241. * [in] lGatewayIndex - 1-begin 0xffffffff-all
  3242. * [in] dwStaic - : 0-close,1-open,2-always open,3-always close
  3243. */
  3244. [DllImport(@"HCNetSDK.dll")]
  3245. public static extern bool NET_DVR_ControlGateway(int lUserID, int lGatewayIndex, uint dwStaic);
  3246. [DllImport(@"HCNetSDK.dll")]
  3247. public static extern bool NET_DVR_STDXMLConfig(int lUserID, IntPtr lpInputParam, IntPtr lpOutputParam);
  3248. public delegate void REALDATACALLBACK(Int32 lRealHandle, UInt32 dwDataType, ref byte pBuffer, UInt32 dwBufSize, IntPtr pUser);
  3249. [DllImport(@"HCNetSDK.dll")]
  3250. public static extern int NET_DVR_RealPlay_V30(int iUserID, ref NET_DVR_CLIENTINFO lpClientInfo, REALDATACALLBACK fRealDataCallBack_V30, IntPtr pUser, UInt32 bBlocked);
  3251. [DllImport(@"HCNetSDK.dll")]
  3252. public static extern bool NET_DVR_StopRealPlay(int iRealHandle);
  3253. public delegate void VOICEDATACALLBACKV30(int lVoiceComHandle, string pRecvDataBuffer, uint dwBufSize, byte byAudioFlag, System.IntPtr pUser);
  3254. [DllImport(@"HCNetSDK.dll")]
  3255. public static extern int NET_DVR_StartVoiceCom_V30(int lUserID, uint dwVoiceChan, bool bNeedCBNoEncData, VOICEDATACALLBACKV30 fVoiceDataCallBack, IntPtr pUser);
  3256. [DllImport(@"HCNetSDK.dll")]
  3257. public static extern bool NET_DVR_SetVoiceComClientVolume(int lVoiceComHandle, ushort wVolume);
  3258. [DllImport(@"HCNetSDK.dll")]
  3259. public static extern bool NET_DVR_StopVoiceCom(int lVoiceComHandle);
  3260. [DllImport("User32.dll", EntryPoint = "PostMessage")]
  3261. public static extern int PostMessage(IntPtr hWnd, int Msg, Int64 wParam, Int64 lParam);
  3262. [DllImport(@"HCNetSDK.dll")]
  3263. public static extern bool NET_DVR_CaptureJPEGPicture(int lUserID, int lChannel, ref CHCNetSDK.NET_DVR_JPEGPARA lpJpegPara, IntPtr sPicFileName);
  3264. #endregion
  3265. #region 门禁卡,指纹,人脸接口优化新增命令码及结构体
  3266. public const int NET_DVR_GET_CARD = 2560;
  3267. public const int NET_DVR_SET_CARD = 2561;
  3268. public const int NET_DVR_DEL_CARD = 2562;
  3269. public const int NET_DVR_GET_FINGERPRINT = 2563;
  3270. public const int NET_DVR_SET_FINGERPRINT = 2564;
  3271. public const int NET_DVR_DEL_FINGERPRINT = 2565;
  3272. public const int NET_DVR_GET_FACE = 2566;
  3273. public const int NET_DVR_SET_FACE = 2567;
  3274. [StructLayoutAttribute(LayoutKind.Sequential)]
  3275. public struct NET_DVR_CARD_COND
  3276. {
  3277. public uint dwSize;
  3278. public uint dwCardNum; //card number, 0xffffffff means to get all card information when getting
  3279. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 64, ArraySubType = UnmanagedType.I1)]
  3280. public byte[] byRes;
  3281. public void Init()
  3282. {
  3283. byRes = new byte[64];
  3284. }
  3285. }
  3286. [StructLayoutAttribute(LayoutKind.Sequential)]
  3287. public struct NET_DVR_CARD_RECORD
  3288. {
  3289. public uint dwSize;
  3290. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3291. public byte[] byCardNo; //card No
  3292. public byte byCardType;
  3293. public byte byLeaderCard;
  3294. public byte byUserType;
  3295. public byte byRes1;
  3296. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  3297. public byte[] byDoorRight;
  3298. public NET_DVR_VALID_PERIOD_CFG struValid;
  3299. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_GROUP_NUM_128, ArraySubType = UnmanagedType.I1)]
  3300. public byte[] byBelongGroup;
  3301. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = CARD_PASSWORD_LEN, ArraySubType = UnmanagedType.I1)]
  3302. public byte[] byCardPassword;
  3303. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_DOOR_NUM_256, ArraySubType = UnmanagedType.I1)]
  3304. public ushort[] wCardRightPlan;
  3305. public uint dwMaxSwipeTimes;
  3306. public uint dwSwipeTimes;
  3307. public uint dwEmployeeNo;
  3308. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = NAME_LEN, ArraySubType = UnmanagedType.I1)]
  3309. public byte[] byName;
  3310. //按位表示,0-无权限,1-有权限
  3311. //第0位表示:弱电报警
  3312. //第1位表示:开门提示音
  3313. //第2位表示:限制客卡
  3314. //第3位表示:通道
  3315. //第4位表示:反锁开门
  3316. //第5位表示:巡更功能
  3317. public uint dwCardRight;
  3318. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 256, ArraySubType = UnmanagedType.I1)]
  3319. public byte[] byRes;
  3320. public void Init()
  3321. {
  3322. byCardNo = new byte[ACS_CARD_NO_LEN];
  3323. byDoorRight = new byte[MAX_DOOR_NUM_256];
  3324. byBelongGroup = new byte[MAX_GROUP_NUM_128];
  3325. byCardPassword = new byte[CARD_PASSWORD_LEN];
  3326. wCardRightPlan = new ushort[MAX_DOOR_NUM_256];
  3327. byName = new byte[NAME_LEN];
  3328. byRes = new byte[256];
  3329. }
  3330. }
  3331. [StructLayoutAttribute(LayoutKind.Sequential)]
  3332. public struct NET_DVR_FINGERPRINT_COND
  3333. {
  3334. public uint dwSize;
  3335. public uint dwFingerPrintNum; //the number send or get. if get,0xffffffff means all
  3336. [MarshalAs(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3337. public byte[] byCardNo;
  3338. public uint dwEnableReaderNo;
  3339. public byte byFingerPrintID;
  3340. [MarshalAs(UnmanagedType.ByValArray, SizeConst = 131, ArraySubType = UnmanagedType.I1)]
  3341. public byte[] byRes;
  3342. public void Init()
  3343. {
  3344. byCardNo = new byte[ACS_CARD_NO_LEN];
  3345. byRes = new byte[131];
  3346. }
  3347. }
  3348. [StructLayoutAttribute(LayoutKind.Sequential)]
  3349. public struct NET_DVR_FACE_COND
  3350. {
  3351. public uint dwSize;
  3352. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3353. public byte[] byCardNo; //card No
  3354. public uint dwFaceNum; //the number send or get. if get,0xffffffff means all
  3355. public uint dwEnableReaderNo;
  3356. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 124, ArraySubType = UnmanagedType.I1)]
  3357. public byte[] byRes;
  3358. public void Init()
  3359. {
  3360. byCardNo = new byte[ACS_CARD_NO_LEN];
  3361. byRes = new byte[124];
  3362. }
  3363. }
  3364. [StructLayoutAttribute(LayoutKind.Sequential)]
  3365. public struct NET_DVR_CARD_SEND_DATA
  3366. {
  3367. public uint dwSize;
  3368. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3369. public byte[] byCardNo; //card No
  3370. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 16, ArraySubType = UnmanagedType.I1)]
  3371. public byte[] byRes;
  3372. public void Init()
  3373. {
  3374. byCardNo = new byte[ACS_CARD_NO_LEN];
  3375. byRes = new byte[16];
  3376. }
  3377. }
  3378. [StructLayoutAttribute(LayoutKind.Sequential)]
  3379. public struct NET_DVR_FACE_RECORD
  3380. {
  3381. public uint dwSize;
  3382. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3383. public byte[] byCardNo; //card No
  3384. public uint dwFaceLen;
  3385. public IntPtr pFaceBuffer;
  3386. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 128, ArraySubType = UnmanagedType.I1)]
  3387. public byte[] byRes;
  3388. public void Init()
  3389. {
  3390. byCardNo = new byte[ACS_CARD_NO_LEN];
  3391. byRes = new byte[128];
  3392. }
  3393. }
  3394. [StructLayoutAttribute(LayoutKind.Sequential)]
  3395. public struct NET_DVR_CARD_STATUS
  3396. {
  3397. public uint dwSize;
  3398. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3399. public byte[] byCardNo; //card No
  3400. public uint dwErrorCode;
  3401. public byte byStatus; //0-fail, 1-success
  3402. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 23, ArraySubType = UnmanagedType.I1)]
  3403. public byte[] byRes;
  3404. public void Init()
  3405. {
  3406. byCardNo = new byte[ACS_CARD_NO_LEN];
  3407. byRes = new byte[23];
  3408. }
  3409. }
  3410. [StructLayoutAttribute(LayoutKind.Sequential)]
  3411. public struct NET_DVR_FACE_STATUS
  3412. {
  3413. public uint dwSize;
  3414. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3415. public byte[] byCardNo; //card No
  3416. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ERROR_MSG_LEN, ArraySubType = UnmanagedType.I1)]
  3417. public byte[] byErrorMsg; //下发错误信息,当byCardReaderRecvStatus为4时,表示已存在人脸对应的卡号
  3418. public uint dwReaderNo; //人脸读卡器编号,可用于下发错误返回
  3419. public byte byRecvStatus; //人脸读卡器状态,按字节表示,0-失败,1-成功,2-重试或人脸质量差,3-内存已满(人脸数据满),4-已存在该人脸,5-非法人脸ID
  3420. //,6-算法建模失败,7-未下发卡权限,8-未定义(保留),9-人眼间距小距小,10-图片数据长度小于1KB,11-图片格式不符(png/jpg/bmp),12-图片像素数量超过上限,13-图片像素数量低于下限,14-图片信息校验失败,15-图片解码失败,16-人脸检测失败,17-人脸评分失败
  3421. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 131, ArraySubType = UnmanagedType.I1)]
  3422. public byte[] byRes;
  3423. public void Init()
  3424. {
  3425. byCardNo = new byte[ACS_CARD_NO_LEN];
  3426. byErrorMsg = new byte[ERROR_MSG_LEN];
  3427. byRes = new byte[131];
  3428. }
  3429. }
  3430. [StructLayoutAttribute(LayoutKind.Sequential)]
  3431. public struct NET_DVR_FINGERPRINT_RECORD
  3432. {
  3433. public uint dwSize;
  3434. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3435. public byte[] byCardNo; //card No
  3436. public uint dwFingerPrintLen; //指纹数据长度
  3437. public uint dwEnableReaderNo; //需要下发指纹的读卡器编号
  3438. public byte byFingerPrintID; //手指编号,有效值范围为1-10
  3439. public byte byFingerType; //指纹类型 0-普通指纹,1-胁迫指纹
  3440. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 30, ArraySubType = UnmanagedType.I1)]
  3441. public byte[] byRes1;
  3442. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = MAX_FINGER_PRINT_LEN, ArraySubType = UnmanagedType.I1)]
  3443. public byte[] byFingerData; //指纹数据内容
  3444. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 96, ArraySubType = UnmanagedType.I1)]
  3445. public byte[] byRes;
  3446. public void Init()
  3447. {
  3448. byCardNo = new byte[ACS_CARD_NO_LEN];
  3449. byRes1 = new byte[30];
  3450. byFingerData = new byte[MAX_FINGER_PRINT_LEN];
  3451. byRes = new byte[96];
  3452. }
  3453. }
  3454. [StructLayoutAttribute(LayoutKind.Sequential)]
  3455. public struct NET_DVR_FINGERPRINT_STATUS
  3456. {
  3457. public uint dwSize;
  3458. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ACS_CARD_NO_LEN, ArraySubType = UnmanagedType.I1)]
  3459. public byte[] byCardNo; //指纹关联的卡号
  3460. public byte byCardReaderRecvStatus; //指纹读卡器状态,按字节表示,0-失败,1-成功,2-该指纹模组不在线,3-重试或指纹质量差,4-内存已满,5-已存在该指纹,6-已存在该指纹ID,7-非法指纹ID,8-该指纹模组无需配置
  3461. public byte byFingerPrintID; //手指编号,有效值范围为1-10
  3462. public byte byFingerType; //指纹类型 0-普通指纹,1-胁迫指纹
  3463. public byte byRecvStatus; //主机错误状态:0-成功,1-手指编号错误,2-指纹类型错误,3-卡号错误(卡号规格不符合设备要求),4-指纹未关联工号或卡号(工号或卡号字段为空),5-工号不存在,6-指纹数据长度为0,7-读卡器编号错误,8-工号错误
  3464. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = ERROR_MSG_LEN, ArraySubType = UnmanagedType.I1)]
  3465. public byte[] byErrorMsg; //下发错误信息,当byCardReaderRecvStatus为5时,表示已存在指纹对应的卡号
  3466. public uint dwCardReaderNo; //当byCardReaderRecvStatus为5时,表示已存在指纹对应的指纹读卡器编号,可用于下发错误返回。0时表示无错误信息
  3467. [MarshalAsAttribute(UnmanagedType.ByValArray, SizeConst = 20, ArraySubType = UnmanagedType.I1)]
  3468. public byte[] byRes;
  3469. public void Init()
  3470. {
  3471. byCardNo = new byte[ACS_CARD_NO_LEN];
  3472. byErrorMsg = new byte[ERROR_MSG_LEN];
  3473. byRes = new byte[20];
  3474. }
  3475. }
  3476. // 新增接口一个
  3477. [DllImportAttribute(@"HCNetSDK.dll")]
  3478. public static extern int NET_DVR_SendWithRecvRemoteConfig(int lHandle, IntPtr lpInBuff, uint dwInBuffSize, IntPtr lpOutBuff, uint dwOutBuffSize, ref uint dwOutDataLen);
  3479. // 用户调用SendwithRecv接口时,接口返回的状态
  3480. public enum NET_SDK_SENDWITHRECV_STATUS
  3481. {
  3482. NET_SDK_CONFIG_STATUS_SUCCESS = 1000, // 成功读取到数据,客户端处理完本次数据后需要再次调用NET_DVR_SendWithRecvRemoteConfig获取下一条数据
  3483. NET_SDK_CONFIG_STATUS_NEEDWAIT, // 配置等待,客户端可重新NET_DVR_SendWithRecvRemoteConfig
  3484. NET_SDK_CONFIG_STATUS_FINISH, // 数据全部取完,此时客户端可调用NET_DVR_StopRemoteConfig结束
  3485. NET_SDK_CONFIG_STATUS_FAILED, // 配置失败,客户端可重新NET_DVR_SendWithRecvRemoteConfig
  3486. NET_SDK_CONFIG_STATUS_EXCEPTION, // 配置异常,此时客户端可调用NET_DVR_StopRemoteConfig结束
  3487. }
  3488. #endregion
  3489. }
  3490. }