HCNetSDK.cs 208 KB

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