#ifndef __MSG__DEF_201107271737__H__
#define __MSG__DEF_201107271737__H__ 

enum {
	ALARM_CODE_BEGIN=0,
	ALARM_CODE_LINKDOWN=1,
	ALARM_CODE_LINKUP,
	ALARM_CODE_USB_PLUG,
	ALARM_CODE_USB_UNPLUG,
	ALARM_CODE_SD0_PLUG,
	ALARM_CODE_SD0_UNPLUG,
	ALARM_CODE_SD1_PLUG,
	ALARM_CODE_SD1_UNPLUG,
	ALARM_CODE_USB_FREESPACE_LOW,
	ALARM_CODE_SD0_FREESPACE_LOW,
	ALARM_CODE_SD1_FREESPACE_LOW,
	ALARM_CODE_VIDEO_LOST,
	ALARM_CODE_VIDEO_COVERD,
	ALARM_CODE_MOTION_DETECT,
	ALARM_CODE_GPIO3_HIGH2LOW,
	ALARM_CODE_GPIO3_LOW2HIGH,
	ALARM_CODE_STORAGE_FREESPACE_LOW,   //added by johnnyling 20090318
	ALARM_CODE_RECORD_START,			//added by johnnyling 20090403
	ALARM_CODE_RECORD_FINISHED,			//added by johnnyling 20090403
	ALARM_CODE_RECORD_FAILED,			//added by johnnyling 20090403
	ALARM_CODE_GPS_INFO,				//added by johnnyling 20100716
	ALARM_CODE_EMERGENCY_CALL,			//added by johnnyling 20100716
	ALARM_CODE_JPEG_CAPTURED,			//added by johnnyling 20120330
	ALARM_CODE_RS485_DATA,				//added by johnnyling 20120330
	ALARM_CODE_SAME_IP,					//added by johnnyling 20120911
	ALARM_CODE_END
};


//CONGIG SET AND GET
///////////////////////////////////////////////////////////////////////////////////////////////////
//system config cmd
#define CMD_SYSTEM_CONFIG_BASE		200
#define CMD_GET_SYSTEM_CONFIG		(CMD_SYSTEM_CONFIG_BASE + 0)
#define CMD_GET_SYSTEM_PTZ_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 1)
#define CMD_GET_SYSTEM_TIME_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 2)
#define CMD_GET_SYSTEM_USER_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 3)
#define CMD_GET_SYSTEM_LOG_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 4)
#define CMD_GET_SYSTEM_MISC_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 5)

#define CMD_SET_SYSTEM_CONFIG		(CMD_SYSTEM_CONFIG_BASE + 20)
#define CMD_SET_SYSTEM_PTZ_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 21)
#define CMD_SET_SYSTEM_TIME_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 22)
#define CMD_SET_SYSTEM_USER_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 23)
#define CMD_SET_SYSTEM_LOG_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 24)

#define CMD_SET_SYSTEM_PTZ_COMMON	(CMD_SYSTEM_CONFIG_BASE + 25)
#define CMD_SET_SYSTEM_PTZ_ADVANCE	(CMD_SYSTEM_CONFIG_BASE + 26)

#define CMD_SET_SYSTEM_MISC_CONFIG	(CMD_SYSTEM_CONFIG_BASE + 27)

#define CMD_SYSTEM_CONFIG_LAST		(CMD_SYSTEM_CONFIG_BASE + 27)

//network cofig cmd
#define CMD_NETWORK_CONFIG_BASE				300
#define CMD_GET_NETWORK_CONFIG				(CMD_NETWORK_CONFIG_BASE + 0)


#define CMD_GET_NETWORK_LAN_CONFIG   		(CMD_NETWORK_CONFIG_BASE + 5)
#define CMD_GET_NETWORK_WIFI_CONFIG			(CMD_NETWORK_CONFIG_BASE + 6)
#define CMD_GET_NETWORK_ADSL_CONFIG			(CMD_NETWORK_CONFIG_BASE + 10)
#define CMD_GET_NETWORK_DDNS_CONFIG			(CMD_NETWORK_CONFIG_BASE + 11)
#define CMD_GET_NETWORK_UPNP_CONFIG			(CMD_NETWORK_CONFIG_BASE + 12)
#define CMD_GET_NETWORK_G3_CONFIG			(CMD_NETWORK_CONFIG_BASE + 13)

