using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.ComponentModel; namespace NetSDKCS { public static class NETClient { #region << constant >> /// /// whether to throw an execption. /// 是否抛异常 /// private static bool m_IsThrowErrorMessage = false; /// /// Query splice screen(struct NET_COMPOSITE_CHANNEL) /// public static uint NET_DEVSTATE_COMPOSITE_CHN = 0x0047; /// /// en-us language /// 英文错误码对应的错误信息 /// private static Dictionary en_us_String = new Dictionary() { {EM_ErrorCode.NET_NOERROR,"No error"}, {EM_ErrorCode.NET_ERROR,"Unknown error"}, {EM_ErrorCode.NET_SYSTEM_ERROR,"Windows system error"}, {EM_ErrorCode.NET_NETWORK_ERROR,"Protocol error it may result from network timeout"}, {EM_ErrorCode.NET_DEV_VER_NOMATCH,"Device protocol does not match"}, {EM_ErrorCode.NET_INVALID_HANDLE,"Handle is invalid"}, {EM_ErrorCode.NET_OPEN_CHANNEL_ERROR,"Failed to open channel"}, {EM_ErrorCode.NET_CLOSE_CHANNEL_ERROR,"Failed to close channel"}, {EM_ErrorCode.NET_ILLEGAL_PARAM,"User parameter is illegal"}, {EM_ErrorCode.NET_SDK_INIT_ERROR,"SDK initialization error"}, {EM_ErrorCode.NET_SDK_UNINIT_ERROR,"SDK clear error"}, {EM_ErrorCode.NET_RENDER_OPEN_ERROR,"Error occurs when apply for render resources"}, {EM_ErrorCode.NET_DEC_OPEN_ERROR,"Error occurs when opening the decoder library"}, {EM_ErrorCode.NET_DEC_CLOSE_ERROR,"Error occurs when closing the decoder library"}, {EM_ErrorCode.NET_MULTIPLAY_NOCHANNEL,"The detected channel number is 0 in multiple-channel preview"}, {EM_ErrorCode.NET_TALK_INIT_ERROR,"Failed to initialize record library"}, {EM_ErrorCode.NET_TALK_NOT_INIT,"The record library has not been initialized"}, {EM_ErrorCode.NET_TALK_SENDDATA_ERROR,"Error occurs when sending out audio data"}, {EM_ErrorCode.NET_REAL_ALREADY_SAVING,"The real-time has been protected"}, {EM_ErrorCode.NET_NOT_SAVING,"The real-time data has not been save"}, {EM_ErrorCode.NET_OPEN_FILE_ERROR,"Error occurs when opening the file"}, {EM_ErrorCode.NET_PTZ_SET_TIMER_ERROR,"Failed to enable PTZ to control timer"}, {EM_ErrorCode.NET_RETURN_DATA_ERROR,"Error occurs when verify returned data"}, {EM_ErrorCode.NET_INSUFFICIENT_BUFFER,"There is no sufficient buffer"}, {EM_ErrorCode.NET_NOT_SUPPORTED,"The current SDK does not support this function"}, {EM_ErrorCode.NET_NO_RECORD_FOUND,"There is no searched result"}, {EM_ErrorCode.NET_NOT_AUTHORIZED,"You have no operation right"}, {EM_ErrorCode.NET_NOT_NOW,"Can not operate right now"}, {EM_ErrorCode.NET_NO_TALK_CHANNEL,"There is no audio talk channel"}, {EM_ErrorCode.NET_NO_AUDIO,"There is no audio"}, {EM_ErrorCode.NET_NO_INIT,"The network SDK has not been initialized"}, {EM_ErrorCode.NET_DOWNLOAD_END,"The download completed"}, {EM_ErrorCode.NET_EMPTY_LIST,"There is no searched result"}, {EM_ErrorCode.NET_ERROR_GETCFG_SYSATTR,"Failed to get system property setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_SERIAL,"Failed to get SN"}, {EM_ErrorCode.NET_ERROR_GETCFG_GENERAL,"Failed to get general property"}, {EM_ErrorCode.NET_ERROR_GETCFG_DSPCAP,"Failed to get DSP capacity description"}, {EM_ErrorCode.NET_ERROR_GETCFG_NETCFG,"Failed to get network channel setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_CHANNAME,"Failed to get channel name"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEO,"Failed to get video property"}, {EM_ErrorCode.NET_ERROR_GETCFG_RECORD,"Failed to get record setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_PRONAME,"Failed to get decoder protocol name"}, {EM_ErrorCode.NET_ERROR_GETCFG_FUNCNAME,"Failed to get 232 COM function name"}, {EM_ErrorCode.NET_ERROR_GETCFG_485DECODER,"Failed to get decoder property"}, {EM_ErrorCode.NET_ERROR_GETCFG_232COM,"Failed to get 232 COM setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_ALARMIN,"Failed to get external alarm input setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_ALARMDET,"Failed to get motion detection alarm"}, {EM_ErrorCode.NET_ERROR_GETCFG_SYSTIME,"Failed to get device time"}, {EM_ErrorCode.NET_ERROR_GETCFG_PREVIEW,"Failed to get preview parameter"}, {EM_ErrorCode.NET_ERROR_GETCFG_AUTOMT,"Failed to get audio maintenance setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEOMTRX,"Failed to get video matrix setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_COVER,"Failed to get privacy mask zone setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_WATERMAKE,"Failed to get video watermark setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_MULTICAST,"Failed to get config multicast port by channel"}, {EM_ErrorCode.NET_ERROR_SETCFG_GENERAL,"Failed to modify general property"}, {EM_ErrorCode.NET_ERROR_SETCFG_NETCFG,"Failed to modify channel setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_CHANNAME,"Failed to modify channel name"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEO,"Failed to modify video channel"}, {EM_ErrorCode.NET_ERROR_SETCFG_RECORD,"Failed to modify record setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_485DECODER,"Failed to modify decoder property"}, {EM_ErrorCode.NET_ERROR_SETCFG_232COM,"Failed to modify 232 COM setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_ALARMIN,"Failed to modify external input alarm setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_ALARMDET,"Failed to modify motion detection alarm setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_SYSTIME,"Failed to modify device time"}, {EM_ErrorCode.NET_ERROR_SETCFG_PREVIEW,"Failed to modify preview parameter"}, {EM_ErrorCode.NET_ERROR_SETCFG_AUTOMT,"Failed to modify auto maintenance setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEOMTRX,"Failed to modify video matrix setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_COVER,"Failed to modify privacy mask zone"}, {EM_ErrorCode.NET_ERROR_SETCFG_WATERMAKE,"Failed to modify video watermark setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_WLAN,"Failed to modify wireless network information"}, {EM_ErrorCode.NET_ERROR_SETCFG_WLANDEV,"Failed to select wireless network device"}, {EM_ErrorCode.NET_ERROR_SETCFG_REGISTER,"Failed to modify the actively registration parameter setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_CAMERA,"Failed to modify camera property"}, {EM_ErrorCode.NET_ERROR_SETCFG_INFRARED,"Failed to modify IR alarm setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_SOUNDALARM,"Failed to modify audio alarm setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_STORAGE,"Failed to modify storage position setup"}, {EM_ErrorCode.NET_AUDIOENCODE_NOTINIT,"The audio encode port has not been successfully initialized"}, {EM_ErrorCode.NET_DATA_TOOLONGH,"The data are too long"}, {EM_ErrorCode.NET_UNSUPPORTED,"The device does not support current operation"}, {EM_ErrorCode.NET_DEVICE_BUSY,"Device resources is not sufficient"}, {EM_ErrorCode.NET_SERVER_STARTED,"The server has boot up"}, {EM_ErrorCode.NET_SERVER_STOPPED,"The server has not fully boot up"}, {EM_ErrorCode.NET_LISTER_INCORRECT_SERIAL,"Input serial number is not correct"}, {EM_ErrorCode.NET_QUERY_DISKINFO_FAILED,"Failed to get HDD information"}, {EM_ErrorCode.NET_ERROR_GETCFG_SESSION,"Failed to get connect session information"}, {EM_ErrorCode.NET_USER_FLASEPWD_TRYTIME,"The password you typed is incorrect. You have exceeded the maximum number of retries"}, {EM_ErrorCode.NET_LOGIN_ERROR_PASSWORD,"Password is not correct"}, {EM_ErrorCode.NET_LOGIN_ERROR_USER,"The account does not exist"}, {EM_ErrorCode.NET_LOGIN_ERROR_TIMEOUT,"Time out for log in returned value"}, {EM_ErrorCode.NET_LOGIN_ERROR_RELOGGIN,"The account has logged in"}, {EM_ErrorCode.NET_LOGIN_ERROR_LOCKED,"The account has been locked"}, {EM_ErrorCode.NET_LOGIN_ERROR_BLACKLIST,"The account has been in the blocklist"}, {EM_ErrorCode.NET_LOGIN_ERROR_BUSY,"Resources are not sufficient. System is busy now"}, {EM_ErrorCode.NET_LOGIN_ERROR_CONNECT,"Time out. Please check network and try again"}, {EM_ErrorCode.NET_LOGIN_ERROR_NETWORK,"Network connection failed"}, {EM_ErrorCode.NET_LOGIN_ERROR_SUBCONNECT,"Successfully logged in the device but can not create video channel. Please check network connection"}, {EM_ErrorCode.NET_LOGIN_ERROR_MAXCONNECT,"exceed the max connect number"}, {EM_ErrorCode.NET_LOGIN_ERROR_PROTOCOL3_ONLY,"protocol 3 support"}, {EM_ErrorCode.NET_LOGIN_ERROR_UKEY_LOST,"There is no USB or USB info error"}, {EM_ErrorCode.NET_LOGIN_ERROR_NO_AUTHORIZED,"Client-end IP address has no right to login"}, {EM_ErrorCode.NET_LOGIN_ERROR_USER_OR_PASSOWRD,"user or password error"}, {EM_ErrorCode.NET_RENDER_SOUND_ON_ERROR,"Error occurs when Render library open audio"}, {EM_ErrorCode.NET_RENDER_SOUND_OFF_ERROR,"Error occurs when Render library close audio"}, {EM_ErrorCode.NET_RENDER_SET_VOLUME_ERROR,"Error occurs when Render library control volume"}, {EM_ErrorCode.NET_RENDER_ADJUST_ERROR,"Error occurs when Render library set video parameter"}, {EM_ErrorCode.NET_RENDER_PAUSE_ERROR,"Error occurs when Render library pause play"}, {EM_ErrorCode.NET_RENDER_SNAP_ERROR,"Render library snapshot error"}, {EM_ErrorCode.NET_RENDER_STEP_ERROR,"Render library stepper error"}, {EM_ErrorCode.NET_RENDER_FRAMERATE_ERROR,"Error occurs when Render library set frame rate"}, {EM_ErrorCode.NET_RENDER_DISPLAYREGION_ERROR,"Error occurs when Render lib setting show region"}, {EM_ErrorCode.NET_RENDER_GETOSDTIME_ERROR,"An error occurred when Render library getting current play time"}, {EM_ErrorCode.NET_GROUP_EXIST,"Group name has been existed"}, {EM_ErrorCode.NET_GROUP_NOEXIST,"The group name does not exist"}, {EM_ErrorCode.NET_GROUP_RIGHTOVER,"The group right exceeds the right list"}, {EM_ErrorCode.NET_GROUP_HAVEUSER,"The group can not be removed since there is user in it"}, {EM_ErrorCode.NET_GROUP_RIGHTUSE,"The user has used one of the group right. It can not be removed"}, {EM_ErrorCode.NET_GROUP_SAMENAME,"New group name has been existed"}, {EM_ErrorCode.NET_USER_EXIST,"The user name has been existed"}, {EM_ErrorCode.NET_USER_NOEXIST,"The account does not exist"}, {EM_ErrorCode.NET_USER_RIGHTOVER,"User right exceeds the group right"}, {EM_ErrorCode.NET_USER_PWD,"Reserved account. It does not allow to be modified"}, {EM_ErrorCode.NET_USER_FLASEPWD,"password is not correct"}, {EM_ErrorCode.NET_USER_NOMATCHING,"Password is invalid"}, {EM_ErrorCode.NET_USER_INUSE,"account in use"}, {EM_ErrorCode.NET_ERROR_GETCFG_ETHERNET,"Failed to get network card setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_WLAN,"Failed to get wireless network information"}, {EM_ErrorCode.NET_ERROR_GETCFG_WLANDEV,"Failed to get wireless network device"}, {EM_ErrorCode.NET_ERROR_GETCFG_REGISTER,"Failed to get actively registration parameter"}, {EM_ErrorCode.NET_ERROR_GETCFG_CAMERA,"Failed to get camera property"}, {EM_ErrorCode.NET_ERROR_GETCFG_INFRARED,"Failed to get IR alarm setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_SOUNDALARM,"Failed to get audio alarm setup"}, {EM_ErrorCode.NET_ERROR_GETCFG_STORAGE,"Failed to get storage position"}, {EM_ErrorCode.NET_ERROR_GETCFG_MAIL,"Failed to get mail setup"}, {EM_ErrorCode.NET_CONFIG_DEVBUSY,"Can not set right now"}, {EM_ErrorCode.NET_CONFIG_DATAILLEGAL,"The configuration setup data are illegal"}, {EM_ErrorCode.NET_ERROR_GETCFG_DST,"Failed to get DST setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_DST,"Failed to set DST"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEO_OSD,"Failed to get video osd setup"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEO_OSD,"Failed to set video osd"}, {EM_ErrorCode.NET_ERROR_GETCFG_GPRSCDMA,"Failed to get CDMA\\GPRS configuration"}, {EM_ErrorCode.NET_ERROR_SETCFG_GPRSCDMA,"Failed to set CDMA\\GPRS configuration"}, {EM_ErrorCode.NET_ERROR_GETCFG_IPFILTER,"Failed to get IP Filter configuration"}, {EM_ErrorCode.NET_ERROR_SETCFG_IPFILTER,"Failed to set IP Filter configuration"}, {EM_ErrorCode.NET_ERROR_GETCFG_TALKENCODE,"Failed to get Talk Encode configuration"}, {EM_ErrorCode.NET_ERROR_SETCFG_TALKENCODE,"Failed to set Talk Encode configuration"}, {EM_ErrorCode.NET_ERROR_GETCFG_RECORDLEN,"Failed to get The length of the video package configuration"}, {EM_ErrorCode.NET_ERROR_SETCFG_RECORDLEN,"Failed to set The length of the video package configuration"}, {EM_ErrorCode.NET_DONT_SUPPORT_SUBAREA,"Not support Network hard disk partition"}, {EM_ErrorCode.NET_ERROR_GET_AUTOREGSERVER,"Failed to get the register server information"}, {EM_ErrorCode.NET_ERROR_CONTROL_AUTOREGISTER,"Failed to control actively registration"}, {EM_ErrorCode.NET_ERROR_DISCONNECT_AUTOREGISTER,"Failed to disconnect actively registration"}, {EM_ErrorCode.NET_ERROR_GETCFG_MMS,"Failed to get mms configuration"}, {EM_ErrorCode.NET_ERROR_SETCFG_MMS,"Failed to set mms configuration"}, {EM_ErrorCode.NET_ERROR_GETCFG_SMSACTIVATION,"Failed to get SMS configuration"}, {EM_ErrorCode.NET_ERROR_SETCFG_SMSACTIVATION,"Failed to set SMS configuration"}, {EM_ErrorCode.NET_ERROR_GETCFG_DIALINACTIVATION,"Failed to get activation of a wireless connection"}, {EM_ErrorCode.NET_ERROR_SETCFG_DIALINACTIVATION,"Failed to set activation of a wireless connection"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEOOUT,"Failed to get the parameter of video output"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEOOUT,"Failed to set the configuration of video output"}, {EM_ErrorCode.NET_ERROR_GETCFG_OSDENABLE,"Failed to get osd overlay enabling"}, {EM_ErrorCode.NET_ERROR_SETCFG_OSDENABLE,"Failed to set OSD overlay enabling"}, {EM_ErrorCode.NET_ERROR_SETCFG_ENCODERINFO,"Failed to set digital input configuration of front encoders"}, {EM_ErrorCode.NET_ERROR_GETCFG_TVADJUST,"Failed to get TV adjust configuration"}, {EM_ErrorCode.NET_ERROR_SETCFG_TVADJUST,"Failed to set TV adjust configuration"}, {EM_ErrorCode.NET_ERROR_CONNECT_FAILED,"Failed to request to establish a connection"}, {EM_ErrorCode.NET_ERROR_SETCFG_BURNFILE,"Failed to request to upload burn files"}, {EM_ErrorCode.NET_ERROR_SNIFFER_GETCFG,"Failed to get capture configuration information"}, {EM_ErrorCode.NET_ERROR_SNIFFER_SETCFG,"Failed to set capture configuration information"}, {EM_ErrorCode.NET_ERROR_DOWNLOADRATE_GETCFG,"Failed to get download restrictions information"}, {EM_ErrorCode.NET_ERROR_DOWNLOADRATE_SETCFG,"Failed to set download restrictions information"}, {EM_ErrorCode.NET_ERROR_SEARCH_TRANSCOM,"Failed to query serial port parameters"}, {EM_ErrorCode.NET_ERROR_GETCFG_POINT,"Failed to get the preset info"}, {EM_ErrorCode.NET_ERROR_SETCFG_POINT,"Failed to set the preset info"}, {EM_ErrorCode.NET_SDK_LOGOUT_ERROR,"SDK log out the device abnormally"}, {EM_ErrorCode.NET_ERROR_GET_VEHICLE_CFG,"Failed to get vehicle configuration"}, {EM_ErrorCode.NET_ERROR_SET_VEHICLE_CFG,"Failed to set vehicle configuration"}, {EM_ErrorCode.NET_ERROR_GET_ATM_OVERLAY_CFG,"Failed to get ATM overlay configuration"}, {EM_ErrorCode.NET_ERROR_SET_ATM_OVERLAY_CFG,"Failed to set ATM overlay configuration"}, {EM_ErrorCode.NET_ERROR_GET_ATM_OVERLAY_ABILITY,"Failed to get ATM overlay ability"}, {EM_ErrorCode.NET_ERROR_GET_DECODER_TOUR_CFG,"Failed to get decoder tour configuration"}, {EM_ErrorCode.NET_ERROR_SET_DECODER_TOUR_CFG,"Failed to set decoder tour configuration"}, {EM_ErrorCode.NET_ERROR_CTRL_DECODER_TOUR,"Failed to control decoder tour"}, {EM_ErrorCode.NET_GROUP_OVERSUPPORTNUM,"Beyond the device supports for the largest number of user groups"}, {EM_ErrorCode.NET_USER_OVERSUPPORTNUM,"Beyond the device supports for the largest number of users"}, {EM_ErrorCode.NET_ERROR_GET_SIP_CFG,"Failed to get SIP configuration"}, {EM_ErrorCode.NET_ERROR_SET_SIP_CFG,"Failed to set SIP configuration"}, {EM_ErrorCode.NET_ERROR_GET_SIP_ABILITY,"Failed to get SIP capability"}, {EM_ErrorCode.NET_ERROR_GET_WIFI_AP_CFG,"Failed to get 'WIFI ap' configuration"}, {EM_ErrorCode.NET_ERROR_SET_WIFI_AP_CFG,"Failed to set 'WIFI ap' configuration"}, {EM_ErrorCode.NET_ERROR_GET_DECODE_POLICY,"Failed to get decode policy"}, {EM_ErrorCode.NET_ERROR_SET_DECODE_POLICY,"Failed to set decode policy"}, {EM_ErrorCode.NET_ERROR_TALK_REJECT,"refuse talk"}, {EM_ErrorCode.NET_ERROR_TALK_OPENED,"talk has opened by other client"}, {EM_ErrorCode.NET_ERROR_TALK_RESOURCE_CONFLICIT,"resource conflict"}, {EM_ErrorCode.NET_ERROR_TALK_UNSUPPORTED_ENCODE,"unsupported encode type"}, {EM_ErrorCode.NET_ERROR_TALK_RIGHTLESS,"no right"}, {EM_ErrorCode.NET_ERROR_TALK_FAILED,"request failed"}, {EM_ErrorCode.NET_ERROR_GET_MACHINE_CFG,"Failed to get device relative config"}, {EM_ErrorCode.NET_ERROR_SET_MACHINE_CFG,"Failed to set device relative config"}, {EM_ErrorCode.NET_ERROR_GET_DATA_FAILED,"get data failed"}, {EM_ErrorCode.NET_ERROR_MAC_VALIDATE_FAILED,"MAC validate failed"}, {EM_ErrorCode.NET_ERROR_GET_INSTANCE,"Failed to get server instance"}, {EM_ErrorCode.NET_ERROR_JSON_REQUEST,"Generated json string is error"}, {EM_ErrorCode.NET_ERROR_JSON_RESPONSE,"The responding json string is error"}, {EM_ErrorCode.NET_ERROR_VERSION_HIGHER,"The protocol version is lower than current version"}, {EM_ErrorCode.NET_SPARE_NO_CAPACITY,"Hotspare disk operation failed. The capacity is low"}, {EM_ErrorCode.NET_ERROR_SOURCE_IN_USE,"Display source is used by other output"}, {EM_ErrorCode.NET_ERROR_REAVE,"advanced users grab low-level user resource"}, {EM_ErrorCode.NET_ERROR_NETFORBID,"net forbid"}, {EM_ErrorCode.NET_ERROR_GETCFG_MACFILTER,"get MAC filter configuration error"}, {EM_ErrorCode.NET_ERROR_SETCFG_MACFILTER,"set MAC filter configuration error"}, {EM_ErrorCode.NET_ERROR_GETCFG_IPMACFILTER,"get IP/MAC filter configuration error"}, {EM_ErrorCode.NET_ERROR_SETCFG_IPMACFILTER,"set IP/MAC filter configuration error"}, {EM_ErrorCode.NET_ERROR_OPERATION_OVERTIME,"operation over time"}, {EM_ErrorCode.NET_ERROR_SENIOR_VALIDATE_FAILED,"senior validation failure"}, {EM_ErrorCode.NET_ERROR_DEVICE_ID_NOT_EXIST,"device ID is not exist"}, {EM_ErrorCode.NET_ERROR_UNSUPPORTED,"unsupport operation"}, {EM_ErrorCode.NET_ERROR_PROXY_DLLLOAD,"proxy dll load error"}, {EM_ErrorCode.NET_ERROR_PROXY_ILLEGAL_PARAM,"proxy user parameter is not legal"}, {EM_ErrorCode.NET_ERROR_PROXY_INVALID_HANDLE,"handle invalid"}, {EM_ErrorCode.NET_ERROR_PROXY_LOGIN_DEVICE_ERROR,"login device error"}, {EM_ErrorCode.NET_ERROR_PROXY_START_SERVER_ERROR,"start proxy server error"}, {EM_ErrorCode.NET_ERROR_SPEAK_FAILED,"request speak failed"}, {EM_ErrorCode.NET_ERROR_NOT_SUPPORT_F6,"unsupport F6"}, {EM_ErrorCode.NET_ERROR_CD_UNREADY,"CD is not ready"}, {EM_ErrorCode.NET_ERROR_DIR_NOT_EXIST,"Directory does not exist"}, {EM_ErrorCode.NET_ERROR_UNSUPPORTED_SPLIT_MODE,"The device does not support the segmentation model"}, {EM_ErrorCode.NET_ERROR_OPEN_WND_PARAM,"Open the window parameter is illegal"}, {EM_ErrorCode.NET_ERROR_LIMITED_WND_COUNT,"Open the window more than limit"}, {EM_ErrorCode.NET_ERROR_UNMATCHED_REQUEST,"Request command with the current pattern don't match"}, {EM_ErrorCode.NET_RENDER_ENABLELARGEPICADJUSTMENT_ERROR,"Render Library to enable high-definition image internal adjustment strategy error"}, {EM_ErrorCode.NET_ERROR_UPGRADE_FAILED,"Upgrade equipment failure"}, {EM_ErrorCode.NET_ERROR_NO_TARGET_DEVICE,"Can't find the target device"}, {EM_ErrorCode.NET_ERROR_NO_VERIFY_DEVICE,"Can't find the verify device"}, {EM_ErrorCode.NET_ERROR_CASCADE_RIGHTLESS,"No cascade permissions"}, {EM_ErrorCode.NET_ERROR_LOW_PRIORITY,"low priority"}, {EM_ErrorCode.NET_ERROR_REMOTE_REQUEST_TIMEOUT,"The remote device request timeout"}, {EM_ErrorCode.NET_ERROR_LIMITED_INPUT_SOURCE,"Input source beyond maximum route restrictions"}, {EM_ErrorCode.NET_ERROR_SET_LOG_PRINT_INFO,"Failed to set log print"}, {EM_ErrorCode.NET_ERROR_PARAM_DWSIZE_ERROR,"'dwSize' is not initialized in input param"}, {EM_ErrorCode.NET_ERROR_LIMITED_MONITORWALL_COUNT,"TV wall exceed limit"}, {EM_ErrorCode.NET_ERROR_PART_PROCESS_FAILED,"Fail to execute part of the process"}, {EM_ErrorCode.NET_ERROR_TARGET_NOT_SUPPORT,"Fail to transmit due to not supported by target"}, {EM_ErrorCode.NET_ERROR_VISITE_FILE,"Access to the file failed"}, {EM_ErrorCode.NET_ERROR_DEVICE_STATUS_BUSY,"Device busy"}, {EM_ErrorCode.NET_USER_PWD_NOT_AUTHORIZED,"Fail to change the password"}, {EM_ErrorCode.NET_USER_PWD_NOT_STRONG,"Password strength is not enough"}, {EM_ErrorCode.NET_ERROR_NO_SUCH_CONFIG,"No corresponding setup"}, {EM_ErrorCode.NET_ERROR_AUDIO_RECORD_FAILED,"Failed to record audio"}, {EM_ErrorCode.NET_ERROR_SEND_DATA_FAILED,"Failed to send out data"}, {EM_ErrorCode.NET_ERROR_OBSOLESCENT_INTERFACE,"Abandoned port"}, {EM_ErrorCode.NET_ERROR_INSUFFICIENT_INTERAL_BUF,"Internal buffer is not sufficient"}, {EM_ErrorCode.NET_ERROR_NEED_ENCRYPTION_PASSWORD,"verify password when changing device IP"}, {EM_ErrorCode.NET_ERROR_NOSUPPORT_RECORD,"device not support the record"}, {EM_ErrorCode.NET_ERROR_SERIALIZE_ERROR,"Failed to serialize data"}, {EM_ErrorCode.NET_ERROR_DESERIALIZE_ERROR,"Failed to deserialize data"}, {EM_ErrorCode.NET_ERROR_LOWRATEWPAN_ID_EXISTED,"the wireless id is already existed"}, {EM_ErrorCode.NET_ERROR_LOWRATEWPAN_ID_LIMIT,"the wireless id limited"}, {EM_ErrorCode.NET_ERROR_LOWRATEWPAN_ID_ABNORMAL,"add the wireless id abnormaly"}, {EM_ErrorCode.NET_ERROR_ENCRYPT, "encrypt data fail"}, {EM_ErrorCode.NET_ERROR_PWD_ILLEGAL, "new password illegal"}, {EM_ErrorCode.NET_ERROR_DEVICE_ALREADY_INIT, "device is already init"}, {EM_ErrorCode.NET_ERROR_SECURITY_CODE, "security code check out fail"}, {EM_ErrorCode.NET_ERROR_SECURITY_CODE_TIMEOUT, "security code out of time"}, {EM_ErrorCode.NET_ERROR_GET_PWD_SPECI, "get passwd specification fail"}, {EM_ErrorCode.NET_ERROR_NO_AUTHORITY_OF_OPERATION, "no authority of operation"}, {EM_ErrorCode.NET_ERROR_DECRYPT, "decrypt data fail"}, {EM_ErrorCode.NET_ERROR_2D_CODE, "2D code check out fail"}, {EM_ErrorCode.NET_ERROR_INVALID_REQUEST, "invalid request"}, {EM_ErrorCode.NET_ERROR_PWD_RESET_DISABLE, "pwd reset disabled"}, {EM_ErrorCode.NET_ERROR_PLAY_PRIVATE_DATA, "failed to display private data,such as rule box"}, {EM_ErrorCode.NET_ERROR_ROBOT_OPERATE_FAILED, "robot operate failed"}, {EM_ErrorCode.NET_ERROR_CHANNEL_ALREADY_OPENED, "channel has already been opened"}, {EM_ErrorCode.ERR_INTERNAL_INVALID_CHANNEL,"invaild channel"}, {EM_ErrorCode.ERR_INTERNAL_REOPEN_CHANNEL,"reopen channel failed"}, {EM_ErrorCode.ERR_INTERNAL_SEND_DATA,"send data failed"}, {EM_ErrorCode.ERR_INTERNAL_CREATE_SOCKET,"create socket failed"}, {EM_ErrorCode.ERR_INTERNAL_LISTEN_FAILED,"Start listen failed"}, {EM_ErrorCode.NET_ERROR_FACE_RECOGNITION_SERVER_GROUP_ID_EXCEED, "Target recognition server group id exceed " }, {EM_ErrorCode.ERR_NOT_SUPPORT_HIGHLEVEL_SECURITY_LOGIN, "device not support high level security login" }, {EM_ErrorCode.NET_ERROR_PHOTOSIZE_EXCEEDSLIMIT, "photosize exceeds limit"}, {EM_ErrorCode.NET_ERROR_USERID_INVALID, "userid invalid"}, {EM_ErrorCode.NET_ERROR_EXTRACTFEATURE_FAILED, "photo extract feature failed"}, {EM_ErrorCode.NET_ERROR_PHOTO_EXIST, "photo exist"}, {EM_ErrorCode.NET_ERROR_PHOTO_OVERFLOW, "photo over flow"}, {EM_ErrorCode.NET_ERROR_PHOTO_FORMAT, "photo format error"}, {EM_ErrorCode.NET_ERROR_INVALID_PARAM, "invalid param"}, {EM_ErrorCode.NET_ERROR_INVALID_PASSWORD, "invalid password"}, {EM_ErrorCode.NET_ERROR_INVALID_FINGERPRINT, "invalid infomation"}, {EM_ErrorCode.NET_ERROR_INVALID_FACE, "invalid target"}, {EM_ErrorCode.NET_ERROR_INVALID_CARD, "invalid card"}, {EM_ErrorCode.NET_ERROR_INVALID_USER, "invalid user"}, {EM_ErrorCode.NET_ERROR_GET_SUBSERVICE, "device get sub service fail"}, {EM_ErrorCode.NET_ERROR_GET_METHOD, "device get method fail"}, {EM_ErrorCode.NET_ERROR_GET_SUBCAPS, "device get sub caps fail"}, {EM_ErrorCode.NET_ERROR_UPTO_INSERT_LIMIT, "up to insert limit"}, {EM_ErrorCode.NET_ERROR_UPTO_MAX_INSERT_RATE, "up tp max insert rate"}, {EM_ErrorCode.NET_ERROR_ERASE_FINGERPRINT, "erase infomation data fail"}, {EM_ErrorCode.NET_ERROR_ERASE_FACE, "erase target data fail"}, {EM_ErrorCode.NET_ERROR_ERASE_CARD, "erase card data fail"}, {EM_ErrorCode.NET_ERROR_NO_RECORD, "no record"}, {EM_ErrorCode.NET_ERROR_NOMORE_RECORDS, "no more records"}, {EM_ErrorCode.NET_ERROR_RECORD_ALREADY_EXISTS, "record already exist"}, {EM_ErrorCode.NET_ERROR_EXCEED_MAX_FINGERPRINT_PERUSER, "exceed max infomation per user"}, {EM_ErrorCode.NET_ERROR_EXCEED_MAX_CARD_PERUSER, "exceed max card per user"}, {EM_ErrorCode.NET_ERROR_EXCEED_ADMINISTRATOR_LIMIT, "exceed administrator limit"}, {EM_ErrorCode.NET_ERROR_CARD_NUM_EXIST, "card num already exist"}, {EM_ErrorCode.NET_ERROR_FINGERPRINT_EXIST, "infomation already exist"}, {EM_ErrorCode.NET_ERROR_FINGERPRINT_DOWNLOAD_FAIL, "information Download Fail"}, {EM_ErrorCode.NET_ERROR_DOOR_IN_NORMALLY_OPEN_STATUS, "The door is in a normally open status"}, {EM_ErrorCode.NET_ERROR_DOOR_IN_NORMALLY_CLOSED_STATUS, "The door is in a normally closed status"}, {EM_ErrorCode.NET_ERROR_DOOR_IN_INTERLOCK_STATUS, "The door is in an interlocking status"}, {EM_ErrorCode.NET_ERROR_DO_NOT_EDIT, "Data Do Not Edit"}, {EM_ErrorCode.NET_ERROR_BINDING, "Data bound"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FEATURE_SIZE_ERROR, "The security code has exceeded its validity period"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_NO_FACE_DETECTED, "No target detected"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_MULTI_FACE_DETECTED, "Multi target detected, Can not extract eigenvalues"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_PICTURE_DECODING_ERROR, "Picture decoding error"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_LOW_PICTURE_QUALITY, "The picture quality is too low"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_NOT_RECOMMENDED, "Not recommended"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_FEATURE_ALREADY_EXIST, "target eigenvalue already exist"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_ANGLE_OVER_THRESHOLDS, "target angle over thresholds"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_RADIO_EXCEEDS_RANGE, "target radio exceeds range"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_OVER_EXPOSED, "target over exposed"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_UNDER_EXPOSED, "target under exposed"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_BRIGHTNESS_IMBALANCE, "target brightness imbalance"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_LOWER_CONFIDENCE, "target lower confidence level"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_LOW_ALIGN, "target low align score"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FRAGMENTARY_FACE_DETECTED, "Fragmentary target detected"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_PUPIL_DISTANCE_NOT_ENOUGH, "Pupil distance in the photo is not enough"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_DATA_DOWNLOAD_FAILED, "target download failed"}, {EM_ErrorCode.NET_ERROR_NORMAL_USER_NOTSUPPORT, "Ordinary users do not support delivery"}, {EM_ErrorCode.NET_ERROR_CITIZENID_EXIST, "ID is already exist"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_FFE_FAILED, "The target can be detected"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_PHOTO_FEATURE_FAILED_FOR_FA, "The feature value extracted from the target photo is incorrect due to the inconsistency of target attributes such as masks, hats, sunglasses, etc."}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_DATA_PHOTO_INCOMPLETE, "Incomplete target photo"} }; /// /// zh-cn language /// 中文错误码对应的错误信息 /// private static Dictionary zh_cn_String = new Dictionary() { {EM_ErrorCode.NET_NOERROR,"没有错误"}, {EM_ErrorCode.NET_ERROR,"未知错误"}, {EM_ErrorCode.NET_SYSTEM_ERROR,"Windows系统出错"}, {EM_ErrorCode.NET_NETWORK_ERROR,"网络错误,可能是因为网络超时"}, {EM_ErrorCode.NET_DEV_VER_NOMATCH,"设备协议不匹配"}, {EM_ErrorCode.NET_INVALID_HANDLE,"句柄无效"}, {EM_ErrorCode.NET_OPEN_CHANNEL_ERROR,"打开通道失败"}, {EM_ErrorCode.NET_CLOSE_CHANNEL_ERROR,"关闭通道失败"}, {EM_ErrorCode.NET_ILLEGAL_PARAM,"用户参数不合法"}, {EM_ErrorCode.NET_SDK_INIT_ERROR,"SDK初始化出错"}, {EM_ErrorCode.NET_SDK_UNINIT_ERROR,"SDK清理出错"}, {EM_ErrorCode.NET_RENDER_OPEN_ERROR,"申请render资源出错"}, {EM_ErrorCode.NET_DEC_OPEN_ERROR,"打开解码库出错"}, {EM_ErrorCode.NET_DEC_CLOSE_ERROR,"关闭解码库出错"}, {EM_ErrorCode.NET_MULTIPLAY_NOCHANNEL,"多画面预览中检测到通道数为0"}, {EM_ErrorCode.NET_TALK_INIT_ERROR,"录音库初始化失败"}, {EM_ErrorCode.NET_TALK_NOT_INIT,"录音库未经初始化"}, {EM_ErrorCode.NET_TALK_SENDDATA_ERROR,"发送音频数据出错"}, {EM_ErrorCode.NET_REAL_ALREADY_SAVING,"实时数据已经处于保存状态"}, {EM_ErrorCode.NET_NOT_SAVING,"未保存实时数据"}, {EM_ErrorCode.NET_OPEN_FILE_ERROR,"打开文件出错"}, {EM_ErrorCode.NET_PTZ_SET_TIMER_ERROR,"启动云台控制定时器失败"}, {EM_ErrorCode.NET_RETURN_DATA_ERROR,"对返回数据的校验出错"}, {EM_ErrorCode.NET_INSUFFICIENT_BUFFER,"没有足够的缓存"}, {EM_ErrorCode.NET_NOT_SUPPORTED,"当前SDK未支持该功能"}, {EM_ErrorCode.NET_NO_RECORD_FOUND,"查询不到录象"}, {EM_ErrorCode.NET_NOT_AUTHORIZED,"无操作权限"}, {EM_ErrorCode.NET_NOT_NOW,"暂时无法执行"}, {EM_ErrorCode.NET_NO_TALK_CHANNEL,"未发现对讲通道"}, {EM_ErrorCode.NET_NO_AUDIO,"未发现音频"}, {EM_ErrorCode.NET_NO_INIT,"网络SDK未经初始化"}, {EM_ErrorCode.NET_DOWNLOAD_END,"下载已结束"}, {EM_ErrorCode.NET_EMPTY_LIST,"查询结果为空"}, {EM_ErrorCode.NET_ERROR_GETCFG_SYSATTR,"获取系统属性配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_SERIAL,"获取序列号失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_GENERAL,"获取常规属性失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_DSPCAP,"获取DSP能力描述失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_NETCFG,"获取网络配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_CHANNAME,"获取通道名称失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEO,"获取视频属性失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_RECORD,"获取录象配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_PRONAME,"获取解码器协议名称失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_FUNCNAME,"获取232串口功能名称失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_485DECODER,"获取解码器属性失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_232COM,"获取232串口配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_ALARMIN,"获取外部报警输入配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_ALARMDET,"获取动态检测报警失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_SYSTIME,"获取设备时间失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_PREVIEW,"获取预览参数失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_AUTOMT,"获取自动维护配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEOMTRX,"获取视频矩阵配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_COVER,"获取区域遮挡配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_WATERMAKE,"获取图象水印配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_MULTICAST,"获取配置失败位置:组播端口按通道配置"}, {EM_ErrorCode.NET_ERROR_SETCFG_GENERAL,"修改常规属性失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_NETCFG,"修改网络配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_CHANNAME,"修改通道名称失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEO,"修改视频属性失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_RECORD,"修改录象配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_485DECODER,"修改解码器属性失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_232COM,"修改232串口配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_ALARMIN,"修改外部输入报警配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_ALARMDET,"修改动态检测报警配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_SYSTIME,"修改设备时间失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_PREVIEW,"修改预览参数失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_AUTOMT,"修改自动维护配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEOMTRX,"修改视频矩阵配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_COVER,"修改区域遮挡配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_WATERMAKE,"修改图象水印配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_WLAN,"修改无线网络信息失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_WLANDEV,"选择无线网络设备失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_REGISTER,"修改主动注册参数配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_CAMERA,"修改摄像头属性配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_INFRARED,"修改红外报警配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_SOUNDALARM,"修改音频报警配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_STORAGE,"修改存储位置配置失败"}, {EM_ErrorCode.NET_AUDIOENCODE_NOTINIT,"音频编码接口没有成功初始化"}, {EM_ErrorCode.NET_DATA_TOOLONGH,"数据过长"}, {EM_ErrorCode.NET_UNSUPPORTED,"设备不支持该操作"}, {EM_ErrorCode.NET_DEVICE_BUSY,"设备资源不足"}, {EM_ErrorCode.NET_SERVER_STARTED,"服务器已经启动"}, {EM_ErrorCode.NET_SERVER_STOPPED,"服务器尚未成功启动"}, {EM_ErrorCode.NET_LISTER_INCORRECT_SERIAL,"输入序列号有误"}, {EM_ErrorCode.NET_QUERY_DISKINFO_FAILED,"获取硬盘信息失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_SESSION,"获取连接Session信息"}, {EM_ErrorCode.NET_USER_FLASEPWD_TRYTIME,"输入密码错误超过限制次数"}, {EM_ErrorCode.NET_LOGIN_ERROR_PASSWORD,"密码不正确"}, {EM_ErrorCode.NET_LOGIN_ERROR_USER,"帐户不存在"}, {EM_ErrorCode.NET_LOGIN_ERROR_TIMEOUT,"等待登录返回超时"}, {EM_ErrorCode.NET_LOGIN_ERROR_RELOGGIN,"帐号已登录"}, {EM_ErrorCode.NET_LOGIN_ERROR_LOCKED,"帐号已被锁定"}, {EM_ErrorCode.NET_LOGIN_ERROR_BLACKLIST,"帐号已被列为禁用名单"}, {EM_ErrorCode.NET_LOGIN_ERROR_BUSY,"资源不足,系统忙"}, {EM_ErrorCode.NET_LOGIN_ERROR_CONNECT,"登录设备超时,请检查网络并重试"}, {EM_ErrorCode.NET_LOGIN_ERROR_NETWORK,"网络连接失败"}, {EM_ErrorCode.NET_LOGIN_ERROR_SUBCONNECT,"登录设备成功,但无法创建视频通道,请检查网络状况"}, {EM_ErrorCode.NET_LOGIN_ERROR_MAXCONNECT,"超过最大连接数"}, {EM_ErrorCode.NET_LOGIN_ERROR_PROTOCOL3_ONLY,"只支持3代协议"}, {EM_ErrorCode.NET_LOGIN_ERROR_UKEY_LOST,"未插入U盾或U盾信息错误"}, {EM_ErrorCode.NET_LOGIN_ERROR_NO_AUTHORIZED,"客户端IP地址没有登录权限"}, {EM_ErrorCode.NET_LOGIN_ERROR_USER_OR_PASSOWRD,"账号或密码错误"}, {EM_ErrorCode.NET_RENDER_SOUND_ON_ERROR,"Render库打开音频出错"}, {EM_ErrorCode.NET_RENDER_SOUND_OFF_ERROR,"Render库关闭音频出错"}, {EM_ErrorCode.NET_RENDER_SET_VOLUME_ERROR,"Render库控制音量出错"}, {EM_ErrorCode.NET_RENDER_ADJUST_ERROR,"Render库设置画面参数出错"}, {EM_ErrorCode.NET_RENDER_PAUSE_ERROR,"Render库暂停播放出错"}, {EM_ErrorCode.NET_RENDER_SNAP_ERROR,"Render库抓图出错"}, {EM_ErrorCode.NET_RENDER_STEP_ERROR,"Render库步进出错"}, {EM_ErrorCode.NET_RENDER_FRAMERATE_ERROR,"Render库设置帧率出错"}, {EM_ErrorCode.NET_RENDER_DISPLAYREGION_ERROR,"Render库设置显示区域出错"}, {EM_ErrorCode.NET_RENDER_GETOSDTIME_ERROR,"Render库获取当前播放时间出错"}, {EM_ErrorCode.NET_GROUP_EXIST,"组名已存在"}, {EM_ErrorCode.NET_GROUP_NOEXIST,"组名不存在"}, {EM_ErrorCode.NET_GROUP_RIGHTOVER,"组的权限超出权限列表范围"}, {EM_ErrorCode.NET_GROUP_HAVEUSER,"组下有用户,不能删除"}, {EM_ErrorCode.NET_GROUP_RIGHTUSE,"组的某个权限被用户使用,不能出除"}, {EM_ErrorCode.NET_GROUP_SAMENAME,"新组名同已有组名重复"}, {EM_ErrorCode.NET_USER_EXIST,"用户已存在"}, {EM_ErrorCode.NET_USER_NOEXIST,"用户不存在"}, {EM_ErrorCode.NET_USER_RIGHTOVER,"用户权限超出组权限"}, {EM_ErrorCode.NET_USER_PWD,"保留帐号,不容许修改密码"}, {EM_ErrorCode.NET_USER_FLASEPWD,"密码不正确"}, {EM_ErrorCode.NET_USER_NOMATCHING,"密码不匹配"}, {EM_ErrorCode.NET_USER_INUSE,"账号正在使用中"}, {EM_ErrorCode.NET_ERROR_GETCFG_ETHERNET,"获取网卡配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_WLAN,"获取无线网络信息失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_WLANDEV,"获取无线网络设备失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_REGISTER,"获取主动注册参数失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_CAMERA,"获取摄像头属性失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_INFRARED,"获取红外报警配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_SOUNDALARM,"获取音频报警配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_STORAGE,"获取存储位置配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_MAIL,"获取邮件配置失败"}, {EM_ErrorCode.NET_CONFIG_DEVBUSY,"暂时无法设置"}, {EM_ErrorCode.NET_CONFIG_DATAILLEGAL,"配置数据不合法"}, {EM_ErrorCode.NET_ERROR_GETCFG_DST,"获取夏令时配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_DST,"设置夏令时配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEO_OSD,"获取视频OSD叠加配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEO_OSD,"设置视频OSD叠加配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_GPRSCDMA,"获取CDMA\\GPRS网络配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_GPRSCDMA,"设置CDMA\\GPRS网络配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_IPFILTER,"获取IP过滤配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_IPFILTER,"设置IP过滤配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_TALKENCODE,"获取语音对讲编码配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_TALKENCODE,"设置语音对讲编码配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_RECORDLEN,"获取录像打包长度配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_RECORDLEN,"设置录像打包长度配置失败"}, {EM_ErrorCode.NET_DONT_SUPPORT_SUBAREA,"不支持网络硬盘分区"}, {EM_ErrorCode.NET_ERROR_GET_AUTOREGSERVER,"获取设备上主动注册服务器信息失败"}, {EM_ErrorCode.NET_ERROR_CONTROL_AUTOREGISTER,"主动注册重定向注册错误"}, {EM_ErrorCode.NET_ERROR_DISCONNECT_AUTOREGISTER,"断开主动注册服务器错误"}, {EM_ErrorCode.NET_ERROR_GETCFG_MMS,"获取mms配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_MMS,"设置mms配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_SMSACTIVATION,"获取短信激活无线连接配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_SMSACTIVATION,"设置短信激活无线连接配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_DIALINACTIVATION,"获取拨号激活无线连接配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_DIALINACTIVATION,"设置拨号激活无线连接配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_VIDEOOUT,"查询视频输出参数配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_VIDEOOUT,"设置视频输出参数配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_OSDENABLE,"获取osd叠加使能配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_OSDENABLE,"设置osd叠加使能配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_ENCODERINFO,"设置数字通道前端编码接入配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_TVADJUST,"获取TV调节配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_TVADJUST,"设置TV调节配置失败"}, {EM_ErrorCode.NET_ERROR_CONNECT_FAILED,"请求建立连接失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_BURNFILE,"请求刻录文件上传失败"}, {EM_ErrorCode.NET_ERROR_SNIFFER_GETCFG,"获取抓包配置信息失败"}, {EM_ErrorCode.NET_ERROR_SNIFFER_SETCFG,"设置抓包配置信息失败"}, {EM_ErrorCode.NET_ERROR_DOWNLOADRATE_GETCFG,"查询下载限制信息失败"}, {EM_ErrorCode.NET_ERROR_DOWNLOADRATE_SETCFG,"设置下载限制信息失败"}, {EM_ErrorCode.NET_ERROR_SEARCH_TRANSCOM,"查询串口参数失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_POINT,"获取预制点信息错误"}, {EM_ErrorCode.NET_ERROR_SETCFG_POINT,"设置预制点信息错误"}, {EM_ErrorCode.NET_SDK_LOGOUT_ERROR,"SDK没有正常登出设备"}, {EM_ErrorCode.NET_ERROR_GET_VEHICLE_CFG,"获取车载配置失败"}, {EM_ErrorCode.NET_ERROR_SET_VEHICLE_CFG,"设置车载配置失败"}, {EM_ErrorCode.NET_ERROR_GET_ATM_OVERLAY_CFG,"获取atm叠加配置失败"}, {EM_ErrorCode.NET_ERROR_SET_ATM_OVERLAY_CFG,"设置atm叠加配置失败"}, {EM_ErrorCode.NET_ERROR_GET_ATM_OVERLAY_ABILITY,"获取atm叠加能力失败"}, {EM_ErrorCode.NET_ERROR_GET_DECODER_TOUR_CFG,"获取解码器解码轮巡配置失败"}, {EM_ErrorCode.NET_ERROR_SET_DECODER_TOUR_CFG,"设置解码器解码轮巡配置失败"}, {EM_ErrorCode.NET_ERROR_CTRL_DECODER_TOUR,"控制解码器解码轮巡失败"}, {EM_ErrorCode.NET_GROUP_OVERSUPPORTNUM,"超出设备支持最大用户组数目"}, {EM_ErrorCode.NET_USER_OVERSUPPORTNUM,"超出设备支持最大用户数目"}, {EM_ErrorCode.NET_ERROR_GET_SIP_CFG,"获取SIP配置失败"}, {EM_ErrorCode.NET_ERROR_SET_SIP_CFG,"设置SIP配置失败"}, {EM_ErrorCode.NET_ERROR_GET_SIP_ABILITY,"获取SIP能力失败"}, {EM_ErrorCode.NET_ERROR_GET_WIFI_AP_CFG,"获取WIFI ap配置失败"}, {EM_ErrorCode.NET_ERROR_SET_WIFI_AP_CFG,"设置WIFI ap配置失败"}, {EM_ErrorCode.NET_ERROR_GET_DECODE_POLICY,"获取解码策略配置失败"}, {EM_ErrorCode.NET_ERROR_SET_DECODE_POLICY,"设置解码策略配置失败"}, {EM_ErrorCode.NET_ERROR_TALK_REJECT,"拒绝对讲"}, {EM_ErrorCode.NET_ERROR_TALK_OPENED,"对讲被其他客户端打开"}, {EM_ErrorCode.NET_ERROR_TALK_RESOURCE_CONFLICIT,"资源冲突"}, {EM_ErrorCode.NET_ERROR_TALK_UNSUPPORTED_ENCODE,"不支持的语音编码格式"}, {EM_ErrorCode.NET_ERROR_TALK_RIGHTLESS,"无权限"}, {EM_ErrorCode.NET_ERROR_TALK_FAILED,"请求对讲失败"}, {EM_ErrorCode.NET_ERROR_GET_MACHINE_CFG,"获取机器相关配置失败"}, {EM_ErrorCode.NET_ERROR_SET_MACHINE_CFG,"设置机器相关配置失败"}, {EM_ErrorCode.NET_ERROR_GET_DATA_FAILED,"设备无法获取当前请求数据"}, {EM_ErrorCode.NET_ERROR_MAC_VALIDATE_FAILED,"MAC地址验证失败 "}, {EM_ErrorCode.NET_ERROR_GET_INSTANCE,"获取服务器实例失败"}, {EM_ErrorCode.NET_ERROR_JSON_REQUEST,"生成的jason字符串错误"}, {EM_ErrorCode.NET_ERROR_JSON_RESPONSE,"响应的jason字符串错误"}, {EM_ErrorCode.NET_ERROR_VERSION_HIGHER,"协议版本低于当前使用的版本"}, {EM_ErrorCode.NET_SPARE_NO_CAPACITY,"热备操作失败, 容量不足"}, {EM_ErrorCode.NET_ERROR_SOURCE_IN_USE,"显示源被其他输出占用"}, {EM_ErrorCode.NET_ERROR_REAVE,"高级用户抢占低级用户资源"}, {EM_ErrorCode.NET_ERROR_NETFORBID,"禁止入网 "}, {EM_ErrorCode.NET_ERROR_GETCFG_MACFILTER,"获取MAC过滤配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_MACFILTER,"设置MAC过滤配置失败"}, {EM_ErrorCode.NET_ERROR_GETCFG_IPMACFILTER,"获取IP/MAC过滤配置失败"}, {EM_ErrorCode.NET_ERROR_SETCFG_IPMACFILTER,"设置IP/MAC过滤配置失败"}, {EM_ErrorCode.NET_ERROR_OPERATION_OVERTIME,"当前操作超时 "}, {EM_ErrorCode.NET_ERROR_SENIOR_VALIDATE_FAILED,"高级校验失败"}, {EM_ErrorCode.NET_ERROR_DEVICE_ID_NOT_EXIST,"设备ID不存在"}, {EM_ErrorCode.NET_ERROR_UNSUPPORTED,"不支持当前操作"}, {EM_ErrorCode.NET_ERROR_PROXY_DLLLOAD,"代理库加载失败"}, {EM_ErrorCode.NET_ERROR_PROXY_ILLEGAL_PARAM,"代理用户参数不合法"}, {EM_ErrorCode.NET_ERROR_PROXY_INVALID_HANDLE,"代理句柄无效"}, {EM_ErrorCode.NET_ERROR_PROXY_LOGIN_DEVICE_ERROR,"代理登入前端设备失败"}, {EM_ErrorCode.NET_ERROR_PROXY_START_SERVER_ERROR,"启动代理服务失败"}, {EM_ErrorCode.NET_ERROR_SPEAK_FAILED,"请求喊话失败"}, {EM_ErrorCode.NET_ERROR_NOT_SUPPORT_F6,"设备不支持此F6接口调用"}, {EM_ErrorCode.NET_ERROR_CD_UNREADY,"光盘未就绪"}, {EM_ErrorCode.NET_ERROR_DIR_NOT_EXIST,"目录不存在"}, {EM_ErrorCode.NET_ERROR_UNSUPPORTED_SPLIT_MODE,"设备不支持的分割模式"}, {EM_ErrorCode.NET_ERROR_OPEN_WND_PARAM,"开窗参数不合法"}, {EM_ErrorCode.NET_ERROR_LIMITED_WND_COUNT,"开窗数量超过限制"}, {EM_ErrorCode.NET_ERROR_UNMATCHED_REQUEST,"请求命令与当前模式不匹配"}, {EM_ErrorCode.NET_RENDER_ENABLELARGEPICADJUSTMENT_ERROR,"Render库启用高清图像内部调整策略出错"}, {EM_ErrorCode.NET_ERROR_UPGRADE_FAILED,"设备升级失败"}, {EM_ErrorCode.NET_ERROR_NO_TARGET_DEVICE,"找不到目标设备"}, {EM_ErrorCode.NET_ERROR_NO_VERIFY_DEVICE,"找不到验证设备"}, {EM_ErrorCode.NET_ERROR_CASCADE_RIGHTLESS,"无级联权限"}, {EM_ErrorCode.NET_ERROR_LOW_PRIORITY,"低优先级"}, {EM_ErrorCode.NET_ERROR_REMOTE_REQUEST_TIMEOUT,"远程设备请求超时"}, {EM_ErrorCode.NET_ERROR_LIMITED_INPUT_SOURCE,"输入源超出最大路数限制"}, {EM_ErrorCode.NET_ERROR_SET_LOG_PRINT_INFO,"设置日志打印失败"}, {EM_ErrorCode.NET_ERROR_PARAM_DWSIZE_ERROR,"入参的dwsize字段出错"}, {EM_ErrorCode.NET_ERROR_LIMITED_MONITORWALL_COUNT,"电视墙数量超过上限"}, {EM_ErrorCode.NET_ERROR_PART_PROCESS_FAILED,"部分过程执行失败"}, {EM_ErrorCode.NET_ERROR_TARGET_NOT_SUPPORT,"该功能不支持转发"}, {EM_ErrorCode.NET_ERROR_VISITE_FILE,"访问文件失败"}, {EM_ErrorCode.NET_ERROR_DEVICE_STATUS_BUSY,"设备忙"}, {EM_ErrorCode.NET_USER_PWD_NOT_AUTHORIZED,"修改密码无权限"}, {EM_ErrorCode.NET_USER_PWD_NOT_STRONG,"密码强度不够"}, {EM_ErrorCode.NET_ERROR_NO_SUCH_CONFIG,"没有对应的配置"}, {EM_ErrorCode.NET_ERROR_AUDIO_RECORD_FAILED,"录音失败"}, {EM_ErrorCode.NET_ERROR_SEND_DATA_FAILED,"数据发送失败"}, {EM_ErrorCode.NET_ERROR_OBSOLESCENT_INTERFACE,"废弃接口"}, {EM_ErrorCode.NET_ERROR_INSUFFICIENT_INTERAL_BUF,"内部缓冲不足"}, {EM_ErrorCode.NET_ERROR_NEED_ENCRYPTION_PASSWORD,"修改设备ip时,需要校验密码"}, {EM_ErrorCode.NET_ERROR_NOSUPPORT_RECORD,"设备不支持此记录集"}, {EM_ErrorCode.NET_ERROR_SERIALIZE_ERROR,"数据序列化错误"}, {EM_ErrorCode.NET_ERROR_DESERIALIZE_ERROR,"数据反序列化错误"}, {EM_ErrorCode.NET_ERROR_LOWRATEWPAN_ID_EXISTED,"该无线ID已存在"}, {EM_ErrorCode.NET_ERROR_LOWRATEWPAN_ID_LIMIT,"无线ID数量已超限"}, {EM_ErrorCode.NET_ERROR_LOWRATEWPAN_ID_ABNORMAL,"无线异常添加"}, {EM_ErrorCode.NET_ERROR_ENCRYPT, "加密数据失败"}, {EM_ErrorCode.NET_ERROR_PWD_ILLEGAL, "新密码不合规范"}, {EM_ErrorCode.NET_ERROR_DEVICE_ALREADY_INIT, "设备已经初始化"}, {EM_ErrorCode.NET_ERROR_SECURITY_CODE, "安全码错误"}, {EM_ErrorCode.NET_ERROR_SECURITY_CODE_TIMEOUT, "安全码超出有效期"}, {EM_ErrorCode.NET_ERROR_GET_PWD_SPECI, "获取密码规范失败"}, {EM_ErrorCode.NET_ERROR_NO_AUTHORITY_OF_OPERATION, "无权限进行该操作"}, {EM_ErrorCode.NET_ERROR_DECRYPT, "解密数据失败"}, {EM_ErrorCode.NET_ERROR_2D_CODE, "2D code校验失败"}, {EM_ErrorCode.NET_ERROR_INVALID_REQUEST, "非法的RPC请求"}, {EM_ErrorCode.NET_ERROR_PWD_RESET_DISABLE, "密码重置功能已关闭"}, {EM_ErrorCode.NET_ERROR_PLAY_PRIVATE_DATA, "显示私有数据,比如规则框等失败"}, {EM_ErrorCode.NET_ERROR_ROBOT_OPERATE_FAILED, "机器人操作失败"}, {EM_ErrorCode.NET_ERROR_CHANNEL_ALREADY_OPENED, "通道已经打开"}, {EM_ErrorCode.ERR_INTERNAL_INVALID_CHANNEL,"错误的通道号"}, {EM_ErrorCode.ERR_INTERNAL_REOPEN_CHANNEL,"打开重复通道"}, {EM_ErrorCode.ERR_INTERNAL_SEND_DATA,"发送消息失败"}, {EM_ErrorCode.ERR_INTERNAL_CREATE_SOCKET,"创建socket失败"}, {EM_ErrorCode.ERR_INTERNAL_LISTEN_FAILED,"启动监听失败"}, {EM_ErrorCode.NET_ERROR_FACE_RECOGNITION_SERVER_GROUP_ID_EXCEED, "组ID超过最大值" }, {EM_ErrorCode.ERR_NOT_SUPPORT_HIGHLEVEL_SECURITY_LOGIN, "设备不支持高安全等级登录" }, {EM_ErrorCode.NET_ERROR_PHOTOSIZE_EXCEEDSLIMIT, "图片大小超限"}, {EM_ErrorCode.NET_ERROR_USERID_INVALID, "用户ID不存在"}, {EM_ErrorCode.NET_ERROR_EXTRACTFEATURE_FAILED, "照片特征值提取失败"}, {EM_ErrorCode.NET_ERROR_PHOTO_EXIST, "照片已存在"}, {EM_ErrorCode.NET_ERROR_PHOTO_OVERFLOW, "照片数量超过上限"}, {EM_ErrorCode.NET_ERROR_PHOTO_FORMAT, "图片格式错误"}, {EM_ErrorCode.NET_ERROR_INVALID_PARAM, "参数无效"}, {EM_ErrorCode.NET_ERROR_INVALID_PASSWORD, "密码无效"}, {EM_ErrorCode.NET_ERROR_INVALID_FINGERPRINT, "信息无效"}, {EM_ErrorCode.NET_ERROR_INVALID_FACE, "目标无效"}, {EM_ErrorCode.NET_ERROR_INVALID_CARD, "卡无效"}, {EM_ErrorCode.NET_ERROR_INVALID_USER, "用户无效"}, {EM_ErrorCode.NET_ERROR_GET_SUBSERVICE, "能力集子服务获取失败"}, {EM_ErrorCode.NET_ERROR_GET_METHOD, "获取组件的方法集失败"}, {EM_ErrorCode.NET_ERROR_GET_SUBCAPS, "获取资源实体能力集失败"}, {EM_ErrorCode.NET_ERROR_UPTO_INSERT_LIMIT, "已达插入上限"}, {EM_ErrorCode.NET_ERROR_UPTO_MAX_INSERT_RATE, "已达最大插入速度"}, {EM_ErrorCode.NET_ERROR_ERASE_FINGERPRINT, "清除信息数据失败"}, {EM_ErrorCode.NET_ERROR_ERASE_FACE, "清除目标数据失败"}, {EM_ErrorCode.NET_ERROR_ERASE_CARD, "清除卡数据失败"}, {EM_ErrorCode.NET_ERROR_NO_RECORD, "没有记录"}, {EM_ErrorCode.NET_ERROR_NOMORE_RECORDS, "查找到最后,没有更多记录"}, {EM_ErrorCode.NET_ERROR_RECORD_ALREADY_EXISTS, "下发卡或信息时,数据重复"}, {EM_ErrorCode.NET_ERROR_EXCEED_MAX_FINGERPRINT_PERUSER, "超过个人最大信息记录数"}, {EM_ErrorCode.NET_ERROR_EXCEED_MAX_CARD_PERUSER, "超过个人最大卡片记录数"}, {EM_ErrorCode.NET_ERROR_EXCEED_ADMINISTRATOR_LIMIT, "超过门禁管理员个数限制"}, {EM_ErrorCode.NET_ERROR_CARD_NUM_EXIST, "卡号已存在"}, {EM_ErrorCode.NET_ERROR_FINGERPRINT_EXIST, "信息已存在"}, {EM_ErrorCode.NET_ERROR_FINGERPRINT_DOWNLOAD_FAIL, "信息通过URL下载方式下载失败"}, {EM_ErrorCode.NET_ERROR_DOOR_IN_NORMALLY_OPEN_STATUS, "门处于常开状态"}, {EM_ErrorCode.NET_ERROR_DOOR_IN_NORMALLY_CLOSED_STATUS, "门处于常闭状态"}, {EM_ErrorCode.NET_ERROR_DOOR_IN_INTERLOCK_STATUS, "门处于互锁状态"}, {EM_ErrorCode.NET_ERROR_DO_NOT_EDIT, "数据不允许编辑"}, {EM_ErrorCode.NET_ERROR_BINDING, "数据被绑定"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FEATURE_SIZE_ERROR, "特征值长度错误"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_NO_FACE_DETECTED, "图片中检测到0个目标"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_MULTI_FACE_DETECTED, "图片中检测到多个目标,无法返回特征"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_PICTURE_DECODING_ERROR, "图片解码错误"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_LOW_PICTURE_QUALITY, "图片质量太低"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_NOT_RECOMMENDED, "结果不推荐使用"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_FEATURE_ALREADY_EXIST, "目标特征已存在"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_ANGLE_OVER_THRESHOLDS, "目标角度超过配置阈值"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_RADIO_EXCEEDS_RANGE, "目标占比超出范围"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_OVER_EXPOSED, "目标过爆"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_UNDER_EXPOSED, "目标欠爆"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_BRIGHTNESS_IMBALANCE, "目标亮度不均衡"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_LOWER_CONFIDENCE, "目标的置信度低"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_LOW_ALIGN, "目标对齐分数低"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FRAGMENTARY_FACE_DETECTED, "目标存在遮挡、残缺不全"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_PUPIL_DISTANCE_NOT_ENOUGH, "目标瞳距小于阈值"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_DATA_DOWNLOAD_FAILED, "目标数据下载失败"}, {EM_ErrorCode.NET_ERROR_NORMAL_USER_NOTSUPPORT, "普通用户不支持下发"}, {EM_ErrorCode.NET_ERROR_CITIZENID_EXIST, "证件号已存在"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_FFE_FAILED, "目标可检测,但特征值提取失败(算法场景)"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_PHOTO_FEATURE_FAILED_FOR_FA, "目标照片因口罩,帽子,墨镜等目标属性不符合而提取特征值错误"}, {EM_ErrorCode.NET_ERROR_FACEMANAGER_FACE_DATA_PHOTO_INCOMPLETE, "目标照片不完整"} }; #endregion //<< constant >> #region << C# SDK calls >> #region << init and login >> /// /// set throw error message /// 设置接口抛异常 /// /// throw expection or not 是否抛异常 public static void SetThrowErrorMessage(bool isThrow) { m_IsThrowErrorMessage = isThrow; } /// /// error code convert to error message /// 错误码转成错误信息 /// /// SDK error code SDK错误码 /// error message description 错误信息描述 private static string GetLastErrorMessage(EM_ErrorCode errorCode) { string result = string.Empty; switch (System.Globalization.CultureInfo.CurrentCulture.LCID) { case 0x00804: zh_cn_String.TryGetValue(errorCode, out result); break; default: en_us_String.TryGetValue(errorCode, out result); break; } if (null == result) { result = errorCode.ToString("X"); } return result; } /// /// judge the SDK function is failed or successful /// 判断SDK接口函数调用是否成功 /// /// value type 接口函数返回值类型 /// the value is SDK function returns value,the value must be value type 接口函数返回值 private static void NetGetLastError(T value) where T : struct { object temp = value; bool isGetLastError = false; if (value is IntPtr) { IntPtr tempValue = (IntPtr)temp; if (IntPtr.Zero == tempValue) { isGetLastError = true; } } else if (value is int) { int tempValue = (int)temp; if (0 > tempValue) { isGetLastError = true; } } else if (value is bool) { bool tempValue = (bool)temp; if (false == tempValue) { isGetLastError = true; } } else { return; } if (isGetLastError) { if (!m_IsThrowErrorMessage) { return; } int error = OriginalSDK.CLIENT_GetLastError(); if (0 != error) { string errorMessage = GetLastErrorMessage((EM_ErrorCode)error); throw new NETClientExcetion(error, errorMessage); } } } /// /// get last error message /// 获取错误信息 /// /// error message 错误信息 public static string GetLastError() { string reslut = null; int error = OriginalSDK.CLIENT_GetLastError(); if (0 != error) { reslut = GetLastErrorMessage((EM_ErrorCode)error); } return reslut; } /// /// initialize SDK,can only be called once.Must be called before others SDK function,otherwise others SDK function will fail. /// 初始化SDK,只能被调用一次,必须在别的SDK接口函数调用之前调用。 /// /// disconnect the callback function, see the delegate 断线回调函数 /// user data, there is no data, please use IntPtr.Zero 用户数据 /// initialization parameter,can input null SDK初始化参数 /// failed return false, successful return true 失败返回false 成功返回true public static bool Init(fDisConnectCallBack cbDisConnect, IntPtr dwUser, NETSDK_INIT_PARAM? stuInitParam) { bool result = false; IntPtr lpInitParam = IntPtr.Zero; try { if (null != stuInitParam) { lpInitParam = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NETSDK_INIT_PARAM))); Marshal.StructureToPtr(stuInitParam, lpInitParam, true); } result = OriginalSDK.CLIENT_InitEx(cbDisConnect, dwUser, lpInitParam); NetGetLastError(result); } finally { Marshal.FreeHGlobal(lpInitParam); } return result; } /// /// initialize SDK (with default Disconnect Callback and Reconnected Callback), /// can only be called once.Must be called before others SDK function,otherwise others SDK function will fail. /// 初始化SDK(使用默认的断线重连和重连恢复回调函数), /// 只能被调用一次,必须在别的SDK接口函数调用之前调用。 /// /// public static bool InitWithDefaultSetting(fDisConnectCallBack cbDisConnect, fHaveReConnectCallBack cbReconnect, IntPtr dwUser, NETSDK_INIT_PARAM? stuInitParam) { bool result = false; IntPtr lpInitParam = IntPtr.Zero; IntPtr pNetParam = IntPtr.Zero; try { if (null != stuInitParam) { lpInitParam = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NETSDK_INIT_PARAM))); Marshal.StructureToPtr(stuInitParam, lpInitParam, true); } // init SDK and set disconnect callback (初始化 SDK) result = OriginalSDK.CLIENT_InitEx(cbDisConnect, dwUser, lpInitParam); NetGetLastError(result); if (!result) return false; // Timeout of login 登录时尝试建立连接的超时时间 // Tiemout of sub-connect 设置子连接的超时时间 NET_PARAM netParam = new NET_PARAM(); netParam.nConnectTime = 5000; // 5s netParam.nGetConnInfoTime = 3000; // 3s pNetParam = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_PARAM))); Marshal.StructureToPtr(netParam, pNetParam, true); OriginalSDK.CLIENT_SetNetworkParam(pNetParam); // set reconnect callback 设置断线重连回调接口 OriginalSDK.CLIENT_SetAutoReconnect(cbReconnect, IntPtr.Zero); // set reconnect time 设置重连时间,可选 // Set timeout and number of attempts 设置登录超时时间和尝试次数,可选 int waitTime = 5000; // 5s int tryTimes = 3; // 3 times OriginalSDK.CLIENT_SetConnectTime(waitTime, tryTimes); } finally { Marshal.FreeHGlobal(lpInitParam); Marshal.FreeHGlobal(pNetParam); } return result; } /// /// empty SDK, release occupied resource,call after all SDK functions /// 清空SDK,释放资源 /// public static void Cleanup() { OriginalSDK.CLIENT_Cleanup(); } /// /// login to the device /// 登陆设备 /// /// device IP 设备IP /// device port 设备端口 /// username 用户名 /// password 密码 /// device supported capacity,when the value is EM_LOGIN_SPAC_CAP_TYPE.SERVER_CONN means active listen mode user login(mobile dvr login) 登陆方式 /// nSpecCap compensation parameter,nSpecCap = EM_LOGIN_SPAC_CAP_TYPE.SERVER_CONN,pCapParam fill in device serial number string(mobile dvr login) emSpecCap参数,只有当 EM_LOGIN_SPAC_CAP_TYPE.SERVER_CONN有效 /// device information,for output parmaeter 输出的设备信息 /// failed return 0,successful return LoginID,after successful login, device Operation may be via this this value(device handle)corresponding to corresponding device.失败返回0,成功返回大于O的值 public static IntPtr Login(string pchDVRIP, ushort wDVRPort, string pchUserName, string pchPassword, EM_LOGIN_SPAC_CAP_TYPE emSpecCap, IntPtr pCapParam, ref NET_DEVICEINFO_Ex deviceInfo) { IntPtr result = IntPtr.Zero; int error = 0; result = OriginalSDK.CLIENT_LoginEx2(pchDVRIP, wDVRPort, pchUserName, pchPassword, emSpecCap, pCapParam, ref deviceInfo, ref error); NetGetLastError(result); return result; } /// /// login device with high level security /// 高安全级别登陆 /// /// device IP 设备IP /// device port 设备端口 /// username 用户名 /// password 密码 /// device supported capacity,when the value is EM_LOGIN_SPAC_CAP_TYPE.SERVER_CONN means active listen mode user login(mobile dvr login) 登陆方式 /// nSpecCap compensation parameter,nSpecCap = EM_LOGIN_SPAC_CAP_TYPE.SERVER_CONN,pCapParam fill in device serial number string(mobile dvr login) emSpecCap参数,只有当 EM_LOGIN_SPAC_CAP_TYPE.SERVER_CONN有效 /// device information,for output parmaeter 输出的设备信息 /// failed return 0,successful return LoginID,after successful login, device Operation may be via this this value(device handle)corresponding to corresponding device.失败返回0,成功返回大于O的值 public static IntPtr LoginWithHighLevelSecurity(string pchDVRIP, ushort wDVRPort, string pchUserName, string pchPassword, EM_LOGIN_SPAC_CAP_TYPE emSpecCap, IntPtr pCapParam, ref NET_DEVICEINFO_Ex deviceInfo) { IntPtr result = IntPtr.Zero; NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY stuInParam = new NET_IN_LOGIN_WITH_HIGHLEVEL_SECURITY(); stuInParam.dwSize = (uint)Marshal.SizeOf(stuInParam); stuInParam.szIP = pchDVRIP; stuInParam.nPort = wDVRPort; stuInParam.szUserName = pchUserName; stuInParam.szPassword = pchPassword; stuInParam.emSpecCap = emSpecCap; stuInParam.pCapParam = pCapParam; NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY stuOutParam = new NET_OUT_LOGIN_WITH_HIGHLEVEL_SECURITY(); stuOutParam.dwSize = (uint)Marshal.SizeOf(stuOutParam); result = OriginalSDK.CLIENT_LoginWithHighLevelSecurity(ref stuInParam, ref stuOutParam); deviceInfo = stuOutParam.stuDeviceInfo; NetGetLastError(result); return result; } /// /// log off device /// 登出设备 /// /// user LoginID:Login's returns value,登陆ID,Login返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool Logout(IntPtr lLoginID) { bool result = false; result = OriginalSDK.CLIENT_Logout(lLoginID); NetGetLastError(result); return result; } /// /// set re-connection callback function after disconnection. Internal SDK auto connect again after disconnection /// 设置自动重连设备 /// /// re-connection callback function 重连回调函数 /// user data, there is no data, please use IntPtr.Zero 用户数据 public static void SetAutoReconnect(fHaveReConnectCallBack cbAutoConnect, IntPtr dwUser) { OriginalSDK.CLIENT_SetAutoReconnect(cbAutoConnect, dwUser); } /// /// set log in network environment /// 设置登陆设备的网络参数 /// /// network environment 网络参数 public static void SetNetworkParam(NET_PARAM? netParam) { if (null == netParam) { return; } IntPtr lpNetParam = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_PARAM))); Marshal.StructureToPtr(netParam, lpNetParam, true); OriginalSDK.CLIENT_SetNetworkParam(lpNetParam); Marshal.FreeHGlobal(lpNetParam); } #endregion #region << real-time monitoring >> /// /// start real-time monitor.just only support 32bit /// 开始实时预览.只支持32位 /// /// user LoginID:Login's returns value 登陆ID,Login返回值 /// real time monitor channel NO.(from 0). 通道号 /// if rType is RType_Multiplay, nChannelID is reserved. /// when rType is RType_Multiplay_1 ~ RType_Multiplay_16, nChannelID determines the preview picture. /// ex. when RType_Multiplay_4, nChannelID is 4 or 5 or 6 or 7 will display fifth to seventh channels in the four picture preview /// display window handle. When value is 0(IntPtr.Zero), data are not decoded or displayed 显示窗口句柄 /// realplay type 预览类型 /// real data callback 预览数据回调 /// video monitor disconnect callback function 预览断线回调 /// user defined data, used in callback 用户数据 /// waiting time 等待时间 /// failed return 0, successful return the real time monitorID(real time monitor handle),as parameter of related function. 失败返回0,成功返回大于0的值 public static IntPtr StartRealPlay(IntPtr lLoginID, int nChannelID, IntPtr hWnd, EM_RealPlayType rType, fRealDataCallBackEx cbRealData, fRealPlayDisConnectCallBack cbDisconnect, IntPtr dwUser, uint dwWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartRealPlay(lLoginID, nChannelID, hWnd, rType, cbRealData, cbDisconnect, dwUser, dwWaitTime); NetGetLastError(result); return result; } /// /// start real-time monitor.support 32bit and 64bit /// 开始实时预览.支持32位和64位 /// /// user LoginID:Login's returns value 登陆ID,Login返回值 /// real time monitor channel NO.(from 0). 通道号 /// display window handle. When value is 0(IntPtr.Zero), data are not decoded or displayed 显示窗口句柄 /// realplay type 预览类型 /// failed return 0, successful return the real time monitorID(real time monitor handle),as parameter of related function. 失败返回0,成功返回大于0的值 public static IntPtr RealPlay(IntPtr lLoginID, int nChannelID, IntPtr hWnd, EM_RealPlayType rType = EM_RealPlayType.EM_A_RType_Realplay) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_RealPlayEx(lLoginID, nChannelID, hWnd, rType); NetGetLastError(result); return result; } /// /// stop real time monitoring /// 关闭实时预览 /// /// monitor handle StartRealPlay returns value 预览ID StartRealPlay返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool StopRealPlay(IntPtr lRealHandle) { bool result = false; result = OriginalSDK.CLIENT_StopRealPlayEx(lRealHandle); NetGetLastError(result); return result; } /// /// set real-time monitor data callback /// 设置实时预览数据回调 /// /// monitor handle 预览句柄 /// callback function 回调函数 /// user data, there is no data, please use IntPtr.Zero 用户数据 /// by bit, can combine, when it is 0x1f, callback the five types, 回调数据类型as: /// 0x00000001 is equivalent with original data /// 0x00000002 is MPEG4/H264 standard data /// 0x00000004 YUV data /// 0x00000008 PCM data /// 0x00000010 original audio data /// 0x0000001f above five data type /// failed return false, successful return true 失败返回false 成功返回true public static bool SetRealDataCallBack(IntPtr lRealHandle, fRealDataCallBackEx2 cbRealData, IntPtr dwUser, EM_REALDATA_FLAG dwFlag) { bool result = false; result = OriginalSDK.CLIENT_SetRealDataCallBackEx2(lRealHandle, cbRealData, dwUser, (uint)dwFlag); NetGetLastError(result); return result; } /// /// set real-time monitor data callback /// 设置实时预览数据回调 /// /// monitor handle 预览句柄 /// callback function 回调函数 /// user data, there is no data, please use IntPtr.Zero 用户数据 /// by bit, can combine, when it is 0x1f, callback the five types, 回调数据类型as: /// 0x00000001 is equivalent with original data /// 0x00000002 is MPEG4/H264 standard data /// 0x00000004 YUV data /// 0x00000008 PCM data /// 0x00000010 original audio data /// 0x0000001f above five data type /// failed return false, successful return true 失败返回false 成功返回true public static bool SetRealDataCallBack(IntPtr lRealHandle, fRealDataCallBackEx cbRealData, IntPtr dwUser, EM_REALDATA_FLAG dwFlag) { bool result = false; result = OriginalSDK.CLIENT_SetRealDataCallBackEx(lRealHandle, cbRealData, dwUser, (uint)dwFlag); NetGetLastError(result); return result; } /// /// set real-time monitor data callback /// 设置回放YUC数据回调 /// /// play back handle 回放句柄 /// callback function 回调函数 /// user data, there is no data, please use IntPtr.Zero 用户数据 /// failed return false, successful return true 失败返回false 成功返回true public static bool SetPlaybackYUVCallBack(IntPtr lPlayHandle, fYUVDataCallBack cYUVData, IntPtr dwUser) { bool result = false; result = OriginalSDK.CLIENT_SetPlaybackYUVCallBack(lPlayHandle, cYUVData, dwUser); NetGetLastError(result); return result; } /// /// save data to file /// 保存实时预览数据到文件 /// /// monitor handle 预览句柄 /// save path 保存文件路径 /// failed return false, successful return true 失败返回false 成功返回true public static bool SaveRealData(IntPtr lRealHandle, string pchFileName) { bool result = false; result = OriginalSDK.CLIENT_SaveRealData(lRealHandle, pchFileName); NetGetLastError(result); return result; } /// /// stop saving data to file /// 停止保存数据到文件 /// /// monitor handle 预览句柄 /// failed return false, successful return true 失败返回false 成功返回true public static bool StopSaveRealData(IntPtr lRealHandle) { bool result = false; result = OriginalSDK.CLIENT_StopSaveRealData(lRealHandle); NetGetLastError(result); return result; } /// /// set snapshot callback function /// 设置远程抓图回调 /// /// snapshot data callback function 抓图数据回调 /// user data, there is no data, please use IntPtr.Zero 用户数据 public static void SetSnapRevCallBack(fSnapRevCallBack OnSnapRevMessage, IntPtr dwUser) { OriginalSDK.CLIENT_SetSnapRevCallBack(OnSnapRevMessage, dwUser); } /// /// snapshot request /// 远程抓图请求 /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// Snapshot parameter(structure) 抓图参数 /// reserved 保留参数 /// failed return false, successful return true 失败返回false 成功返回true public static bool SnapPictureEx(IntPtr lLoginID, NET_SNAP_PARAMS par, IntPtr reserved) { bool result = false; result = OriginalSDK.CLIENT_SnapPictureEx(lLoginID, ref par, reserved); NetGetLastError(result); return result; } /// /// snap picture to file /// 远程抓图到文件 /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// snap picture to file in paramter 抓图输入参数 /// snap picture to file out paramter 抓图输出参数 /// waite time 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool SnapPictureToFile(IntPtr lLoginID, ref NET_IN_SNAP_PIC_TO_FILE_PARAM inParam, ref NET_OUT_SNAP_PIC_TO_FILE_PARAM outParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SnapPictureToFile(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } /// /// playback by time, support playback by direction and device must support direction /// 按时间回放,支持倒放,但设备要支持 /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// channel number 通道号 /// record play back parameter in 录像回放输入参数 /// record play back parameter out 录像回放输出参数 /// failed return 0, successful return the playback ID(playback handle),as parameter of related function. 失败返回0,成功返回大于0的值 public static IntPtr PlayBackByTime(IntPtr lLoginID, int nChannelID, NET_IN_PLAY_BACK_BY_TIME_INFO pstNetIn, ref NET_OUT_PLAY_BACK_BY_TIME_INFO pstNetOut) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_PlayBackByTimeEx2(lLoginID, nChannelID, ref pstNetIn, ref pstNetOut); NetGetLastError(result); return result; } /// /// Query video files /// 查询录像文件 /// /// Device handles user login 登陆ID,Login返回值 /// channelID 通道号 /// Video file types 查询录像文件类型 /// Recording start time 查询开始时间 /// Recording end time 查询结束时间 /// card number,Only for card number query effectively,In other cases you can fill NULL 卡号 /// Return to video file information,Is an array of structures NET_RECORDFILE_INFO[Video file information for the specified bar] 查询到文件信息 /// nriFileinfoThe maximum length of the buffer;[Unit of byte,Dimensional structure of an array of size number*sizeof(NET_RECORDFILE_INFO),Victoria is the size of the array is equal to 1,Recommend less than 200] 最大查询长度 /// The number of documents returned,Maximum output parameters are only found in video recording until the buffer is full,查询到的文件个数 /// Waiting Time 等待时间 /// Whether by time(Currently use false) 是否通过时间,这里用FALSE /// true:success;false:failure 失败返回false 成功返回true public static bool QueryRecordFile(IntPtr lLoginID, int nChannelId, EM_QUERY_RECORD_TYPE nRecordFileType, DateTime tmStart, DateTime tmEnd, string pchCardid, ref NET_RECORDFILE_INFO[] nriFileinfo, ref int filecount, int waittime, bool bTime) { bool returnValue = false; filecount = 0; IntPtr pBoxInfo = IntPtr.Zero; int maxlen = Marshal.SizeOf(typeof(NET_RECORDFILE_INFO)) * nriFileinfo.Length; try { NET_TIME timeStart = NET_TIME.FromDateTime(tmStart); NET_TIME timeEnd = NET_TIME.FromDateTime(tmEnd); pBoxInfo = Marshal.AllocHGlobal(maxlen);//Allocation of fixed specified the size of the memory space int fileCountMin = 0; if (pBoxInfo != IntPtr.Zero) { returnValue = OriginalSDK.CLIENT_QueryRecordFile(lLoginID, nChannelId, (int)nRecordFileType, ref timeStart, ref timeEnd, pchCardid, pBoxInfo, maxlen, ref filecount, waittime, bTime); NetGetLastError(returnValue); fileCountMin = (filecount <= nriFileinfo.Length ? filecount : nriFileinfo.Length); for (int dwLoop = 0; dwLoop < fileCountMin; dwLoop++) { // specify the memory space of the data is copied to the purpose in the array in the specified format nriFileinfo[dwLoop] = (NET_RECORDFILE_INFO)Marshal.PtrToStructure(IntPtr.Add(pBoxInfo, Marshal.SizeOf(typeof(NET_RECORDFILE_INFO)) * dwLoop), typeof(NET_RECORDFILE_INFO)); } } } finally { Marshal.FreeHGlobal(pBoxInfo);//Release the fixed memory allocation pBoxInfo = IntPtr.Zero; } return returnValue; } /// /// Whether there is a video status mask on each day in a month /// 某月内的各天是否存在录像的状态 /// /// Lonin return value 登陆ID /// channel value 通道ID /// record file type 录像类型 EM_QUERY_RECORD_TYPE /// month 月份 /// card id 输入卡号, nRecordFileType == EM_RECORD_TYPE_CARD,pchCardid输入卡号; nRecordFileType == EM_RECORD_TYPE_FIELD,pchCardid输入自定义字段 /// recorde status in some month 某月的各天是否存在录像的状态信息 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryRecordStatus(IntPtr lLoginID, int nChannelId, EM_QUERY_RECORD_TYPE nRecordFileType, DateTime tmMonth, string pchCardid, ref NET_RECORD_STATUS pRecordStatus, int waittime = 1000) { bool returnValue = false; NET_TIME timeMonth = NET_TIME.FromDateTime(tmMonth); returnValue = OriginalSDK.CLIENT_QueryRecordStatus(lLoginID, nChannelId, (int)nRecordFileType, ref timeMonth, pchCardid, ref pRecordStatus, waittime); NetGetLastError(returnValue); return returnValue; } /// /// get current osd time. /// 获取当前OSD时间 /// /// PlayBackByTime returns value PlayBackByTime返回值 /// return osd time 返回OSD时间 /// start time 开始时间 /// end time 结束时间 /// true:success;false:failure 失败返回false 成功返回true public static bool GetPlayBackOsdTime(IntPtr lPlayHandle, ref NET_TIME lpOsdTime, ref NET_TIME lpStartTime, ref NET_TIME lpEndTime) { bool result = false; result = OriginalSDK.CLIENT_GetPlayBackOsdTime(lPlayHandle, ref lpOsdTime, ref lpStartTime, ref lpEndTime); NetGetLastError(result); return result; } /// /// capture a picture /// 本地抓图 /// /// real handle or palyback handle 实时预览或回放的句柄 /// StartRealPlay returns value StartRealPlay返回值 /// PlayBackByTime returns value PlayBackByTime返回值 /// picture's saving name 保存的文件路径 /// picture type 图片类型 /// failed return false, successful return true 失败返回false 成功返回true public static bool CapturePicture(IntPtr hPlayHandle, string pchPicFileName, EM_NET_CAPTURE_FORMATS eFormat) { bool result = false; result = OriginalSDK.CLIENT_CapturePictureEx(hPlayHandle, pchPicFileName, eFormat); NetGetLastError(result); return result; } /// /// download video by time /// 按时间下载录像 /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// channel number 通道号 /// file type 录像文件类型 /// start time 开始时间 /// end time 结束时间 /// save file name 保存录像的文件名 /// download by time's pos callback 下载的时间回调 /// cbTimeDownLoadPos's user data, there is no data, please use IntPtr.Zero 用户数据 /// video data's callback 下载数据回调 /// fDownLoadDataCallBack's user data, there is no data, please use IntPtr.Zero 用户数据 /// Reserved 保留参数 /// failed return 0, successful return downloadsID, public static IntPtr DownloadByTime(IntPtr lLoginID, int nChannelId, EM_QUERY_RECORD_TYPE nRecordFileType, DateTime tmStart, DateTime tmEnd, string sSavedFileName, fTimeDownLoadPosCallBack cbTimeDownLoadPos, IntPtr dwUserData, fDataCallBack fDownLoadDataCallBack, IntPtr dwDataUser, IntPtr pReserved) { IntPtr result = IntPtr.Zero; NET_TIME startTime = NET_TIME.FromDateTime(tmStart); NET_TIME endTime = NET_TIME.FromDateTime(tmEnd); result = OriginalSDK.CLIENT_DownloadByTimeEx(lLoginID, nChannelId, (int)nRecordFileType, ref startTime, ref endTime, sSavedFileName, cbTimeDownLoadPos, dwUserData, fDownLoadDataCallBack, dwDataUser, pReserved); NetGetLastError(result); return result; } /// /// stop downloads /// 停止下载 /// /// downloadsID DownloadByTime returns value 下载ID DownloadByTime返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool StopDownload(IntPtr lFileHandle) { bool result = false; result = OriginalSDK.CLIENT_StopDownload(lFileHandle); NetGetLastError(result); return result; } /// /// download the video to get the current position,Can be used to display the download progress does not require real-time interface,Similar to the callback function to download /// 当前下载进度 /// /// download handle 下载句柄 /// total download size(KB) 总下载大小 /// the size have download(KB) 已经下载的大小 /// failed return false, successful return true 失败返回false 成功返回true public static bool GetDownloadPos(IntPtr lFileHandle, ref int nTotalSize, ref int nDownLoadSize) { bool result = false; result = OriginalSDK.CLIENT_GetDownloadPos(lFileHandle, ref nTotalSize, ref nDownLoadSize); NetGetLastError(result); return result; } /// /// 私有云台控制,param4由用户申请释放内存,内存大小参照 EM_A_EXTPTZ_ControlType 对应的结构体 /// Private PTZ control,user malloc param4's memory,please refer to corresponding structure of EM_A_EXTPTZ_ControlType /// public static bool DHPTZControl(IntPtr lLoginID, int nChannelID, uint dwPTZCommand, byte param1, byte param2, byte param3, bool dwStop, IntPtr param4) { bool result = false; result = OriginalSDK.CLIENT_DHPTZControl(lLoginID, nChannelID, dwPTZCommand, param1, param2, param3, dwStop, param4); NetGetLastError(result); return result; } /// /// PTZ control /// PTZ控制接口 /// /// user LoginID:Login's returns value 登陆ID,Login返回值 /// channel number 通道号 /// PTZ control commands 控制命令 /// Parameter1 details refer to EM_A_EXTPTZ_ControlType 控制命令的参数1 /// Parameter2 details refer to EM_A_EXTPTZ_ControlType 控制命令的参数2 /// Parameter3 details refer to EM_A_EXTPTZ_ControlType 控制命令的参数3 /// stop or not, effective to PTZ eight-directions operation and lens operation. During other operation, this parameter should fill in false 是否停止 /// support PTZ control extensive command,support these commands: 控制命令的参数4 /// EM_A_EXTPTZ_ControlType.MOVE_ABSOLUTELY:Absolute motion control commands,param4 corresponding struct NET_PTZ_CONTROL_ABSOLUTELY /// EM_A_EXTPTZ_ControlType.MOVE_CONTINUOUSLY:Continuous motion control commands,param4 corresponding struct NET_PTZ_CONTROL_CONTINUOUSLY /// EM_A_EXTPTZ_ControlType.GOTOPRESET:PTZ control command, at a certain speed to preset locus,parm4 corresponding struct NET_PTZ_CONTROL_GOTOPRESET /// EM_A_EXTPTZ_ControlType.SET_VIEW_RANGE:Set to horizon(param4 corresponding struct NET_PTZ_VIEW_RANGE_INFO /// EM_A_EXTPTZ_ControlType.FOCUS_ABSOLUTELY:Absolute focus(param4 corresponding struct NET_PTZ_FOCUS_ABSOLUTELY /// EM_A_EXTPTZ_ControlType.HORSECTORSCAN:Level fan sweep(param4 corresponding NET_PTZ_CONTROL_SECTORSCAN,param1、param2、param3 is invalid /// EM_A_EXTPTZ_ControlType.VERSECTORSCAN:Vertical sweep fan(param4 corresponding NET_PTZ_CONTROL_SECTORSCAN,param1、param2、param3 is invalid /// EM_A_EXTPTZ_ControlType.SET_FISHEYE_EPTZ:Control fish eye PTZ,param4corresponding to structure NET_PTZ_CONTROL_SET_FISHEYE_EPTZ /// EM_A_EXTPTZ_ControlType.SET_TRACK_START/SET_TRACK_STOP:param4 corresponding to structure NET_PTZ_CONTROL_SET_TRACK_CONTROL,dwStop set as FALSE,param1、param2、param3 is invalid /// failed return false, successful return true 失败返回false 成功返回true public static bool PTZControl(IntPtr lLoginID, int nChannelID, uint dwPTZCommand, int lParam1, int lParam2, int lParam3, bool dwStop, IntPtr param4) { bool result = false; result = OriginalSDK.CLIENT_DHPTZControlEx2(lLoginID, nChannelID, dwPTZCommand, lParam1, lParam2, lParam3, dwStop, param4); NetGetLastError(result); return result; } /// /// PTZ边界限制下发 /// /// 登陆ID,Login返回值 /// 扫描配置入参 /// 扫描配置出参 /// 超时时间 /// public static bool PTZSetPanGroupLimit(IntPtr lLoginID, ref NET_IN_PAN_GROUP_LIMIT_INFO pstInParam, ref NET_OUT_PAN_GROUP_LIMIT_INFO pstOutParam, uint dwWaitTime) { bool result = false; result = OriginalSDK.CLIENT_PTZSetPanGroupLimit(lLoginID, ref pstInParam, ref pstOutParam, dwWaitTime); NetGetLastError(result); return result; } /// /// PTZ边界限制组(添加/删除) /// /// 登陆ID,Login返回值 /// 入参 /// 出参 /// 超时时间 /// public static bool PTZSetPanGroup(IntPtr lLoginID, ref NET_IN_SET_PAN_GROUP_PARAM pstInParam, ref NET_OUT_SET_PAN_GROUP_PARAM pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_PTZSetPanGroup(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取PTZ边界限制组信息 /// /// 登陆ID,Login返回值 /// 入参 /// 出参 /// 超时时间 /// public static bool PTZGetPanGroup(IntPtr lLoginID, ref NET_IN_GET_PAN_GROUP_PARAM pInParam, ref NET_OUT_GET_PAN_GROUP_PARAM pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_PTZGetPanGroup(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// open audio /// 打开声音 /// /// real handle or palyback handle 实时预览或回放的句柄 /// StartRealPlay returns value StartRealPlay返回值 /// PlayBackByTime returns value PlayBackByTime返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool OpenSound(IntPtr lPlayHandle) { bool result = false; result = OriginalSDK.CLIENT_OpenSound(lPlayHandle); NetGetLastError(result); return result; } /// /// stop audio /// 关闭声音 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool CloseSound() { bool result = false; result = OriginalSDK.CLIENT_CloseSound(); NetGetLastError(result); return result; } #endregion /// /// control playback operation. /// 二维字符串数组拼接设置 /// /// 在二维数组中的下标 /// 需要替换的数据长度 /// 需要替换的原数据 /// 原数据 (注:元数据内存由用户自行申请) /// failed return false, successful return true 失败返回false 成功返回true public static void MultiArraySet(int index, int maxLen, string src, ref string dst) { byte[] srcArray = System.Text.Encoding.Default.GetBytes(src); byte[] dstArray = System.Text.Encoding.Default.GetBytes(dst); srcArray.CopyTo(dstArray, index * maxLen); dst = System.Text.Encoding.Default.GetString(dstArray); } /// /// control playback operation. /// 二维字符串数组读取 /// /// 在二维数组中的下标 /// 需要读取的数据长度 /// 读取结果 /// failed return false, successful return true 失败返回false 成功返回true public static string MultiArrayGet(int index, int maxLen, string dst) { byte[] dstArray = System.Text.Encoding.Default.GetBytes(dst); return System.Text.Encoding.Default.GetString(dstArray, index * maxLen, maxLen); } /// /// control playback operation. /// 控制回放 /// /// lPlayHandle:palyback handle 回放句柄 /// control type 控制类型 /// failed return false, successful return true 失败返回false 成功返回true public static bool PlayBackControl(IntPtr lPlayHandle, PlayBackType type) { bool result = false; switch (type) { case PlayBackType.Play: result = OriginalSDK.CLIENT_PausePlayBack(lPlayHandle, false); NetGetLastError(result); break; case PlayBackType.Pause: result = OriginalSDK.CLIENT_PausePlayBack(lPlayHandle, true); NetGetLastError(result); break; case PlayBackType.Stop: result = OriginalSDK.CLIENT_StopPlayBack(lPlayHandle); NetGetLastError(result); break; case PlayBackType.Fast: result = OriginalSDK.CLIENT_FastPlayBack(lPlayHandle); NetGetLastError(result); break; case PlayBackType.Slow: result = OriginalSDK.CLIENT_SlowPlayBack(lPlayHandle); NetGetLastError(result); break; case PlayBackType.Normal: result = OriginalSDK.CLIENT_NormalPlayBack(lPlayHandle); NetGetLastError(result); break; default: break; } return result; } /// /// set user work mode /// 设置用户工作模式 /// /// loginID,login returns value 登陆ID /// user work mode 工作模式类型 /// support these type:对应的结构体 /// EM_USEDEV_MODE.TALK_ENCODE_TYPE:corresponding structure NET_DEV_TALKDECODE_INFO /// EM_USEDEV_MODE.ALARM_LISTEN_MODE:value type int(0-16) /// EM_USEDEV_MODE.CONFIG_AUTHORITY_MODE:value type int(0/1) /// EM_USEDEV_MODE.TALK_TALK_CHANNEL:value type int(channel number) /// EM_USEDEV_MODE.TALK_SPEAK_PARAM:corresponding structure NET_SPEAK_PARAM /// EM_USEDEV_MODE.TALK_TRANSFER_MODE:corresponding structure NET_TALK_TRANSFER_PARAM /// EM_USEDEV_MODE.PLAYBACK_REALTIME_MODE:value type int(0/1) /// EM_USEDEV_MODE.RECORD_STREAM_TYPE:value type int(0/1/2) /// EM_USEDEV_MODE.RECORD_TYPE:see to EM_RECORD_TYPE /// EM_USEDEV_MODE.TALK_VT_PARAM:corresponding structure NET_VT_TALK_PARAM /// EM_USEDEV_MODE.TARGET_DEV_ID:value type int (0 or other) /// failed return false, successful return true 失败返回false 成功返回true public static bool SetDeviceMode(IntPtr lLoginID, EM_USEDEV_MODE emType, IntPtr pValue) { bool result = false; result = OriginalSDK.CLIENT_SetDeviceMode(lLoginID, emType, pValue); NetGetLastError(result); return result; } /// /// 设置报警回调函数 /// Set alarm callback function /// public static void SetDVRMessCallBack(fMessCallBack cbMessage, IntPtr dwUser) { OriginalSDK.CLIENT_SetDVRMessCallBack(cbMessage, dwUser); } /// /// set alarm callback function /// 设置报警回调 /// /// alarm callback 报警回调 /// user data 用户数据 public static void SetDVRMessCallBackEx1(fMessCallBackEx cbMessage, IntPtr dwUser) { OriginalSDK.CLIENT_SetDVRMessCallBackEx1(cbMessage, dwUser); } /// /// subscribe alarm /// 订阅报警 /// /// loginID:login returns value 登陆ID /// failed return false, successful return true 失败返回false 成功返回true public static bool StartListen(IntPtr lLoginID) { bool result = false; result = OriginalSDK.CLIENT_StartListenEx(lLoginID); NetGetLastError(result); return result; } /// /// unsubscribe alarm /// 取消订阅报警 /// /// loginID:login returns value 登陆ID /// failed return false, successful return true 失败返回false 成功返回true public static bool StopListen(IntPtr lLoginID) { bool result = false; result = OriginalSDK.CLIENT_StopListen(lLoginID); NetGetLastError(result); return result; } /// /// subscribe event /// 订阅事件 /// /// loginID:login returns value 登陆ID /// channel id 通道号 /// event type see EM_EVENT_IVS_TYPE 事件类型 /// subscribe image file or not,ture-yes,return intelligent image info during callback function,false not return intelligent image info during callback function 是否需要图片 /// intelligent data analysis callback 事件回调函数 /// user data 用户数据 /// reserved 保留参数 /// failed return 0, successful return the analyzerHandle public static IntPtr RealLoadPicture(IntPtr lLoginID, int nChannelID, uint dwAlarmType, bool bNeedPicFile, fAnalyzerDataCallBack cbAnalyzerData, IntPtr dwUser, IntPtr reserved) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_RealLoadPictureEx(lLoginID, nChannelID, dwAlarmType, bNeedPicFile, cbAnalyzerData, dwUser, reserved); NetGetLastError(result); return result; } /// /// unsubscribe event /// 取消订阅事件 /// /// analyzerHandle:RealLoadPicture returns value RealLoadPicture返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool StopLoadPic(IntPtr lAnalyzerHandle) { bool result = false; result = OriginalSDK.CLIENT_StopLoadPic(lAnalyzerHandle); NetGetLastError(result); return result; } /// /// query system information /// 查询系统信息 /// /// Login returns value 登陆ID /// query type 查询类型 /// information buffer 类型对应的数据信息 /// buffer max len 最大长度 /// return information len 返回的信息大小 /// wait time 等待时间 /// failed return false, successful return true 失败返回false 成功返回true private static bool QuerySystemInfo(IntPtr lLoginID, EM_SYS_ABILITY nSystemType, IntPtr pSysInfoBuffer, int maxlen, ref int nSysInfolen, int waittime) { bool result = false; result = OriginalSDK.CLIENT_QuerySystemInfo(lLoginID, (int)nSystemType, pSysInfoBuffer, maxlen, ref nSysInfolen, waittime); NetGetLastError(result); return result; } /// /// query system information /// 查询系统信息 /// /// Login returns value 登陆ID /// query type 查询类型 /// return information object 返回信息对像 /// wait time 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QuerySystemInfo(IntPtr lLoginID, EM_SYS_ABILITY nSystemType, ref object obj, int waittime) { bool result = false; IntPtr pBuf = IntPtr.Zero; Type type = obj.GetType(); int len = Marshal.SizeOf(obj); int nSysInfolen = 0; try { pBuf = Marshal.AllocHGlobal(len); Marshal.StructureToPtr(obj, pBuf, true); result = QuerySystemInfo(lLoginID, nSystemType, pBuf, len, ref nSysInfolen, waittime); obj = Marshal.PtrToStructure(pBuf, type); } finally { Marshal.FreeHGlobal(pBuf); } return result; } /// /// query device log /// 查询设备日志 /// /// Login returns value 登陆ID /// query param 查询参数 /// log buffer 日志数据缓存 /// buffer len 缓存大小 /// return log number 返回日志的个数 /// wait time 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryDeviceLog(IntPtr lLoginID, ref NET_QUERY_DEVICE_LOG_PARAM pQueryParam, IntPtr pLogBuffer, int nLogBufferLen, ref int pRecLogNum, int waittime) { bool result = false; result = OriginalSDK.CLIENT_QueryDeviceLog(lLoginID, ref pQueryParam, pLogBuffer, nLogBufferLen, ref pRecLogNum, waittime); NetGetLastError(result); return result; } /// /// start talk /// 开始对讲 /// /// Login returns value 登陆ID /// audio data callback 语音回调函数 /// user data 用户数据 /// failed return zero, successful return non-zero(talk handle) 失败返回0,成功返回大于0的值 public static IntPtr StartTalk(IntPtr lLoginID, fAudioDataCallBack pfcb, IntPtr dwUser) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartTalkEx(lLoginID, pfcb, dwUser); NetGetLastError(result); return result; } /// /// stop talk /// 关闭对讲 /// /// StartTalk returns value StartTalk返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool StopTalk(IntPtr lTalkHandle) { bool result = false; result = OriginalSDK.CLIENT_StopTalkEx(lTalkHandle); NetGetLastError(result); return result; } /// /// start record /// 开始录音 /// /// Login returns value 登陆ID /// failed return false, successful return true 失败返回false 成功返回true public static bool RecordStart(IntPtr lLoginID) { bool result = false; result = OriginalSDK.CLIENT_RecordStartEx(lLoginID); NetGetLastError(result); return result; } /// /// stop record /// 关闭录音 /// /// Login returns value 登陆ID /// failed return false, successful return true 失败返回false 成功返回true public static bool RecordStop(IntPtr lLoginID) { bool result = false; result = OriginalSDK.CLIENT_RecordStopEx(lLoginID); NetGetLastError(result); return result; } /// /// send data /// 发送数据 /// /// StartTalk returns value StartTalk返回值 /// send buffer 发送数据缓存 /// buffer size 缓存大小 /// failed return zero, successful return non-zero public static int TalkSendData(IntPtr lTalkHandle, IntPtr pSendBuf, uint dwBufSize) { int result = 0; result = OriginalSDK.CLIENT_TalkSendData(lTalkHandle, pSendBuf, dwBufSize); NetGetLastError(result); return result; } /// /// audio decode /// 语音解码 /// /// audio buffer 语音缓存 /// buffer size 缓存大小 public static void AudioDec(IntPtr pAudioDataBuf, uint dwBufSize) { OriginalSDK.CLIENT_AudioDec(pAudioDataBuf, dwBufSize); } /// /// Device control,user malloc param's memory,please refer to the corresponding structure of type /// 设备控制 /// /// loginID:login returns value 登陆ID /// CtrlType 控制类型 /// pointer to control param 控制类型对应的信息指针地址 /// wait time 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool ControlDevice(IntPtr lLoginID, EM_CtrlType type, IntPtr param, int waittime) { bool result = false; result = OriginalSDK.CLIENT_ControlDevice(lLoginID, type, param, waittime); NetGetLastError(result); return result; } /// /// Device control,user malloc param's memory,please refer to the corresponding structure of type /// 设备控制Ex /// /// loginID:login returns value 登陆ID /// CtrlType 控制类型 /// pointer to control in param 控制类型对应的信息入参指针地址 /// pointer to control out param 控制类型对应的信息出参指针地址 /// wait time 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool ControlDeviceEx(IntPtr lLoginID, EM_CtrlType emType, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_ControlDeviceEx(lLoginID, emType, pInBuf, pOutBuf, nWaitTime); NetGetLastError(result); return result; } /// /// query device state /// 查询设备状态 /// /// loginID:login returns value 登陆ID /// query type 查询类型 /// return information object 返回信息对像 /// query struct type 查询结构体的类型 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryDevState(IntPtr lLoginID, int nType, ref object obj, Type typeName, int waittime) { bool result = false; int pRetLen = 0; int nBufLen = 0; IntPtr pBuf = IntPtr.Zero; try { nBufLen = Marshal.SizeOf(typeName); pBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); Marshal.StructureToPtr(obj, pBuf, true); result = OriginalSDK.CLIENT_QueryDevState(lLoginID, nType, pBuf, nBufLen, ref pRetLen, waittime); NetGetLastError(result); obj = Marshal.PtrToStructure(pBuf, typeName); } finally { Marshal.FreeHGlobal(pBuf); nBufLen = 0; } return result; } public static bool QueryDevState(IntPtr lLoginID, EM_DEVICE_STATE nType, ref object obj, Type typeName, int waittime) { bool result = false; int pRetLen = 0; int nBufLen = 0; IntPtr pBuf = IntPtr.Zero; try { nBufLen = Marshal.SizeOf(typeName); pBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); Marshal.StructureToPtr(obj, pBuf, true); result = OriginalSDK.CLIENT_QueryDevState(lLoginID, (int)nType, pBuf, nBufLen, ref pRetLen, waittime); NetGetLastError(result); obj = Marshal.PtrToStructure(pBuf, typeName); } finally { Marshal.FreeHGlobal(pBuf); nBufLen = 0; } return result; } /// /// query device state /// 查询设备状态 /// /// loginID:login returns value 登陆ID /// query type 查询类型 /// return information object 返回信息对像 /// query struct type 查询结构体的类型 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryDevState(IntPtr lLoginID, int nType, ref object[] objs, Type typeName, int waittime) { bool result = false; int pRetLen = 0; int nBufLen = 0; IntPtr pBuf = IntPtr.Zero; int nQueryNum = objs.Length; try { nBufLen = Marshal.SizeOf(typeName) * nQueryNum; pBuf = Marshal.AllocHGlobal(nBufLen); for (int index = 0; index < nQueryNum; index++) { IntPtr pIndexBuf = IntPtr.Add(pBuf, index * Marshal.SizeOf(typeName)); if (objs[index] != null && objs[index].GetType() == typeName) { Marshal.StructureToPtr(objs[index], pIndexBuf, true); } else { for (int i = 0; i < Marshal.SizeOf(typeName); i++) { Marshal.WriteByte(pIndexBuf, i, 0); } } } result = OriginalSDK.CLIENT_QueryDevState(lLoginID, nType, pBuf, nBufLen, ref pRetLen, waittime); NetGetLastError(result); if (result) { int nRetNum = pRetLen / Marshal.SizeOf(typeName); objs = new object[nRetNum]; for (int i = 0; i < nRetNum; i++) { objs[i] = Marshal.PtrToStructure(IntPtr.Add(pBuf, i * Marshal.SizeOf(typeName)), typeName); } } } finally { Marshal.FreeHGlobal(pBuf); nBufLen = 0; } return result; } public static bool QueryDevState(IntPtr lLoginID, int nType, ref byte[] byStates, int waittime) { bool result = false; int pRetLen = 0; int nBufLen = 1024 * 1024; IntPtr pBuf = IntPtr.Zero; try { pBuf = Marshal.AllocHGlobal(nBufLen); result = OriginalSDK.CLIENT_QueryDevState(lLoginID, nType, pBuf, nBufLen, ref pRetLen, waittime); NetGetLastError(result); if (pRetLen == 0) { byStates = new byte[0]; } else { byStates = new byte[pRetLen]; for (int i = 0; i < byStates.Length; i++) { byStates[i] = Marshal.ReadByte(IntPtr.Add(pBuf, i)); } } } finally { Marshal.FreeHGlobal(pBuf); nBufLen = 0; } return result; } /// /// New Search system capacity information /// 查询系统能力信息 /// /// CLIENT_Login's return value 登陆ID /// Channel id 通道号 /// Command string 查询命令 /// Object correspondence to the Command 返回的数据 /// obj's type 查询命令对应结构体的类型 /// Wait timeout,The default setting is 1000 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryNewSystemInfo(IntPtr lLoginID, Int32 lChannel, string strCommand, ref object obj, Type typeName, int waittime) { bool returnValue = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pRetLen = IntPtr.Zero; UInt32 nRetLen = 0; UInt32 nBufSize = 1024 * 1024; UInt32 nError = 0; try { pInBuf = Marshal.AllocHGlobal((int)nBufSize);//Allocation of fixed specified the size of the memory space pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); if (obj.GetType() == typeName) //if obj is boxinged type of typeName, some param(ex. dwsize) need trans to unmanaged memory { Marshal.StructureToPtr(obj, pOutBuf, true); } else { for (int i = 0; i < Marshal.SizeOf(typeName); i++) { Marshal.WriteByte(pOutBuf, i, 0); } } pRetLen = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(UInt32))); if (pInBuf != IntPtr.Zero && pOutBuf != IntPtr.Zero) { returnValue = OriginalSDK.CLIENT_QueryNewSystemInfo(lLoginID, strCommand, lChannel, pInBuf, nBufSize, ref nError, waittime); NetGetLastError(returnValue); if (returnValue == true) { returnValue = OriginalSDK.CLIENT_ParseData(strCommand, pInBuf, pOutBuf, (UInt32)Marshal.SizeOf(typeName), pRetLen); nRetLen = (UInt32)Marshal.PtrToStructure(pRetLen, typeof(UInt32)); obj = Marshal.PtrToStructure(pOutBuf, typeName); } } NetGetLastError(returnValue); } finally { Marshal.FreeHGlobal(pInBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pOutBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pRetLen);//Release fixed memory allocation pInBuf = IntPtr.Zero; pOutBuf = IntPtr.Zero; pRetLen = IntPtr.Zero; } return returnValue; } /// /// New Search system capacity information /// 查询系统能力信息(带额外信息) /// /// CLIENT_Login's return value 登陆ID /// Channel id 通道号 /// Command string 查询命令 /// Object correspondence to the Command 返回的数据 /// obj's type 查询命令对应结构体的类型 /// Wait timeout,The default setting is 1000 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryNewSystemInfoEx(IntPtr lLoginID, Int32 lChannel, string strCommand, ref object obj, Type typeName, Object extendInfo, Type extendInfoType, int waittime) { bool returnValue = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pRetLen = IntPtr.Zero; UInt32 nRetLen = 0; UInt32 nBufSize = 1024 * 1024; UInt32 nError = 0; IntPtr pExtendInfo = IntPtr.Zero; try { if (extendInfo != null && extendInfoType != null) { pExtendInfo = Marshal.AllocHGlobal(Marshal.SizeOf(extendInfoType)); Marshal.StructureToPtr(extendInfo, pExtendInfo, true); } pInBuf = Marshal.AllocHGlobal((int)nBufSize); // Allocation of fixed specified the size of the memory space pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); pRetLen = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(UInt32))); if (pInBuf != IntPtr.Zero && pOutBuf != IntPtr.Zero) { returnValue = OriginalSDK.CLIENT_QueryNewSystemInfoEx(lLoginID, strCommand, lChannel, pInBuf, nBufSize, ref nError, pExtendInfo, waittime); NetGetLastError(returnValue); if (returnValue == true) { returnValue = OriginalSDK.CLIENT_ParseData(strCommand, pInBuf, pOutBuf, (UInt32)Marshal.SizeOf(typeName), pRetLen); nRetLen = (UInt32)Marshal.PtrToStructure(pRetLen, typeof(UInt32)); obj = Marshal.PtrToStructure(pOutBuf, typeName); } } NetGetLastError(returnValue); } finally { Marshal.FreeHGlobal(pExtendInfo); Marshal.FreeHGlobal(pInBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pOutBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pRetLen);//Release fixed memory allocation pExtendInfo = IntPtr.Zero; pInBuf = IntPtr.Zero; pOutBuf = IntPtr.Zero; pRetLen = IntPtr.Zero; } return returnValue; } /// /// start search record by search filter /// 打开查找录像文件 /// /// Lonin return value 登陆ID /// Record Type 录像类型 /// search condition 查找条件 /// type of condition struct 查找条件对应结构体的类型 /// lFindeHandle 返回的查找ID /// Wait timeout, million second 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool FindRecord(IntPtr lLoginID, EM_NET_RECORD_TYPE emRecordType, object oCondition, Type tyCondition, ref IntPtr lFindID, int waittime) { bool result = false; IntPtr pCondition = IntPtr.Zero; NET_IN_FIND_RECORD_PARAM stuInParam = new NET_IN_FIND_RECORD_PARAM(); NET_OUT_FIND_RECORD_PARAM stuOutParam = new NET_OUT_FIND_RECORD_PARAM(); stuInParam.dwSize = (uint)Marshal.SizeOf(stuInParam); stuInParam.emType = emRecordType; try { if (oCondition == null || tyCondition == null) { stuInParam.pQueryCondition = IntPtr.Zero; } else { pCondition = Marshal.AllocHGlobal(Marshal.SizeOf(tyCondition)); Marshal.StructureToPtr(oCondition, pCondition, true); stuInParam.pQueryCondition = pCondition; } stuOutParam.dwSize = (uint)Marshal.SizeOf(stuOutParam); result = OriginalSDK.CLIENT_FindRecord(lLoginID, ref stuInParam, ref stuOutParam, waittime); NetGetLastError(result); lFindID = stuOutParam.lFindeHandle; } finally { Marshal.FreeHGlobal(pCondition); } return result; } /// /// search record :nFilecount: need search items, return value as media file items return value /// 查找录像文件 /// /// FindRecord's return value FindRecord返回值 /// max number of search 最大的个数 /// return number 返回的个数 /// list of Record 返回的录像列表 /// typeof Record 查找录像对应的结构的类型 /// Wait timeout, million second 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static int FindNextRecord(IntPtr lFindeHandle, int nMaxNum, ref int nRetNum, ref List ls, Type tyRecord, int waittime) { int result = 0; IntPtr pRecordList = IntPtr.Zero; try { NET_IN_FIND_NEXT_RECORD_PARAM stuInParam = new NET_IN_FIND_NEXT_RECORD_PARAM(); stuInParam.dwSize = (uint)Marshal.SizeOf(stuInParam); stuInParam.lFindeHandle = lFindeHandle; stuInParam.nFileCount = nMaxNum; NET_OUT_FIND_NEXT_RECORD_PARAM stuOutParam = new NET_OUT_FIND_NEXT_RECORD_PARAM(); stuOutParam.dwSize = (uint)Marshal.SizeOf(stuOutParam); stuOutParam.nMaxRecordNum = nMaxNum; pRecordList = Marshal.AllocHGlobal(Marshal.SizeOf(tyRecord) * nMaxNum); for (int i = 0; i < nMaxNum; i++) { Marshal.StructureToPtr(ls[i], IntPtr.Add(pRecordList, Marshal.SizeOf(tyRecord) * i), true); } stuOutParam.pRecordList = pRecordList; result = OriginalSDK.CLIENT_FindNextRecord(ref stuInParam, ref stuOutParam, waittime); if (result >= 0) { nRetNum = stuOutParam.nRetRecordNum; ls.Clear(); for (int i = 0; i < nRetNum; i++) { ls.Add(Marshal.PtrToStructure(IntPtr.Add(pRecordList, Marshal.SizeOf(tyRecord) * i), tyRecord)); } } else { NetGetLastError(result); } } finally { Marshal.FreeHGlobal(pRecordList); } return result; } /// /// end record search /// 关闭查找 /// /// FindRecord's return value FindRecord返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool FindRecordClose(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_FindRecordClose(lFindHandle); NetGetLastError(result); return result; } /// /// search records' count /// 查找录像的个数 /// /// FindRecord's return value FindRecord返回值 /// records' count 录像的个数 /// Wait timeout, million second 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryRecordCount(IntPtr lFindHandle, ref int nRecordCount, int waittime) { bool result = false; NET_IN_QUEYT_RECORD_COUNT_PARAM stuInParam = new NET_IN_QUEYT_RECORD_COUNT_PARAM(); stuInParam.dwSize = (uint)Marshal.SizeOf(stuInParam); stuInParam.lFindeHandle = lFindHandle; NET_OUT_QUEYT_RECORD_COUNT_PARAM stuOutParam = new NET_OUT_QUEYT_RECORD_COUNT_PARAM(); stuOutParam.dwSize = (uint)Marshal.SizeOf(stuOutParam); result = OriginalSDK.CLIENT_QueryRecordCount(ref stuInParam, ref stuOutParam, waittime); nRecordCount = stuOutParam.nRecordCount; NetGetLastError(result); return result; } #region <> /// /// start find number state /// 打开查找数字统计状态 /// /// CLIENT_Login's return value 登陆ID /// In Param 输入参数 /// Out Param, dwsize need assign too 输出参数 /// Find Handle 返回查找名柄 public static IntPtr StartFindNumberStat(IntPtr lLoginID, ref NET_IN_FINDNUMBERSTAT pstInParam, ref NET_OUT_FINDNUMBERSTAT pstOutParam) { IntPtr pRet = IntPtr.Zero; pRet = OriginalSDK.CLIENT_StartFindNumberStat(lLoginID, ref pstInParam, ref pstOutParam); NetGetLastError(pRet); return pRet; } /// /// do find number state /// 查找数字统计状态 /// /// StartFindNumberStat return value StartFindNumberStat返回值 /// in param 输入参数 /// number stats' array. 数字统计状态的数组 /// larger than 0: success. small than 0: fail 大于0成功,小于0失败 public static int DoFindNumberStat(IntPtr lFindHandle, ref NET_IN_DOFINDNUMBERSTAT pstInParam, ref NET_NUMBERSTAT[] pNumberStats) { int nRet = 0; uint nMaxCount = pstInParam.nCount; IntPtr pBuffer = IntPtr.Zero; NET_OUT_DOFINDNUMBERSTAT stuOutParam = new NET_OUT_DOFINDNUMBERSTAT(); int nUnitBufferSize = Marshal.SizeOf(typeof(NET_NUMBERSTAT)); try { pBuffer = Marshal.AllocHGlobal(nUnitBufferSize * (int)nMaxCount); stuOutParam.dwSize = (uint)Marshal.SizeOf(stuOutParam); stuOutParam.pstuNumberStat = pBuffer; stuOutParam.nBufferLen = (int)nMaxCount * nUnitBufferSize; stuOutParam.nCount = (int)pstInParam.nCount; for (int i = 0; i < nMaxCount; i++) { NET_NUMBERSTAT item = new NET_NUMBERSTAT(); item.dwSize = (uint)Marshal.SizeOf(item); Marshal.StructureToPtr(item, IntPtr.Add(pBuffer, i * nUnitBufferSize), true); } nRet = OriginalSDK.CLIENT_DoFindNumberStat(lFindHandle, ref pstInParam, ref stuOutParam); NetGetLastError(nRet); if (nRet > 0) { pNumberStats = new NET_NUMBERSTAT[stuOutParam.nCount]; for (int i = 0; i < stuOutParam.nCount; i++) { pNumberStats[i] = (NET_NUMBERSTAT)Marshal.PtrToStructure(IntPtr.Add(pBuffer, i * nUnitBufferSize), typeof(NET_NUMBERSTAT)); } } } finally { Marshal.FreeHGlobal(pBuffer); pBuffer = IntPtr.Zero; } return nRet; } /// /// stop find number state /// 关闭查找数字统计状态 /// /// StartFindNumberStat return value StartFindNumberStat返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool StopFindNumberStat(IntPtr lFindHandle) { bool bRet = false; bRet = OriginalSDK.CLIENT_StopFindNumberStat(lFindHandle); NetGetLastError(bRet); return bRet; } /// /// subscribe video statistical summary /// 订阅视频统计摘要信息 /// /// CLIENT_Login's return value 登陆ID /// in param 输入参数 /// out param, not useful, dwsize need assign too 输出参数 /// Wait timeout, million second 等待时间 /// Attach Handle 订阅句柄 public static IntPtr AttachVideoStatSummary(IntPtr lLoginID, ref NET_IN_ATTACH_VIDEOSTAT_SUM pInParam, ref NET_OUT_ATTACH_VIDEOSTAT_SUM pOutParam, int nWaitTime) { IntPtr pRet = IntPtr.Zero; pRet = OriginalSDK.CLIENT_AttachVideoStatSummary(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(pRet); return pRet; } /// /// unsubscribe video statistical summary /// 取消订阅视频统计摘要信息 /// /// AttachVideoStatSummary returns value AttachVideoStatSummary返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool DetachVideoStatSummary(IntPtr lAttachHandle) { bool bRet = false; bRet = OriginalSDK.CLIENT_DetachVideoStatSummary(lAttachHandle); NetGetLastError(bRet); return bRet; } #endregion #region <> /// /// create transparent serial channel, change front-end device serial to transparent channel status /// 创建透明串口通道 /// /// Login return value 登陆ID /// lower 2 bytes are serial type, 0:serial(232), 1:485 port; higher 2 bytes are channel number, start from 0 TransComType高2个字节表示串口序号,低2个字节表示串口类型 /// serial baud rate,1~8 as 1200,2400,4800,9600,19200,38400,57600,115200 respectively 串口波特率 /// serial data digit 4~8 represent 4~8 digits 串口数据位< /param> /// serial stop digit 1 represent 1 digit, 2 represent 1-5 digit(s), 3 represent 2 digits 串口停止位 /// serial inspection digit,1:odd,2:even,3: none 串口检测数据 /// serial data callback, recall info sent from front-end device 串口数据回调 /// user data 用户数据 /// successful return to transparent serial ID,failed return to 0. 失败返回0,成功返回大于0的值 public static IntPtr CreateTransComChannel(IntPtr lLoginID, int TransComType, uint baudrate, uint databits, uint stopbits, uint parity, fTransComCallBack cbTransCom, IntPtr dwUser) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_CreateTransComChannel(lLoginID, TransComType, baudrate, databits, stopbits, parity, cbTransCom, dwUser); NetGetLastError(result); return result; } /// /// send transparent serial data, as sent data to front end data /// 透明串口发送数据 /// /// transparent serial ID, interface CreateTransComChannel value CreateTransComChannel返回值 /// transparent serial data to send 发送的数据 /// successful return to TRUE,failed return to FALSE. 失败返回false 成功返回true public static bool SendTransComData(IntPtr lTransComChannel, byte[] byDatas) { bool result = false; IntPtr pBuffer = IntPtr.Zero; uint dwLength = (uint)byDatas.Length; try { pBuffer = Marshal.AllocHGlobal(byDatas.Length); for (int i = 0; i < dwLength; i++) { Marshal.WriteByte(pBuffer, i, byDatas[i]); } result = OriginalSDK.CLIENT_SendTransComData(lTransComChannel, pBuffer, (uint)byDatas.Length); } finally { Marshal.FreeHGlobal(pBuffer); } NetGetLastError(result); return result; } /// /// close transparent channel /// 关闭透明串口通道 /// /// transparent serial ID, interface CreateTransComChannel return value CreateTransComChannel返回值 /// successful return to TRUE,failed return to FALSE 失败返回false 成功返回true public static bool DestroyTransComChannel(IntPtr lTransComChannel) { bool result = false; result = OriginalSDK.CLIENT_DestroyTransComChannel(lTransComChannel); NetGetLastError(result); return result; } #endregion <> #region <> /// /// Set Security Key /// 设置安全密钥 /// /// Play Handle 播放名柄 /// Security Key 安全密钥 /// failed return false, successful return true 失败返回false 成功返回true public static bool NetSetSecurityKey(IntPtr lPlayHandle, string szKey) { bool result = OriginalSDK.CLIENT_SetSecurityKey(lPlayHandle, szKey, (uint)szKey.Length); NetGetLastError(result); return result; } #endregion #region <> public static bool QueryMatrixCardInfo(IntPtr lLoginID, ref NET_MATRIX_CARD_LIST pstuCardList, int nWaitTime) { bool result = OriginalSDK.CLIENT_QueryMatrixCardInfo(lLoginID, ref pstuCardList, nWaitTime); NetGetLastError(result); return result; } public static bool GetSplitCaps(IntPtr lLoginId, int nChannel, ref NET_SPLIT_CAPS stuCaps, int nWaitTime) { bool result = OriginalSDK.CLIENT_GetSplitCaps(lLoginId, nChannel, ref stuCaps, nWaitTime); NetGetLastError(result); return result; } public static bool GetSplitMode(IntPtr lLoginID, int nChannel, ref NET_SPLIT_MODE_INFO stuSplitInfo, int nWaitTime) { bool result = OriginalSDK.CLIENT_GetSplitMode(lLoginID, nChannel, ref stuSplitInfo, nWaitTime); NetGetLastError(result); return result; } public static bool SetSplitMode(IntPtr lLoginID, int nChannel, ref NET_SPLIT_MODE_INFO stuSplitInfo, int nWaitTime) { bool result = OriginalSDK.CLIENT_SetSplitMode(lLoginID, nChannel, ref stuSplitInfo, nWaitTime); NetGetLastError(result); return result; } public static bool OpenSplitWindow(IntPtr lLoginID, ref NET_IN_SPLIT_OPEN_WINDOW pInParam, ref NET_OUT_SPLIT_OPEN_WINDOW pOutParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_OpenSplitWindow(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 设置显示源(pInparam, pOutParam内存由用户申请释放) /// set display source,user malloc and free (pInParam's and pOutParam's)memory /// public static bool MatrixSetCameras(IntPtr lLoginID, ref NET_IN_MATRIX_SET_CAMERAS pInParam, ref NET_OUT_MATRIX_SET_CAMERAS pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_MatrixSetCameras(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } // get all valid display source, return length is stuCameras.Length public static bool MatrixGetCameras(IntPtr lLoginID, out NET_MATRIX_CAMERA_INFO[] stuCameras, int nMaxCameraCount, int nWaitTime) { bool result = false; stuCameras = new NET_MATRIX_CAMERA_INFO[nMaxCameraCount]; NET_IN_MATRIX_GET_CAMERAS stuInParam = new NET_IN_MATRIX_GET_CAMERAS(); stuInParam.dwSize = (uint)Marshal.SizeOf(stuInParam.GetType()); NET_OUT_MATRIX_GET_CAMERAS stuOutParam = new NET_OUT_MATRIX_GET_CAMERAS(); stuOutParam.dwSize = (uint)Marshal.SizeOf(stuOutParam.GetType()); try { int nBuflen = Marshal.SizeOf(typeof(NET_MATRIX_CAMERA_INFO)) * nMaxCameraCount; stuOutParam.pstuCameras = Marshal.AllocHGlobal(nBuflen);//开辟内存 for (int i = 0; i < nMaxCameraCount; i++) { stuCameras[i].dwSize = (uint)Marshal.SizeOf(stuCameras[i].GetType()); stuCameras[i].stuRemoteDevice.dwSize = (uint)Marshal.SizeOf(stuCameras[i].stuRemoteDevice.GetType()); IntPtr pstuCamTemp = IntPtr.Add(stuOutParam.pstuCameras, Marshal.SizeOf(typeof(NET_MATRIX_CAMERA_INFO)) * i); Marshal.StructureToPtr(stuCameras[i], pstuCamTemp, true); } stuOutParam.nMaxCameraCount = nMaxCameraCount; result = OriginalSDK.CLIENT_MatrixGetCameras(lLoginID, ref stuInParam, ref stuOutParam, nWaitTime); NetGetLastError(result); if (result) { int nRetCount = Math.Min(stuOutParam.nMaxCameraCount, stuOutParam.nRetCameraCount); stuCameras = new NET_MATRIX_CAMERA_INFO[nRetCount]; for (int i = 0; i < nRetCount; i++) { IntPtr pstuCamTemp = IntPtr.Add(stuOutParam.pstuCameras, Marshal.SizeOf(typeof(NET_MATRIX_CAMERA_INFO)) * i); stuCameras[i] = (NET_MATRIX_CAMERA_INFO)Marshal.PtrToStructure(pstuCamTemp, typeof(NET_MATRIX_CAMERA_INFO)); } } } finally { Marshal.FreeHGlobal(stuOutParam.pstuCameras); } return result; } public static bool SetSplitSource(IntPtr lLoginID, int nChannel, int nWindow, NET_SPLIT_SOURCE[] stuSplitSrcs, int nWaitTime) { bool result = false; IntPtr pstuSplitSrc = IntPtr.Zero; try { pstuSplitSrc = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_SPLIT_SOURCE)) * stuSplitSrcs.Length); for (int i = 0; i < stuSplitSrcs.Length; i++) { IntPtr pstuSplitSrcTemp = IntPtr.Add(pstuSplitSrc, Marshal.SizeOf(typeof(NET_SPLIT_SOURCE)) * i); Marshal.StructureToPtr(stuSplitSrcs[i], pstuSplitSrcTemp, true); } result = OriginalSDK.CLIENT_SetSplitSource(lLoginID, nChannel, nWindow, pstuSplitSrc, stuSplitSrcs.Length, nWaitTime); } finally { Marshal.FreeHGlobal(pstuSplitSrc); } NetGetLastError(result); return result; } public static bool SetSplitSourceEx(IntPtr lLoginID, NET_IN_SET_SPLIT_SOURCE inParam, ref NET_OUT_SET_SPLIT_SOURCE outParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_SetSplitSourceEx(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } #endregion #region <> public static bool GetNewDevConfig(IntPtr lLoginID, Int32 lChannel, string strCommand, ref object obj, Type typeName, int waittime, IntPtr pReserved = new IntPtr()) { bool returnValue = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pLastBuf = IntPtr.Zero; UInt32 nBufSize = 1024 * 1024; int nError = 0; try { pInBuf = Marshal.AllocHGlobal((int)nBufSize);//Allocation of fixed specified the size of the memory space for (int i = 0; i < nBufSize; i++) { Marshal.WriteByte(pInBuf, i, 0); } pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); if (obj.GetType() == typeName) //if obj is boxinged type of typeName, some param(ex. dwsize) need trans to unmanaged memory { Marshal.StructureToPtr(obj, pOutBuf, true); } else { for (int i = 0; i < Marshal.SizeOf(typeName); i++) { Marshal.WriteByte(pOutBuf, i, 0); } } pLastBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(uint))); if (pInBuf != IntPtr.Zero && pOutBuf != IntPtr.Zero) { returnValue = OriginalSDK.CLIENT_GetNewDevConfig(lLoginID, strCommand, lChannel, pInBuf, nBufSize, out nError, waittime, pReserved); if (returnValue == true) { returnValue = OriginalSDK.CLIENT_ParseData(strCommand, pInBuf, pOutBuf, (UInt32)Marshal.SizeOf(typeName), pLastBuf); obj = Marshal.PtrToStructure(pOutBuf, typeName); } } } finally { Marshal.FreeHGlobal(pInBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pOutBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pLastBuf);//Release fixed memory allocation pInBuf = IntPtr.Zero; pOutBuf = IntPtr.Zero; pLastBuf = IntPtr.Zero; } NetGetLastError(returnValue); return returnValue; } //get public static bool GetNewDevConfig(IntPtr lLoginID, Int32 lChannel, string strCommand, ref object[] objs, Type typeName, int waittime, IntPtr pReserved = new IntPtr()) { bool returnValue = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pRetBytes = IntPtr.Zero;//pointer to int UInt32 nInBufSize = 1024 * 1024; int nOutBufSize = Marshal.SizeOf(typeName) * objs.Length; int nError = 0; try { pInBuf = Marshal.AllocHGlobal((int)nInBufSize);//Allocation of fixed specified the size of the memory space for (int i = 0; i < nInBufSize; i++) { Marshal.WriteByte(pInBuf, i, 0); } pOutBuf = Marshal.AllocHGlobal(nOutBufSize); for (int index = 0; index < objs.Length; index++) { IntPtr pOutBufOfIndex = pOutBuf + index * Marshal.SizeOf(typeName); if (objs[index].GetType() == typeName) //if obj is boxinged type of typeName, some param(ex. dwsize) need trans to unmanaged memory { Marshal.StructureToPtr(objs[index], pOutBufOfIndex, true); } else { for (int i = 0; i < Marshal.SizeOf(typeName); i++) { Marshal.WriteByte(pOutBufOfIndex, i, 0); } } } pRetBytes = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int))); Marshal.WriteInt32(pRetBytes, 0); if (pInBuf != IntPtr.Zero && pOutBuf != IntPtr.Zero) { returnValue = OriginalSDK.CLIENT_GetNewDevConfig(lLoginID, strCommand, lChannel, pInBuf, nInBufSize, out nError, waittime, pReserved); if (returnValue == true) { returnValue = OriginalSDK.CLIENT_ParseData(strCommand, pInBuf, pOutBuf, (uint)nOutBufSize, pRetBytes); if (returnValue) { int nRetStu = Marshal.ReadInt32(pRetBytes) / Marshal.SizeOf(typeName); objs = new object[nRetStu]; for (int i = 0; i < nRetStu; i++) { objs[i] = Marshal.PtrToStructure(IntPtr.Add(pOutBuf, i * Marshal.SizeOf(typeName)), typeName); } } } } } finally { Marshal.FreeHGlobal(pInBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pOutBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pRetBytes); pInBuf = IntPtr.Zero; pOutBuf = IntPtr.Zero; pRetBytes = IntPtr.Zero; } NetGetLastError(returnValue); return returnValue; } /// /// new version--Set the device information for internal use command function /// /// Equipment User LoginID:CLIENT_Login return value /// Channel number /// Preparation of command /// objectObject /// Type Name /// Wait Time /// true:success;false:failure public static bool SetNewDevConfig(IntPtr lLoginID, int lChannel, string strCommand, object obj, Type typeName, int waittime) { bool returnValue = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; UInt32 nBufSize = 1024 * 1024; int nRestart = 0; int nError = 0; try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); for (int i = 0; i < Marshal.SizeOf(typeName); i++) { Marshal.WriteByte(pInBuf, i, 0); } pOutBuf = Marshal.AllocHGlobal((int)nBufSize); for (int i = 0; i < nBufSize; i++) { Marshal.WriteByte(pOutBuf, i, 0); } Marshal.StructureToPtr(obj, pInBuf, true); returnValue = OriginalSDK.CLIENT_PacketData(strCommand, pInBuf, (UInt32)Marshal.SizeOf(typeName), pOutBuf, nBufSize); if (returnValue) { returnValue = OriginalSDK.CLIENT_SetNewDevConfig(lLoginID, strCommand, lChannel, pOutBuf, nBufSize, ref nError, ref nRestart, waittime); } } finally { Marshal.FreeHGlobal(pInBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pOutBuf);//Release fixed memory allocation pInBuf = IntPtr.Zero; pOutBuf = IntPtr.Zero; } NetGetLastError(returnValue); return returnValue; } public static bool PacketData(string szCommand, IntPtr lpInBuffer, uint dwInBufferSize, IntPtr szOutBuffer, uint dwOutFufferSize) { bool result = false; result = OriginalSDK.CLIENT_PacketData(szCommand, lpInBuffer, dwInBufferSize, szOutBuffer, dwOutFufferSize); NetGetLastError(result); return result; } public static bool SetNewDevConfigs(IntPtr lLoginID, int lChannel, string strCommand, object[] objs, Type typeName, int waittime) { bool returnValue = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; UInt32 nBufSize = (uint)(1024 * 1024 * objs.Length); int nRestart = 0; int nError = 0; try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeName) * objs.Length); for (int index = 0; index < objs.Length; index++) { IntPtr pInBufTemp = IntPtr.Add(pInBuf, index * Marshal.SizeOf(typeName)); for (int i = 0; i < Marshal.SizeOf(typeName); i++) { Marshal.WriteByte(pInBufTemp, i, 0); } Marshal.StructureToPtr(objs[index], pInBufTemp, true); } pOutBuf = Marshal.AllocHGlobal((int)nBufSize); for (int i = 0; i < nBufSize; i++) { Marshal.WriteByte(pOutBuf, i, 0); } returnValue = OriginalSDK.CLIENT_PacketData(strCommand, pInBuf, (UInt32)(Marshal.SizeOf(typeName) * objs.Length), pOutBuf, nBufSize); if (returnValue) { returnValue = OriginalSDK.CLIENT_SetNewDevConfig(lLoginID, strCommand, lChannel, pOutBuf, nBufSize, ref nError, ref nRestart, waittime); } } finally { Marshal.FreeHGlobal(pInBuf);//Release fixed memory allocation Marshal.FreeHGlobal(pOutBuf);//Release fixed memory allocation pInBuf = IntPtr.Zero; pOutBuf = IntPtr.Zero; } NetGetLastError(returnValue); return returnValue; } public static bool GetOperateConfig(IntPtr lLoginID, EM_CFG_OPERATE_TYPE cfg_type, int lChannel, ref object obj, Type typeName, int waittime) { bool result = false; IntPtr outPtr = IntPtr.Zero; try { outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); Marshal.StructureToPtr(obj, outPtr, true); result = OriginalSDK.CLIENT_GetConfig(lLoginID, (int)cfg_type, lChannel, outPtr, (uint)Marshal.SizeOf(typeName), waittime, IntPtr.Zero); NetGetLastError(result); obj = Marshal.PtrToStructure(outPtr, typeName); } finally { Marshal.FreeHGlobal(outPtr); } return result; } public static bool SetOperateConfig(IntPtr lLoginID, EM_CFG_OPERATE_TYPE cfg_type, int lChannel, object obj, Type typeName, int waittime) { bool result = false; IntPtr inPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); Marshal.StructureToPtr(obj, inPtr, true); result = OriginalSDK.CLIENT_SetConfig(lLoginID, (int)cfg_type, lChannel, inPtr, (uint)Marshal.SizeOf(typeName), waittime, IntPtr.Zero, IntPtr.Zero); NetGetLastError(result); } finally { Marshal.FreeHGlobal(inPtr); } return result; } /// /// 考勤机 - 读取设置 /// /// /// /// /// /// /// public static bool GetAttendanceConfig(IntPtr lLoginID, int lChannel, ref object obj, Type typeName, int waittime) { bool result = false; IntPtr outPtr = IntPtr.Zero; try { outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); Marshal.StructureToPtr(obj, outPtr, true); result = OriginalSDK.CLIENT_GetConfig(lLoginID, (int)EM_CFG_OPERATE_TYPE.ACCESSCTL_KEYBINDINGINFOCFG, lChannel, outPtr, (uint)Marshal.SizeOf(typeName), waittime, IntPtr.Zero); NetGetLastError(!result); obj = Marshal.PtrToStructure(outPtr, typeName); } finally { Marshal.FreeHGlobal(outPtr); } return result; } /// /// 考勤机 - 设置配置 /// /// /// /// /// /// /// public static bool SetAttendanceConfig(IntPtr lLoginID, int lChannel, object obj, Type typeName, int waittime) { bool result = false; IntPtr inPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeName)); Marshal.StructureToPtr(obj, inPtr, true); result = OriginalSDK.CLIENT_SetConfig(lLoginID, (int)EM_CFG_OPERATE_TYPE.ACCESSCTL_KEYBINDINGINFOCFG, lChannel, inPtr, (uint)Marshal.SizeOf(typeName), waittime, IntPtr.Zero, IntPtr.Zero); NetGetLastError(result); } finally { Marshal.FreeHGlobal(inPtr); } return result; } #endregion #region <> /// /// Query device time /// /// CLIENT_Login's return value /// [out] Device Time /// Wait timeout, million second /// failed return false, successful return true public static bool QueryDeviceTime(IntPtr lLoginID, ref NET_TIME pDeviceTime, int waittime) { bool result = false; result = OriginalSDK.CLIENT_QueryDeviceTime(lLoginID, ref pDeviceTime, waittime); NetGetLastError(result); return result; } /// /// Set device time /// /// CLIENT_Login's return value /// deivce time /// failed return false, successful return true public static bool SetupDeviceTime(IntPtr lLoginID, NET_TIME DeviceTime) { bool result = false; result = OriginalSDK.CLIENT_SetupDeviceTime(lLoginID, ref DeviceTime); NetGetLastError(result); return result; } /// /// remove anti-submarine alarm /// /// CLIENT_Login's return value /// remove anti-submarine alarm input parameter /// remove anti-submarine alarm output parameter /// Wait timeout, million second /// failed return false, successful return true public static bool ClearRepeatEnter(IntPtr lLoginID, ref NET_IN_CLEAR_REPEAT_ENTER pInParam, ref NET_OUT_CLEAR_REPEAT_ENTER pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ClearRepeatEnter(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool FaceInfoOpreate(IntPtr lLoginID, EM_FACEINFO_OPREATE_TYPE emType, IntPtr pInParam, IntPtr pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_FaceInfoOpreate(lLoginID, emType, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } public static IntPtr StartFindFaceInfo(IntPtr lLoginID, NET_IN_FACEINFO_START_FIND inParam, ref NET_OUT_FACEINFO_START_FIND outParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartFindFaceInfo(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool DoFindFaceInfo(IntPtr lFindHandle, NET_IN_FACEINFO_DO_FIND inParam, ref NET_OUT_FACEINFO_DO_FIND outParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DoFindFaceInfo(lFindHandle, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool StopFindFaceInfo(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_StopFindFaceInfo(lFindHandle); NetGetLastError(result); return result; } #endregion #region <> public static bool InsertOperateAccessUserService(IntPtr lLoginID, NET_ACCESS_USER_INFO[] stInParam, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = stInParam.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pInArrayBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_USER_SERVICE_INSERT stuInInfo = new NET_IN_ACCESS_USER_SERVICE_INSERT(); NET_OUT_ACCESS_USER_SERVICE_INSERT stuOutInfo = new NET_OUT_ACCESS_USER_SERVICE_INSERT(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pInArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_ACCESS_USER_INFO)) * stuCount); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); for (int i = 0; i < stuCount; i++) { IntPtr pDst = IntPtr.Add(pInArrayBuf, Marshal.SizeOf(typeof(NET_ACCESS_USER_INFO)) * i); Marshal.StructureToPtr(stInParam[i], pDst, true); } stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.nInfoNum = stuCount; stuInInfo.pUserInfo = pInArrayBuf; stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessUserService(lLoginID, EM_ACCESS_CTL_USER_SERVICE.INSERT, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_USER_SERVICE_INSERT)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_USER_SERVICE_INSERT)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pInArrayBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } public static bool InsertOperateAccessCardService(IntPtr lLoginID, NET_ACCESS_CARD_INFO[] stInParam, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = stInParam.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pInArrayBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_CARD_SERVICE_INSERT stuInInfo = new NET_IN_ACCESS_CARD_SERVICE_INSERT(); NET_OUT_ACCESS_CARD_SERVICE_INSERT stuOutInfo = new NET_OUT_ACCESS_CARD_SERVICE_INSERT(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pInArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_ACCESS_CARD_INFO)) * stuCount); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); for (int i = 0; i < stuCount; i++) { IntPtr pDst = IntPtr.Add(pInArrayBuf, Marshal.SizeOf(typeof(NET_ACCESS_CARD_INFO)) * i); Marshal.StructureToPtr(stInParam[i], pDst, true); } stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.nInfoNum = stuCount; stuInInfo.pCardInfo = pInArrayBuf; stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessCardService(lLoginID, EM_ACCESS_CTL_CARD_SERVICE.INSERT, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_CARD_SERVICE_INSERT)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_CARD_SERVICE_INSERT)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pInArrayBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } public static bool InsertOperateAccessFingerprintService(IntPtr lLoginID, NET_ACCESS_FINGERPRINT_INFO[] stInParam, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = stInParam.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pInArrayBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_FINGERPRINT_SERVICE_INSERT stuInInfo = new NET_IN_ACCESS_FINGERPRINT_SERVICE_INSERT(); NET_OUT_ACCESS_FINGERPRINT_SERVICE_INSERT stuOutInfo = new NET_OUT_ACCESS_FINGERPRINT_SERVICE_INSERT(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pInArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_ACCESS_FINGERPRINT_INFO)) * stuCount); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); for (int i = 0; i < stuCount; i++) { IntPtr pDst = IntPtr.Add(pInArrayBuf, Marshal.SizeOf(typeof(NET_ACCESS_FINGERPRINT_INFO)) * i); Marshal.StructureToPtr(stInParam[i], pDst, true); } stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.nFpNum = stuCount; stuInInfo.pFingerPrintInfo = pInArrayBuf; stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessFingerprintService(lLoginID, EM_ACCESS_CTL_FINGERPRINT_SERVICE.INSERT, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_FINGERPRINT_SERVICE_INSERT)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_FINGERPRINT_SERVICE_INSERT)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pInArrayBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } public static bool GetOperateAccessUserService(IntPtr lLoginID, string[] userid, out NET_ACCESS_USER_INFO[] stOutParam1, out NET_EM_FAILCODE[] stOutParam2, int nWaitTime) { bool bRet = false; int stuCount = userid.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pOutInfoArrayBuf = IntPtr.Zero; IntPtr pOutErrorArrayBuf = IntPtr.Zero; NET_IN_ACCESS_USER_SERVICE_GET stuInInfo = new NET_IN_ACCESS_USER_SERVICE_GET(); NET_OUT_ACCESS_USER_SERVICE_GET stuOutInfo = new NET_OUT_ACCESS_USER_SERVICE_GET(); try { int userInfoLen = Marshal.SizeOf(typeof(NET_ACCESS_USER_INFO)); pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pOutInfoArrayBuf = Marshal.AllocHGlobal(userInfoLen * stuCount); pOutErrorArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); NET_ACCESS_USER_INFO userInfo = new NET_ACCESS_USER_INFO(); for (int i = 0; i < stuCount; i++) { Marshal.StructureToPtr(userInfo, IntPtr.Add(pOutInfoArrayBuf, userInfoLen * i), true); } stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.szUserID = new NET_STRING_32_USER_ID[100]; stuInInfo.nUserNum = stuCount; for (int i = 0; i < Math.Min(stuCount, stuInInfo.szUserID.Length); i++) { stuInInfo.szUserID[i].szUserID = userid[i]; } stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutErrorArrayBuf; stuOutInfo.pUserInfo = pOutInfoArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessUserService(lLoginID, EM_ACCESS_CTL_USER_SERVICE.GET, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_USER_SERVICE_GET)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_USER_SERVICE_GET)); stOutParam1 = new NET_ACCESS_USER_INFO[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuCount; i++) { IntPtr pDst = IntPtr.Add(pOutInfoArrayBuf, userInfoLen * i); stOutParam1[i] = (NET_ACCESS_USER_INFO)Marshal.PtrToStructure(pDst, typeof(NET_ACCESS_USER_INFO)); } stOutParam2 = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutErrorArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam2[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pOutInfoArrayBuf); Marshal.FreeHGlobal(pOutErrorArrayBuf); } } public static bool GetOperateAccessCardService(IntPtr lLoginID, string[] Cardid, out NET_ACCESS_CARD_INFO[] stOutParam1, out NET_EM_FAILCODE[] stOutParam2, int nWaitTime) { bool bRet = false; int stuCount = Cardid.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pOutInfoArrayBuf = IntPtr.Zero; IntPtr pOutErrorArrayBuf = IntPtr.Zero; NET_IN_ACCESS_CARD_SERVICE_GET stuInInfo = new NET_IN_ACCESS_CARD_SERVICE_GET(); NET_OUT_ACCESS_CARD_SERVICE_GET stuOutInfo = new NET_OUT_ACCESS_CARD_SERVICE_GET(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pOutInfoArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_ACCESS_CARD_INFO)) * stuCount); pOutErrorArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.szCardNo = new NET_STRING_32_CARD_NO[100]; stuInInfo.nCardNum = stuCount; for (int i = 0; i < Math.Min(stuCount, stuInInfo.szCardNo.Length); i++) { stuInInfo.szCardNo[i].szCardNo = Cardid[i]; } stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutErrorArrayBuf; stuOutInfo.pCardInfo = pOutInfoArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessCardService(lLoginID, EM_ACCESS_CTL_CARD_SERVICE.GET, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_CARD_SERVICE_GET)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_CARD_SERVICE_GET)); stOutParam1 = new NET_ACCESS_CARD_INFO[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuCount; i++) { IntPtr pDst = IntPtr.Add(pOutInfoArrayBuf, Marshal.SizeOf(typeof(NET_ACCESS_CARD_INFO)) * i); stOutParam1[i] = (NET_ACCESS_CARD_INFO)Marshal.PtrToStructure(pDst, typeof(NET_ACCESS_CARD_INFO)); } stOutParam2 = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutErrorArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam2[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pOutInfoArrayBuf); Marshal.FreeHGlobal(pOutErrorArrayBuf); } } public static bool GetOperateAccessFingerprintService(IntPtr lLoginID, string userid, IntPtr pFingerprintData, int dataLen, out NET_ACCESS_FINGERPRINT_INFO stOutParam1, int nWaitTime) { bool bRet = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; NET_IN_ACCESS_FINGERPRINT_SERVICE_GET stuInInfo = new NET_IN_ACCESS_FINGERPRINT_SERVICE_GET(); NET_OUT_ACCESS_FINGERPRINT_SERVICE_GET stuOutInfo = new NET_OUT_ACCESS_FINGERPRINT_SERVICE_GET(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.szUserID = userid; stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxFingerDataLength = dataLen; stuOutInfo.pbyFingerData = pFingerprintData; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessFingerprintService(lLoginID, EM_ACCESS_CTL_FINGERPRINT_SERVICE.GET, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_FINGERPRINT_SERVICE_GET)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_FINGERPRINT_SERVICE_GET)); stOutParam1 = new NET_ACCESS_FINGERPRINT_INFO(); stOutParam1.szUserID = userid; stOutParam1.nDuressIndex = stuOutInfo.nDuressIndex; stOutParam1.nPacketLen = stuOutInfo.nSinglePacketLength; stOutParam1.nPacketNum = stuOutInfo.nRetFingerPrintCount; stOutParam1.szFingerPrintInfo = stuOutInfo.pbyFingerData; return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); } } public static bool RemoveOperateAccessUserService(IntPtr lLoginID, string[] userid, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = userid.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_USER_SERVICE_REMOVE stuInInfo = new NET_IN_ACCESS_USER_SERVICE_REMOVE(); NET_OUT_ACCESS_USER_SERVICE_REMOVE stuOutInfo = new NET_OUT_ACCESS_USER_SERVICE_REMOVE(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.szUserID = new NET_STRING_32_USER_ID[100]; stuInInfo.nUserNum = stuCount; for (int i = 0; i < Math.Min(stuCount, stuInInfo.szUserID.Length); i++) { stuInInfo.szUserID[i].szUserID = userid[i]; } stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessUserService(lLoginID, EM_ACCESS_CTL_USER_SERVICE.REMOVE, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_USER_SERVICE_REMOVE)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_USER_SERVICE_REMOVE)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } public static bool RemoveOperateAccessCardService(IntPtr lLoginID, string[] Cardid, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = Cardid.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_CARD_SERVICE_REMOVE stuInInfo = new NET_IN_ACCESS_CARD_SERVICE_REMOVE(); NET_OUT_ACCESS_CARD_SERVICE_REMOVE stuOutInfo = new NET_OUT_ACCESS_CARD_SERVICE_REMOVE(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.szCardNo = new NET_STRING_32_CARD_NO[100]; stuInInfo.nCardNum = stuCount; for (int i = 0; i < Math.Min(stuCount, stuInInfo.szCardNo.Length); i++) { stuInInfo.szCardNo[i].szCardNo = Cardid[i]; } stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessCardService(lLoginID, EM_ACCESS_CTL_CARD_SERVICE.REMOVE, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_CARD_SERVICE_REMOVE)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_CARD_SERVICE_REMOVE)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } public static bool RemoveOperateAccessFingerprintService(IntPtr lLoginID, string[] userid, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = userid.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_FINGERPRINT_SERVICE_REMOVE stuInInfo = new NET_IN_ACCESS_FINGERPRINT_SERVICE_REMOVE(); NET_OUT_ACCESS_FINGERPRINT_SERVICE_REMOVE stuOutInfo = new NET_OUT_ACCESS_FINGERPRINT_SERVICE_REMOVE(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.szUserID = new NET_STRING_32_USER_ID[100]; stuInInfo.nUserNum = stuCount; for (int i = 0; i < Math.Min(stuCount, stuInInfo.szUserID.Length); i++) { stuInInfo.szUserID[i].szUserID = userid[i]; } stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessFingerprintService(lLoginID, EM_ACCESS_CTL_FINGERPRINT_SERVICE.REMOVE, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_FINGERPRINT_SERVICE_REMOVE)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_FINGERPRINT_SERVICE_REMOVE)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } public static bool ClearOperateAccessUserService(IntPtr lLoginID, int nWaitTime) { bool bRet = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; NET_IN_ACCESS_USER_SERVICE_CLEAR stuInInfo = new NET_IN_ACCESS_USER_SERVICE_CLEAR(); NET_OUT_ACCESS_USER_SERVICE_CLEAR stuOutInfo = new NET_OUT_ACCESS_USER_SERVICE_CLEAR(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessUserService(lLoginID, EM_ACCESS_CTL_USER_SERVICE.CLEAR, pInBuf, pOutBuf, nWaitTime); NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); } } public static bool ClearOperateAccessCardService(IntPtr lLoginID, int nWaitTime) { bool bRet = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; NET_IN_ACCESS_CARD_SERVICE_CLEAR stuInInfo = new NET_IN_ACCESS_CARD_SERVICE_CLEAR(); NET_OUT_ACCESS_CARD_SERVICE_CLEAR stuOutInfo = new NET_OUT_ACCESS_CARD_SERVICE_CLEAR(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessCardService(lLoginID, EM_ACCESS_CTL_CARD_SERVICE.CLEAR, pInBuf, pOutBuf, nWaitTime); NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); } } public static bool ClearOperateAccessFingerprintService(IntPtr lLoginID, int nWaitTime) { bool bRet = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; NET_IN_ACCESS_FINGERPRINT_SERVICE_CLEAR stuInInfo = new NET_IN_ACCESS_FINGERPRINT_SERVICE_CLEAR(); NET_OUT_ACCESS_FINGERPRINT_SERVICE_CLEAR stuOutInfo = new NET_OUT_ACCESS_FINGERPRINT_SERVICE_CLEAR(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessFingerprintService(lLoginID, EM_ACCESS_CTL_FINGERPRINT_SERVICE.CLEAR, pInBuf, pOutBuf, nWaitTime); NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); } } public static bool UpdateOperateAccessCardService(IntPtr lLoginID, NET_ACCESS_CARD_INFO[] stInParam, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = stInParam.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pInArrayBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_CARD_SERVICE_UPDATE stuInInfo = new NET_IN_ACCESS_CARD_SERVICE_UPDATE(); NET_OUT_ACCESS_CARD_SERVICE_UPDATE stuOutInfo = new NET_OUT_ACCESS_CARD_SERVICE_UPDATE(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pInArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_ACCESS_CARD_INFO)) * stuCount); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); for (int i = 0; i < stuCount; i++) { IntPtr pDst = IntPtr.Add(pInArrayBuf, Marshal.SizeOf(typeof(NET_ACCESS_CARD_INFO)) * i); Marshal.StructureToPtr(stInParam[i], pDst, true); } stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.nInfoNum = stuCount; stuInInfo.pCardInfo = pInArrayBuf; stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessCardService(lLoginID, EM_ACCESS_CTL_CARD_SERVICE.UPDATE, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_CARD_SERVICE_UPDATE)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_CARD_SERVICE_UPDATE)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pInArrayBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } public static bool UpdateOperateAccessFingerprintService(IntPtr lLoginID, NET_ACCESS_FINGERPRINT_INFO[] stInParam, out NET_EM_FAILCODE[] stOutParam, int nWaitTime) { bool bRet = false; int stuCount = stInParam.Length; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; IntPtr pInArrayBuf = IntPtr.Zero; IntPtr pOutArrayBuf = IntPtr.Zero; NET_IN_ACCESS_FINGERPRINT_SERVICE_UPDATE stuInInfo = new NET_IN_ACCESS_FINGERPRINT_SERVICE_UPDATE(); NET_OUT_ACCESS_FINGERPRINT_SERVICE_UPDATE stuOutInfo = new NET_OUT_ACCESS_FINGERPRINT_SERVICE_UPDATE(); try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); pInArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_ACCESS_FINGERPRINT_INFO)) * stuCount); pOutArrayBuf = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * stuCount); for (int i = 0; i < stuCount; i++) { IntPtr pDst = IntPtr.Add(pInArrayBuf, Marshal.SizeOf(typeof(NET_ACCESS_FINGERPRINT_INFO)) * i); Marshal.StructureToPtr(stInParam[i], pDst, true); } stuInInfo.dwSize = (uint)Marshal.SizeOf(stuInInfo); stuInInfo.nFpNum = stuCount; stuInInfo.pFingerPrintInfo = pInArrayBuf; stuOutInfo.dwSize = (uint)Marshal.SizeOf(stuOutInfo); stuOutInfo.nMaxRetNum = stuCount; stuOutInfo.pFailCode = pOutArrayBuf; Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_OperateAccessFingerprintService(lLoginID, EM_ACCESS_CTL_FINGERPRINT_SERVICE.UPDATE, pInBuf, pOutBuf, nWaitTime); stuOutInfo = (NET_OUT_ACCESS_FINGERPRINT_SERVICE_UPDATE)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_ACCESS_FINGERPRINT_SERVICE_UPDATE)); stOutParam = new NET_EM_FAILCODE[stuOutInfo.nMaxRetNum]; for (int i = 0; i < stuOutInfo.nMaxRetNum; i++) { IntPtr pDst = IntPtr.Add(pOutArrayBuf, Marshal.SizeOf(typeof(NET_EM_FAILCODE)) * i); stOutParam[i] = (NET_EM_FAILCODE)Marshal.PtrToStructure(pDst, typeof(NET_EM_FAILCODE)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); Marshal.FreeHGlobal(pInArrayBuf); Marshal.FreeHGlobal(pOutArrayBuf); } } #endregion //access control #region <> public static bool OperateFaceRecognitionDB(IntPtr lLoginID, ref NET_IN_OPERATE_FACERECONGNITIONDB pstInParam, ref NET_OUT_OPERATE_FACERECONGNITIONDB pstOutParam, Int32 nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_OperateFaceRecognitionDB(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Search according to the condition /// /// CLIENT_Login's return value /// find type /// search condition /// type of condition struct /// /// Wait timeout, million second /// lFindeHandle public static IntPtr FindFile(IntPtr lLoginID, EM_FILE_QUERY_TYPE emType, object oQueryCondition, Type tyCondition, int waittime) { IntPtr result = IntPtr.Zero; IntPtr pCondition = IntPtr.Zero; try { if (oQueryCondition == null || tyCondition == null) { pCondition = IntPtr.Zero; } else { int nBufLen = Marshal.SizeOf(tyCondition); int n1 = Marshal.SizeOf(oQueryCondition); pCondition = Marshal.AllocHGlobal(nBufLen); Marshal.StructureToPtr(oQueryCondition, pCondition, true); } result = OriginalSDK.CLIENT_FindFileEx(lLoginID, emType, pCondition, IntPtr.Zero, waittime); NetGetLastError(result); } finally { Marshal.FreeHGlobal(pCondition); } return result; } public static int FindNextFile(IntPtr lFindHandle, int nFilecount, List lsOMediaFileInfo, Type tyFile, int waittime) { int result = 0; IntPtr pMediaFileInfo = IntPtr.Zero; int singleBufLen = Marshal.SizeOf(tyFile); int maxBufLen = singleBufLen * nFilecount; try { pMediaFileInfo = Marshal.AllocHGlobal(maxBufLen); for (int i = 0; i < nFilecount; i++) { Marshal.StructureToPtr(lsOMediaFileInfo[i], IntPtr.Add(pMediaFileInfo, i * singleBufLen), true); } result = OriginalSDK.CLIENT_FindNextFileEx(lFindHandle, nFilecount, pMediaFileInfo, maxBufLen, IntPtr.Zero, waittime); if (result >= 0) { for (int i = 0; i < result; i++) { lsOMediaFileInfo[i] = Marshal.PtrToStructure(IntPtr.Add(pMediaFileInfo, i * singleBufLen), tyFile); } } else { NetGetLastError(result); } } finally { Marshal.FreeHGlobal(pMediaFileInfo); } return result; } public static bool FindClose(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_FindCloseEx(lFindHandle); NetGetLastError(result); return result; } public static bool DetectFace(IntPtr lLoginID, ref NET_IN_DETECT_FACE pstInParam, ref NET_OUT_DETECT_FACE pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DetectFace(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } public static IntPtr AttachFaceFindState(IntPtr lLoginID, ref NET_IN_FACE_FIND_STATE pstInParam, ref NET_OUT_FACE_FIND_STATE pstOutParam, Int32 nWaitTime) { IntPtr nHanddle = IntPtr.Zero; nHanddle = OriginalSDK.CLIENT_AttachFaceFindState(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(nHanddle); return nHanddle; } public static bool DetachFaceFindState(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachFaceFindState(lAttachHandle); NetGetLastError(result); return result; } public static bool StartFindFaceRecognition(IntPtr lLoginID, ref NET_IN_STARTFIND_FACERECONGNITION pstInParam, ref NET_OUT_STARTFIND_FACERECONGNITION pstOutParam, int waittime) { bool result = false; IntPtr inPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_IN_STARTFIND_FACERECONGNITION))); Marshal.StructureToPtr(pstInParam, inPtr, true); outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_OUT_STARTFIND_FACERECONGNITION))); Marshal.StructureToPtr(pstOutParam, outPtr, true); result = OriginalSDK.CLIENT_StartFindFaceRecognition(lLoginID, inPtr, outPtr, waittime); NetGetLastError(result); if (result) { pstOutParam = (NET_OUT_STARTFIND_FACERECONGNITION)Marshal.PtrToStructure(outPtr, typeof(NET_OUT_STARTFIND_FACERECONGNITION)); } } finally { Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); } return result; } public static bool StartMultiFindFaceRecognition(IntPtr lLoginID, ref NET_IN_STARTMULTIFIND_FACERECONGNITION pstInParam, ref NET_OUT_STARTMULTIFIND_FACERECONGNITION pstOutParam, int waittime) { bool result = false; IntPtr inPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_IN_STARTMULTIFIND_FACERECONGNITION))); Marshal.StructureToPtr(pstInParam, inPtr, true); outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_OUT_STARTMULTIFIND_FACERECONGNITION))); Marshal.StructureToPtr(pstOutParam, outPtr, true); result = OriginalSDK.CLIENT_StartMultiFindFaceRecognition(lLoginID, inPtr, outPtr, waittime); NetGetLastError(result); if (result) { pstOutParam = (NET_OUT_STARTMULTIFIND_FACERECONGNITION)Marshal.PtrToStructure(outPtr, typeof(NET_OUT_STARTMULTIFIND_FACERECONGNITION)); } } finally { Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); } return result; } public static bool DoFindFaceRecognition(ref NET_IN_DOFIND_FACERECONGNITION pstInParam, ref NET_OUT_DOFIND_FACERECONGNITION pstOutParam, int waittime) { bool result = false; IntPtr inPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_IN_DOFIND_FACERECONGNITION))); Marshal.StructureToPtr(pstInParam, inPtr, true); outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_OUT_DOFIND_FACERECONGNITION))); Marshal.StructureToPtr(pstOutParam, outPtr, true); result = OriginalSDK.CLIENT_DoFindFaceRecognition(inPtr, outPtr, waittime); NetGetLastError(result); if (result) { pstOutParam = (NET_OUT_DOFIND_FACERECONGNITION)Marshal.PtrToStructure(outPtr, typeof(NET_OUT_DOFIND_FACERECONGNITION)); } } finally { Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); } return result; } public static bool StopFindFaceRecognition(IntPtr lFindHandle) { bool result = OriginalSDK.CLIENT_StopFindFaceRecognition(lFindHandle); NetGetLastError(result); return result; } public static bool DoFindFaceRecognitionRecordEx(NET_IN_DOFIND_FACERECONGNITIONRECORD_EX inParam, ref NET_OUT_DOFIND_FACERECONGNITIONRECORD_EX outParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_DoFindFaceRecognitionRecordEx(ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool FaceRecognitionPutDisposition(IntPtr lLoginID, NET_IN_FACE_RECOGNITION_PUT_DISPOSITION_INFO inParam, ref NET_OUT_FACE_RECOGNITION_PUT_DISPOSITION_INFO outParam, int nWaitTime) { bool result = false; IntPtr inPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_IN_FACE_RECOGNITION_PUT_DISPOSITION_INFO))); Marshal.StructureToPtr(inParam, inPtr, true); outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_OUT_FACE_RECOGNITION_PUT_DISPOSITION_INFO))); Marshal.StructureToPtr(outParam, outPtr, true); result = OriginalSDK.CLIENT_FaceRecognitionPutDisposition(lLoginID, inPtr, outPtr, nWaitTime); NetGetLastError(result); if (result) { outParam = (NET_OUT_FACE_RECOGNITION_PUT_DISPOSITION_INFO)Marshal.PtrToStructure(outPtr, typeof(NET_OUT_FACE_RECOGNITION_PUT_DISPOSITION_INFO)); } } finally { Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); } return result; } public static bool FaceRecognitionDelDisposition(IntPtr lLoginID, NET_IN_FACE_RECOGNITION_DEL_DISPOSITION_INFO inParam, ref NET_OUT_FACE_RECOGNITION_DEL_DISPOSITION_INFO outParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_FaceRecognitionDelDisposition(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool GetTotalFileCount(IntPtr lFindHandle, ref Int32 pTotalCount, IntPtr pReserved, Int32 nWaittime) { bool bReturn = false; bReturn = OriginalSDK.CLIENT_GetTotalFileCount(lFindHandle, ref pTotalCount, pReserved, nWaittime); NetGetLastError(bReturn); return bReturn; } public static bool SetFindingJumpOption(IntPtr lFindHandle, ref NET_FINDING_JUMP_OPTION_INFO pOption, IntPtr reserved, int waittime) { bool bReturn = false; bReturn = OriginalSDK.CLIENT_SetFindingJumpOption(lFindHandle, ref pOption, reserved, waittime); NetGetLastError(bReturn); return bReturn; } public static bool FindGroupInfo(IntPtr lLoginID, ref NET_IN_FIND_GROUP_INFO pstInParam, ref NET_OUT_FIND_GROUP_INFO pstOutParam, int nWaitTime) { bool bReturn = false; bReturn = OriginalSDK.CLIENT_FindGroupInfo(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(bReturn); return bReturn; } public static bool OperateFaceRecognitionGroup(IntPtr lLoginID, ref NET_IN_OPERATE_FACERECONGNITION_GROUP pstInParam, ref NET_OUT_OPERATE_FACERECONGNITION_GROUP pstOutParam, int nWaitTime) { bool bReturn = false; bReturn = OriginalSDK.CLIENT_OperateFaceRecognitionGroup(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(bReturn); return bReturn; } /// /// 删除指定人员组内符合条件的人员 /// deletes the qualified personnel in the specified personnel group /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Indicates the input parameter of the interface /// [out] pstuOutParam 接口输出参数; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Timeout period of the interface, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success. FALSE Indicates failure public static bool DeletePersonByCondition(IntPtr lLoginID, ref NET_IN_DELETE_PERSON_BY_CONDITION_INFO pstuInParam, ref NET_OUT_DELETE_PERSON_BY_CONDITION_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DeletePersonByCondition(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool RenderPrivateData(IntPtr lPlayHandle, bool bTrue) { bool result = false; result = OriginalSDK.CLIENT_RenderPrivateData(lPlayHandle, bTrue); NetGetLastError(result); return result; } #endregion #region Query device info /// /// query device info(storage device info) /// 查询设备信息(存储设备信息) /// /// CLIENT_Login's return value 登陆ID /// in param 输入参数 /// out param 输出参数 /// Wait timeout, million second 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryDevInfo(IntPtr lLoginID, ref NET_IN_STORAGE_DEV_INFOS stuInInfo, ref NET_OUT_STORAGE_DEV_INFOS stuOutInfo, int nWaitTime) { bool bRet = false; IntPtr pInBuf = IntPtr.Zero; IntPtr pOutBuf = IntPtr.Zero; try { pInBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuInInfo)); pOutBuf = Marshal.AllocHGlobal(Marshal.SizeOf(stuOutInfo)); Marshal.StructureToPtr(stuInInfo, pInBuf, true); Marshal.StructureToPtr(stuOutInfo, pOutBuf, true); bRet = OriginalSDK.CLIENT_QueryDevInfo(lLoginID, 0x02, pInBuf, pOutBuf, IntPtr.Zero, nWaitTime); if (bRet) { stuOutInfo = (NET_OUT_STORAGE_DEV_INFOS)Marshal.PtrToStructure(pOutBuf, typeof(NET_OUT_STORAGE_DEV_INFOS)); } NetGetLastError(bRet); return bRet; } finally { Marshal.FreeHGlobal(pInBuf); Marshal.FreeHGlobal(pOutBuf); } } #endregion //Query device info /// /// Get OSD Config /// 获取OSD配置 /// /// Lonin return value 登陆ID /// config type 配置类型 /// channel id 通道号 /// config struct 配置结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool GetOSDConfig(IntPtr lLoginID, EM_CFG_OSD_TYPE emCfgOpType, int nChannelID, ref object obj, int waittime) { bool result = false; Type type = obj.GetType(); IntPtr outPtr = IntPtr.Zero; try { outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(obj, outPtr, true); result = OriginalSDK.CLIENT_GetConfig(lLoginID, (int)emCfgOpType, nChannelID, outPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero); NetGetLastError(result); obj = Marshal.PtrToStructure(outPtr, type); } finally { Marshal.FreeHGlobal(outPtr); } return result; } /// /// Set OSD config /// 设置OSD配置 /// /// Lonin return value 登陆ID /// config type 配置类型 /// channel id 通道号 /// config struct 配置结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool SetOSDConfig(IntPtr lLoginID, EM_CFG_OSD_TYPE emCfgOpType, int nChannelID, object obj, int waittime) { bool result = false; Type type = obj.GetType(); IntPtr inPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(obj, inPtr, true); result = OriginalSDK.CLIENT_SetConfig(lLoginID, (int)emCfgOpType, nChannelID, inPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero, IntPtr.Zero); NetGetLastError(result); } finally { Marshal.FreeHGlobal(inPtr); } return result; } /// /// Get Encode Config /// 获取编码配置 /// /// Lonin return value 登陆ID /// config type 配置类型 /// channel id 通道号 /// config struct 配置结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool GetEncodeConfig(IntPtr lLoginID, EM_CFG_ENCODE_TYPE emCfgOpType, int nChannelID, ref object obj, int waittime) { bool result = false; Type type = obj.GetType(); IntPtr outPtr = IntPtr.Zero; try { outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(obj, outPtr, true); result = OriginalSDK.CLIENT_GetConfig(lLoginID, (int)emCfgOpType, nChannelID, outPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero); NetGetLastError(result); obj = Marshal.PtrToStructure(outPtr, type); } finally { Marshal.FreeHGlobal(outPtr); } return result; } /// /// Set Encode config /// 设置编码配置 /// /// Lonin return value 登陆ID /// config type 配置类型 /// channel id 通道号 /// config struct 配置结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool SetEncodeConfig(IntPtr lLoginID, EM_CFG_ENCODE_TYPE emCfgOpType, int nChannelID, object obj, int waittime) { bool result = false; Type type = obj.GetType(); IntPtr inPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(obj, inPtr, true); result = OriginalSDK.CLIENT_SetConfig(lLoginID, (int)emCfgOpType, nChannelID, inPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero, IntPtr.Zero); NetGetLastError(result); } finally { Marshal.FreeHGlobal(inPtr); } return result; } public static bool SetTrafficVoiceBroadcast(IntPtr lLoginID, NET_CFG_TRAFFIC_VOICE_BROADCAST_INFO info, int waittime) { bool result = false; Type type = info.GetType(); IntPtr inPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(info, inPtr, true); result = OriginalSDK.CLIENT_SetConfig(lLoginID, (int)10001, -1, inPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero, IntPtr.Zero); NetGetLastError(result); } finally { Marshal.FreeHGlobal(inPtr); } return result; } public static bool GetTrafficVoiceBroadcast(IntPtr lLoginID, ref NET_CFG_TRAFFIC_VOICE_BROADCAST_INFO info, int waittime) { bool result = false; Type type = info.GetType(); IntPtr outPtr = IntPtr.Zero; try { outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(info, outPtr, true); result = OriginalSDK.CLIENT_GetConfig(lLoginID, (int)10001, -1, outPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero); NetGetLastError(result); info = (NET_CFG_TRAFFIC_VOICE_BROADCAST_INFO)Marshal.PtrToStructure(outPtr, type); } finally { Marshal.FreeHGlobal(outPtr); } return result; } public static bool SetTrafficLatticeScreen(IntPtr lLoginID, NET_CFG_TRAFFIC_LATTICE_SCREEN_INFO info, int waittime) { bool result = false; Type type = info.GetType(); IntPtr inPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(info, inPtr, true); result = OriginalSDK.CLIENT_SetConfig(lLoginID, (int)10000, -1, inPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero, IntPtr.Zero); NetGetLastError(result); } finally { Marshal.FreeHGlobal(inPtr); } return result; } public static bool GetTrafficLatticeScreen(IntPtr lLoginID, ref NET_CFG_TRAFFIC_LATTICE_SCREEN_INFO info, int waittime) { bool result = false; Type type = info.GetType(); IntPtr outPtr = IntPtr.Zero; try { outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(info, outPtr, true); result = OriginalSDK.CLIENT_GetConfig(lLoginID, (int)10000, -1, outPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero); NetGetLastError(result); info = (NET_CFG_TRAFFIC_LATTICE_SCREEN_INFO)Marshal.PtrToStructure(outPtr, type); } finally { Marshal.FreeHGlobal(outPtr); } return result; } public static bool SetSpecialDaysScheduleConfig(IntPtr lLoginID, NET_CFG_ACCESSCTL_SPECIALDAY_GROUP_INFO info, int waittime) { bool result = false; Type type = info.GetType(); IntPtr inPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(type)); Marshal.StructureToPtr(info, inPtr, true); result = OriginalSDK.CLIENT_SetConfig(lLoginID, (int)3902, -1, inPtr, (uint)Marshal.SizeOf(type), waittime, IntPtr.Zero, IntPtr.Zero); NetGetLastError(result); } finally { Marshal.FreeHGlobal(inPtr); } return result; } public static bool GetSpecialDaysScheduleConfig(IntPtr lLoginID, ref object[] objs, Type typeName, int waittime) { bool result = false; IntPtr outPtr = IntPtr.Zero; try { int nOutBufSize = Marshal.SizeOf(typeName) * objs.Length; outPtr = Marshal.AllocHGlobal(nOutBufSize); result = OriginalSDK.CLIENT_GetConfig(lLoginID, (int)3902, -1, outPtr, (uint)nOutBufSize, waittime, IntPtr.Zero); NetGetLastError(result); for (int i = 0; i < objs.Length; ++i) { objs[i] = Marshal.PtrToStructure(IntPtr.Add(outPtr, i * Marshal.SizeOf(typeName)), typeName); } } finally { Marshal.FreeHGlobal(outPtr); } return result; } public static bool GetSplitWindowsInfo(IntPtr lLoginID, object inParam, ref object outParam, int nWaitTime) { bool result = false; IntPtr inPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(inParam.GetType())); Marshal.StructureToPtr(inParam, inPtr, true); outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(outParam.GetType())); Marshal.StructureToPtr(outParam, outPtr, false); result = OriginalSDK.CLIENT_GetSplitWindowsInfo(lLoginID, inPtr, outPtr, nWaitTime); NetGetLastError(result); if (result) { outParam = Marshal.PtrToStructure(outPtr, outParam.GetType()); } } finally { Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); } return result; } public static bool OperateSplit(IntPtr lLoginID, EM_NET_SPLIT_OPERATE_TYPE emType, object inParam, ref object outParam, int nWaitTime) { bool result = false; IntPtr inPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(inParam.GetType())); Marshal.StructureToPtr(inParam, inPtr, true); outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(outParam.GetType())); Marshal.StructureToPtr(outParam, outPtr, true); result = OriginalSDK.CLIENT_OperateSplit(lLoginID, emType, inPtr, outPtr, nWaitTime); NetGetLastError(result); if (result) { outParam = Marshal.PtrToStructure(outPtr, outParam.GetType()); } } finally { Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); } return result; } public static bool OperateSplitPlayer(IntPtr lLoginID, EM_NET_PLAYER_OPERATE_TYPE emType, object inParam, ref object outParam, int nWaitTime) { bool result = false; IntPtr inPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { inPtr = Marshal.AllocHGlobal(Marshal.SizeOf(inParam.GetType())); Marshal.StructureToPtr(inParam, inPtr, true); outPtr = Marshal.AllocHGlobal(Marshal.SizeOf(outParam.GetType())); Marshal.StructureToPtr(outParam, outPtr, true); result = OriginalSDK.CLIENT_OperateSplitPlayer(lLoginID, emType, inPtr, outPtr, nWaitTime); NetGetLastError(result); if (result) { outParam = Marshal.PtrToStructure(outPtr, outParam.GetType()); } } finally { Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); } return result; } public static bool WindowRegionEnlarge(IntPtr lLoginID, NET_IN_WINDOW_REGION_ENLARGE inParam, ref NET_OUT_WINDOW_REGION_ENLARGE outParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_WindowRegionEnlarge(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool WindowEnlargeReduction(IntPtr lLoginID, NET_IN_WINDOW_ENLARGE_REDUCTION inParam, ref NET_OUT_WINDOW_ENLARGE_REDUCTION outParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_WindowEnlargeReduction(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool OperateTrafficList(IntPtr lLoginID, NET_IN_OPERATE_TRAFFIC_LIST_RECORD inParam, ref NET_OUT_OPERATE_TRAFFIC_LIST_RECORD outParam, int waittime) { bool result = false; result = OriginalSDK.CLIENT_OperateTrafficList(lLoginID, ref inParam, ref outParam, waittime); NetGetLastError(result); return result; } public static IntPtr FileTransmit(IntPtr lLoginID, EM_FIELTRANSMIT_TYPE nTransType, object obj, fTransFileCallBack cbTransFile, IntPtr dwUserData, int waittime) { IntPtr result = IntPtr.Zero; IntPtr bufPtr = IntPtr.Zero; try { bufPtr = Marshal.AllocHGlobal(Marshal.SizeOf(obj.GetType())); Marshal.StructureToPtr(obj, bufPtr, true); result = OriginalSDK.CLIENT_FileTransmit(lLoginID, (int)nTransType, bufPtr, Marshal.SizeOf(obj.GetType()), cbTransFile, dwUserData, waittime); NetGetLastError(result); } finally { Marshal.FreeHGlobal(bufPtr); } return result; } public static bool QueryUserInfoNew(IntPtr lLoginID, ref NET_USER_MANAGE_INFO_NEW info, int waittime) { bool result = false; IntPtr inPtr = Marshal.AllocHGlobal((int)info.dwSize); Marshal.StructureToPtr(info, inPtr, true); result = OriginalSDK.CLIENT_QueryUserInfoNew(lLoginID, inPtr, IntPtr.Zero, waittime); NetGetLastError(result); if (result) { info = (NET_USER_MANAGE_INFO_NEW)Marshal.PtrToStructure(inPtr, typeof(NET_USER_MANAGE_INFO_NEW)); } Marshal.FreeHGlobal(inPtr); return result; } public static bool OperateUserInfoNew(IntPtr lLoginID, EM_OPERATE_USER_TYPE nOperateType, IntPtr opParam, IntPtr subParam, int waittime) { bool result = false; result = OriginalSDK.CLIENT_OperateUserInfoNew(lLoginID, (int)nOperateType, opParam, subParam, IntPtr.Zero, waittime); NetGetLastError(result); return result; } public static IntPtr StartSearchDevice(fSearchDevicesCB cbSearchDevice, IntPtr pUserData, IntPtr szLocalIp) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartSearchDevices(cbSearchDevice, pUserData, szLocalIp); NetGetLastError(result); return result; } public static bool ModifyDevice(DEVICE_NET_INFO_EX devNetInfo, uint dwWaitTime) { bool result = false; int error = 0; result = OriginalSDK.CLIENT_ModifyDevice(ref devNetInfo, dwWaitTime, ref error, null, IntPtr.Zero); NetGetLastError(result); return result; } public static bool StopSearchDevice(IntPtr lSearchHandle) { bool result = false; result = OriginalSDK.CLIENT_StopSearchDevices(lSearchHandle); NetGetLastError(result); return result; } public static bool DownloadRemoteFile(IntPtr lLoginID, ref NET_IN_DOWNLOAD_REMOTE_FILE inParam, ref NET_OUT_DOWNLOAD_REMOTE_FILE outParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DownloadRemoteFile(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool GetDevEncodeCaps(IntPtr lLoginID, NET_IN_ENCODE_CFG_CAPS stuInParam, ref NET_OUT_ENCODE_CFG_CAPS stuOutParam, int nWaitTime) { bool result = false; NET_INTERNAL_IN_ENCODE_CAPS stuIn = new NET_INTERNAL_IN_ENCODE_CAPS { dwSize = (uint)Marshal.SizeOf(typeof(NET_INTERNAL_IN_ENCODE_CAPS)), stuInEncodeCaps = stuInParam, }; NET_INTERNAL_OUT_ENCODE_CAPS stuOut = new NET_INTERNAL_OUT_ENCODE_CAPS { dwSize = (uint)Marshal.SizeOf(typeof(NET_INTERNAL_OUT_ENCODE_CAPS)), stuOutEncodeCaps = stuOutParam, }; int size = Marshal.SizeOf(typeof(NET_INTERNAL_OUT_ENCODE_CAPS)); for (int i = 0; i < 3; i++) { stuOut.stuOutEncodeCaps.stuMainFormatCaps[i].dwSize = (uint)Marshal.SizeOf(typeof(NET_STREAM_CFG_CAPS)); stuOut.stuOutEncodeCaps.stuExtraFormatCaps[i].dwSize = (uint)Marshal.SizeOf(typeof(NET_STREAM_CFG_CAPS)); if (i != 2) { stuOut.stuOutEncodeCaps.stuSnapFormatCaps[i].dwSize = (uint)Marshal.SizeOf(typeof(NET_STREAM_CFG_CAPS)); } } uint nBufSize = 1024 * 1024; string strCommand = "Encode"; IntPtr pInBuf = IntPtr.Zero; int nError = 0; try { stuIn.pchEncodeJson = Marshal.AllocHGlobal((int)nBufSize); } catch (OutOfMemoryException) { result = false; return result; } result = OriginalSDK.CLIENT_GetNewDevConfig(lLoginID, strCommand, stuInParam.nChannelId, stuIn.pchEncodeJson, nBufSize, out nError, nWaitTime, new IntPtr()); if (result) { IntPtr intPtr = IntPtr.Zero; IntPtr outPtr = IntPtr.Zero; try { intPtr = Marshal.AllocHGlobal((int)stuIn.dwSize); outPtr = Marshal.AllocHGlobal((int)stuOut.dwSize); } catch (OutOfMemoryException) { Marshal.FreeHGlobal(stuIn.pchEncodeJson); result = false; return result; } Marshal.StructureToPtr(stuIn, intPtr, true); Marshal.StructureToPtr(stuOut, outPtr, true); result = OriginalSDK.CLIENT_GetDevCaps(lLoginID, 0x02, intPtr, outPtr, nWaitTime); if (result) { stuOut = (NET_INTERNAL_OUT_ENCODE_CAPS)Marshal.PtrToStructure(outPtr, typeof(NET_INTERNAL_OUT_ENCODE_CAPS)); stuOutParam = stuOut.stuOutEncodeCaps; } else { NetGetLastError(result); } Marshal.FreeHGlobal(intPtr); Marshal.FreeHGlobal(outPtr); } Marshal.FreeHGlobal(stuIn.pchEncodeJson); return result; } public static bool QueryChannelName(IntPtr lLoginID, IntPtr pChannelName, int maxlen, ref int nChannelCount, int waittime) { bool result = false; result = OriginalSDK.CLIENT_QueryChannelName(lLoginID, pChannelName, maxlen, ref nChannelCount, waittime); NetGetLastError(result); return result; } public static bool SetDeviceSearchParam(NET_DEVICE_SEARCH_PARAM inParam) { bool result = false; result = OriginalSDK.CLIENT_SetDeviceSearchParam(ref inParam); NetGetLastError(result); return result; } public static bool GetDevConfig(IntPtr lLoginID, EM_DEV_CFG_TYPE type, int lChannel, IntPtr lpOutBuffer, uint dwOutBufferSize, ref uint bytesReturned, int waittime) { bool result = false; result = OriginalSDK.CLIENT_GetDevConfig(lLoginID, (uint)type, lChannel, lpOutBuffer, dwOutBufferSize, ref bytesReturned, waittime); NetGetLastError(result); return result; } public static bool SetDevConfig(IntPtr lLoginID, EM_DEV_CFG_TYPE type, int lChannel, IntPtr lpInBuffer, uint dwInBufferSize, int waittime) { bool result = false; result = OriginalSDK.CLIENT_SetDevConfig(lLoginID, (uint)type, lChannel, lpInBuffer, dwInBufferSize, waittime); NetGetLastError(result); return result; } public static IntPtr DownloadByRecordFile(IntPtr lLoginID, ref NET_RECORDFILE_INFO lpRecordFile, string sSavedFileName, fDownLoadPosCallBack cbDownLoadPos, IntPtr dwUserData, bool bUseUTCTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_DownloadByRecordFile(lLoginID, ref lpRecordFile, sSavedFileName, cbDownLoadPos, dwUserData, bUseUTCTime); NetGetLastError(result); return result; } public static bool RebootDev(IntPtr lLoginID) { bool result = false; result = OriginalSDK.CLIENT_RebootDev(lLoginID); NetGetLastError(result); return result; } public static bool Attendance_AddUser(IntPtr lLoginID, NET_IN_ATTENDANCE_ADDUSER stuInAddUser, ref NET_OUT_ATTENDANCE_ADDUSER stuOutAddUser, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_AddUser(lLoginID, ref stuInAddUser, ref stuOutAddUser, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_DelUser(IntPtr lLoginID, NET_IN_ATTENDANCE_DELUSER stuInDelUser, ref NET_OUT_ATTENDANCE_DELUSER stuOutDelUser, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_DelUser(lLoginID, ref stuInDelUser, ref stuOutDelUser, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_ModifyUser(IntPtr lLoginID, NET_IN_ATTENDANCE_ModifyUSER stuInModifyUser, ref NET_OUT_ATTENDANCE_ModifyUSER stuOutModifyUser, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_ModifyUser(lLoginID, ref stuInModifyUser, ref stuOutModifyUser, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_GetUser(IntPtr lLoginID, NET_IN_ATTENDANCE_GetUSER stuInGetUser, ref NET_OUT_ATTENDANCE_GetUSER stuOutGetUser, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_GetUser(lLoginID, ref stuInGetUser, ref stuOutGetUser, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_FindUser(IntPtr lLoginID, NET_IN_ATTENDANCE_FINDUSER stuInFindUser, ref NET_OUT_ATTENDANCE_FINDUSER stuOutFindUser, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_FindUser(lLoginID, ref stuInFindUser, ref stuOutFindUser, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_InsertFingerByUserID(IntPtr lLoginID, ref NET_IN_FINGERPRINT_INSERT_BY_USERID stuInInsert, ref NET_OUT_FINGERPRINT_INSERT_BY_USERID stuOutInsert, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_InsertFingerByUserID(lLoginID, ref stuInInsert, ref stuOutInsert, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_RemoveFingerByUserID(IntPtr lLoginID, ref NET_CTRL_IN_FINGERPRINT_REMOVE_BY_USERID stuInRemove, ref NET_CTRL_OUT_FINGERPRINT_REMOVE_BY_USERID stuOutRemove, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_RemoveFingerByUserID(lLoginID, ref stuInRemove, ref stuOutRemove, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_GetFingerByUserID(IntPtr lLoginID, ref NET_IN_FINGERPRINT_GETBYUSER stuIn, ref NET_OUT_FINGERPRINT_GETBYUSER stuOut, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_GetFingerByUserID(lLoginID, ref stuIn, ref stuOut, nWaitTime); NetGetLastError(result); return result; } public static IntPtr AttachMotionData(IntPtr lLoginID, NET_IN_ATTACH_MOTION_DATA inParam, int nWaitTime) { IntPtr result = IntPtr.Zero; NET_OUT_ATTACH_MOTION_DATA outParam = new NET_OUT_ATTACH_MOTION_DATA(); outParam.dwSize = (uint)Marshal.SizeOf(typeof(NET_OUT_ATTACH_MOTION_DATA)); result = OriginalSDK.CLIENT_AttachMotionData(lLoginID, ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } public static bool DetachMotionData(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachMotionData(lAttachHandle); NetGetLastError(result); return result; } public static bool SearchDevicesByIPs(NET_DEVICE_IP_SEARCH_INFO pIpSearchInfo, fSearchDevicesCB cbSearchDevices, IntPtr dwUserData, string szLocalIp, uint dwWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SearchDevicesByIPs(ref pIpSearchInfo, cbSearchDevices, dwUserData, szLocalIp, dwWaitTime); NetGetLastError(result); return result; } public static bool InitDevAccount(NET_IN_INIT_DEVICE_ACCOUNT pInitAccountIn, ref NET_OUT_INIT_DEVICE_ACCOUNT pInitAccountOut, uint dwWaitTime, string szLocalIp) { bool result = false; result = OriginalSDK.CLIENT_InitDevAccount(ref pInitAccountIn, ref pInitAccountOut, dwWaitTime, szLocalIp); NetGetLastError(result); return result; } public static bool GetDevCaps(IntPtr lLoginID, EM_DEVCAP_TYPE nType, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetDevCaps(lLoginID, (int)nType, pInBuf, pOutBuf, nWaitTime); NetGetLastError(result); return result; } public static IntPtr ListenServer(string ip, ushort port, int nTimeout, fServiceCallBack cbListen, IntPtr dwUserData) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_ListenServer(ip, port, nTimeout, cbListen, dwUserData); NetGetLastError(result); return result; } public static bool StopListenServer(IntPtr lServerHandle) { bool result = OriginalSDK.CLIENT_StopListenServer(lServerHandle); NetGetLastError(result); return result; } public static bool QueryProductionDefinition(IntPtr lLoginID, ref NET_PRODUCTION_DEFNITION pstuProdDef, int nWaitTime) { bool result = OriginalSDK.CLIENT_QueryProductionDefinition(lLoginID, ref pstuProdDef, nWaitTime); NetGetLastError(result); return result; } public static bool QueryDevInfo(IntPtr lLoginID, EM_QUERY_DEV_INFO emQueryType, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime = 1000) { bool result = OriginalSDK.CLIENT_QueryDevInfo(lLoginID, (int)emQueryType, pInBuf, pOutBuf, IntPtr.Zero, nWaitTime); NetGetLastError(result); return result; } public static IntPtr AttachCameraState(IntPtr lLoginID, NET_IN_CAMERASTATE pstInParam, ref NET_OUT_CAMERASTATE pstOutParam, int nWaitTime = 3000) { IntPtr lAttachHandle = IntPtr.Zero; lAttachHandle = OriginalSDK.CLIENT_AttachCameraState(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(lAttachHandle); return lAttachHandle; } public static bool DetachCameraState(IntPtr lAttachHandle) { bool result = OriginalSDK.CLIENT_DetachCameraState(lAttachHandle); NetGetLastError(result); return result; } public static bool GetSoftwareVersion(IntPtr lLoginID, NET_IN_GET_SOFTWAREVERSION_INFO pstInParam, ref NET_OUT_GET_SOFTWAREVERSION_INFO pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetSoftwareVersion(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool GetDeviceType(IntPtr lLoginID, NET_IN_GET_DEVICETYPE_INFO pstInParam, ref NET_OUT_GET_DEVICETYPE_INFO pstOutParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_GetDeviceType(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool LogOpen(NET_LOG_SET_PRINT_INFO pstLogPrintInfo) { bool result = false; result = OriginalSDK.CLIENT_LogOpen(ref pstLogPrintInfo); NetGetLastError(result); return result; } public static bool AudioDecEx(IntPtr lTalkHandle, IntPtr pAudioDataBuf, uint dwBufSize) { bool result = false; result = OriginalSDK.CLIENT_AudioDecEx(lTalkHandle, pAudioDataBuf, dwBufSize); NetGetLastError(result); return result; } public static bool Attendance_GetFingerRecord(IntPtr lLoginID, ref NET_CTRL_IN_FINGERPRINT_GET pstuInGet, ref NET_CTRL_OUT_FINGERPRINT_GET pstuOutGet, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_GetFingerRecord(lLoginID, ref pstuInGet, ref pstuOutGet, nWaitTime); NetGetLastError(result); return result; } public static bool Attendance_RemoveFingerRecord(IntPtr lLoginID, ref NET_CTRL_IN_FINGERPRINT_REMOVE pstuInRemove, ref NET_CTRL_OUT_FINGERPRINT_REMOVE pstuOutRemove, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_Attendance_RemoveFingerRecord(lLoginID, ref pstuInRemove, ref pstuOutRemove, nWaitTime); NetGetLastError(result); return result; } public static bool OperateAccessFingerprintService(IntPtr lLoginID, EM_ACCESS_CTL_FINGERPRINT_SERVICE emtype, IntPtr pstInParam, IntPtr pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_OperateAccessFingerprintService(lLoginID, emtype, pstInParam, pstOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool OperateAccessControlManager(IntPtr lLoginID, NET_EM_ACCESS_CTL_MANAGER emtype, IntPtr pstInParam, IntPtr pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_OperateAccessControlManager(lLoginID, emtype, pstInParam, pstInParam, nWaitTime); NetGetLastError(result); return result; } public static bool EncryptString(NET_IN_ENCRYPT_STRING pInParam, ref NET_OUT_ENCRYPT_STRING pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_EncryptString(ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } public static IntPtr DownloadMediaFile(IntPtr lLoginID, EM_FILE_QUERY_TYPE emType, IntPtr lpMediaFileInfo, string sSavedFileName, fDownLoadPosCallBack cbDownLoadPos, IntPtr dwUserData, IntPtr reserved) { IntPtr result = IntPtr.Zero; IntPtr file_name = Marshal.StringToHGlobalAnsi(sSavedFileName); result = OriginalSDK.CLIENT_DownloadMediaFile(lLoginID, emType, lpMediaFileInfo, file_name, cbDownLoadPos, dwUserData, reserved); Marshal.FreeHGlobal(file_name); NetGetLastError(result); return result; } public static bool StopDownloadMediaFile(IntPtr lFileHandle) { bool result = false; result = OriginalSDK.CLIENT_StopDownloadMediaFile(lFileHandle); NetGetLastError(result); return result; } public static IntPtr SCADAAlarmAttachInfo(IntPtr lLoginID, NET_IN_SCADA_ALARM_ATTACH_INFO pInParam, NET_OUT_SCADA_ALARM_ATTACH_INFO pOutParam, int nWaitTime = 3000) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_SCADAAlarmAttachInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool SCADAAlarmDetachInfo(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_SCADAAlarmDetachInfo(lAttachHandle); NetGetLastError(result); return result; } public static IntPtr SCADAAttachInfo(IntPtr lLoginID, NET_IN_SCADA_ATTACH_INFO pInParam, NET_OUT_SCADA_ATTACH_INFO pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_SCADAAttachInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool SCADADetachInfo(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_SCADADetachInfo(lAttachHandle); NetGetLastError(result); return result; } public static IntPtr AttachPTZStatusProc(IntPtr lLoginID, NET_IN_PTZ_STATUS_PROC pstuInPtzStatusProc, ref NET_OUT_PTZ_STATUS_PROC pstuOutPtzStatusProc, int nWaitTime = 3000) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachPTZStatusProc(lLoginID, ref pstuInPtzStatusProc, ref pstuOutPtzStatusProc, nWaitTime); NetGetLastError(result); return result; } public static bool DetachPTZStatusProc(IntPtr lAttachHandle) { bool result = true; result = OriginalSDK.CLIENT_DetachPTZStatusProc(lAttachHandle); NetGetLastError(result); return result; } public static bool StartFind(IntPtr lLoginID, EM_FIND emType, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_StartFind(lLoginID, emType, pInBuf, pOutBuf, nWaitTime); NetGetLastError(result); return result; } public static bool DoFind(IntPtr lLoginID, EM_FIND emType, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_DoFind(lLoginID, emType, pInBuf, pOutBuf, nWaitTime); NetGetLastError(result); return result; } public static bool StopFind(IntPtr lLoginID, EM_FIND emType, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_StopFind(lLoginID, emType, pInBuf, pOutBuf, nWaitTime); NetGetLastError(result); return result; } public static IntPtr RadiometryAttach(IntPtr lLoginID, NET_IN_RADIOMETRY_ATTACH pInParam, ref NET_OUT_RADIOMETRY_ATTACH pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_RadiometryAttach(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } public static bool RadiometryDetach(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_RadiometryDetach(lAttachHandle); NetGetLastError(result); return result; } public static bool RadiometryFetch(IntPtr lLoginID, NET_IN_RADIOMETRY_FETCH pInParam, ref NET_OUT_RADIOMETRY_FETCH pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_RadiometryFetch(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// RealPlay By Stream Data Type 指定回调数据类型 实施预览(预览) /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// real play parameter in 预览输入参数 /// real play parameter out 预览输出参数 /// Waiting Time 等待时间 /// failed return 0, successful return the realplay ID(realplay handle),as parameter of related function. 失败返回0,成功返回大于0的值 public static IntPtr RealPlayByDataType(IntPtr lLoginID, NET_IN_REALPLAY_BY_DATA_TYPE pstInParam, ref NET_OUT_REALPLAY_BY_DATA_TYPE pstOutParam, uint dwWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_RealPlayByDataType(lLoginID, ref pstInParam, ref pstOutParam, dwWaitTime); NetGetLastError(result); return result; } /// /// Playback By Stream Data Type 指定回调数据类型回放 /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// playback parameter in 回放输入参数 /// playback parameter out 回放输出参数 /// Waiting Time 等待时间 /// failed return 0, successful return the playback ID(playback handle),as parameter of related function. 失败返回0,成功返回大于0的值 public static IntPtr PlayBackByDataType(IntPtr lLoginID, NET_IN_PLAYBACK_BY_DATA_TYPE pstInParam, ref NET_OUT_PLAYBACK_BY_DATA_TYPE pstOutParam, uint dwWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_PlayBackByDataType(lLoginID, ref pstInParam, ref pstOutParam, dwWaitTime); NetGetLastError(result); return result; } /// /// Download By Stream Data Type 指定回调数据类型下载 /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// download parameter in 下载输入参数 /// download parameter Out 下载输出参数 /// Waiting Time 等待时间 /// failed return 0, successful return the download ID(download handle),as parameter of related function. 失败返回0,成功返回大于0的值 public static IntPtr DownloadByDataType(IntPtr lLoginID, NET_IN_DOWNLOAD_BY_DATA_TYPE pstInParam, ref NET_OUT_DOWNLOAD_BY_DATA_TYPE pstOutParam, uint dwWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_DownloadByDataType(lLoginID, ref pstInParam, ref pstOutParam, dwWaitTime); NetGetLastError(result); return result; } /// /// Get Alarm ext module status 报警主机获取扩展模块在线状态接口 /// /// user LoginID:Login's return value 登陆ID,Login返回值 /// Get Alarm ext module status parameter in 输入参数 /// Get Alarm ext module status parameter Out 输出参数 /// Waiting Time 等待时间 /// public static bool GetConnectionStatus(IntPtr lLoginID, NET_IN_GETCONNECTION_STATUS pstInParam, ref NET_OUT_GETCONNECTION_STATUS pstOutParam, int dwWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetConnectionStatus(lLoginID, ref pstInParam, ref pstOutParam, dwWaitTime); NetGetLastError(result); return result; } public static bool GetDefenceArmMode(IntPtr lLoginID, NET_IN_GET_DEFENCEMODE pstInParam, ref NET_OUT_GET_DEFENCEMODE pstOutParam, int dwWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetDefenceArmMode(lLoginID, ref pstInParam, ref pstOutParam, dwWaitTime); NetGetLastError(result); return result; } public static bool SetDefenceArmMode(IntPtr lLoginID, NET_IN_SET_DEFENCEMODE pstInParam, int dwWaitTime) { bool result = false; NET_OUT_SET_DEFENCEMODE outParam = new NET_OUT_SET_DEFENCEMODE(); outParam.dwSize = (uint)Marshal.SizeOf(typeof(NET_OUT_SET_DEFENCEMODE)); result = OriginalSDK.CLIENT_SetDefenceArmMode(lLoginID, ref pstInParam, ref outParam, dwWaitTime); NetGetLastError(result); return result; } public static bool SetParkingSpaceLightPlan(IntPtr lLoginID, NET_IN_SET_PARKING_SPACE_LIGHT_PLAN pstInParam, int nWaitTime) { bool result = false; NET_OUT_SET_PARKING_SPACE_LIGHT_PLAN outParam = new NET_OUT_SET_PARKING_SPACE_LIGHT_PLAN(); outParam.dwSize = (uint)Marshal.SizeOf(typeof(NET_OUT_SET_PARKING_SPACE_LIGHT_PLAN)); result = OriginalSDK.CLIENT_SetParkingSpaceLightPlan(lLoginID, ref pstInParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } /// /// 下发人脸开门比对数据 /// /// 登录句柄 /// 入参 /// 出参 /// 超时时间 /// public static bool FaceOpenDoor(IntPtr lLoginID, NET_IN_FACE_OPEN_DOOR pInParam, NET_OUT_FACE_OPEN_DOOR pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_FaceOpenDoor(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 向服务器提交多张大图,从中检测人脸图片, pstInParam = NET_IN_FACE_RECOGNITION_DETECT_MULTI_FACE_INFO 与pstOutParam内存由用户申请释放 /// submit multiple large images to the server, and detect face images from it, user malloc and free (pstInParam's = NET_IN_FACE_RECOGNITION_DETECT_MULTI_FACE_INFO and pstOutParam's) memory /// public static bool FaceRecognitionDetectMultiFace(IntPtr lLoginID, IntPtr pstInParam, ref NET_OUT_FACE_RECOGNITION_DETECT_MULTI_FACE_INFO pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_FaceRecognitionDetectMultiFace(lLoginID, pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅大图检测小图进度,配合CLIENT_FaceRecognitionDetectMultiFace使用, pstInParam与pstOutParam内存由用户申请释放 /// attach the progress of detect face images form the big images, cooperate with CLIENT_FaceRecognitionDetectMultiFace, user malloc and free (pstInParam's and pstOutParam's) memory /// public static IntPtr AttachDetectMultiFaceState(IntPtr lLoginID, ref NET_IN_MULTIFACE_DETECT_STATE pstInParam, ref NET_OUT_MULTIFACE_DETECT_STATE pstOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachDetectMultiFaceState(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅大图检测小图进度, lAttachHandle为CLIENT_AttachDetectMultiFaceState 返回的句柄 /// detach the progress of detect face images form the big images, lAttachHandleis returned by CLIENT_AttachDetectMultiFaceState /// public static bool DetachDetectMultiFaceState(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachDetectMultiFaceState(lAttachHandle); NetGetLastError(result); return result; } /// /// 报警主机获取操作 /// Get operate of alarm region /// public static bool GetAlarmRegionInfo(IntPtr lLoginID, EM_A_NET_EM_GET_ALARMREGION_INFO emType, IntPtr pstuInParam, IntPtr pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetAlarmRegionInfo(lLoginID, emType, pstuInParam, pstuOutParam, nWaitTime); NetGetLastError(result); return result; } #region<< gps >> /// /// GPS inforamtion subscribe /// /// login handle /// TRUE:subscribe FALSE:cancle subscribe /// subscribe time last (unit second) value:-1 means indefinite duration last /// GPS send rate in subscribe time /// failed return false, successful return true public static bool SubcribeGPS(IntPtr lLoginID, bool bStart, int KeepTime, int InterTime) { bool result = false; result = OriginalSDK.CLIENT_SubcribeGPS(lLoginID, bStart, KeepTime, InterTime); NetGetLastError(result); return result; } /// /// Set GPS subscription callback function /// /// callback method /// public static void SetSubcribeGPSCallBack(fGPSRevEx2 OnGPSMessage, IntPtr dwUser) { OriginalSDK.CLIENT_SetSubcribeGPSCallBackEX2(OnGPSMessage, dwUser); } #endregion GPS #region Analyze Task /// /// 订阅智能分析任务状态 /// /// Lonin return value 登陆ID /// 入参 /// waittime 等待时间 /// failed return Intptr.Zero, successful return other; 失败返回Intptr.Zero 成功返回其他值 public static IntPtr AttachAnalyseTaskState(IntPtr lLoginID, ref NET_IN_ATTACH_ANALYSE_TASK_STATE pInParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachAnalyseTaskState(lLoginID, ref pInParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅智能分析任务状态 /// /// AttachAnalyseTaskState return value; 订阅返回句柄ID /// public static bool DetachAnalyseTaskState(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachAnalyseTaskState(lAttachHandle); NetGetLastError(result); return result; } /// /// 推送需要智能分析的图片 /// /// Lonin return value; 登陆ID /// 入参 /// 出参 /// waittime; 等待时间 /// failed return false, successful return true; 失败返回false 成功返回true public static bool PushAnalysePictureFile(IntPtr lLoginID, ref NET_IN_PUSH_ANALYSE_PICTURE_FILE pInParam, ref NET_OUT_PUSH_ANALYSE_PICTURE_FILE pOutParam, int nWaitTime) { bool result = false; IntPtr ppInParam = IntPtr.Zero; IntPtr ppOutParam = IntPtr.Zero; ppInParam = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_IN_PUSH_ANALYSE_PICTURE_FILE))); ppOutParam = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_OUT_PUSH_ANALYSE_PICTURE_FILE))); Marshal.StructureToPtr(pInParam, ppInParam, false); Marshal.StructureToPtr(pOutParam, ppOutParam, false); result = OriginalSDK.CLIENT_PushAnalysePictureFile(lLoginID, ppInParam, ppOutParam, nWaitTime); NetGetLastError(result); if (result) { pOutParam = (NET_OUT_PUSH_ANALYSE_PICTURE_FILE)Marshal.PtrToStructure(ppOutParam, typeof(NET_OUT_PUSH_ANALYSE_PICTURE_FILE)); } Marshal.FreeHGlobal(ppInParam); Marshal.FreeHGlobal(ppOutParam); return result; } /// /// 推送智能分析图片文件和规则信息,当CLIENT_AddAnalyseTask的数据源类型emDataSourceType为 EM_DATA_SOURCE_PUSH_PICFILE_BYRULE 时使用 /// Push intelligent analysis of picture files and rule information when the client_ The data source type emdatasourcetype of addanalysistask is em_ DATA_ SOURCE_ PUSH_ PICFILE_ Used when byrule /// /// Lonin return value; 登陆ID /// 入参 /// 出参 /// waittime; 等待时间 /// failed return false, successful return true; 失败返回false 成功返回true public static bool PushAnalysePictureFileByRule(IntPtr lLoginID, ref NET_IN_PUSH_ANALYSE_PICTURE_FILE_BYRULE pInParam, ref NET_OUT_PUSH_ANALYSE_PICTURE_FILE_BYRULE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_PushAnalysePictureFileByRule(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 添加智能分析任务(图片方式) /// /// Lonin return value 登陆ID /// 推送图片文件信息 /// 出参 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool AddAnalyseTask_PushPicFile(IntPtr lLoginID, NET_PUSH_PICFILE_INFO stuPushInfo, ref NET_OUT_ADD_ANALYSE_TASK pOutParam, int nWaitTime) { bool result = false; IntPtr pInParam = IntPtr.Zero; EM_DATA_SOURCE_TYPE emDataSourceType = EM_DATA_SOURCE_TYPE.PUSH_PICFILE; try { pInParam = Marshal.AllocHGlobal(Marshal.SizeOf(stuPushInfo)); Marshal.StructureToPtr(stuPushInfo, pInParam, true); result = OriginalSDK.CLIENT_AddAnalyseTask(lLoginID, emDataSourceType, pInParam, ref pOutParam, nWaitTime); ; NetGetLastError(result); return result; } finally { Marshal.FreeHGlobal(pInParam); } } public static bool AddAnalyseTask(IntPtr lLoginID, EM_DATA_SOURCE_TYPE emDataSourceType, IntPtr pInParam, ref NET_OUT_ADD_ANALYSE_TASK pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_AddAnalyseTask(lLoginID, emDataSourceType, pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 删除智能分析任务 /// /// Lonin return value 登陆ID /// 入参 /// 出参 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool RemoveAnalyseTask(IntPtr lLoginID, ref NET_IN_REMOVE_ANALYSE_TASK pInParam, ref NET_OUT_REMOVE_ANALYSE_TASK pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_RemoveAnalyseTask(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅智能分析结果 /// /// Lonin return value 登陆ID /// 入参 /// waittime 等待时间 /// failed return Intptr.Zero, successful return other; 失败返回Intptr.Zero 成功返回其他值 public static IntPtr AttachAnalyseTaskResult(IntPtr lLoginID, ref NET_IN_ATTACH_ANALYSE_RESULT pInParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachAnalyseTaskResult(lLoginID, ref pInParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅智能分析结果 /// /// AttachAnalyseTaskResult返回结果 /// failed return false, successful return true 失败返回false 成功返回true public static bool DetachAnalyseTaskResult(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachAnalyseTaskResult(lAttachHandle); NetGetLastError(result); return result; } public static bool FindAnalyseTask(IntPtr lLoginID, ref NET_IN_FIND_ANALYSE_TASK stuInParam, ref NET_OUT_FIND_ANALYSE_TASK stuOutParam, int nWaitTime) { bool result = false; IntPtr pOut = IntPtr.Zero; try { pOut = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NET_OUT_FIND_ANALYSE_TASK))); result = OriginalSDK.CLIENT_FindAnalyseTask(lLoginID, ref stuInParam, pOut, nWaitTime); if (result) { stuOutParam = (NET_OUT_FIND_ANALYSE_TASK)Marshal.PtrToStructure(pOut, typeof(NET_OUT_FIND_ANALYSE_TASK)); } } finally { Marshal.FreeHGlobal(pOut); } NetGetLastError(result); return result; } #endregion /// /// Open PlayGroup /// 打开播放组 /// /// failed return 0,successful return PlayGroupID 失败返回0,成功返回大于O的值 public static IntPtr OpenPlayGroup() { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_OpenPlayGroup(); NetGetLastError(result); return result; } /// /// Add PlayHandle To PlayGroup /// 将播放句柄加入播放组,保证同步播放 /// /// 输入数据 /// 输出数据 /// failed return false, successful return true 失败返回false 成功返回true public static bool AddPlayHandleToPlayGroup(ref NET_IN_ADD_PLAYHANDLE_TO_PLAYGROUP pInParam, ref NET_OUT_ADD_PLAYHANDLE_TO_PLAYGROUP pOutParam) { bool result = false; result = OriginalSDK.CLIENT_AddPlayHandleToPlayGroup(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// Pause or Play PlayGroup /// 暂停或继续播放组 /// /// PlayGroupID 播放组ID /// false:play;true:pause false:播放;true:暂停 /// failed return false, successful return true 失败返回false 成功返回true public static bool PausePlayGroup(IntPtr lPlayGroupHandle, bool bPause) { bool result = false; result = OriginalSDK.CLIENT_PausePlayGroup(lPlayGroupHandle, bPause); NetGetLastError(result); return result; } /// /// Query the time of PlayGroup /// 查询播放组的播放时间 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryPlayGroupTime(ref NET_IN_QUERY_PLAYGROUP_TIME pInParam, ref NET_OUT_QUERY_PLAYGROUP_TIME pOutParam) { bool result = false; result = OriginalSDK.CLIENT_QueryPlayGroupTime(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// Delete From PlayGroup /// 将指定句柄从播放组中删除 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DeletePlayHandleFromPlayGroup(ref NET_IN_DELETE_FROM_PLAYGROUP pInParam, ref NET_OUT_DELETE_FROM_PLAYGROUP pOutParam) { bool result = false; result = OriginalSDK.CLIENT_DeleteFromPlayGroup(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// close PlayGroup /// 关闭播放组 /// /// 播放组ID /// failed return false, successful return true 失败返回false 成功返回true public static bool ClosePlayGroup(IntPtr lPlayGroupHandle) { bool result = false; result = OriginalSDK.CLIENT_ClosePlayGroup(lPlayGroupHandle); NetGetLastError(result); return result; } /// /// Set PlayGroup Direction /// 设置播放组播放方向 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool SetPlayGroupDirection(ref NET_IN_SET_PLAYGROUP_DIRECTION pInParam, ref NET_OUT_SET_PLAYGROUP_DIRECTION pOutParam) { bool result = false; result = OriginalSDK.CLIENT_SetPlayGroupDirection(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// Set PlayGroup Speed /// 设置播放组播放速度 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool SetPlayGroupSpeed(ref NET_IN_SET_PLAYGROUP_SPEED pInParam, ref NET_OUT_SET_PLAYGROUP_SPEED pOutParam) { bool result = false; result = OriginalSDK.CLIENT_SetPlayGroupSpeed(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// PlayGroup play fast /// 播放组快放 /// /// 播放组ID /// failed return false, successful return true 失败返回false 成功返回true public static bool FastPlayGroup(IntPtr lPlayGroupHandle) { bool result = false; result = OriginalSDK.CLIENT_FastPlayGroup(lPlayGroupHandle); NetGetLastError(result); return result; } /// /// PlayGroup play slow /// 播放组慢放 /// /// 播放组ID /// failed return false, successful return true 失败返回false 成功返回true public static bool SlowPlayGroup(IntPtr lPlayGroupHandle) { bool result = false; result = OriginalSDK.CLIENT_SlowPlayGroup(lPlayGroupHandle); NetGetLastError(result); return result; } /// /// PlayGroup play normal /// 播放组正常播放 /// /// 播放组ID /// failed return false, successful return true 失败返回false 成功返回true public static bool NormalPlayGroup(IntPtr lPlayGroupHandle) { bool result = false; result = OriginalSDK.CLIENT_NormalPlayGroup(lPlayGroupHandle); NetGetLastError(result); return result; } /// /// start upload remote file /// 开始上传文件 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static IntPtr StartUploadRemoteFile(IntPtr lLoginID, ref NET_IN_UPLOAD_REMOTE_FILE pInParam, ref NET_OUT_UPLOAD_REMOTE_FILE pOutParam, fUploadFileCallBack cbUploadFile, IntPtr dwUser) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartUploadRemoteFile(lLoginID, ref pInParam, ref pOutParam, cbUploadFile, dwUser); NetGetLastError(result); return result; } /// /// stop upload remote file /// 停止文件上传 /// /// 上传ID /// failed return false, successful return true 失败返回false 成功返回true public static bool StopUploadRemoteFile(IntPtr lPlayGroupHandle) { bool result = false; result = OriginalSDK.CLIENT_StopUploadRemoteFile(lPlayGroupHandle); NetGetLastError(result); return result; } /// /// 开始打标签 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool TagManagerStartTag(IntPtr lLoginID, ref NET_IN_TAGMANAGER_STARTTAG_INFO pInParam, ref NET_OUT_TAGMANAGER_STARTTAG_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TagManagerStartTag(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 停止打标签 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool TagManagerStopTag(IntPtr lLoginID, ref NET_IN_TAGMANAGER_STOPTAG_INFO pInParam, ref NET_OUT_TAGMANAGER_STOPTAG_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TagManagerStopTag(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取标签状态 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool TagManagerGetTagState(IntPtr lLoginID, ref NET_IN_TAGMANAGER_GETTAGSTATE_INFO pInParam, ref NET_OUT_TAGMANAGER_GETTAGSTATE_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TagManagerGetTagState(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 开始查询标签信息 /// /// /// /// failed return 0, successful return the handle 失败返回0,成功返回大于0的值 public static IntPtr TagManagerStartFind(IntPtr lLoginID, ref NET_IN_TAGMANAGER_STARTFIND_INFO pInParam, ref NET_OUT_TAGMANAGER_STARTFIND_INFO pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_TagManagerStartFind(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取标签查询结果信息 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool TagManagerDoFind(IntPtr lLoginID, ref NET_IN_TAGMANAGER_DOFIND_INFO pInParam, ref NET_OUT_TAGMANAGER_DOFIND_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TagManagerDoFind(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取标签查询能力 /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool TagManagerGetCaps(IntPtr lLoginID, ref NET_IN_TAGMANAGER_GETCAPS_INFO pInParam, ref NET_OUT_TAGMANAGER_GETCAPS_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TagManagerGetCaps(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 停止打标签 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool TagManagerStopFind(IntPtr lLoginID) { bool result = false; result = OriginalSDK.CLIENT_TagManagerStopFind(lLoginID); NetGetLastError(result); return result; } /// /// 获取黑体异常报警能力 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool GetHumanRadioCaps(IntPtr lLoginID, ref NET_IN_GET_HUMAN_RADIO_CAPS pInParam, ref NET_OUT_GET_HUMAN_RADIO_CAPS pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetHumanRadioCaps(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 异步添加自定义设备 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool AsyncAddCustomDevice(IntPtr lLoginID, ref NET_IN_ASYNC_ADD_CUSTOM_DEVICE pInParam, ref NET_OUT_ASYNC_ADD_CUSTOM_DEVICE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_AsyncAddCustomDevice(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 删除设备 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool RemoveDevice(IntPtr lLoginID, ref NET_IN_REMOVE_DEVICE pInParam, ref NET_OUT_REMOVE_DEVICE pOutParam, int nWaitTime) { bool result = false; IntPtr inPtr = Marshal.AllocHGlobal((int)pInParam.dwSize); Marshal.StructureToPtr(pInParam, inPtr, true); IntPtr outPtr = Marshal.AllocHGlobal((int)pOutParam.dwSize); Marshal.StructureToPtr(pOutParam, outPtr, true); result = OriginalSDK.CLIENT_RemoveDevice(lLoginID, inPtr, outPtr, nWaitTime); NetGetLastError(result); if (result) { pOutParam = (NET_OUT_REMOVE_DEVICE)Marshal.PtrToStructure(outPtr, typeof(NET_OUT_REMOVE_DEVICE)); } Marshal.FreeHGlobal(inPtr); Marshal.FreeHGlobal(outPtr); return result; } /// /// 下载离线智能分析数据-图片 /// /// failed return 0, successful return the handle 失败返回0,成功返回大于0的值 public static IntPtr LoadOffLineFile(IntPtr lLoginID, int nChannelID, uint dwAlarmType, NET_TIME_EX lpStartTime, NET_TIME_EX lpEndTime, fAnalyzerDataCallBack cbAnalyzerData, IntPtr dwUser) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_LoadOffLineFile(lLoginID, nChannelID, dwAlarmType, lpStartTime, lpEndTime, cbAnalyzerData, dwUser); NetGetLastError(result); return result; } /// /// 获取回放帧速 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool GetFramePlayBack(IntPtr lPlayBackID, ref int nfileframerate, ref int nplayframerate) { bool result = false; result = OriginalSDK.CLIENT_GetFramePlayBack(lPlayBackID, ref nfileframerate, ref nplayframerate); NetGetLastError(result); return result; } /// /// 设置回放帧速 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool SetFramePlayBack(IntPtr lPlayBackID, int framerate) { bool result = false; result = OriginalSDK.CLIENT_SetFramePlayBack(lPlayBackID, framerate); NetGetLastError(result); return result; } public static IntPtr StartSearchDevicesEx(ref NET_IN_STARTSERACH_DEVICE pInBuf, ref NET_OUT_STARTSERACH_DEVICE pOutBuf) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartSearchDevicesEx(ref pInBuf, ref pOutBuf); NetGetLastError(result); return result; } /// /// search device log item /// 查询设备日志条数 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryDevLogCount(IntPtr lLoginID, ref NET_IN_GETCOUNT_LOG_PARAM pInParam, ref NET_OUT_GETCOUNT_LOG_PARAM pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_QueryDevLogCount(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Start query log(support BSC only) /// 开始查询日志(目前只支持门禁BSC系列) /// /// failed return 0, successful return non-0 失败返回0 成功返回非0 public static IntPtr StartQueryLog(IntPtr lLoginID, ref NET_IN_START_QUERYLOG pInParam, ref NET_OUT_START_QUERYLOG pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartQueryLog(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Query next log(support BSC only) /// 获取日志(目前只支持门禁BSC系列) /// /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryNextLog(IntPtr lFindLogID, ref NET_IN_QUERYNEXTLOG pInParam, ref NET_OUT_QUERYNEXTLOG pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_QueryNextLog(lFindLogID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Stop query log(support BSC only) /// 结束查询日志(目前只支持门禁BSC系列) /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StopQueryLog(IntPtr lFindLogID) { bool result = false; result = OriginalSDK.CLIENT_StopQueryLog(lFindLogID); NetGetLastError(result); return result; } /// /// 开始升级设备程序--扩展,pchFileName由用户申请释放内存,大小为MAX_PATH /// /// failed return 0, successful return the handle 失败返回0,成功返回大于0的值 public static IntPtr StartUpgrade(IntPtr lLoginID, EM_UPGRADE_TYPE emType, string pchFileName, fUpgradeCallBack cbUpgrade, IntPtr dwUser) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartUpgradeEx(lLoginID, emType, pchFileName, cbUpgrade, dwUser); NetGetLastError(result); return result; } /// /// 重启系统,恢复出厂默认(包括清空配置和删除账户)并重启,实现硬复位功能 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool ResetSystem(IntPtr lLoginID, ref NET_IN_RESET_SYSTEM pInParam, ref NET_OUT_RESET_SYSTEM pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ResetSystem(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 恢复出厂配置扩展接口(包括清空配置和删除账户),实现硬复位及软复位功能 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool ResetSystemEx(IntPtr lLoginID, ref NET_IN_RESET_SYSTEM_EX pInParam, ref NET_OUT_RESET_SYSTEM_EX pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ResetSystemEx(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 发送数据 /// /// StartUpgrade返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool SendUpgrade(IntPtr lUpgradeID) { bool result = false; result = OriginalSDK.CLIENT_SendUpgrade(lUpgradeID); NetGetLastError(result); return result; } /// /// 结束升级设备程序 /// /// StartUpgrade返回值 /// failed return false, successful return true 失败返回false 成功返回true public static bool StopUpgrade(IntPtr lUpgradeID) { bool result = false; result = OriginalSDK.CLIENT_StopUpgrade(lUpgradeID); NetGetLastError(result); return result; } /// /// 开始查询人员信息 /// /// failed return 0, successful return the handle 失败返回0,成功返回大于0的值 public static IntPtr StartFindUserInfo(IntPtr lLoginID, ref NET_IN_USERINFO_START_FIND pstIn, ref NET_OUT_USERINFO_START_FIND pstOut, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartFindUserInfo(lLoginID, ref pstIn, ref pstOut, nWaitTime); NetGetLastError(result); return result; } /// /// 获取人员信息 ,lFindHandle 为StartFindUserInfo接口返回值 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DoFindUserInfo(IntPtr lFindHandle, ref NET_IN_USERINFO_DO_FIND pstIn, ref NET_OUT_USERINFO_DO_FIND pstOut, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DoFindUserInfo(lFindHandle, ref pstIn, ref pstOut, nWaitTime); NetGetLastError(result); return result; } /// /// 停止查询人员信息 ,lFindHandle 为StartFindUserInfo接口返回值 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StopFindUserInfo(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_StopFindUserInfo(lFindHandle); NetGetLastError(result); return result; } /// /// 开始查询卡片信息 /// /// failed return 0, successful return the handle 失败返回0,成功返回大于0的值 public static IntPtr StartFindCardInfo(IntPtr lLoginID, ref NET_IN_CARDINFO_START_FIND pstIn, ref NET_OUT_CARDINFO_START_FIND pstOut, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartFindCardInfo(lLoginID, ref pstIn, ref pstOut, nWaitTime); NetGetLastError(result); return result; } /// /// 获取卡片信息,lFindHandle 为StartFindCardInfo接口返回值 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DoFindCardInfo(IntPtr lFindHandle, ref NET_IN_CARDINFO_DO_FIND pstIn, ref NET_OUT_CARDINFO_DO_FIND pstOut, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DoFindCardInfo(lFindHandle, ref pstIn, ref pstOut, nWaitTime); NetGetLastError(result); return result; } /// /// 停止查询卡片信息,lFindHandle 为StartFindCardInfo接口返回值 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StopFindCardInfo(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_StopFindCardInfo(lFindHandle); NetGetLastError(result); return result; } /// /// 门禁人脸信息管理接口 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool OperateAccessFaceService(IntPtr lLoginID, EM_NET_ACCESS_CTL_FACE_SERVICE emtype, IntPtr pstInParam, IntPtr pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_OperateAccessFaceService(lLoginID, emtype, pstInParam, pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅雷达的报警点信息 /// /// /// /// /// /// public static IntPtr AttachRadarAlarmPointInfo(IntPtr lLoginID, NET_IN_RADAR_ALARMPOINTINFO pInParam, ref NET_OUT_RADAR_ALARMPOINTINFO pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachRadarAlarmPointInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅雷达的报警点信息 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DetachRadarAlarmPointInfo(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachRadarAlarmPointInfo(lAttachHandle); NetGetLastError(result); return result; } /// /// 雷达操作 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool RadarOperate(IntPtr lLoginID, EM_RADAR_OPERATE_TYPE emtype, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_RadarOperate(lLoginID, emtype, pInBuf, pOutBuf, nWaitTime); NetGetLastError(result); return result; } /// /// Radar add link-SD /// 用于雷达联动球机添加 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool AddRadarLinkSD(IntPtr lLoginID, ref NET_IN_RADAR_ADD_RADARLINKSD pstInParam, ref NET_OUT_RADAR_ADD_RADARLINKSD pstOutParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_AddRadarLinkSD(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Radar delete link-SD /// 用于雷达联动球机删除 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DelRadarLinkSD(IntPtr lLoginID, ref NET_IN_RADAR_DEL_RADARLINKSD pstInParam, ref NET_OUT_RADAR_DEL_RADARLINKSD pstOutParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_DelRadarLinkSD(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// radar get link SD state /// 获取雷达联动的远程球机状态 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool GetRadarLinkSDState(IntPtr lLoginID, ref NET_IN_RADAR_GET_LINKSTATE pstInParam, ref NET_OUT_RADAR_GET_LINKSTATE pstOutParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_GetRadarLinkSDState(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Search IO status /// 查询IO状态(pState内存由用户申请释放,根据emType对应的类型找到相应的结构体,进而确定申请内存大小) /// /// failed return false, successful return true 失败返回false 成功返回true public static bool QueryIOControlState(IntPtr lLoginID, EM_NET_IOTYPE emType, IntPtr pState, int maxlen, ref int nIOCount, int waittime = 1000) { bool result = false; result = OriginalSDK.CLIENT_QueryIOControlState(lLoginID, emType, pState, maxlen, ref nIOCount, waittime); NetGetLastError(result); return result; } /// /// IO control,user malloc memory of pState, please refer to corresponding structure of emType /// IO控制(pState内存由用户申请释放,根据emType对应的类型找到相应的结构体,进而确定申请内存大小) /// /// failed return false, successful return true 失败返回false 成功返回true public static bool IOControl(IntPtr lLoginID, EM_NET_IOTYPE emType, IntPtr pState, int maxlen) { bool result = false; result = OriginalSDK.CLIENT_IOControl(lLoginID, emType, pState, maxlen); NetGetLastError(result); return result; } /// /// 获取设备点位信息 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool SCADAGetAttributeInfo(IntPtr lLoginID, IntPtr pstInParam, IntPtr pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SCADAGetAttributeInfo(lLoginID, pstInParam, pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 根据楼层号获取对应梯控模块映射关系 /// /// public static bool GetFloorInfo(IntPtr lLoginID, ref NET_IN_GET_FLOOR_INFO pstInParam, ref NET_OUT_GET_FLOOR_INFO pstOutParam, uint dwWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetFloorInfo(lLoginID, ref pstInParam, ref pstOutParam, dwWaitTime); NetGetLastError(result); return result; } /// /// 自定义定时抓图订阅接口(目前智慧养殖猪温检测在用) /// /// failed return 0, successful return the handle 失败返回0,成功返回不等于0的值 public static IntPtr AttachCustomSnapInfo(IntPtr lLoginID, ref NET_IN_ATTACH_CUSTOM_SNAP_INFO pstInParam, ref NET_OUT_ATTACH_CUSTOM_SNAP_INFO pstOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachCustomSnapInfo(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消自定义定时抓图订阅接口(目前智慧养殖猪温检测在用) /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DetachCustomSnapInfo(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachCustomSnapInfo(lFindHandle); NetGetLastError(result); return result; } /// /// operate Monitor Wall,user malloc memory of pInParam and pOutParam,please refer to the corresponding structure of emType /// 电视墙操作,pInParam与pOutParam内存由用户申请释放,大小参照emType对应的结构体 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool OperateMonitorWall(IntPtr lLoginID, NET_MONITORWALL_OPERATE_TYPE emType, IntPtr pInParam, IntPtr pOutParam, int nWaitTime = 5000) { bool result = false; result = OriginalSDK.CLIENT_OperateMonitorWall(lLoginID, emType, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取电视墙场景,pInParam与pOutParam内存由用户申请释放 /// get scene of monitor wall ,user malloc memory of pInParam and pOutParam /// /// /// /// failed return false, successful return true 失败返回false 成功返回true public static bool MonitorWallGetScene(IntPtr lLoginID, ref NET_A_IN_MONITORWALL_GET_SCENE pInParam, ref NET_A_OUT_MONITORWALL_GET_SCENE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_MonitorWallGetScene(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取设备序列号 /// /// public static bool GetDeviceSerialNo(IntPtr lLoginID, ref NET_IN_GET_DEVICESERIALNO_INFO pstInParam, ref NET_OUT_GET_DEVICESERIALNO_INFO pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetDeviceSerialNo(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取机器名称 /// /// public static bool GetMachineName(IntPtr lLoginID, ref NET_IN_GET_MACHINENAME_INFO pstInParam, ref NET_OUT_GET_MACHINENAME_INFO pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetMachineName(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Subscribe to Bus status /// 订阅Bus状态 /// /// failed return 0, successful return the handle 失败返回0,成功返回不等于0的值 public static IntPtr AttachBusState(IntPtr lLoginID, ref NET_IN_BUS_ATTACH pstuInBus, ref NET_OUT_BUS_ATTACH pstuOutBus, int nWaitTime = 3000) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachBusState(lLoginID, ref pstuInBus, ref pstuOutBus, nWaitTime); NetGetLastError(result); return result; } /// /// Stop subscribing to Bus status /// 停止订阅Bus状态 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DetachBusState(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachBusState(lAttachHandle); NetGetLastError(result); return result; } /// /// Set playback speed /// 设置录像回放速度 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool SetPlayBackSpeed(IntPtr lPlayHandle, EM_PLAY_BACK_SPEED emSpeed) { bool result = false; result = OriginalSDK.CLIENT_SetPlayBackSpeed(lPlayHandle, emSpeed); NetGetLastError(result); return result; } /// /// Record by time marker /// 按时间标记录像 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool SetMarkFileByTime(IntPtr lLoginID, ref NET_IN_SET_MARK_FILE_BY_TIME pInParam, ref NET_OUT_SET_MARK_FILE_BY_TIME pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_SetMarkFileByTime(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Acquire sign video info /// 获取标记录像信息 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool GetMarkInfo(IntPtr lLoginID, ref NET_IN_GET_MARK_INFO pInParam, ref NET_OUT_GET_MARK_INFO pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_GetMarkInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Interface of get record state /// 获取录像状态 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool GetRecordState(IntPtr lLoginID, ref NET_IN_GET_RECORD_STATE pInParam, ref NET_OUT_GET_RECORD_STATE pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_GetRecordState(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Start or stop record /// 开启/关闭指定通道录像 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool SetCourseRecordState(IntPtr lLoginID, ref NET_IN_SET_COURSE_RECORD_STATE pInParam, ref NET_OUT_SET_COURSE_RECORD_STATE pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_SetCourseRecordState(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Get code rate, bit rate /// 获取码率,比特率 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool GetVideoEncodeBitrate(IntPtr lLoginID, ref NET_IN_GET_VIDEO_ENCODE_BITRATE_INFO pInParam, ref NET_OUT_GET_VIDEO_ENCODE_BITRATE_INFO pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_GetVideoEncodeBitrate(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// pre-upload remote file to remote device /// 通过存储设备远程预上传文件至前端设备,用于识别前端设备是否具备接收文件的条件 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool RemotePreUploadFile(IntPtr lLoginID, ref NET_IN_REMOTE_PREUPLOAD_FILE pInParam, ref NET_OUT_REMOTE_PREUPLOAD_FILE pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_RemotePreUploadFile(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Start to upload remote file to remote device. pInParam and pOutParam managed by users /// 开始异步通过存储设备上传文件到前端设备 pInParam与pOutParam内存由用户申请释放 /// /// failed return 0, successful return the handle 失败返回0,成功返回不等于0的值 public static IntPtr StartRemoteUploadFile(IntPtr lLoginID, ref NET_IN_REMOTE_UPLOAD_FILE pInParam, ref NET_OUT_REMOTE_UPLOAD_FILE pOutParam, int nWaitTime = 1000) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartRemoteUploadFile(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Stop to upload remote file to remote device /// 停止异步通过存储设备上传文件到前端设备 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StopRemoteUploadFile(IntPtr lRemoteUploadFileID) { bool result = false; result = OriginalSDK.CLIENT_StopRemoteUploadFile(lRemoteUploadFileID); NetGetLastError(result); return result; } /// /// Get the file information in the remote specified directory (including files / subdirectories), pInParam and pOutParam managed by users /// 得到远程指定目录下文件信息(含文件/子目录)pInParam与pOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool RemoteList(IntPtr lLoginID, ref NET_IN_REMOTE_LIST pInParam, ref NET_OUT_REMOTE_LIST pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_RemoteList(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Delete multiple remote files or directories, pInParam and pOutParam managed by users /// 删除多个远程文件或目录 pInParam与pOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool RemoteRemoveFiles(IntPtr lLoginID, ref NET_IN_REMOTE_REMOVE_FILES pInParam, ref NET_OUT_REMOTE_REMOVE_FILES pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_RemoteRemoveFiles(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Set upload file length, user malloc memory of pInParam and pOutParam /// 设置文件长度, pInParam与pOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool PreUploadRemoteFile(IntPtr lLoginID, ref NET_IN_PRE_UPLOAD_REMOTE_FILE pInParam, ref NET_OUT_PRE_UPLOAD_REMOTE_FILE pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_PreUploadRemoteFile(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// sybcgribize fule upload,user malloc memory of pInParam and pOutParam /// 同步文件上传, 只适用于小文件,pInParam与pOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool UploadRemoteFile(IntPtr lLoginID, ref NET_IN_UPLOAD_REMOTE_FILE pInParam, ref NET_OUT_UPLOAD_REMOTE_FILE pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_UploadRemoteFile(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// display files and subdirectories in a directory,user malloc memory of pInParam and pOutParam /// 显示目录中文件和子目录,pInParam与pOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool ListRemoteFile(IntPtr lLoginID, ref NET_IN_LIST_REMOTE_FILE pInParam, ref NET_OUT_LIST_REMOTE_FILE pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_ListRemoteFile(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// remove file,user malloc memory of pInParam and pOutParam /// 删除文件或目录,pInParam与pOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool RemoveRemoteFiles(IntPtr lLoginID, ref NET_IN_REMOVE_REMOTE_FILES pInParam, ref NET_OUT_REMOVE_REMOTE_FILES pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_RemoveRemoteFiles(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// multimodal Target recognition /// 开始目标识别多通道查询 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StartMultiFindFaceRecognitionRecord(IntPtr lLoginID, ref NET_IN_STARTMULTIFIND_FACERECONGNITIONRECORD pInParam, ref NET_OUT_STARTMULTIFIND_FACERECONGNITIONRECORD pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_StartMultiFindFaceRecognitionRecord(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// multi channel Search file:nFilecount:the searched amount. The return value is media file amount. The search in the specified time completed if return /// failed return false, successful return true 失败返回false 成功返回true public static bool DoFindFaceRecognitionRecord(ref NET_IN_DOFIND_FACERECONGNITIONRECORD inParam, ref NET_OUT_DOFIND_FACERECONGNITIONRECORD outParam, int nWaitTime) { bool result = OriginalSDK.CLIENT_DoFindFaceRecognitionRecord(ref inParam, ref outParam, nWaitTime); NetGetLastError(result); return result; } /// /// end search /// 结束查询 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StopFindFaceRecognitionRecord(IntPtr lFindHandle) { bool result = OriginalSDK.CLIENT_StopFindFaceRecognitionRecord(lFindHandle); NetGetLastError(result); return result; } /// /// Alarm upload function. Enable service. dwTimeOut paramter is invalid /// 警上传功能,启动服务;dwTimeOut参数已无效 /// /// failed return false, successful return true 失败返回false 成功返回true public static IntPtr StartService(uint wPort, IntPtr pIp, fServiceCallBack pfscb, uint dwTimeOut = 0xffffffff, IntPtr dwUserData = new IntPtr()) { IntPtr result = OriginalSDK.CLIENT_StartService(wPort, pIp, pfscb, dwTimeOut, dwUserData); NetGetLastError(result); return result; } /// /// add logical cameras by group,user malloc and free (pInParam's and pOutParam's) memory /// 批量添加视频源,pInParam与pOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool MatrixAddCamerasByGroup(IntPtr lLoginID, ref NET_IN_ADD_LOGIC_BYGROUP_CAMERA pInParam, ref NET_OUT_ADD_LOGIC_BYGROUP_CAMERA pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_MatrixAddCamerasByGroup(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// get camera all by group, user malloc and free (pInParam's and pOutParam's) memory /// 按组获取视频通道 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool MatrixGetCameraAllByGroup(IntPtr lLoginID, ref NET_IN_GET_CAMERA_ALL_BY_GROUP pInParam, ref NET_OUT_GET_CAMERA_ALL_BY_GROUP pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_MatrixGetCameraAllByGroup(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// delete camera by group, user malloc and free (pInParam's and pOutParam's) memory /// 按组删除视频通道 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool MatrixDeleteCameraByGroup(IntPtr lLoginID, ref NET_IN_DELETE_CAMERA_BY_GROUP pInParam, ref NET_OUT_DELETE_CAMERA_BY_GROUP pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_MatrixDeleteCameraByGroup(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// open burning session, return to burning session handle,user malloc and free (pstInParam's and pstOutParam's) memory /// 打开刻录会话, 返回刻录会话句柄,pstInParam与pstOutParam内存由用户申请释放 /// /// failed return 0, successful return the handle 失败返回0,成功返回不等于0的值 public static IntPtr StartBurnSession(IntPtr lLoginID, ref NET_IN_START_BURN_SESSION pstInParam, ref NET_OUT_START_BURN_SESSION pstOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartBurnSession(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// close burning session /// 关闭刻录会话 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StopBurnSession(IntPtr lBurnSession) { bool result = false; result = OriginalSDK.CLIENT_StopBurnSession(lBurnSession); NetGetLastError(result); return result; } /// /// start burning,user malloc and free (pstInParam's and pstOutParam's) memory /// 开始刻录,pstInParam与pstOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StartBurn(IntPtr lBurnSession, ref NET_IN_START_BURN pstInParam, ref NET_OUT_START_BURN pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_StartBurn(lBurnSession, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// stop burning /// 停止刻录 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StopBurn(IntPtr lBurnSession) { bool result = false; result = OriginalSDK.CLIENT_StopBurn(lBurnSession); NetGetLastError(result); return result; } /// /// pause/recover burning /// 暂停/恢复刻录 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool PauseBurn(IntPtr lBurnSession, bool bPause) { bool result = false; result = OriginalSDK.CLIENT_PauseBurn(lBurnSession, bPause); NetGetLastError(result); return result; } /// /// attach burn state,user malloc and free (pstInParam's and pstOutParam's) memory /// 监听刻录状态,pstInParam与pstOutParam内存由用户申请释放 /// /// failed return 0, successful return the handle 失败返回0,成功返回不等于0的值 public static IntPtr AttachBurnState(IntPtr lLoginID, ref NET_IN_ATTACH_STATE pstInParam, ref NET_OUT_ATTACH_STATE pstOutParam, int nWaitTime = 1000) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachBurnState(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// cancel listening burning status, lAttachHandle is CLIENT_AttachBurnState return value /// 取消监听刻录状态,lAttachHandle是CLIENT_AttachBurnState返回值 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DetachBurnState(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachBurnState(lAttachHandle); NetGetLastError(result); return result; } /// /// key mark,user malloc and free (pstInParam's and pstOutParam's) memory /// 重点标记,pstInParam与pstOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool BurnMarkTag(IntPtr lBurnSession, ref NET_IN_BURN_MARK_TAG pstInParam, ref NET_OUT_BURN_MARK_TAG pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_BurnMarkTag(lBurnSession, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// get burning status,user malloc and free (pstInParam's and pstOutParam's) memory /// 获取刻录状态,pstInParam与pstOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool BurnGetState(IntPtr lBurnSession, ref NET_IN_BURN_GET_STATE pstInParam, ref NET_OUT_BURN_GET_STATE pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_BurnGetState(lBurnSession, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Start the backup task, and the memory of pstInParam and pstOutParam will be released by the user /// 开始备份任务,pstInParam与pstOutParam内存由用户申请释放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool StartBackupTask(IntPtr lLoginID, ref NET_IN_START_BACKUP_TASK_INFO pstInParam, ref NET_OUT_START_BACKUP_TASK_INFO pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_StartBackupTask(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Subscribe to the backup status, pstInParam and pstOutParam memory are released by the user's application /// 订阅备份状态,pstInParam与pstOutParam内存由用户申请释放 /// /// failed return 0, successful return the handle 失败返回0,成功返回不等于0的值 public static IntPtr AttachBackupTaskState(IntPtr lLoginID, ref NET_IN_ATTACH_BACKUP_STATE pstInParam, ref NET_OUT_ATTACH_BACKUP_STATE pstOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachBackupTaskState(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Unsubscribe the backup state, lAttachHandle is the return value of CLIENT_AttachBackupTaskState /// 取消订阅备份状态,lAttachHandle是CLIENT_AttachBackupTaskState返回值 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool DetachBackupTaskState(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachBackupTaskState(lAttachHandle); NetGetLastError(result); return result; } /// /// Real-time monitoring - Extends the Ex2 interface /// 实时预览--扩展Ex2接口 /// /// failed return 0, successful return the handle 失败返回0,成功返回不等于0的值 public static IntPtr RealPlayEx2(IntPtr lLoginID, ref NET_IN_REALPLAY pInParam, ref NET_OUT_REALPLAY pOutParam, uint dwWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_RealPlayEx2(lLoginID, ref pInParam, ref pOutParam, dwWaitTime); NetGetLastError(result); return result; } /// /// Set screen overlay callback /// 设置屏幕叠加回调 /// public static void RigisterDrawFun(fDrawCallBack cbDraw, IntPtr dwUser) { OriginalSDK.CLIENT_RigisterDrawFun(cbDraw, dwUser); } /// /// 计算两张人脸图片的相似度faceRecognitionServer.matchTwoFace,pstInParam与pstOutParam内存由用户申请释放 /// calculate the similarity of two face images,user malloc and free memory of pstInParam and pstOutParam /// public static bool MatchTwoFaceImage(IntPtr lLoginID, ref NET_MATCH_TWO_FACE_IN pstInParam, ref NET_MATCH_TWO_FACE_OUT pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_MatchTwoFaceImage(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 根据查询条件返回录像备份任务的信息表,pInParam与pOutParam内存由用户申请释放 /// The information table of video backup task is returned according to the query conditions. The memory of pInParam and pOutParam is released by the user. /// /// CLIENT_Login's return value /// input info 输入参数 /// output info 输出参数 /// Wait timeout, million second /// failed return false, successful return true 失败返回false 成功返回true public static bool FindRecordBackupRestoreTaskInfos(IntPtr lLoginID, ref NET_IN_FIND_REC_BAK_RST_TASK pInParam, ref NET_OUT_FIND_REC_BAK_RST_TASK pOutParam, int nWaitTime = 3000) { bool result = false; result = OriginalSDK.CLIENT_FindRecordBackupRestoreTaskInfos(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 添加考试录像计划 /// Add test video plan /// /// CLIENT_Login's return value /// input info 输入参数 /// output info 输出参数 /// Wait timeout, million second /// failed return false, successful return true 失败返回false 成功返回true public static bool SetExamRecordingPlans(IntPtr lLoginID, ref NET_IN_SET_EXAM_RECORDING_PLANS pstuInParam, ref NET_OUT_SET_EXAM_RECORDING_PLANS pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetExamRecordingPlans(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 手动抓图, 支持并发调用 /// Manual snap, Indicates concurrent calls /// public static bool ManualSnap(IntPtr lLoginID, ref NET_IN_MANUAL_SNAP pInParam, ref NET_OUT_MANUAL_SNAP pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ManualSnap(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Open stream /// 打开流 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool PlayOpenStream(int nPort, IntPtr pFileHeadBuf, uint nSize, uint nBufPoolSize) { bool result = false; result = OriginalSDK.PLAY_OpenStream(nPort, pFileHeadBuf, nSize, nBufPoolSize); return result; } /// /// Turn on playback, playback starts, the size of the playback video screen will be adjusted according to the hWnd window, to display full screen, as long as the hWnd window is enlarged to full screen. Start decoding thread, if the incoming display window handle is NULL, it is not displayed, but it does not affect decoding /// 开启播放,播放开始,播放视频画面大小将根据hWnd窗口调整,要全屏显示,只要把hWnd窗口放大到全屏。开始解码线程,若送入的显示窗口句柄为NULL,则不显示,但是不影响解码 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool PlayPlay(int nPort, IntPtr hWnd) { bool result = false; result = OriginalSDK.PLAY_Play(nPort, hWnd); return result; } /// /// Input data stream, to be used after PlayPlay /// 输入数据流,PlayPlay之后使用 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool PlayInputData(int nPort, IntPtr pBuf, uint nSize) { bool result = false; result = OriginalSDK.PLAY_InputData(nPort, pBuf, nSize); return result; } /// /// Stop play /// 关闭播放 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool PlayStop(int nPort) { bool result = false; result = OriginalSDK.PLAY_Stop(nPort); return result; } /// /// Close stream /// 关闭流 /// /// failed return false, successful return true 失败返回false 成功返回true public static bool PlayCloseStream(int nPort) { bool result = false; result = OriginalSDK.PLAY_CloseStream(nPort); return result; } /// /// Get monitor wall collections /// 获取电视墙预案 /// /// Lonin return value 登陆ID /// input struct info 输入结构体 /// output struct info 输出结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool GetMonitorWallCollections(IntPtr lLoginID, ref NET_IN_WM_GET_COLLECTIONS pInParam, ref NET_OUT_WM_GET_COLLECTIONS pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_GetMonitorWallCollections(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Load monitor wall collections /// 加载电视墙预案 /// /// Lonin return value 登陆ID /// input struct info 输入结构体 /// output struct info 输出结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool LoadMonitorWallCollection(IntPtr lLoginID, ref NET_IN_WM_LOAD_COLLECTION pInParam, ref NET_OUT_WM_LOAD_COLLECTION pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_LoadMonitorWallCollection(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Save monitor wall collections /// 添加电视墙预案 /// /// Lonin return value 登陆ID /// input struct info 输入结构体 /// output struct info 输出结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool SaveMonitorWallCollection(IntPtr lLoginID, ref NET_IN_WM_SAVE_COLLECTION pInParam, ref NET_OUT_WM_SAVE_COLLECTION pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_SaveMonitorWallCollection(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Rename monitor wall collections(If the original plan name is empty, the plan will be deleted) /// 修改电视墙预案名称(原预案名为空则为删除该预案) /// /// Lonin return value 登陆ID /// input struct info 输入结构体 /// output struct info 输出结构体 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool RenameMonitorWallCollection(IntPtr lLoginID, ref NET_IN_WM_RENAME_COLLECTION pInParam, ref NET_OUT_WM_RENAME_COLLECTION pOutParam, int nWaitTime = 1000) { bool result = false; result = OriginalSDK.CLIENT_RenameMonitorWallCollection(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// Web information upload interface /// web信息上传接口 /// /// Lonin return value 登陆ID /// input info 输入参数 /// output info 输出参数 /// waittime 等待时间 /// failed return false, successful return true 失败返回false 成功返回true public static bool TransmitInfoForWebEx(IntPtr lLoginID, ref NET_IN_TRANSMIT_INFO pInParam, ref NET_OUT_TRANSMIT_INFO pOutParam, int nWaittime = 3000) { bool result = false; result = OriginalSDK.CLIENT_TransmitInfoForWebEx(lLoginID, ref pInParam, ref pOutParam, nWaittime); NetGetLastError(result); return result; } /// /// 获取流量统计信息,pstInParam与pstOutParam内存由用户申请释放 /// start find flux state,user malloc and free (pstInParam's and pstOutParam's) memory /// /// Lonin return value 登陆ID /// input info 输入参数 /// output info 输出参数 /// failed return 0, successful return lFindHandle 失败返回0 成功返回lFindHandle public static IntPtr StartFindFluxStat(IntPtr lLoginID, ref NET_IN_TRAFFICSTARTFINDSTAT pstInParam, ref NET_OUT_TRAFFICSTARTFINDSTAT pstOutParam) { return OriginalSDK.CLIENT_StartFindFluxStat(lLoginID, ref pstInParam, ref pstOutParam); } /// /// 继续查询流量统计,pstInParam与pstOutParam内存由用户申请释放 /// do find flux state,user malloc and free (pstInParam's and pstOutParam's) memory /// /// FindHandle value 登陆ID /// input info 输入参数 /// output info 输出参数 /// failed return -1, successful return 1 失败返回 -1 成功返回 1 public static int DoFindFluxStat(IntPtr lFindHandle, ref NET_IN_TRAFFICDOFINDSTAT pstInParam, ref NET_OUT_TRAFFICDOFINDSTAT pstOutParam) { int result = 0; result = OriginalSDK.CLIENT_DoFindFluxStat(lFindHandle, ref pstInParam, ref pstOutParam); if (result == -1) NetGetLastError(result); return result; } /// /// 结束查询流量统计 /// stop find flux state /// /// FindHandle value 登陆ID /// failed return false, successful return true 失败返回false 成功返回true public static bool StopFindFluxStat(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_StopFindFluxStat(lFindHandle); NetGetLastError(result); return result; } // /// 添加人脸库下载任务 /// Add task of download face data base /// public static bool AddFaceDbDownLoadTask(IntPtr lLoginID, ref NET_IN_ADD_FACEDB_DOWNLOAD_TASK pInParam, ref NET_OUT_ADD_FACEDB_DOWNLOAD_TASK pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_AddFaceDbDownLoadTask(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅人脸库下载结果 /// Attach the result of downloading face data base /// public static IntPtr AttachFaceDbDownLoadResult(IntPtr lLoginID, ref NET_IN_ATTACH_FACEDB_DOWNLOAD_RESULT pInParam, ref NET_OUT_ATTACH_FACEDB_DOWNLOAD_RESULT pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachFaceDbDownLoadResult(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅人脸库下载结果 lAttachHandle为 AttachFaceDbDownLoadResult 接口的返回值 /// Detach Attach the result of downloading face data base /// ///@brief , public static bool DetachFaceDbDownLoadResult(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachFaceDbDownLoadResult(lAttachHandle); NetGetLastError(result); return result; } /// /// 设置解码窗口输出OSD信息扩展接口(pInparam, pOutParam内存由用户申请释放) /// set splite output OSD info ----expand interface (the memory of pInParam and pOutParam applyed and released by user),user malloc and free (pInParam's and pOutParam's)memory /// [Obsolete("此接口已弃用,原因是NET_IN_SPLIT_SET_OSD_EX结构体过大,请使用形参为IntPtr的重载\n" + "This interface has been deprecated due to the excessive size of the NET_IN_SPLIT_SET_OSD_EX structure. Please use an overload with the parameter IntPtr")] public static bool SetSplitOSDEx(IntPtr lLoginID, ref NET_IN_SPLIT_SET_OSD_EX pInParam, ref NET_OUT_SPLIT_SET_OSD_EX pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetSplitOSDEx(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取解码窗口输出OSD信息扩展接口(pInparam, pOutParam内存由用户申请释放) /// get splite output OSD info ----expand interface (the memory of pInParam and pOutParam applyed and released by user),user malloc and free (pInParam's and pOutParam's)memory /// [Obsolete("此接口已弃用,原因是NET_OUT_SPLIT_GET_OSD_EX结构体过大,请使用形参为IntPtr的重载\n" + "This interface has been deprecated due to the excessive size of the NET_OUT_SPLIT_GET_OSD_EX structure. Please use an overload with the parameter IntPtr")] public static bool GetSplitOSDEx(IntPtr lLoginID, ref NET_IN_SPLIT_GET_OSD_EX pInParam, ref NET_OUT_SPLIT_GET_OSD_EX pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetSplitOSDEx(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 设置解码窗口输出OSD信息扩展接口(pInparam, pOutParam内存由用户申请释放) /// set splite output OSD info ----expand interface (the memory of pInParam and pOutParam applyed and released by user),user malloc and free (pInParam's and pOutParam's)memory /// public static bool SetSplitOSDEx(IntPtr lLoginID, IntPtr pInParam, IntPtr pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetSplitOSDEx(lLoginID, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取解码窗口输出OSD信息扩展接口(pInparam, pOutParam内存由用户申请释放) /// get splite output OSD info ----expand interface (the memory of pInParam and pOutParam applyed and released by user),user malloc and free (pInParam's and pOutParam's)memory /// public static bool GetSplitOSDEx(IntPtr lLoginID, IntPtr pInParam, IntPtr pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetSplitOSDEx(lLoginID, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 在线升级检查是否有可用升级包, pInParam和pOutParam内存由用户申请和释放 /// Check Cloud Upgrader, user mallloc memory of pInParam and pOutParam /// public static bool CheckCloudUpgrader(IntPtr lLoginID, ref NET_IN_CHECK_CLOUD_UPGRADER pInParam, ref NET_OUT_CHECK_CLOUD_UPGRADER pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_CheckCloudUpgrader(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 执行在线云升级, pInParam和pOutParam内存由用户申请和释放 /// Execute Cloud Upgrader, user mallloc memory of pInParam and pOutParam /// public static bool ExecuteCloudUpgrader(IntPtr lLoginID, ref NET_IN_EXECUTE_CLOUD_UPGRADER pInParam, ref NET_OUT_EXECUTE_CLOUD_UPGRADER pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ExecuteCloudUpgrader(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取云升级在线升级状态, pInParam和pOutParam内存由用户申请和释放 /// Get Cloud Upgrader State, user mallloc memory of pInParam and pOutParam /// public static bool GetCloudUpgraderState(IntPtr lLoginID, ref NET_IN_GET_CLOUD_UPGRADER_STATE pInParam, ref NET_OUT_GET_CLOUD_UPGRADER_STATE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetCloudUpgraderState(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 开始目标检测/注册库的多通道查询(IVSS产品特色功能以图搜图支持两段式查询。第一步先上传大图并从中识别出目标小图,返回小图的SmallID,第二步用SmallID进行以图搜图) /// Start the multi-channel query of target detection / registry (IVSS product features the function of image search, which supports two-stage query. The first step is to upload the large image and identify the target small image, return the smallid of the small image, and the second step is to search the image with smallid) /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstInParam 接口输入参数; [in] pstInParam Interface input parameters /// [out]pstOutParam 接口输出参数; [out] pstOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; True indicates success and false indicates failure public static bool StartMultiPersonFindFaceR(IntPtr lLoginID, ref NET_IN_STARTMULTIPERSONFIND_FACER pstInParam, ref NET_OUT_STARTMULTIPERSONFIND_FACER pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_StartMultiPersonFindFaceR(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取目标检测令牌 /// Get target detection token /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数; [in] pInParam Interface input parameters /// [out]pOutParam 接口输出参数; [out] pOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; True indicates success and false indicates failure public static bool FaceRServerGetDetectToken(IntPtr lLoginID, ref NET_IN_FACERSERVER_GETDETEVTTOKEN pInParam, ref NET_OUT_FACERSERVER_GETDETEVTTOKEN pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_FaceRServerGetDetectToken(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 指定时间段内录像自定义重命名 /// Rename the recording within the specified time period /// /// [in] lLoginID: 登录句柄; [in] lLoginID: Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam: Interface input parameters, memory resources are requested and released by the user /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam: Interface output parameters, memory resources are requested and released by the user /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime: Interface timeout, in milliseconds /// TRUE表示成功FALSE表示失败; TRUE means success, FALSE means failure public static bool SetFileAlias(IntPtr lLoginID, ref NET_IN_SET_FILE_ALIAS_INFO pstuInParam, ref NET_OUT_SET_FILE_ALIAS_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetFileAlias(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 根据录像的命名调取录像 /// Query the video according to the name of the video /// /// [in] lLoginID: 登录句柄; [in] lLoginID: Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam: Interface input parameters, memory resources are requested and released by the user /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam: Interface output parameters, memory resources are requested and released by the user /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime: Interface timeout, in milliseconds /// TRUE表示成功FALSE表示失败; TRUE means success, FALSE means failure public static bool SearchFileByAlias(IntPtr lLoginID, ref NET_IN_SEARCH_FILE_BYALIAS_INFO pstuInParam, ref NET_OUT_SEARCH_FILE_BYALIAS_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SearchFileByAlias(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取水质检测能力 /// Acquire water quality detection capability /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Interface input parameters /// [out]pstuOutParam 接口输出参数; [out]pstuOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success FALSE indicates failure public static IntPtr GetWaterDataStatServerCaps(IntPtr lLoginID, ref NET_IN_WATERDATA_STAT_SERVER_GETCAPS_INFO pstuInParam, ref NET_OUT_WATERDATA_STAT_SERVER_GETCAPS_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_GetWaterDataStatServerCaps(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 开始水质检测报表数据查询 /// Start data query of water quality test report /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Interface input parameters /// [out]pstuOutParam 接口输出参数; [out]pstuOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success FALSE indicates failure public static IntPtr StartFindWaterDataStatServer(IntPtr lLoginID, ref NET_IN_START_FIND_WATERDATA_STAT_SERVER_INFO pstuInParam, ref NET_OUT_START_FIND_WATERDATA_STAT_SERVER_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartFindWaterDataStatServer(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 水质检测报表数据查询 /// Data query of water quality test report /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Interface input parameters /// [out]pstuOutParam 接口输出参数; [out]pstuOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success FALSE indicates failure public static IntPtr DoFindWaterDataStatServer(IntPtr lLoginID, ref NET_IN_DO_FIND_WATERDATA_STAT_SERVER_INFO pstuInParam, ref NET_OUT_DO_FIND_WATERDATA_STAT_SERVER_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_DoFindWaterDataStatServer(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 停止水质检测报表数据查询 /// Stop data query of water quality test report /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Interface input parameters /// [out]pstuOutParam 接口输出参数; [out]pstuOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success FALSE indicates failure public static IntPtr StopFindWaterDataStatServer(IntPtr lLoginID, ref NET_IN_STOP_FIND_WATERDATA_STAT_SERVER_INFO pstuInParam, ref NET_OUT_STOP_FIND_WATERDATA_STAT_SERVER_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StopFindWaterDataStatServer(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 水质检测实时数据获取 /// Real time data acquisition of water quality detection /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Interface input parameters /// [out]pstuOutParam 接口输出参数; [out]pstuOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success FALSE indicates failure public static IntPtr GetWaterDataStatServerWaterData(IntPtr lLoginID, ref NET_IN_WATERDATA_STAT_SERVER_GETDATA_INFO pstuInParam, ref NET_OUT_WATERDATA_STAT_SERVER_GETDATA_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_GetWaterDataStatServerWaterData(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取设备状态, DMSS专用接口, pInParam与pOutParam内存由用户申请释放 /// public static bool GetUnifiedStatus(IntPtr lLoginID, ref NET_IN_UNIFIEDINFOCOLLECT_GET_DEVSTATUS pInParam, ref NET_OUT_UNIFIEDINFOCOLLECT_GET_DEVSTATUS pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetUnifiedStatus(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅统计通道数据,pInParam与pOutParam内存由用户申请释放 /// Subscribe to statistical channel data, and the memory of pinparam and outparam is released by user application /// public static IntPtr AttachVideoStatStream(IntPtr lLoginID, ref NET_IN_ATTACH_VIDEOSTAT_STREAM pInParam, ref NET_OUT_ATTACH_VIDEOSTAT_STREAM pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachVideoStatStream(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅统计通道数据 /// Unsubscribe statistics channel data /// public static bool DetachVideoStatStream(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachVideoStatStream(lAttachHandle); NetGetLastError(result); return result; } /// /// 添加多个人员信息和人脸样本 /// batch append persons, user malloc and free (pstInParam's and pstOutParam's) memory /// public static bool BatchAppendFaceRecognition(IntPtr lLoginID, ref NET_IN_BATCH_APPEND_FACERECONGNITION pstInParam, ref NET_OUT_BATCH_APPEND_FACERECONGNITION pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_BatchAppendFaceRecognition(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// :设置GPS信息UUID /// :set gps uuid /// /// [in]: LLONG :lLoginID 登陆句柄; [in]: LLONG :lLoginID login handle /// [in]: NET_IN_SUBCRIBE_GPS_INFO :pInParam 接口输入参数, 内存资源由用户申请和释放; [in]: NET_IN_SUBCRIBE_GPS_INFO :pInParam Interface input parameters, memory resources are applied and released by the user /// [out]: NET_OUT_SET_GPS_UUID_INFO :pOutParam 接口输出参数, 内存资源由用户申请和释放; [out]: NET_OUT_SET_GPS_UUID_INFO :pOutParam Interface output parameters, memory resources are applied and released by the user /// TRUE表示成功 FALSE表示失败; True indicates success and false indicates failure public static bool SetGPSUuidInfo(IntPtr lLoginID, ref NET_IN_SET_GPS_UUID_INFO pInParam, ref NET_OUT_SET_GPS_UUID_INFO pOutParam) { bool result = false; result = OriginalSDK.CLIENT_SetGPSUuidInfo(lLoginID, ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// 人脸库导入接口 /// interface of import face DB /// public static IntPtr ImportFaceDB(IntPtr lLoginID, ref NET_IN_IMPORT_FACE_DB pInParam, ref NET_OUT_IMPORT_FACE_DB pOutParam) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_ImportFaceDB(lLoginID, ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// 停止人脸库导入 /// interface of stopping import face DB /// public static bool StopImportFaceDB(IntPtr lImportFaceDbHandle) { bool result = false; result = OriginalSDK.CLIENT_StopImportFaceDB(lImportFaceDbHandle); NetGetLastError(result); return result; } /// /// 人脸库导出接口 /// interface of export face DB /// public static IntPtr ExportFaceDB(IntPtr lLoginID, ref NET_IN_EXPORT_FACE_DB pInParam, ref NET_OUT_EXPORT_FACE_DB pOutParam) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_ExportFaceDB(lLoginID, ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// 停止人脸库导出 /// interface of stop export upload face DB /// public static bool StopExportFaceDB(IntPtr lExportFaceDbHandle) { bool result = false; result = OriginalSDK.CLIENT_StopExportFaceDB(lExportFaceDbHandle); NetGetLastError(result); return result; } /// /// 订阅事件重传,pInParam内存由用户申请释放 /// attach event restore,user malloc and free memory of pInParam /// public static IntPtr AttachEventRestore(IntPtr lLoginID, ref NET_IN_ATTACH_EVENT_RESTORE pInParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachEventRestore(lLoginID, ref pInParam, nWaitTime); NetGetLastError(result); return result; } /// /// 停止订阅事件重传,pInParam内存由用户申请释放 /// detach event restore ,user malloc and free memory of pInParam /// public static bool DetachEventRestore(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachEventRestore(lAttachHandle); NetGetLastError(result); return result; } /// /// 查询远程设备状态,nType为DEVSTATE_ALARM_FRONTDISCONNECT时,通道号从1开始(pBuf内存由用户申请释放) /// query remote device state,when nType = DEVSTATE_ALARM_FRONTDISCONNECT,the number form 1. /// public static bool QueryRemotDevState(IntPtr lLoginID, int nType, int nChannelID, IntPtr pBuf, int nBufLen, IntPtr pRetLen, int waittime) { bool result = false; result = OriginalSDK.CLIENT_QueryRemotDevState(lLoginID, nType, nChannelID, pBuf, nBufLen, pRetLen, waittime); NetGetLastError(result); return result; } /// /// 报警主机设置操作 /// Set operate of alarm region /// public static bool SetAlarmRegionInfo(IntPtr lLoginID, EM_A_NET_EM_SET_ALARMREGION_INFO emType, IntPtr pstuInParam, IntPtr pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetAlarmRegionInfo(lLoginID, emType, pstuInParam, pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅无线对码信息接口,pstInParam与pstOutParam内存由用户申请释放 /// Order wireless code info port,user malloc memory of pstInBuf and pstOutBuf /// public static IntPtr AttachLowRateWPAN(IntPtr lLoginID, ref NET_IN_ATTACH_LOWRATEWPAN pstInParam, ref NET_OUT_ATTACH_LOWRATEWPAN pstOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachLowRateWPAN(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 平台下发轮询配置 < NET_IN_SET_POLLING_CONFIG pInParam > < NET_OUT_SET_POLLING_CONFIG pOutParam > /// Set Polling Config /// public static bool SetPollingConfig(IntPtr lLoginID, IntPtr pInParam, IntPtr pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetPollingConfig(lLoginID, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// RPC测试 /// RPC test /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool TransmitCmd(IntPtr lLoginID, ref NET_IN_TRANSMIT_CMD pstuInParam, ref NET_OUT_TRANSMIT_CMD pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TransmitCmd(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 手动测试 /// Manual test /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool ManualTest(IntPtr lLoginID, ref NET_IN_MANUAL_TEST pstuInParam, ref NET_OUT_MANUAL_TEST pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ManualTest(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 添加报警用户 /// Add alarm user /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool AddAlarmUser(IntPtr lLoginID, ref NET_IN_ADD_ALARM_USER pstuInParam, ref NET_OUT_ADD_ALARM_USER pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_AddAlarmUser(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 修改报警用户 /// Modify alarm user /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool ModifyAlarmUser(IntPtr lLoginID, ref NET_IN_MODIFY_ALARM_USER pstuInParam, ref NET_OUT_MODIFY_ALARM_USER pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ModifyAlarmUser(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 修改报警用户密码 /// Modify alarm user password /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool ModifyAlarmUserPassword(IntPtr lLoginID, ref NET_IN_MODIFY_ALARM_USER_PASSWORD pstuInParam, ref NET_OUT_MODIFY_ALARM_USER_PASSWORD pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ModifyAlarmUserPassword(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 删除报警用户 /// Modify Delete user password /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool DeleteAlarmUser(IntPtr lLoginID, ref NET_IN_DELETE_ALARM_USER pstuInParam, ref NET_OUT_DELETE_ALARM_USER pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DeleteAlarmUser(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 实时预览--端到端音视频加密 /// Real-time preview End-to-end audio and video encryption /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam Interface input parameters /// [out]pstuOutParam 接口输出参数, 内存资源由用户申请和释放; [out]pOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; Returns the realplay handle public static IntPtr RealPlayForSpGdpr(IntPtr lLoginID, ref NET_IN_REALPLAY_FOR_SP_GDPR pInParam, ref NET_OUT_REALPLAY_FOR_SP_GDPR pOutParam, uint dwWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_RealPlayForSpGdpr(lLoginID, ref pInParam, ref pOutParam, dwWaitTime); NetGetLastError(result); return result; } /// /// 按时间方式回放--端到端加密方案 /// Playback by time -- end-to-end encryption scheme /// @Param [in] lLoginID login handle /// @Param [in] nChannelID channel number /// @Param [in] lpStartTime Playback start event /// @Param [in] lpStopTime playback end event /// @Param [in] hWnd window handle /// @Param [in] cbDownLoadPos progress callback /// @Param [in] dwPosUser progress callback user data /// @Param [in] fDownLoadDataCallBack data callback /// @Param [in] dwDataUser data callback user data /// @Return non-0 means handle 0 means failure /// /// 非0表示句柄 0 表示失败 public static IntPtr PlayBackByTimeForSpGdpr(IntPtr lLoginID, int nChannelID, ref NET_TIME lpStartTime, ref NET_TIME lpStopTime, IntPtr hWnd, fDownLoadPosCallBack cbDownLoadPos, IntPtr dwPosUser, fDataCallBack fDownLoadDataCallBack, IntPtr dwDataUser) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_PlayBackByTimeForSpGdpr(lLoginID, nChannelID, ref lpStartTime, ref lpStopTime, hWnd, cbDownLoadPos, dwPosUser, fDownLoadDataCallBack, dwDataUser); NetGetLastError(result); return result; } /// /// 设置窗口轮巡显示源(pInparam, pOutParam内存由用户申请释放) /// set window tour display source,user malloc and free (pInParam's and pOutParam's)memory /// public static bool SetTourSource(IntPtr lLoginID, ref NET_IN_SET_TOUR_SOURCE pInParam, ref NET_OUT_SET_TOUR_SOURCE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetTourSource(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取窗口轮巡显示源(pInparam, pOutParam内存由用户申请释放) /// get window tour display source,user malloc and free (pInParam's and pOutParam's)memory /// public static bool GetTourSource(IntPtr lLoginID, ref NET_IN_GET_TOUR_SOURCE pInParam, ref NET_OUT_GET_TOUR_SOURCE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetTourSource(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 查询系统状态(pstuStatus内存由用户申请释放) /// Search system status,user malloc and free pstuStatus's memory /// public static bool QuerySystemStatus(IntPtr lLoginID, ref NET_A_SYSTEM_STATUS pstuStatus, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_QuerySystemStatus(lLoginID, ref pstuStatus, nWaitTime); NetGetLastError(result); return result; } /// /// 局部放大(pSrcRect内存由用户申请释放) /// partial enlarged /// public static bool SetDisplayRegion(IntPtr lPlayHandle, uint nRegionNum, ref NET_A_DISPLAYRREGION pSrcRect, IntPtr hDestWnd, bool bEnable) { bool result = false; result = OriginalSDK.CLIENT_SetDisplayRegion(lPlayHandle, nRegionNum, ref pSrcRect, hDestWnd, bEnable); NetGetLastError(result); return result; } /// /// 获取码流值 /// Get stream Bitrate /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口入参; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam 接口出参; [out] pstuOutParam Indicates the outgoing parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Timeout period of the interface, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE Indicates success. FALSE Indicates failure public static bool GetEncodeBitrate(IntPtr lLoginID, ref NET_IN_GET_ENCODE_BITRATE pstuInParam, ref NET_OUT_GET_ENCODE_BITRATE pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetEncodeBitrate(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取课程录像模式,pInBuf与pOutBuf内存由用户申请释放 /// get course record mode,user malloc and free memory of pInBuf and pOutBuf /// public static bool GetCourseRecordMode(IntPtr lLoginID, ref NET_IN_GET_COURSE_RECORD_MODE pInBuf, ref NET_OUT_GET_COURSE_RECORD_MODE pOutBuf, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetCourseRecordMode(lLoginID, ref pInBuf, ref pOutBuf, nWaitTime); NetGetLastError(result); return result; } /// /// 设置课程录像模式,pInBuf与pOutBuf内存由用户申请释放 /// set course record mode,user malloc and free memory of pInBuf and pOutBuf /// public static bool SetCourseRecordMode(IntPtr lLoginID, ref NET_IN_SET_COURSE_RECORD_MODE pInBuf, ref NET_OUT_SET_COURSE_RECORD_MODE pOutBuf, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetCourseRecordMode(lLoginID, ref pInBuf, ref pOutBuf, nWaitTime); NetGetLastError(result); return result; } /// /// 获取真实预览通道号,pInBuf与pOutBuf内存由用户申请释放 /// get course preview channel,user malloc and free memory of pInBuf and pOutBuf /// public static bool GetRealPreviewChannel(IntPtr lLoginID, ref NET_IN_GET_REAL_PREVIEW_CHANNEL pInBuf, ref NET_OUT_GET_REAL_PREVIEW_CHANNEL pOutBuf, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetRealPreviewChannel(lLoginID, ref pInBuf, ref pOutBuf, nWaitTime); NetGetLastError(result); return result; } /// /// 热图数据解压与转换接口 /// radiometry data unachieving and conversion /// /// [in]pRadiometryData [IN] 热图数据, 由 fRadiometryAttachCB 获得; pRadiometryData [IN] radiometry data, obtained from fRadiometryAttachCB /// [out]pGrayImg [IN, OUT] 解压后的数据,是一张灰度图, 传空指针表示不需要此数据 用户需保证传入的缓冲区足够大(不小于 图像像素数*sizeof(unsigned short)) 每个像素对应一个 unsigned short 型数据,表示图像某个像素的热成像灰度(范围 0 ~ 16383), 低地址对应画面左上角,高地址对应画面右下角; pGrayImg [IN, OUT] unachieved data, which is a grayscale image you can pass NULL if this is not needed you must ensure that the buffer is enough (no less than 'pixel number'*sizeof(unsigned short)) for each pixel, there is an unsigned short value representing the grayscale value (range: 0 ~ 16383) and the ordering is top-left pixels in low memory address and lower-right pixels in high memory address /// [out] pTempForPixels [IN, OUT] 每个像素的温度数据 不能传空指针,否则,返回失败 用户需保证传入的缓冲区足够大(不小于 图像像素数*sizeof(float)) 每个像素对应一个 float 型数据,表示该像素位置的摄氏温度 低地址对应画面左上角,高地址对应画面右下角; pTempForPixels [IN, OUT] The temperature buffer for each pixel can not be empty otherwise,it will fail to return you must ensure that the buffer is enough (no less than 'pixel number'*sizeof(float)) for each pixel, there is a float value representing temperature at pixel position, in centigrade and the ordering is top-left pixels in low memory address and lower-right pixels in high memory address /// TRUE 成功,FALSE 失败; TRUE for success, FALSE for failure public static bool RadiometryDataParse(ref NET_RADIOMETRY_DATA pRadiometryData, IntPtr pGrayImg, IntPtr pTempForPixels) { bool result = false; result = OriginalSDK.CLIENT_RadiometryDataParse(ref pRadiometryData, pGrayImg, pTempForPixels); NetGetLastError(result); return result; } /// /// 获取已添加的设备状态 /// Get the status of added devices /// /// TRUE表示成功 FALSE表示失败 public static bool GetDeviceInfoEx(IntPtr lLoginID, ref NET_IN_GET_DEVICE_INFO_EX pstuInParam, ref NET_OUT_GET_DEVICE_INFO_EX pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetDeviceInfoEx(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取已添加的设备状态 inParam = NET_IN_GET_DEVICE_LIST_INFO, outParam = NET_OUT_GET_DEVICE_LIST_INFO /// interface of get added device info inParam = NET_IN_GET_DEVICE_LIST_INFO, outParam = NET_OUT_GET_DEVICE_LIST_INFO /// public static bool GetDeviceInfo(IntPtr lLoginID, IntPtr pInParam, IntPtr pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetDeviceInfo(lLoginID, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取设备通道信息 /// interface of get channel info /// public static bool GetChannelInfo(IntPtr lLoginID, ref NET_IN_GET_CHANNEL_INFO pInParam, ref NET_OUT_GET_CHANNEL_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetChannelInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 开始巡航 /// Start Tour /// /// [in] lLoginID: 登录句柄; [in] lLoginID: login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam: interface input parameters, memory resources are applied and released by the user /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam: interface output parameters, memory resources are applied and released by the user /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime: interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool PTZStartTour(IntPtr lLoginID, ref NET_IN_PTZ_START_TOUR pstuInParam, ref NET_OUT_PTZ_START_TOUR pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_PTZStartTour(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 停止巡航 /// Stop Tour /// /// [in] lLoginID: 登录句柄; [in] lLoginID: login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam: interface input parameters, memory resources are applied and released by the user /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam: interface output parameters, memory resources are applied and released by the user /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime: interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool PTZStopTour(IntPtr lLoginID, ref NET_IN_PTZ_STOP_TOUR pstuInParam, ref NET_OUT_PTZ_STOP_TOUR pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_PTZStopTour(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 手动抓拍图片 /// Manually capturing images /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstInParam Indicates the interface parameter /// [out]pstuOutParam 接口输出参数; [out] pstOutParam Indicates the output parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success. FALSE indicates failure public static bool ManualSnapByEvent(IntPtr lLoginID, ref NET_IN_MANUALSNAP_BY_EVENT_INFO pstuInParam, ref NET_OUT_MANUALSNAP_BY_EVENT_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ManualSnapByEvent(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取测温区域的参数值, pInParam与pOutParam内存由用户申请释放 /// Get the parameter value of the Temperature Monitoring area, user malloc and free memory of pInParam and pOutParam /// public static bool RadiometryGetRandomRegionTemper(IntPtr lLoginID, ref NET_IN_RADIOMETRY_RANDOM_REGION_TEMPER pInParam, ref NET_OUT_RADIOMETRY_RANDOM_REGION_TEMPER pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_RadiometryGetRandomRegionTemper(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取录像时间范围 /// Obtain the video time range /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Indicates the input parameter of the interface /// [out] pstuOutParam 接口输出参数; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Timeout period of the interface, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success. FALSE Indicates failure public static bool GetStorageBoundTime(IntPtr lLoginID, ref NET_IN_GET_STORAGE_BOUND_TIME_INFO pstuInParam, ref NET_OUT_GET_STORAGE_BOUND_TIME_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetStorageBoundTime(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 开始升级设备程序--扩展支持G以上文件升级 /// Begin upgrading device program--extensive,support large file upgrade,for example G bytes file /// public static IntPtr StartUpgradeEx2(IntPtr lLoginID, EM_UPGRADE_TYPE emType, IntPtr pchFileName, fUpgradeCallBackEx cbUpgrade, IntPtr dwUser) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartUpgradeEx2(lLoginID, emType, pchFileName, cbUpgrade, dwUser); NetGetLastError(result); return result; } /// /// 智慧用电Things物模型属性订阅接口 /// Smart electricity Things subscription interface /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam input param, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam output param, memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// 订阅句柄; Attach handle public static IntPtr AttachThingsInfo(IntPtr lLoginID, ref NET_IN_THINGS_ATTACH pInParam, ref NET_OUT_THINGS_ATTACH pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachThingsInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 智慧用电Things取消物模型属性订阅接口 /// Smart electricity Things Unsubscription interface /// /// [in] lAttachHandle 订阅句柄; [in] lAttachHandle Attach handle /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool DetachThingsInfo(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachThingsInfo(lAttachHandle); NetGetLastError(result); return result; } /// /// 智慧用电Things获取设备列表接口 /// Smart electricity Things get device list interface /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam input param, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam output param, memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool GetThingsDevList(IntPtr lLoginID, ref NET_IN_THINGS_GET_DEVLIST pInParam, ref NET_OUT_THINGS_GET_DEVLIST pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetThingsDevList(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 智慧用电Things获取设备能力集接口 /// Smart electricity Things get caps interface /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam input param, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam output param, memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool GetThingsCaps(IntPtr lLoginID, ref NET_IN_THINGS_GET_CAPS pInParam, ref NET_OUT_THINGS_GET_CAPS pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetThingsCaps(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 智慧用电Things配置获取接口 /// Smart electricity Things Configuration acquisition interface /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam input param, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam output param, memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool GetThingsConfig(IntPtr lLoginID, ref NET_IN_THINGS_GET pInParam, ref NET_OUT_THINGS_GET pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetThingsConfig(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 智慧用电Things配置设置接口 /// Smart electricity Things Configure settings interface /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam input param, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam output param, memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool SetThingsConfig(IntPtr lLoginID, ref NET_IN_THINGS_SET pInParam, ref NET_OUT_THINGS_SET pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetThingsConfig(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 开始升级远程设备程序 /// Start remote upgrade /// public static IntPtr StartRemoteUpgrade(IntPtr lLoginID, ref NET_IN_START_REMOTE_UPGRADE_INFO pInParam, ref NET_OUT_START_REMOTE_UPGRADE_INFO pOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartRemoteUpgrade(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 结束升级远程设备程序 /// Stop remote upgrade /// public static bool StopRemoteUpgrade(IntPtr lUpgradeID) { bool result = false; result = OriginalSDK.CLIENT_StopRemoteUpgrade(lUpgradeID); NetGetLastError(result); return result; } /// /// 智慧用电Things物模型服务调用接口 /// Smart electricity Things service interface /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] emType 物模型服务类型; [in] emType service type /// [in] pInBuf 接口输入参数,参考emType类型,内存资源由用户申请和释放; [in] pInBuf input param,memory resources are applied and released by the user /// [out] pOutBuf 接口输出参数, 参考emType类型,内存资源由用户申请和释放; [out] pOutBuf output param,memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool ThingsServiceOperate(IntPtr lLoginID, EM_THINGS_SERVICE_TYPE emType, IntPtr pInBuf, IntPtr pOutBuf, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ThingsServiceOperate(lLoginID, emType, pInBuf, pOutBuf, nWaitTime); NetGetLastError(result); return result; } /// /// 查询设备当前时间扩展接口 /// Search device current time extension interface /// public static bool QueryDeviceTimeEx(IntPtr lLoginID, ref NET_TIME_EX pDeviceTime, int waittime) { bool result = false; result = OriginalSDK.CLIENT_QueryDeviceTimeEx(lLoginID, ref pDeviceTime, waittime); NetGetLastError(result); return result; } /// /// 设置设备当前时间扩展接口 /// Set device current time extension interface /// public static bool SetupDeviceTimeEx(IntPtr lLoginID, ref NET_TIME_EX pDeviceTime) { bool result = false; result = OriginalSDK.CLIENT_SetupDeviceTimeEx(lLoginID, ref pDeviceTime); NetGetLastError(result); return result; } /// /// 镜头聚焦控制 /// dwFocusCommand = 0为聚焦调节 /// dwFocusCommand = 1为连续聚焦调节 /// dwFocusCommand = 2为自动聚焦调节,调节焦点至最佳位置。nFocus和nZoom无效。 /// control focus /// dwFocusCommand = 0 focus adjucy /// dwFocusCommand = 1continuous focus adjustment /// dwFocusCommand = 2 auto adjust ,adjust to the best position,nFocus and nZoominvalid /// public static bool FocusControl(IntPtr lLoginID, int nChannelID, uint dwFocusCommand, double nFocus, double nZoom, IntPtr reserved, int waittime) { bool result = false; result = OriginalSDK.CLIENT_FocusControl(lLoginID, nChannelID, dwFocusCommand, nFocus, nZoom, reserved, waittime); NetGetLastError(result); return result; } /// /// 获取用户添加的所有方案信息 /// Obtain all scheme information added by the user /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口入参; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam 接口出参; [out] pstuOutParam Indicates the outgoing parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Timeout period of the interface, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE Indicates success. FALSE Indicates failure public static bool GetClassify(IntPtr lLoginID, ref NET_IN_GET_CLASSIFY_INFO pstuInParam, ref NET_OUT_GET_CLASSIFY_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetClassify(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 训练服务器训练任务管理模块获取训练任务接口 /// Training server training task management module obtains training task interface /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口入参; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam 接口出参; [out] pstuOutParam Indicates the outgoing parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Timeout period of the interface, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE Indicates success. FALSE Indicates failure public static bool FindTrainingTask(IntPtr lLoginID, ref NET_IN_FIND_TRAININGTASK_INFO pstuInParam, ref NET_OUT_FIND_TRAININGTASK_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_FindTrainingTask(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅训练任务完成情况 /// Subscription training task completion status /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Indicates the interface parameter /// [out] pstuOutParam 接口输出参数; [out] pstuOutParam Indicates the outgoing parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Timeout period of the interface, in milliseconds /// 返回订阅句柄; Return subscription handle public static IntPtr AttachTrainTask(IntPtr lLoginID, ref NET_IN_ATTACH_TRAIN_TASK_INFO pstuInParam, ref NET_OUT_ATTACH_TRAIN_TASK_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachTrainTask(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅实时数据 /// Unsubscribe from real-time data /// /// [in] lAttachHandle 订阅句柄; [in] lAttachHandle Subscription handle /// TRUE表示成功 FALSE表示失败; TRUE Indicates success. FALSE Indicates failure public static bool DetachTrainTask(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachTrainTask(lAttachHandle); NetGetLastError(result); return result; } /// /// 获取用户信息 /// Obtain user information /// public static bool GetUserInfoAll(IntPtr lLoginID, ref NET_IN_GET_USER_ALL_INFO pstuInParam, ref NET_OUT_GET_USER_ALL_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetUserInfoAll(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 开始查找指纹信息 /// 开始查找指纹信息 /// /// [in] lLoginID 登录句柄; [in] lLoginID 登录句柄 /// [in] pstuInParam 接口入参; [in] pstuInParam 接口入参 /// [out] pstuOutParam 接口出参; [out] pstuOutParam 接口出参 /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime 接口超时时间, 单位毫秒 /// 返回控制句柄; 返回控制句柄 public static IntPtr StartFindAccessFingerprint(IntPtr lLoginID, ref NET_IN_FINGERPRINT_START_FIND_INFO pstuInParam, ref NET_OUT_FINGERPRINT_START_FIND_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartFindAccessFingerprint(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 查询指纹信息 /// 查询指纹信息 /// /// [in] lFindHandle 查询句柄; [in] lFindHandle 查询句柄 /// [in] pstuInParam 接口入参; [in] pstuInParam 接口入参 /// [out] pstuOutParam 接口出参; [out] pstuOutParam 接口出参 /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime 接口超时时间, 单位毫秒 /// TRUE 表示成功 FALSE表示失败; TRUE 表示成功 FALSE表示失败 public static bool DoFindAccessFingerprint(IntPtr lFindHandle, ref NET_IN_FINGERPRINT_DO_FIND_INFO pstuInParam, ref NET_OUT_FINGERPRINT_DO_FIND_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DoFindAccessFingerprint(lFindHandle, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 停止指纹查询 /// 停止指纹查询 /// /// [in] lFindHandle 查询句柄; [in] lFindHandle 查询句柄 /// TRUE 表示成功 FALSE表示失败; TRUE 表示成功 FALSE表示失败 public static bool StopFindAccessFingerprint(IntPtr lFindHandle) { bool result = false; result = OriginalSDK.CLIENT_StopFindAccessFingerprint(lFindHandle); NetGetLastError(result); return result; } /// /// 交通抓拍--网络触发方式,pstInParam与pstOutParam内存由用户申请释放 /// traffic snap--snapshot by network,user malloc and free (pstInParam's and pstOutParam's) memory /// public static bool TrafficSnapByNetwork(IntPtr lLoginID, int nChannelID, ref NET_IN_SNAPSHOT pstInParam, ref NET_OUT_SNAPSHOT pstOutParam) { bool result = false; result = OriginalSDK.CLIENT_TrafficSnapByNetwork(lLoginID, nChannelID, ref pstInParam, ref pstOutParam); NetGetLastError(result); return result; } /// /// 设置窗口场景信息 /// Set window scene information /// /// [in] lLoginID 登录ID; [in] lLoginID Login ID /// [in] pInParam 接口入参; [in] pInParam Interface input parameter /// [out] pOutParam 接口出参; [out] pOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout time in milliseconds /// TRUE 表示成功 FALSE表示失败; TRUE indicates success, FALSE indicates failure public static bool SetSplitWindowsInfo(IntPtr lLoginID, IntPtr pInParam, IntPtr pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetSplitWindowsInfo(lLoginID, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 设置窗口次序(pInparam, pOutParam内存由用户申请释放) /// set window order,user malloc and free (pInParam's and pOutParam's)memory /// /// TRUE表示成功 FALSE表示失败 public static bool SetSplitTopWindow(IntPtr lLoginID, ref NET_IN_SPLIT_SET_TOP_WINDOW pInParam, ref NET_OUT_SPLIT_SET_TOP_WINDOW pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetSplitTopWindow(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 关窗(pInparam, pOutParam内存由用户申请释放) /// close window,user malloc and free (pInParam's and pOutParam's)memory /// /// TRUE表示成功 FALSE表示失败 public static bool CloseSplitWindow(IntPtr lLoginID, ref NET_IN_SPLIT_CLOSE_WINDOW pInParam, ref NET_OUT_SPLIT_CLOSE_WINDOW pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_CloseSplitWindow(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取事件详细信息 /// Obtain event details /// /// [in] lLoginID 登录句柄; [in] lLoginID login handle /// [in] pstInParam 接口输入参数; [in] pstInParam Interface input parameter /// [out] pstOutParam 接口输出参数; [out] pstOutParam Interface output parameter /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime nWaitTime Interface timeout, in milliseconds /// TRUE表示成功,FALSE表示失败; TRUE means success FALSE means failure public static bool GetIVSEventDetail(IntPtr lLoginID, ref NET_IN_GET_IVSEVENT_DETAIL_INFO pstuInParam, ref NET_OUT_GET_IVSEVENT_DETAIL_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetIVSEventDetail(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 文件下载,多次触发分包下载大文件,每次请求指定文件名和下载偏移,pOutParam内存由用户申请释放 /// download piece file,user malloc memory of pInParam and pOutParam /// /// TRUE表示成功 FALSE表示失败 public static bool DownloadPieceFile(IntPtr lLoginID, ref NET_IN_DOWNLOAD_PIECE_FILE pInParam, ref NET_OUT_DOWNLOAD_PIECE_FILE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DownloadPieceFile(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取热图数据 /// heatmap data /// /// TRUE表示成功 FALSE表示失败 public static bool GetHeatMapsDirectly(IntPtr lLoginID, ref NET_IN_GET_HEATMAPS_INFO pInParam, ref NET_OUT_GET_HEATMAPS_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetHeatMapsDirectly(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// pstInParam与pstOutParam内存由用户申请释放 /// user malloc memory of pstInParam and pstOutParam /// /// TRUE表示成功 FALSE表示失败 public static bool AddMission(IntPtr lLoginID, ref NET_IN_ADD_MISSION pstInParam, ref NET_OUT_ADD_MISSION pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_AddMission(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取网卡信息(lpInParam, lpOutParam内存由用户申请释放,大小参照emType对应的结构体) /// get net card info,user malloc the memory of lpInParam and lpOutParam,please refer to the corresponding structure of emType /// /// TRUE表示成功 FALSE表示失败 public static bool QueryNetStat(IntPtr lLoginID, EM_NET_QUERY_TYPE emType, IntPtr lpInParam, int nInParamLen, IntPtr lpOutParam, int nOutParamLen, IntPtr pError, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_QueryNetStat(lLoginID, emType, lpInParam, nInParamLen, lpOutParam, nOutParamLen, pError, nWaitTime); NetGetLastError(result); return result; } /// /// 获取规则配置信息(支持只获取配置节点或子节点的部分字段) /// Get Config Partly /// public static bool GetConfigPartly(IntPtr lLoginID, NET_EM_CFGPARTLY_OPERATE_TYPE emCfgOpType, ref NET_CFGPARTLY_OPERATE_FILTER pstuFilter, IntPtr lpOutBuffer, int nOutBufferSize, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetConfigPartly(lLoginID, emCfgOpType, ref pstuFilter, lpOutBuffer, nOutBufferSize, nWaitTime); NetGetLastError(result); return result; } /// /// 获取温湿度信息 /// get Hygrothermograph Infos /// /// [in] lLoginID 登录句柄; [in] lLoginID login handle /// [in] pstInParam 接口输入参数; [in] pstInParam interface input parameter /// [out]pstOutParam 接口输出参数; [out]pstOutParam interface output parameter /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE means success FALSE means failure public static bool GetHygrothermographInfo(IntPtr lLoginID, ref NET_IN_GET_HYGROTHERMOGRAPH_INFO pInParam, ref NET_OUT_GET_HYGROTHERMOGRAPH_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetHygrothermographInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 分组人员统计--获取摘要信息 /// NumberStatGroup--Get summary info /// /// TRUE表示成功 FALSE表示失败 public static bool GetNumberStatGroupSummary(IntPtr lLoginID, ref NET_IN_NUMBERSTATGROUPSUMMARY_INFO pInParam, ref NET_OUT_NUMBERSTATGROUPSUMMARY_INFO pOutParam, int waittime) { bool result = false; result = OriginalSDK.CLIENT_GetNumberStatGroupSummary(lLoginID, ref pInParam, ref pOutParam, waittime); NetGetLastError(result); return result; } /// /// 订阅电梯内实时数据 /// Subscribe to real-time data inside the elevator /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam The input parameters for the interface, memory resources are allocated and released by the user /// [out] pstuOutParam 接口输出参数; [out] pstuOutParam The output parameters for the interface, memory resources are allocated and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// 返回订阅句柄; Return subscription handle public static IntPtr AttachElevatorFloorCounter(IntPtr lLoginID, ref NET_IN_ATTACH_ELEVATOR_FLOOR_COUNTER_INFO pstuInParam, ref NET_OUT_ATTACH_ELEVATOR_FLOOR_COUNTER_INFO pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachElevatorFloorCounter(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅电梯内实时数据 /// Unsubscribe from real-time data in the elevator /// /// [in] lAttachHandle 订阅句柄; [in] lAttachHandle Subscription handle /// TRUE表示成功 FALSE表示失败; indicates success, FALSE indicates failure public static bool DetachElevatorFloorCounter(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachElevatorFloorCounter(lAttachHandle); NetGetLastError(result); return result; } /// /// 获取电视墙上屏幕窗口解码信息,pInParam与pOutParam内存由用户申请释放 /// get monitorwall window info,user malloc memory of pInParam and pOutParam /// /// TRUE表示成功 FALSE表示失败 public static bool MonitorWallGetWindowInfo(IntPtr lLoginID, ref NET_IN_MW_GET_WINODW_INFO pInParam, ref NET_OUT_MW_GET_WINDOW_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_MonitorWallGetWindowInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 门禁设备开始捕获新卡 /// The access control device starts to capture the new card /// /// TRUE表示成功 FALSE表示失败 public static bool AccessControlCaptureNewCard(IntPtr lLoginID, ref NET_IN_ACCESSCONTROL_CAPTURE_NEWCARD pInParam, ref NET_OUT_ACCESSCONTROL_CAPTURE_NEWCARD pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_AccessControlCaptureNewCard(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 布控通道人员组信息,pstInParam与pstOutParam内存由用户申请释放 /// arm channel staff group info ,user malloc and free (pstInParam's and pstOutParam's) memory /// /// TRUE表示成功 FALSE表示失败 public static bool SetGroupInfoForChannel(IntPtr lLoginID, ref NET_IN_SET_GROUPINFO_FOR_CHANNEL pstInParam, ref NET_OUT_SET_GROUPINFO_FOR_CHANNEL pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetGroupInfoForChannel(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 自动标定,阻塞接口,耗时非常久(分钟级) /// Automatic calibration, blocking interface, very time-consuming (in minutes) /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口入参; [in] pstuInParam Interface input parameter /// [out] pstuOutParam 接口出参; [out] pstuOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout time, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success, FALSE indicates failure public static bool StartAutoCalibrate(IntPtr lLoginID, ref NET_IN_START_AUTO_CALIBRATE pstuInParam, ref NET_OUT_START_AUTO_CALIBRATE pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_StartAutoCalibrate(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅标定状态 /// Subscription calibration status /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Interface input parameters /// [out] pstuOutParam 接口输出参数; [out] pstuOutParam Interface output parameters /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout time, in milliseconds /// 返回订阅句柄; Return subscription handle public static IntPtr AttachCalibrateStatus(IntPtr lLoginID, ref NET_IN_ATTACH_CALIBRATE_STATUS pstuInParam, ref NET_OUT_ATTACH_CALIBRATE_STATUS pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachCalibrateStatus(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅标定状态 /// Unsubscribe from calibration status /// /// [in] lAttachHandle 订阅句柄; [in] lAttachHandle Subscription handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Interface input parameters /// [out] pstuOutParam 接口输出参数; [out] pstuOutParam Interface output parameters /// TRUE表示成功 FALSE表示失败; TRUE indicates success, FALSE indicates failure public static bool DetachCalibrateStatus(IntPtr lAttachHandle, ref NET_IN_DETACH_CALIBRATE_STATUS pstuInParam, ref NET_OUT_DETACH_CALIBRATE_STATUS pstuOutParam) { bool result = false; result = OriginalSDK.CLIENT_DetachCalibrateStatus(lAttachHandle, ref pstuInParam, ref pstuOutParam); NetGetLastError(result); return result; } /// /// 设置窗口位置(pInparam, pOutParam内存由用户申请释放) /// set windown position,user malloc and free (pInParam's and pOutParam's)memory /// /// TRUE表示成功 FALSE表示失败 public static bool SetSplitWindowRect(IntPtr lLoginID, ref NET_IN_SPLIT_SET_RECT pInParam, ref NET_OUT_SPLIT_SET_RECT pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetSplitWindowRect(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 查询显示源(pstuSplitSrc内存由用户申请释放) /// get display source,user malloc and free pstuSplitSrc's memory /// /// TRUE表示成功 FALSE表示失败 public static bool GetSplitSource(IntPtr lLoginID, int nChannel, int nWindow, IntPtr pstuSplitSrc, int nMaxCount, ref int nRetCount, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetSplitSource(lLoginID, nChannel, nWindow, pstuSplitSrc, nMaxCount, ref nRetCount, nWaitTime); NetGetLastError(result); return result; } /// /// 获取临时token /// Get a temporary token /// /// TRUE表示成功 FALSE表示失败 public static bool GetTemporaryToken(IntPtr lLoginID, ref NET_IN_GET_TEMPORARY_TOKEN pstuInParam, ref NET_OUT_GET_TEMPORARY_TOKEN pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetTemporaryToken(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取分压业务能力信息, 由主业务模块调用 /// Get capability information of sub business, called by main business module /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam Interface input parameters, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam Interface output parameters, memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒(目前不生效, 保留在此以便后续扩展); [in] nWaitTime Interface timeout in milliseconds(It does not take effect at present. It is reserved here for subsequent expansion) /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool GetSubBusinessCaps(IntPtr lLoginID, ref NET_IN_GET_SUBBIZ_CAPS pInParam, ref NET_OUT_GET_SUBBIZ_CAPS pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetSubBusinessCaps(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 创建业务sdk模块 /// Create sub business module /// /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam Interface input parameters, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam Interface output parameters, memory resources are applied and released by the user /// 业务sdk句柄,非0表示成功 0表示失败; Sub business module handle, Non 0 means success and 0 means failure public static IntPtr CreateSubBusinessModule(ref NET_IN_CREAT_SUB_BUSINESS_MDL_INFO pInParam, ref NET_OUT_CREAT_SUB_BUSINESS_MDL_INFO pOutParam) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_CreateSubBusinessModule(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// 启动子连接监听服务 /// Start sub link listen server /// /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam Interface input parameters, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam Interface output parameters, memory resources are applied and released by the user /// 子链接监听服务句柄, 非0表示成功 0表示失败; Sub libk listen server handle, Non 0 means success and 0 means failure public static IntPtr StartSubLinkListenServer(ref NET_IN_START_SUBLINK_LISTEN_SERVER pInParam, ref NET_OUT_START_SUBLINK_LISTEN_SERVER pOutParam) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_StartSubLinkListenServer(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// 发送创建子连接所需的信息给设备, 由主业务模块调用 /// Send the information required to create a sub connection to the device, called by main business module /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam Interface input parameters, memory resources are applied and released by the user /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam Interface output parameters, memory resources are applied and released by the user /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool TransferSubLinkInfo(IntPtr lLoginID, ref NET_IN_TRANSFER_SUBLINK_INFO pInParam, ref NET_OUT_TRANSFER_SUBLINK_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TransferSubLinkInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 设置私有透传通道参数 /// Set param about private tunnel /// /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam Input param, resources are requested and released by users /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam Output param, resources are requested and released by users /// TRUE表示成功 FALSE表示失败; TRUE:Success FALSE:Failed public static bool SetTransmitTunnelParam(ref NET_IN_SET_TRANSMITTUNNEL_PARAM pInParam, ref NET_OUT_SET_TRANSMITTUNNEL_PARAM pOutParam) { bool result = false; result = OriginalSDK.CLIENT_SetTransmitTunnelParam(ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// 创建隧道 /// Create private tunnel /// /// [in] lSubBizHandle 业务sdk句柄,由CLIENT_CreateSubBusinessModule接口返回; [in] lSubBizHandle Sub business handle, it is returned by CLIENT_CreateSubBusinessModule /// [in] pInParam 接口输入参数, 内存资源由用户申请和释放; [in] pInParam Input param, resosurces are requested and released by users /// [out] pOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pOutParam Output param, resources are requested and released by userss /// LLONG 透传隧道业务句柄,非0表示成功 0表示失败; LLONG Private tunnel handle, Non 0 means success and 0 means failure public static IntPtr CreateTransmitTunnel(IntPtr lSubBizHandle, ref NET_IN_CREATE_TRANSMIT_TUNNEL pInParam, ref NET_OUT_CREATE_TRANSMIT_TUNNEL pOutParam) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_CreateTransmitTunnel(lSubBizHandle, ref pInParam, ref pOutParam); NetGetLastError(result); return result; } /// /// 销毁隧道 /// Destroy private tunnel /// /// [in] lTransmitHandle 透传隧道业务句柄,由CLIENT_CreateTransmitTunnel接口返回; [in] lTransmitHandle Private tunnel handle, it is returned by CLIENT_CreateTransmitTunnel /// TRUE表示成功 FALSE表示失败; TRUE:Success FALSE:Failed public static bool DestroyTransmitTunnel(IntPtr lTransmitHandle) { bool result = false; result = OriginalSDK.CLIENT_DestroyTransmitTunnel(lTransmitHandle); NetGetLastError(result); return result; } /// /// 销毁业务sdk模块 /// Destroy sub business module /// /// [in] lSubBizHandle 业务sdk句柄,由CLIENT_CreateSubBusinessModule接口返回; [in] lSubBizHandle:sub business module handle, it is returned by CLIENT_CreateSubBusinessModule /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool DestroySubBusinessModule(IntPtr lSubBizHandle) { bool result = false; result = OriginalSDK.CLIENT_DestroySubBusinessModule(lSubBizHandle); NetGetLastError(result); return result; } /// /// 停止子连接监听服务 /// Stop sub link listen server /// /// [in] lListenServer 监听服务句柄,由CLIENT_StartSubLinkListenServer接口返回; [in] lListenServer:sub link listen server handle, it is returned by CLIENT_StartSubLinkListenServer /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool StopSubLinkListenServer(IntPtr lListenServer) { bool result = false; result = OriginalSDK.CLIENT_StopSubLinkListenServer(lListenServer); NetGetLastError(result); return result; } /// /// 获取热成像当前冷(最低的温度)、热(最高的温度)点信息 /// Obtaining the imformation of current cold(minimum)and hot(maximum)points in thermal imaging /// /// TRUE表示成功 FALSE表示失败 public static bool RadiometryGetCurrentHotColdSpotInfo(IntPtr lLoginID, ref NET_IN_RADIOMETRY_CURRENTHOTCOLDSPOT_INFO pInParam, ref NET_OUT_RADIOMETRY_CURRENTHOTCOLDSPOT_INFO pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_RadiometryGetCurrentHotColdSpotInfo(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 门禁人证设备获取目标 /// Access control ID device to obtain target /// /// TRUE表示成功 FALSE表示失败 public static bool AccessControlCaptureCmd(IntPtr lLoginID, ref NET_IN_ACCESSCONTROL_CAPTURE_CMD pInParam, ref NET_OUT_ACCESSCONTROL_CAPTURE_CMD pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_AccessControlCaptureCmd(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 下发人员信息录入结果 /// set person input result to device /// /// TRUE表示成功 FALSE表示失败 public static bool SetPersonInfoInputResult(IntPtr lLoginID, ref NET_IN_PERSON_INFO_INPUT_RESULT pInParam, ref NET_OUT_PERSON_INFO_INPUT_RESULT pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_SetPersonInfoInputResult(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅485实时数据 /// Subscribe to 485 real-time data /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam 接口输入参数; [in] pstuInParam Indicates the input parameter of the interface /// [out] pstuOutParam 接口输出参数; [out] pstuOutParam Indicates the output parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Timeout period of the interface, in milliseconds /// 返回订阅句柄; Returns the subscription handle public static IntPtr AttachIotboxComm(IntPtr lLoginID, ref NET_IN_ATTACH_IOTBOX_COMM pstuInParam, ref NET_OUT_ATTACH_IOTBOX_COMM pstuOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachIotboxComm(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅实时数据 /// Unsubscribe from real-time data /// /// [in] lAttachHandle 订阅句柄; [in] lAttachHandle Subscription handle /// TRUE表示成功 FALSE表示失败; TRUE indicates success. FALSE Indicates failure public static bool DetachIotboxComm(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachIotboxComm(lAttachHandle); NetGetLastError(result); return result; } /// /// 获取车载无线模块状态 /// Get mobile module state /// /// TRUE表示成功 FALSE表示失败 public static bool GetMobileModuleState(IntPtr lLoginID, ref NET_IN_GET_MOBILE_MODULE_STATE pInParam, ref NET_OUT_GET_MOBILE_MODULE_STATE pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetMobileModuleState(lLoginID, ref pInParam, ref pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取SIM卡信息接口 /// Get the SIMINFO of SIM card /// /// TRUE表示成功 FALSE表示失败 public static bool GetMobileSIMInfo(IntPtr lLoginID, EM_SIMINFO_TYPE emType, IntPtr pInParam, IntPtr pOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetMobileSIMInfo(lLoginID, emType, pInParam, pOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 网络应用组件 /// 可用于获取前端设备的网络资源数据,如网络收发数据的速率等,pstuIn与pstuOut内存由用户申请释放,大小参照emType对应的结构体 /// network application component, company internal customized port /// used to acquire network source data of front-end device,user malloc and free memory of pstuIn and pstuOut,please refer to corresponding structure of emType /// public static bool RPC_NetApp(IntPtr lLoginID, EM_RPC_NETAPP_TYPE emType, IntPtr pstuIn, IntPtr pstuOut, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_RPC_NetApp(lLoginID, emType, pstuIn, pstuOut, nWaitTime); NetGetLastError(result); return result; } /// /// 区分报表查询, 单独实现一套全量查询数据接口 /// differentiates report query and implements a set of full query data interface separately /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstInParam 接口输入参数; [in] pstInParam Indicates the interface parameter /// [out] pstOutParam 接口输出参数; [out] pstOutParam Indicates the output parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success. FALSE indicates failure public static bool StartFindDetailNumberStatCluster(IntPtr lLoginID, ref NET_IN_START_FIND_DETAIL_CLUSTER pstInParam, ref NET_OUT_START_FIND_DETAIL_CLUSTER pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_StartFindDetailNumberStatCluster(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 分批查询全量记录 /// Query full records in batches /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstInParam 接口输入参数; [in] pstInParam Indicates the interface parameter /// [out] pstOutParam 接口输出参数; [out] pstOutParam Indicates the output parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success. FALSE indicates failure public static bool DoFindDetailNumberStatCluster(IntPtr lLoginID, IntPtr pstInParam, IntPtr pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_DoFindDetailNumberStatCluster(lLoginID, pstInParam, pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 停止查询 /// stop the query /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstInParam 接口输入参数; [in] pstInParam Indicates the interface parameter /// [out] pstOutParam 接口输出参数; [out] pstOutParam Indicates the output parameter of the interface /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success. FALSE indicates failure public static bool StopFindDetailNumberStatCluster(IntPtr lLoginID, ref NET_IN_STOP_FIND_DETAIL_CLUSTER_INFO pstInParam, ref NET_OUT_STOP_FIND_DETAIL_CLUSTER_INFO pstOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_StopFindDetailNumberStatCluster(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 订阅云台可视域,pstuInViewRange与pstuOutViewRange内存由用户申请释放 /// subscribe PTZ visual domain,user malloc memory of pstuInViewRange and pstuOutViewRange /// /// 返回处理句柄 public static IntPtr AttachViewRangeState(IntPtr lLoginID, ref NET_IN_VIEW_RANGE_STATE pstuInViewRange, ref NET_OUT_VIEW_RANGE_STATE pstuOutViewRange, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachViewRangeState(lLoginID, ref pstuInViewRange, ref pstuOutViewRange, nWaitTime); NetGetLastError(result); return result; } /// /// 停止订阅云台可视域,lAttachHandle是CLIENT_AttachViewRangeState返回值 /// stop subscribe PTZ visual domain, lAttachHandle is CLIENT_AttachViewRangeState return value /// /// TRUE表示成功 FALSE表示失败 public static bool DetachViewRangeState(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachViewRangeState(lAttachHandle); NetGetLastError(result); return result; } /// /// 获取从片性能信息 /// Get sub-chip performance information /// /// [in] lLoginID: 登录句柄; [in] lLoginID: Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam: Interface input parameters; memory managed by the user /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam: Interface output parameters; memory managed by the user /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime: Interface timeout duration, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE if successful, FALSE if failed public static bool GetPeripheralChipPerformanceInfoByID(IntPtr lLoginID, ref NET_IN_GET_CHIP_PERFORMANCE_BYID_INFO pstuInParam, ref NET_OUT_GET_CHIP_PERFORMANCE_BYID_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetPeripheralChipPerformanceInfoByID(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取可以升级的芯片列表 /// Get the list of chips that can be upgraded /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam input param, memory resources are applied and released by the user /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam output param, memory resources are applied and released by the user /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool UpgraderGetChipList(IntPtr lLoginID, ref NET_IN_UPGRADER_GET_CHIPLIST_INFO pstuInParam, ref NET_OUT_UPGRADER_GET_CHIPLIST_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_UpgraderGetChipList(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 获取从片状态 /// Get peripheralchip status /// /// [in] lLoginID: 登录句柄; [in] lLoginID Login handle /// [in] pstuInParam: 接口输入参数, 内存资源由用户申请和释放; [in] pstuInParam input param, memory resources are applied and released by the user /// [out] pstuOutParam: 接口输出参数, 内存资源由用户申请和释放; [out] pstuOutParam output param, memory resources are applied and released by the user /// [in] nWaitTime: 接口超时时间, 单位毫秒; [in] nWaitTime Interface timeout in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE:success FALSE:failed public static bool GetPeripheralChipStateByID(IntPtr lLoginID, ref NET_IN_GET_CHIP_STATE_BYID_INFO pstuInParam, ref NET_OUT_GET_CHIP_STATE_BYID_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_GetPeripheralChipStateByID(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 强制I帧;nChannelID:通道号,nSubChannel:码流类型(0:主,1:子码流1) /// Compulsive I frame /// /// TRUE表示成功 FALSE表示失败 public static bool MakeKeyFrame(IntPtr lLoginID, int nChannelID, int nSubChannel) { bool result = false; result = OriginalSDK.CLIENT_MakeKeyFrame(lLoginID, nChannelID, nSubChannel); NetGetLastError(result); return result; } /// /// 停止服务 /// Stop service /// /// TRUE表示成功 FALSE表示失败 public static bool StopService(IntPtr lHandle) { bool result = false; result = OriginalSDK.CLIENT_StopService(lHandle); NetGetLastError(result); return result; } /// /// 订阅客流统计服务实时数据 /// Attach video statistics real-time data /// /// 返回处理句柄 public static IntPtr AttachVideoStatistics(IntPtr lLoginID, ref NET_IN_ATTACH_VIDEO_STATISTICS pstInParam, ref NET_OUT_ATTACH_VIDEO_STATISTICS pstOutParam, int nWaitTime) { IntPtr result = IntPtr.Zero; result = OriginalSDK.CLIENT_AttachVideoStatistics(lLoginID, ref pstInParam, ref pstOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 取消订阅客流统计服务实时数据 /// Detach video statistics real-time data /// /// TRUE表示成功 FALSE表示失败 public static bool DetachVideoStatistics(IntPtr lAttachHandle) { bool result = false; result = OriginalSDK.CLIENT_DetachVideoStatistics(lAttachHandle); NetGetLastError(result); return result; } /// /// 手动发送短信 /// Manually sending text messages /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstInParam 接口输入参数, 内存资源由用户申请和释放; [in] pstInParam Interface input parameters, memory resources are requested and released by the user /// [out] pstOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pstOutParam Interface output parameters, memory resources are requested and released by users /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success, FALSE indicates failure public static bool ManualSendSMS(IntPtr lLoginID, ref NET_IN_MANUAL_SEND_SMS_INFO pstuInParam, ref NET_OUT_MANUAL_SEND_SMS_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ManualSendSMS(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 手动拨打电话 /// Manually make phone calls /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// [in] pstInParam 接口输入参数, 内存资源由用户申请和释放; [in] pstInParam Interface input parameters, memory resources are requested and released by the user /// [out] pstOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pstOutParam Interface output parameters, memory resources are requested and released by users /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success, FALSE indicates failure public static bool ManualMakeCall(IntPtr lLoginID, ref NET_IN_MANUAL_MAKE_CALL_INFO pstuInParam, ref NET_OUT_MANUAL_MAKE_CALL_INFO pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_ManualMakeCall(lLoginID, ref pstuInParam, ref pstuOutParam, nWaitTime); NetGetLastError(result); return result; } /// /// 触发报警 /// Trigger alarm /// /// [in] lLoginID 登录句柄; [in] lLoginID Login handle /// NET_IN_TRIGGER_ALARM_INFO [in] pstInParam 接口输入参数, 内存资源由用户申请和释放; [in] pstInParam Interface input parameters, memory resources are requested and released by the user /// NET_OUT_TRIGGER_ALARM_INFO[out] pstOutParam 接口输出参数, 内存资源由用户申请和释放; [out] pstOutParam Interface output parameters, memory resources are requested and released by users /// [in] nWaitTime 接口超时时间, 单位毫秒; [in] nWaitTime interface timeout, in milliseconds /// TRUE表示成功 FALSE表示失败; TRUE indicates success, FALSE indicates failure public static bool TriggerUnifiedInfoCollectAlarm(IntPtr lLoginID, IntPtr pstuInParam, IntPtr pstuOutParam, int nWaitTime) { bool result = false; result = OriginalSDK.CLIENT_TriggerUnifiedInfoCollectAlarm(lLoginID, pstuInParam, pstuOutParam, nWaitTime); NetGetLastError(result); return result; } #endregion //<< C# SDK calls >> } /// /// throw SDK exception Class /// SDK异常类 /// public class NETClientExcetion : Exception { /// /// SDK error code property /// SDK错误码属性 /// public int ErrorCode { get; private set; } /// /// SDK error message property /// SDK错误信息属性 /// new public string Message { get; private set; } /// /// construct function. /// 构造函数 /// /// SDK error code number /// SDK error message public NETClientExcetion(int errorCode, string message) { ErrorCode = errorCode; Message = message; } } #region << delegate >> /// /// network disconnection callback function original shape /// 断线回调函数 /// /// user LoginID:Login's returns value 登陆ID /// device IP 设备IP /// device prot 设备端口 /// user data from Init function 用户数据 public delegate void fDisConnectCallBack(IntPtr lLoginID, IntPtr pchDVRIP, int nDVRPort, IntPtr dwUser); /// /// network re-connection callback function original shape /// 重连回调函数 /// /// user LoginID:Login's returns value 登陆ID /// device IP,string type 设备IP /// device prot 设备端口 /// user data from SetAutoReconnect function 用户数据 public delegate void fHaveReConnectCallBack(IntPtr lLoginID, IntPtr pchDVRIP, int nDVRPort, IntPtr dwUser); /// /// real-time monitor data callback function original shape---extensive. just only support 32bit. /// 实时预览数据回调函数,只支持32位,不支持64位. /// /// monitor handle 预览句柄 /// callback data type ,only data set in dwFlag will be callback:回调数据类型 /// 0 original data (identicla SaveRealData saveddata) /// 1 frame data /// 2 yuv data /// 3 pcm audio data /// byte array, length is dwBufSize 回调数据缓存 /// callback data, except type 0, other type is base on frame, one frame data per callback /// pBuffer's size 回调数据的缓存大小 /// pointer to parameter structure,based on different type 参数结构体的指针 /// if type is 0(original) or 2(yuv), param is 0 /// if callback data is frame data, pointer to NET_VideoFrameParam /// if callback data is PCM data, pointer to NET_CBPCMDataParam /// user data,which input above public delegate void fRealDataCallBackEx(IntPtr lRealHandle, uint dwDataType, IntPtr pBuffer, uint dwBufSize, int param, IntPtr dwUser); /// /// real-time monitor data callback function original shape---extensive. support 32bit and 64bit /// 实时预览数据回调函数.支持32位和64位. /// /// monitor handle 预览句柄 /// callback data type ,only data set in dwFlag will be callback:回调数据类型 /// 0 original data (identicla SaveRealData saveddata) /// 1 frame data /// 2 yuv data /// 3 pcm audio data /// byte array, length is dwBufSize 回调数据缓存 /// callback data, except type 0, other type is base on frame, one frame data per callback /// pBuffer's size 回调数据的缓存大小 /// pointer to parameter structure,based on different type 参数结构体的指针 /// if type is 0(original) or 2(yuv), param is 0 /// if callback data is frame data, pointer to NET_VideoFrameParam /// if callback data is PCM data, pointer to NET_CBPCMDataParam /// user data,which input above public delegate void fRealDataCallBackEx2(IntPtr lRealHandle, uint dwDataType, IntPtr pBuffer, uint dwBufSize, IntPtr param, IntPtr dwUser); /// /// real-time monitor data callback function original shape---extensive. support 32bit and 64bit /// 回放YUV数据回调函数 /// /// monitor handle 预览句柄 /// byte array, length is dwBufSize 回调数据缓存 /// callback data, except type 0, other type is base on frame, one frame data per callback /// pBuffer's size 回调数据的缓存大小 /// pointer to parameter structure,based on different type 参数结构体的指针 /// if type is 0(original) or 2(yuv), param is 0 /// if callback data is frame data, pointer to NET_VideoFrameParam /// if callback data is PCM data, pointer to NET_CBPCMDataParam /// user data,which input above 用户数据 /// reserved 预留字段 public delegate void fYUVDataCallBack(IntPtr lPlaybackHandle, IntPtr pBuffer, uint dwBufSize, IntPtr param, IntPtr dwUser, IntPtr reserved); /// /// Real-time monitoring of the raw codestream data callback function (pBuffer memory is freed by SDK internal request) /// 实时预览原始码流数据回调函数(pBuffer内存由SDK内部申请释放) /// /// monitor handle 预览句柄 /// byte array, length is dwBufSize 回调数据缓存 /// pBuffer's size 回调数据的缓存大小 /// user data,which input above public delegate void fOriginalRealDataCallBack(IntPtr lRealHandle, IntPtr pBuffer, uint dwBufSize, IntPtr dwUser); /// /// Real-time monitoring of encrypted data callback functions (pBuffer memory is freed by SDK internal request) /// 实时预览加密数据回调函数(pBuffer内存由SDK内部申请释放) /// /// monitor handle 预览句柄 /// byte array, length is dwBufSize 回调数据缓存 /// pBuffer's size 回调数据的缓存大小 /// user data,which input above public delegate void fEncryptRealDataCallBackEx(IntPtr lRealHandle, IntPtr pBuffer, uint dwBufSize, IntPtr dwUser); /// /// monitor disconnect callback function /// 实时预览断线回调函数 /// /// monitoring handle 预览句柄 /// event type 断线类型 /// event parameter,currently not used 断线事件的数据指针 /// user data,which input above 用户数据 public delegate void fRealPlayDisConnectCallBack(IntPtr lRealHandle, EM_REALPLAY_DISCONNECT_EVENT_TYPE dwEventType, IntPtr param, IntPtr dwUser); /// /// VK info callback,dwError value for example:NET_NOERROR,NET_ERROR_VK_INFO_DECRYPT_FAILED /// VK信息回调(pBuffer内存由SDK内部申请释放),dwError值示例比如NET_NOERROR,NET_ERROR_VK_INFO_DECRYPT_FAILED等 /// /// monitoring handle 预览句柄 /// NET_VKINFO struct, length is dwBufSize 回调数据缓存NET_VKINFO /// error code for example:NET_NOERROR,NET_ERROR_VK_INFO_DECRYPT_FAILED 错误码 /// user data,which input above 用户数据 /// reserved 预留字段 public delegate void fVKInfoCallBack(IntPtr lRealHandle, IntPtr pBuffer, uint dwError, IntPtr dwUser, IntPtr pReserved); /// /// snapshot callback function original shape /// 远程抓图数据回调 /// /// loginID,login returns value 登陆ID /// byte array, length is RevLen 数据缓存 /// pointer to data /// pBuf's size 数据缓存大小 /// image encode type:0:mpeg4 I frame;10:jpeg 编码类型 /// operation NO.,not used in Synchronous capture conditions 序列号 /// user data,which input above 用户数据 public delegate void fSnapRevCallBack(IntPtr lLoginID, IntPtr pBuf, uint RevLen, uint EncodeType, uint CmdSerial, IntPtr dwUser); /// /// vt event callback /// vt事件回调 /// /// vt instance id vt实例ID /// register id 注册ID /// session id /// evnet see EM_AUDIO_CB_FLAG 事件类型 /// date buffer,IntPtr.Zero now 数据缓存 /// data size,0 now 数据缓存大小 /// user data 用户数据 /// reserved 保留 public delegate int fVtEventCallBack(IntPtr instId, IntPtr ulRegisterId, IntPtr ulSessionId, int nEvent, IntPtr pDataBuf, uint dwBufSize, IntPtr dwUser); /// /// play back progress's data callback function /// 回放进度的数据回调函数 /// /// playback handle 回放句柄 /// total size of this play(kb) 总大小 /// played size(kb) 当前的大小 /// -1:playback has over /// -2:write file failed /// user data,which input above 用户数据 public delegate void fDownLoadPosCallBack(IntPtr lPlayHandle, uint dwTotalSize, uint dwDownLoadSize, IntPtr dwUser); /// /// playback data callback function /// 回放数据回调函数 /// /// playback handle 回放数据 /// data type 数据类型 /// byte array, length is dwBufSize 数据缓存 /// pBuffer's size 数据缓存大小 /// user data,which input above 用户数据 /// reserved public delegate int fDataCallBack(IntPtr lRealHandle, uint dwDataType, IntPtr pBuffer, uint dwBufSize, IntPtr dwUser); /// /// Prototype of playback data callback function (extended) /// 回放数据回调函数(扩展) /// /// playback handle 回放数据 /// NET_DATA_CALL_BACK_INFO 数据内容 /// user data,which input above 用户数据 /// reserved public delegate int fDataCallBackEx(IntPtr lRealHandle, IntPtr pDataCallBack, IntPtr dwUser); /// /// download progress callback function /// 下载进度回调函数 /// /// download handle 下载句柄 /// total size of this play(kb) 下载总大小 /// played size(kb) 已下载的大小 /// file index 文件序列 /// record file information 录像文件信息 /// user data,which input above 用户数据 public delegate void fTimeDownLoadPosCallBack(IntPtr lPlayHandle, uint dwTotalSize, uint dwDownLoadSize, int index, NET_RECORDFILE_INFO recordfileinfo, IntPtr dwUser); /// /// alarm message callback function original shape /// 报警回调函数 /// /// alarm type,see EM_ALARM_TYPE 报警类型 /// loginID:login returns value 登陆ID /// alarm data 报警数据缓存 /// alarm data length 数据大小 /// device ip,string type 设备IP /// device port 设备端口 /// true:the event is affirmable event;false:the event is not affirmable event TRUE,该事件为可以进行确认的事件;FALSE,该事件无法进行确认 /// used to AlarmAck function,when the bAlarmAckFlag is true,this paramter is valid 用于对 CLIENT_AlarmAck 接口的入参进行赋值,当 bAlarmAckFlag 为 TRUE 时,该数据有效 /// user data from SetDVRMessCallBack function 用户数据 /// reserved public delegate bool fMessCallBackEx(int lCommand, IntPtr lLoginID, IntPtr pBuf, uint dwBufLen, IntPtr pchDVRIP, int nDVRPort, bool bAlarmAckFlag, int nEventID, IntPtr dwUser); /// /// event data callback /// 事件数据回调函数 /// /// analyzerHandle:RealLoadPicture returns value 事件句柄 /// event type,see EM_EVENT_IVS_TYPE 事件类型 /// event information 事件信息 /// picture buffer 数据缓存 /// picture buffer size 数据缓存大小 /// user data from RealLoadPicture function 用户数据 /// means status of the same uploaded image, when it is 0, it appears first time.When it is 2, it appears last time or appears once.When it is 1, it will appear again. 序列号 /// int nState = (int) reserved means current callback data status;when it is 1, it means current data is real time and current callback data is offline;when it is 2,it means offline data send structure 保留 /// reserved 保留 public delegate int fAnalyzerDataCallBack(IntPtr lAnalyzerHandle, uint dwEventType, IntPtr pEventInfo, IntPtr pBuffer, uint dwBufSize, IntPtr dwUser, int nSequence, IntPtr reserved); /// /// 统计通道数据回调函数 /// Statistics channel data callback function /// public delegate void fVideoStatStreamCallBack(IntPtr lAttachHandle, IntPtr pBuf, int nBufLen, IntPtr dwUser); /// /// audio data callback /// 语音数据回调函数 /// /// StartTalk returns value StartTalk返回值 /// audio data 语音数据缓存 /// audio data size 数据缓存大小 /// audio flag,for send or dec 标志用于发送语音或解码 /// user data 用户数据 public delegate void fAudioDataCallBack(IntPtr lTalkHandle, IntPtr pDataBuf, uint dwBufSize, byte byAudioFlag, IntPtr dwUser); /// /// video statistical summary callback function type /// 视频统计摘要信息回调函数 /// /// return value of AttachVideoStatSummary AttachVideoStatSummary返回值 /// pointer to NET_VIDEOSTAT_SUMMARY 数据缓存 /// buffer length 数据缓存大小 /// user data of AttachVideoStatSummary 用户数据 public delegate void fVideoStatSumCallBack(IntPtr lAttachHandle, IntPtr pBuf, uint dwBufLen, IntPtr dwUser); /// /// Transparent COM callback function original shape /// 透明串口回调函数 /// /// loginID:login returns value 登陆ID /// TransCom Channel 串口通道 /// pointer to TransCom data 数据缓存 /// buffer length 数据缓存大小 /// user data from CreateTransComChannel 用户数据 public delegate void fTransComCallBack(IntPtr lLoginID, IntPtr lTransComChannel, IntPtr pBuffer, uint dwBufSize, IntPtr dwUser); public delegate void fFaceFindStateCallBack(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr pstStates, Int32 nStateNum, UInt32 dwUser); public delegate void fTransFileCallBack(IntPtr lHandle, int nTransType, int nState, int nSendSize, int nTotalSize, IntPtr dwUser); /// /// 异步搜索设备回调 /// public delegate void fSearchDevicesCB(IntPtr pDevNetInfo, IntPtr pUserData); public delegate void fAttachMotionDataCB(IntPtr lAttachHandle, IntPtr pBuf, IntPtr dwUser); public delegate int fServiceCallBack(IntPtr lHandle, IntPtr pIp, ushort wPort, int lCommand, IntPtr pParam, uint dwParamLen, IntPtr dwUserData); public delegate void fCameraStateCallBack(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr pBuf, int nBufLen, IntPtr dwUser); // 订阅云台元数据接口回调函数原型 // pBuf 现阶段主要为 DH_PTZ_LOCATION_INFO 类型 public delegate void fPTZStatusProcCallBack(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr pBuf, int nBufLen, IntPtr dwUser); /// /// /// /// /// NET_SCADA_NOTIFY_POINT_ALARM_INFO_LIST /// /// public delegate void fSCADAAlarmAttachInfoCallBack(IntPtr lAttachHandle, IntPtr pInfo, int nBufLen, IntPtr dwUser); /// /// /// /// /// /// NET_SCADA_NOTIFY_POINT_INFO_LIST /// /// public delegate void fSCADAAttachInfoCallBack(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr pInfo, int nBufLen, IntPtr dwUser); public delegate void fRadiometryAttachCB(IntPtr lAttachHandle, IntPtr pBuf, int nBufLen, IntPtr dwUser); /// /// GPS message subscription callback /// /// loginID:login returns value /// GPS info, struct is NET_GPS_LOCATION_INFO /// user data from _SetSubcribeGPSCallBackEX2 function 用户数据 /// reserved public delegate void fGPSRevEx2(IntPtr lLoginID, IntPtr pGpsInfo, IntPtr dwUserData, IntPtr reserved); /// /// 智能分析状态订阅函数原型, lAttachHandle 为 CLIENT_AttachAnalyseTaskState 函数的返回值 /// /// /// NET_CB_ANALYSE_TASK_STATE_INFO* /// public delegate void fAnalyseTaskStateCallBack(IntPtr lAttachHandle, IntPtr pstAnalyseTaskStateInfo, IntPtr dwUser); /// /// 智能分析结果订阅函数原型, lAttachHandle 为 CLIENT_AttachAnalyseResultState 函数的返回值 /// /// /// NET_CB_ANALYSE_TASK_RESULT_INFO /// /// /// public delegate void fAnalyseTaskResultCallBack(IntPtr lAttachHandle, IntPtr pstAnalyseTaskResult, IntPtr pBuf, uint dwBufSize, IntPtr dwUser); /// /// Upload File callback function /// 异步文件上传回调函数 /// /// uploadfile handle 上传文件数据 /// file total size 文件总数据大小 /// file send size 文件已上传数据大小 /// user data,which input above 用户数据 /// reserved public delegate int fUploadFileCallBack(IntPtr lUploadFileHandle, int nTotalSize, int nSendSize, IntPtr dwUser); // SDK日志回调 public delegate int fSDKLogCallBack(IntPtr lUploadFileHandle, uint nLogSize, IntPtr dwUser); // 异步搜索设备回调(pDevNetInfo内存由SDK内部申请释放) public delegate void fSearchDevicesCBEx(IntPtr lSearchHandle, IntPtr pDevNetInfo, IntPtr dwUser); // 升级设备程序回调函数原形 // nTotalSize = 0, nSendSize = -1 表示升级完成 // nTotalSize = 0, nSendSize = -2 表示升级出错 // nTotalSize = 0, nSendSize = -3 用户没有权限升级 // nTotalSize = 0, nSendSize = -4 升级程序版本过低 // nTotalSize = -1, nSendSize = XX 表示升级进度 // nTotalSize = XX, nSendSize = XX 表示升级文件发送进度 // Upgrade device callback function original shape // nTotalSize = 0, nSendSize = -1 Indicates Upgrade Finish // nTotalSize = 0, nSendSize = -2 Indicates Upgrade Failed // nTotalSize = 0, nSendSize = -3 User do not have permission to upgrade // nTotalSize = 0, nSendSize = -4 Upgrade version too low // nTotalSize = -1, nSendSize = XX Indicates Upgrade Progress // nTotalSize = XX, nSendSize = XX Upgrade file transmission progress public delegate void fUpgradeCallBack(IntPtr lLoginID, IntPtr lUpgradechannel, int nTotalSize, int nSendSize, IntPtr dwUser); // 升级设备程序回调函数原形支持G以上升级文件 // nTotalSize = 0, nSendSize = -1 表示升级完成 // nTotalSize = 0, nSendSize = -2 表示升级出错 // nTotalSize = 0, nSendSize = -3 用户没有权限升级 // nTotalSize = 0, nSendSize = -4 升级程序版本过低 // nTotalSize = -1, nSendSize = XX 表示升级进度 // nTotalSize = XX, nSendSize = XX 表示升级文件发送进度 public delegate void fUpgradeCallBackEx(IntPtr lLoginID, IntPtr lUpgradechannel, long nTotalSize, long nSendSize, IntPtr dwUser); //雷达报警点信息回调函数指针 public delegate void fRadarAlarmPointInfoCallBack(IntPtr lLoginId, IntPtr lAttachHandle, IntPtr pBuf, uint dwBufLen, IntPtr pReserved, IntPtr dwUser); /// /// 自定义定时抓图订阅回调函数原型, lAttachHandle为 CLIENT_AttachCustomSnapInfo 接口的返回值 /// /// /// NET_CB_CUSTOM_SNAP_INFO /// /// /// public delegate void fAttachCustomSnapInfo(IntPtr lAttachHandle, IntPtr pstResult, IntPtr pBuf, uint dwBufSize, IntPtr dwUser); /// /// Subscribe to the Bus state callback function prototype /// 订阅Bus状态回调函数原型, lAttachHandle为 CLIENT_AttachBusState 接口的返回值 /// public delegate void fBusStateCallBack(IntPtr lAttachHandle, int lCommand, IntPtr pBuf, uint dwBufLen, IntPtr dwUser); /// /// Start to upload remote file to remote device process callback,lRemoteUploadFileID is return by CLIENT_StartRemoteUploadFile /// 开始异步文件上传至前端的调函数原形,lRemoteUploadFileID 为 CLIENT_StartRemoteUploadFile 接口返回值 /// public delegate void fRemoteUploadFileCallBack(IntPtr lRemoteUploadFileID, int nTotalSize, int nSendSize, EM_UPLOAD_PROCESS_STATUS emStatus, IntPtr dwUser); /// /// burning device callback function original, lAttachHandle is CLIENT_AttachBurnState return value,each 1 item, pBuf->dwSize == nBufLen /// 刻录设备回调函数原形,lAttachHandle是CLIENT_AttachBurnState返回值, 每次1条,pBuf->dwSize == nBufLen,pBuf类型为NET_CB_BURNSTATE /// public delegate void fAttachBurnStateCB(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr pBuf, int nBufLen, IntPtr dwUser); /// /// burning device callback extension function original /// 刻录设备回调扩展函数原形,pBuf类型为NET_OUT_BURN_GET_STATE /// public delegate void fAttachBurnStateCBEx(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr pBuf, int nBufLen, IntPtr dwUser); /// /// The prototype of the callback function of the burning device, lAttachHandle is the return value of CLIENT_AttachBackupTaskState /// 刻录设备回调函数原形,lAttachHandle是CLIENT_AttachBackupTaskState返回值,pBuf类型为NET_CB_BACKUPTASK_STATE /// public delegate void fAttachBackupTaskStateCB(IntPtr lAttachHandle, IntPtr pBuf, IntPtr dwUser); /// /// OSD callback function original shape /// 屏幕叠加回调函数原形 /// public delegate void fDrawCallBack(IntPtr lLoginID, IntPtr lPlayHandle, IntPtr hDC, IntPtr dwUser); /// /// 订阅人脸库下载进度回调函数原型, lAttachHandle为 CLIENT_AttachFaceDbDownLoadResult 接口的返回值 < pstResult = NET_CB_FACEDB_DOWNLOAD_RESULT > /// Callback function of downloading remote face data base, lAttachHandle is returned by CLIENT_AttachFaceDbDownLoadResult < pstResult = NET_CB_FACEDB_DOWNLOAD_RESULT > /// public delegate void fFaceDbDownLoadResult(IntPtr lAttachHandle, IntPtr pstResult, IntPtr dwUser); /// /// 订阅大图检测小图进度回调函数原型 < pstStates = NET_CB_MULTIFACE_DETECT_STATE > /// the callback function of detection small image form the large image < pstStates = NET_CB_MULTIFACE_DETECT_STATE > /// public delegate void fMultiFaceDetectState(IntPtr lAttachHandle, IntPtr pstStates, IntPtr dwUser); /// /// 订阅大图检测小图进度回调函数原型 < pstStates = NET_CB_MULTIFACE_DETECT_STATE_EX > /// The callback function about attach to large image to detect small image < pstStates = NET_CB_MULTIFACE_DETECT_STATE_EX > /// public delegate void fMultiFaceDetectStateEx(IntPtr lAttachHandle, IntPtr pstStates, IntPtr dwUser); /// /// 回放数据原始回调函数原形 /// pBuffer: 数据缓冲区,内存由SDK内部申请释放 /// 无论设备传的码流是不是加密的,都回调原始码流 /// Playback data callback function prototype /// pBuffer: data buffer, memory malloc or free was managed by SDK interior /// Whether the stream is encrypted or not,dwDataType: 0-original stream /// public delegate int fOriDataCallBack(IntPtr lRealHandle, uint dwDataType, IntPtr pBuffer, uint dwBufSize, IntPtr dwUser); /// /// 导入人脸库回调函数原形 pstFaceDbState : NET_IMPORT_FACEDB_STATE /// the callback function of import face DB, pstFaceDbState : NET_IMPORT_FACEDB_STATE /// public delegate void fImportFaceDbCallBack(IntPtr lImportFaceDbHandle, IntPtr pstFaceDbState, IntPtr dwUser); /// /// 导出人脸库回调函数原形 pstFaceDbState : NET_EXPORT_FACEDB_STATE /// the callback function of export face DB, pstFaceDbState : NET_EXPORT_FACEDB_STATE /// public delegate void fExportStateCallBack(IntPtr lExportFaceDbHandle, IntPtr pstFaceDbState, IntPtr dwUser); /// /// 订阅无线对码信息回调函数原形,lAttachHandle是CLIENT_AttachLowRateWPAN返回值 /// Order wireless code info call function origin, lAttachHandle is CLIENT_AttachLowRateWPAN return valud /// public delegate void fAttachLowRateWPANCB(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr stuBuf, EM_A_NET_CODEID_ERROR_TYPE emError, IntPtr dwUser); /// /// 物模型属性订阅回调函数原型, lAttachHandle为CLIENT_AttachThingsInfo接口的返回值 /// things data state callback function /// /// [out] lAttachHandle 订阅句柄; [out] lAttachHandle subscription handle /// [out] pstResult 物模型属性订阅回调信息; [out] pstResult things data info /// [out] dwUserData 用户信息; [out] dwUserData User Info /// void; void public delegate void fThingsCallBack(IntPtr lAttachHandle, IntPtr pstResult, IntPtr dwUserData); /// /// 升级远程设备程序回调函数 /// RemoteUpgrade callback /// public delegate void fRemoteUpgradeCallBack(IntPtr lLoginID, IntPtr lUpgradeID, EM_REMOTE_UPGRADE_CB_TYPE emState, long nParam1, long nParam2, IntPtr dwUser); /// /// 消息回调函数原形(pBuf内存由SDK内部申请释放) /// Alarm message callback function original shape /// public delegate bool fMessCallBack(int lCommand, IntPtr lLoginID, IntPtr pBuf, uint dwBufLen, IntPtr pchDVRIP, int nDVRPort, IntPtr dwUser); /// /// 订阅训练任务完成情况接口回调函数原型, lAttachHandle 为 CLIENT_AttachTrainTask 接口的返回值 /// Prototype callback function for subscription training task completion interface, with lAttachHandle as CLIENT_ The return value of the AttachTrainTask interface /// /// [out] lAttachHandle 订阅句柄; [out] lAttachHandle Subscription handle /// [out] pstuTalkDevTaskState 操作执行状态信息; [out] pstuTalkDevTaskState Operation execution status information /// [out] dwUser 用户信息; [out] dwUser user information /// void; void public delegate void fNotifyTrainTaskdata(IntPtr lAttachHandle, IntPtr pstuTrainTaskInfo, IntPtr dwUser); /// /// 事件详细信息回调 /// Event Details Callback /// /// [out] pstuNotifyIVSEventDetailInfo 获取事件的详细信息; [out] pstuNotifyIVSEventDetailInfo Obtain detailed information about the event /// [out] dwUser 用户信息; [out] dwUser user information /// void; void public delegate void fNotifyIVSEventDetail(IntPtr pstuNotifyIVSEventDetailInfo, IntPtr dwUser); /// /// 订阅电梯内实时数据接口回调函数原型, lAttachHandle 为 CLIENT_AttachElevatorFloorCounter 接口的返回值 /// Prototype of callback function for subscribing to real-time data interface in elevators, lAttachHandle is the return value of the CLIENT-AttachElevatorFloorCounter interface /// /// [out] lAttachHandle 订阅句柄; [out] lAttachHandle Subscription handle /// [out] pstuCentraProxyActionInfo 操作执行状态信息; [out] pstuCentraProxyActionInfo Operation execution status information /// [out] dwUser 用户信息; [out] dwUser user information /// void; void public delegate void fNotifyElevatorFloorCounterdata(IntPtr lAttachHandle, IntPtr pstuElevatorFloorCounterInfo, IntPtr dwUser); /// /// 订阅标定状态接口回调函数原型, lAttachHandle 为 CLIENT_AttachCalibrateStatus 接口的返回值 /// Prototype of callback function for subscription calibration status interface, lAttachHandle is the return value of CLIENT_AttachCalibrateStatus /// /// [out] lAttachHandle 订阅句柄; [out] lAttachHandle Subscription handle /// [out] pstuCalibrateStatusInfo 标定状态信息; [out] pstuCalibrateStatusInfo Calibration status information /// [out] dwUser 用户信息; [out] dwUser User Information /// void; void public delegate void fNotifyCalibrateStatus(IntPtr lAttachHandle, IntPtr pstuCalibrateStatusInfo, IntPtr dwUser); /// /// callback /// 子连接监听服务回调函数原型 /// Callback function of sublink server /// /// [out] lListenServer 子链接监听服务句柄, 由CLIENT_StartSubLinkListenServer接口返回; [out] lListenServer:Sublink server handle, it is returned by CLIENT_StartSubLinkListenServer /// [out] lSubBizHandle 分压业务sdk句柄, 由CLIENT_CreateSubBusinessModule接口返回; [out] lSubBizHandle: sub business module handle, it is returned by CLIENT_CreateSubBusinessModule /// [out] pstSubLinkCallBack 子链接监听服务回调信息; [out] pstSubLinkCallBack: callback info of sublink server @retval void /// void public delegate void fSubLinkServiceCallBack(IntPtr lListenServer, IntPtr lSubBizHandle, IntPtr pstSubLinkCallBack); /// /// 隧道业务连接断开回调 /// Private tunnel disconnect callback function /// /// [out] lSubBizHandle 分压模块句柄, 由CLIENT_CreateSubBusinessModule接口返回; [out] lSubBizHandle: Sub business handle, it is returned by CLIENT_CreateSubBusinessModule /// [out] lOperateHandle 业务句柄; [out] lOperateHandle: Opreate handle /// [out] pstDisConnectInfo 断线回调数据; [out] pstDisConnectInfo: Disconnect callback info of private tunnel /// void; void public delegate void fTransmitDisConnectCallBack(IntPtr lSubBizHandle, IntPtr lOperateHandle, IntPtr pstDisConnectInfo); /// /// 分压业务连接断线回调 /// Call back function of subbiz disconnect /// /// [out] lSubBizHandle 分压业务sdk句柄, 由CLIENT_CreateSubBusinessModule接口返回; [out] lSubBizHandle: Sub business module handle, it is retuened by CLIENT_CreateSubBusinessModule /// [out] lOperateHandle 业务句柄; [out] lOperateHandle: Operate handle /// [out] pstDisConnectInfo 断线回调数据; [out] pstDisConnectInfo: Call back info of disconnect @retval void /// void public delegate void fSubBizDisConnectCallBack(IntPtr lSubBizHandle, IntPtr lOperateHandle, IntPtr pstDisConnectInfo); /// /// 订阅485实时数据接口回调函数原型, lAttachHandle 为 CLIENT_AttachIotboxComm 接口的返回值 /// Subscribe to 485 real-time data interface callback Function prototype, lAttachHandle is the return value of CLIENT_AttachIotboxComm /// /// [out] lAttachHandle 订阅句柄; [out] lAttachRecalHandle Subscription handle /// [out] pstuIotboxComm 订阅的485实时数据; [out] pstuIotboxComm Subscribed 485 real-time data /// [out] dwUser 用户信息; [out] dwUser user information /// void; void public delegate void fNotifyIotboxRealdata(IntPtr lAttachHandle, IntPtr pstuIotboxComm, IntPtr dwUser); /// /// 订阅云台可视域回调函数原型 /// Subscribe to yuntai horizon callback function prototype /// public delegate void fViewRangeStateCallBack(IntPtr lLoginID, IntPtr lAttachHandle, IntPtr pBuf, int nBufLen, IntPtr dwUser); /// /// 立体行为-视频统计信息回调函数原形,lAttachHandle 是 CLIENT_AttachVideoStatistics返回值 /// StereoBehavior-Video statistics data callback function,lAttachHandle is the return value of CLIENT_AttachVideoStatistics /// public delegate void fVideoStatisticsInfoCallBack(IntPtr lAttachHandle, EM_VS_TYPE emType, IntPtr pBuf, uint dwBufLen, IntPtr dwUser); /// /// TTLV异步搜索设备回调(pDevNetInfo内存由SDK内部申请释放) /// TTLV Asynchronism search device call /// public delegate void fSearchDevicesCBTTLV(IntPtr lSearchHandle, IntPtr pDevNetInfo, IntPtr pUserData); #endregion //<< delegate >> }