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