#define CMD_SET_NETWORK_CONFIG				(CMD_NETWORK_CONFIG_BASE + 20)


#define CMD_SET_NETWORK_LAN_CONFIG			(CMD_NETWORK_CONFIG_BASE + 25)
#define CMD_SET_NETWORK_WIFI_CONFIG			(CMD_NETWORK_CONFIG_BASE + 26)
#define CMD_SET_NETWORK_ADSL_CONFIG			(CMD_NETWORK_CONFIG_BASE + 30)
#define CMD_SET_NETWORK_DDNS_CONFIG			(CMD_NETWORK_CONFIG_BASE + 31)
#define CMD_SET_NETWORK_UPNP_CONFIG			(CMD_NETWORK_CONFIG_BASE + 32)
#define CMD_SET_NETWORK_G3_CONFIG			(CMD_NETWORK_CONFIG_BASE + 33)

#define CMD_NETWORK_CONFIG_LAST			(CMD_NETWORK_CONFIG_BASE + 33)

//server config cmd
#define CMD_SERVER_CONFIG_BASE			400

#define CMD_GET_SERVER_CONFIG			(CMD_SERVER_CONFIG_BASE + 0)
#define CMD_GET_SERVER_FTP_CONFIG		(CMD_SERVER_CONFIG_BASE + 1)
#define CMD_GET_SERVER_SMTP_CONFIG		(CMD_SERVER_CONFIG_BASE + 2)

#define CMD_SET_SERVER_CONFIG			(CMD_SERVER_CONFIG_BASE + 20)
#define CMD_SET_SERVER_FTP_CONFIG		(CMD_SERVER_CONFIG_BASE + 21)
#define CMD_SET_SERVER_SMTP_CONFIG		(CMD_SERVER_CONFIG_BASE + 22)

#define CMD_SERVER_CONFIG_LAST			(CMD_SERVER_CONFIG_BASE + 22)

//media config cmd
#define CMD_MEDIA_CONFIG_BASE			500

#define CMD_GET_MEDIA_CONFIG			(CMD_MEDIA_CONFIG_BASE + 0)
#define CMD_GET_MEDIA_VIDEO_CONFIG		(CMD_MEDIA_CONFIG_BASE + 1)
#define CMD_GET_MEDIA_AUDIO_CONFIG		(CMD_MEDIA_CONFIG_BASE + 2)

#define CMD_SET_MEDIA_CONFIG			(CMD_MEDIA_CONFIG_BASE + 20)
#define CMD_SET_MEDIA_VIDEO_CONFIG		(CMD_MEDIA_CONFIG_BASE + 21)
#define CMD_SET_MEDIA_AUDIO_CONFIG		(CMD_MEDIA_CONFIG_BASE + 22)

#define CMD_SET_MEDIA_VIDEO_ENCODE		(CMD_MEDIA_CONFIG_BASE + 23)
#define CMD_SET_MEDIA_VIDEO_CAPTURE		(CMD_MEDIA_CONFIG_BASE + 24)
#define CMD_SET_MEDIA_VIDEO_OSD			(CMD_MEDIA_CONFIG_BASE + 25)
#define CMD_SET_MEDIA_VIDEO_JPEG		(CMD_MEDIA_CONFIG_BASE + 26)

#define CMD_SET_MEDIA_AUDIO_CAPTURE		(CMD_MEDIA_CONFIG_BASE + 27)
#define CMD_SET_MEDIA_AUDIO_ENCODE		(CMD_MEDIA_CONFIG_BASE + 28)
#define CMD_SET_MEDIA_VIDEO_MASK         (CMD_MEDIA_CONFIG_BASE + 29) //added by johnnyling 20120607


#define CMD_MEDIA_CONFIG_LAST			(CMD_MEDIA_CONFIG_BASE + 29)

//mediastream config cmd
#define CMD_MEDIASTREAM_CONFIG_BASE			600
#define CMD_GET_MEDIASTREAM_CONFIG			(CMD_MEDIASTREAM_CONFIG_BASE + 0)
#define CMD_SET_MEDIASTREAM_CONFIG			(CMD_MEDIASTREAM_CONFIG_BASE + 20)
#define CMD_MEDIASTREAM_CONFIG_LAST			(CMD_MEDIASTREAM_CONFIG_BASE + 24)

#define CMD_PLATFORM_CONFIG_BASE			650
#define CMD_GET_PLATFORM_CONFIG				(CMD_PLATFORM_CONFIG_BASE + 0)
#define CMD_SET_PLATFORM_CONFIG				(CMD_PLATFORM_CONFIG_BASE + 20)
#define CMD_PLATFORM_CONFIG_LAST			(CMD_PLATFORM_CONFIG_BASE + 24)

//record config cmd
#define CMD_RECORD_CONFIG_BASE			700
#define CMD_GET_RECORD_CONFIG			(CMD_RECORD_CONFIG_BASE + 0)
#define CMD_SET_RECORD_CONFIG			(CMD_RECORD_CONFIG_BASE + 20)
#define CMD_RECORD_CONFIG_LAST			(CMD_RECORD_CONFIG_BASE + 22)


//alarm config cmd
#define CMD_ALARM_CONFIG_BASE				800

#define CMD_GET_ALARM_CONFIG				(CMD_ALARM_CONFIG_BASE + 0)
#define CMD_GET_ALARM_INPUT_CONFIG			(CMD_ALARM_CONFIG_BASE + 1)
#define CMD_GET_ALARM_MOTIONDETECT_CONFIG	(CMD_ALARM_CONFIG_BASE + 2)
#define CMD_GET_ALARM_VIDEOCOVER_CONFIG		(CMD_ALARM_CONFIG_BASE + 3)
#define CMD_GET_ALARM_VIDEOLOST_CONFIG		(CMD_ALARM_CONFIG_BASE + 4)
#define CMD_GET_ALARM_SF_CONFIG				(CMD_ALARM_CONFIG_BASE + 5)

#define CMD_SET_ALARM_CONFIG				(CMD_ALARM_CONFIG_BASE + 20)
#define CMD_SET_ALARM_INPUT_CONFIG			(CMD_ALARM_CONFIG_BASE + 21)
#define CMD_SET_ALARM_MOTIONDETECT_CONFIG	(CMD_ALARM_CONFIG_BASE + 22)
#define CMD_SET_ALARM_VIDEOCOVER_CONFIG		(CMD_ALARM_CONFIG_BASE + 23)
#define CMD_SET_ALARM_VIDEOLOST_CONFIG		(CMD_ALARM_CONFIG_BASE + 24)
#define CMD_SET_ALARM_SF_CONFIG				(CMD_ALARM_CONFIG_BASE + 25)

#define CMD_SET_ALARM_INPUT_CHANNEL_CONFIG		(CMD_ALARM_CONFIG_BASE + 26)		

#define CMD_ALARM_CONFIG_LAST				(CMD_ALARM_CONFIG_BASE + 26)

#define CMD_GET_CONFIG_FIELD_VALUE			900

// config manager cmd
#define CMD_SYSTEM_MANAGE_BASE  1000

#define CMD_CONFIG_UPDATE		(CMD_SYSTEM_MANAGE_BASE + 1)
#define CMD_CONFIG_RESTORE		(CMD_SYSTEM_MANAGE_BASE + 2)
#define CMD_CONFIG_BACKUP		(CMD_SYSTEM_MANAGE_BASE + 3)

#define CMD_SET_SYSTEM_TIME		(CMD_SYSTEM_MANAGE_BASE + 5)
#define CMD_SYSTEM_REBOOT		(CMD_SYSTEM_MANAGE_BASE + 7)
#define CMD_RECORD_REMOVE		(CMD_SYSTEM_MANAGE_BASE + 8)

#define CMD_APPBIN_LOCAL_UPDATE 	(CMD_SYSTEM_MANAGE_BASE + 9)
#define CMD_APPBIN_FTP_UPDATE  		(CMD_SYSTEM_MANAGE_BASE + 10)

#define CMD_GET_SYSTEM_VERSION_INFO  (CMD_SYSTEM_MANAGE_BASE + 12)

#define CMD_GET_LOG_CONFIG      (CMD_SYSTEM_MANAGE_BASE + 13)
#define CMD_GET_STORAGE_INFO 	(CMD_SYSTEM_MANAGE_BASE + 14)

#define CMD_RECORD_START			(CMD_SYSTEM_MANAGE_BASE + 15)
#define CMD_RECORD_STOP				(CMD_SYSTEM_MANAGE_BASE + 16)	

#define CMD_STORAGE_DEVICE_FORMAT	(CMD_SYSTEM_MANAGE_BASE + 17)	
#define CMD_STORAGE_DEVICE_UNMOUNT  (CMD_SYSTEM_MANAGE_BASE + 18)	

#define CMD_GET_SERIALNUMBER			(CMD_SYSTEM_MANAGE_BASE + 19)	
#define CMD_GET_SYSTEMCONTROLSTRING		(CMD_SYSTEM_MANAGE_BASE + 20)	

#define CMD_GET_RECORD_FILE_LIST		(CMD_SYSTEM_MANAGE_BASE + 21)
#define CMD_UPLOAD_FILE					(CMD_SYSTEM_MANAGE_BASE + 22)
#define CMD_DOWNLOAD_FILE				(CMD_SYSTEM_MANAGE_BASE + 23)
#define CMD_REMOVE_FILE					(CMD_SYSTEM_MANAGE_BASE + 24)
#define CMD_GET_LOGFILE_LIST			(CMD_SYSTEM_MANAGE_BASE + 25)

#define CMD_GET_NETWORK_STATUS			(CMD_SYSTEM_MANAGE_BASE + 26)
#define CMD_CONFIG_NETWORK				(CMD_SYSTEM_MANAGE_BASE + 27)

#define CMD_SET_REPLAY_FILENAME			(CMD_SYSTEM_MANAGE_BASE + 28)
#define CMD_GET_REPLAY_FILENAME			(CMD_SYSTEM_MANAGE_BASE + 29)

#define CMD_GET_IPC_TYPE				(CMD_SYSTEM_MANAGE_BASE + 30) //added by johnnyling 20090706
//added by johnnyling 20111110
#define CMD_GET_MEDIA_CAPABILITY		(CMD_SYSTEM_MANAGE_BASE + 31) //added by johnnyling 20111110
#define CMD_SET_KEYFRAME				(CMD_SYSTEM_MANAGE_BASE + 32) //added by johnnyling 20111205
#define CMD_SET_USER_DEV_DATA			(CMD_SYSTEM_MANAGE_BASE + 33) //added by johnnyling 20111205
#define CMD_GET_USER_DEV_DATA			(CMD_SYSTEM_MANAGE_BASE + 34) //added by johnnyling 20111205

#define CMD_START_RTP_PUSH				(CMD_SYSTEM_MANAGE_BASE + 40) //added by johnnyling 20091013
#define CMD_STOP_RTP_PUSH				(CMD_SYSTEM_MANAGE_BASE + 41) //added by johnnyling 20091013 

#define CMD_ALARM_OUTPUT_CONTROL		(CMD_SYSTEM_MANAGE_BASE + 42) //added by johnnyling 20100909 
#define CMD_SNAP_JPEG_PICTURE           (CMD_SYSTEM_MANAGE_BASE + 43) //added by johnnyling 20120330

#define CMD_NETWORK_DIAL				(CMD_SYSTEM_MANAGE_BASE + 45) //added by johnnyling 20100910 

#define CMD_GET_SYSTEM_TIME             (CMD_SYSTEM_MANAGE_BASE + 48) //added by johnnyling 20121127 
#define CMD_GET_PTZ_CAPABILITY          (CMD_SYSTEM_MANAGE_BASE + 49) //added by johnnyling 20121127 

#define CMD_SYSTEM_MANAGE_LAST			1050

#define CMD_MAX_COMAND					1200



 
enum
{
	PROCESS_KEY_START=0,
	
	SYSTEM_PROCESS_KEY,
	MEDIA_PROCESS_KEY,
	WEB_PROCESS_KEY,
	RTSP_PROCESS_KEY,
	RECORD_PROCESS_KEY,	
	AUX_PROCESS_KEY,
	LOG_PROCESS_KEY,
	DEBUG_PROCESS_KEY,
	NATAGENT_PROCESS_KEY,//added by johnnyling 20090504
	RTPSINK_PROCESS_KEY,//added by johnnyling 20091012
	AUDIO_TALKBACK_KEY,//added by johnnyling 20101028
	PROCESS_KEY_END
};

 




#if PLATFORM_720P
enum 
{
	MSG_CMD_START = 0,

	STREAM_CMD_GET_MEMINFO=1,
	STREAM_CMD_REGISTER_READER,
	STREAM_CMD_UNREGISTER_READER,
	STREAM_CMD_GET_VOL,
	STREAM_CMD_GET_ENTRYINFO,
	STREAM_CMD_READLOCK,
	STREAM_CMD_READUNLOCK,

	MSG_CMD_SET_M41_BITRATE,
	MSG_CMD_SET_M42_BITRATE,
	MSG_CMD_SET_JPEG_QUALITY,
	MSG_CMD_SET_M41_FRAMERATE,
	MSG_CMD_SET_M42_FRAMERATE,
	MSG_CMD_SET_JPG_FRAMERATE,

	MSG_CMD_SET_M41_RATECTRL,
	MSG_CMD_SET_M42_RATECTRL,
	
	MSG_CMD_SET_M41_INTRAINTERVAL,
	MSG_CMD_SET_M42_INTRAINTERVAL,

	MSG_CMD_SET_M41_ENABLE,
	MSG_CMD_SET_M42_ENABLE,
	MSG_CMD_SET_JPG_ENABLE,
	MSG_CMD_SET_AUDIO_ENABLE,
	MSG_CMD_SET_AUDIO_CAPTUREVOLUME,

	MSG_CMD_SET_MOTION_CONFIG,
	MSG_CMD_SET_OVERLAY_CONFIG,

	MSG_CMD_SET_BRIGHTNESS,
	MSG_CMD_SET_CONTRAST,
	MSG_CMD_SET_SATURATION,
	MSG_CMD_SET_SHARPNESS,	
	MSG_CMD_SET_HUE,

	MSG_CMD_SET_DAY_NIGHT,
	MSG_CMD_SET_WHITE_BALANCE,
	MSG_CMD_SET_BACKLIGHT,	
	MSG_CMD_SWITCH_2A,
	MSG_CMD_SET_TV_SYSTEM,
	MSG_CMD_SET_BINNING_SKIP,

	MSG_CMD_SET_GPSINFO, //johnnyling 20100716
	MSG_CMD_SET_AUXDATA, //johnnyling 20100730
	MSG_CMD_END
};
#else
enum 
{
	MSG_CMD_START = 0,

	STREAM_CMD_GET_MEMINFO=1,
	STREAM_CMD_REGISTER_READER,
	STREAM_CMD_UNREGISTER_READER,
	STREAM_CMD_GET_VOL,
	STREAM_CMD_GET_ENTRYINFO,
	STREAM_CMD_READLOCK,
	STREAM_CMD_READUNLOCK,

	MSG_CMD_SET_M41_BITRATE,
	MSG_CMD_SET_M42_BITRATE,
	MSG_CMD_SET_JPEG_QUALITY,
	MSG_CMD_SET_M41_FRAMERATE,
	MSG_CMD_SET_M42_FRAMERATE,
	MSG_CMD_SET_JPG_FRAMERATE,

	MSG_CMD_SET_M41_RATECTRL,
	MSG_CMD_SET_M42_RATECTRL,
	
	MSG_CMD_SET_M41_INTRAINTERVAL,
	MSG_CMD_SET_M42_INTRAINTERVAL,

	MSG_CMD_SET_M41_ENABLE,
	MSG_CMD_SET_M42_ENABLE,
	MSG_CMD_SET_JPG_ENABLE,
	MSG_CMD_SET_AUDIO_ENABLE,
	MSG_CMD_SET_AUDIO_CAPTUREVOLUME,

	MSG_CMD_SET_MOTION_CONFIG,
	MSG_CMD_SET_OVERLAY_CONFIG,

	MSG_CMD_SET_BRIGHTNESS,
	MSG_CMD_SET_CONTRAST,
	MSG_CMD_SET_SATURATION,
	MSG_CMD_SET_HUE,
	
	MSG_CMD_SET_GPSINFO, //johnnyling 20100716
	MSG_CMD_SET_AUXDATA, //johnnyling 20100730
	MSG_CMD_END
};


#endif 



#endif
