#include "ProtoInnerCan.h"
#include "gvalue.h"
#include "CnCpp.h"
#include "record.h"
#include "Runtime.h"

extern "C" {
	#include "fdcan_task.h"
}

const unsigned char  CmdActiveDefaultSet[256][10] = {
	//0
	{0		,			0, 	0, 	0, 	1,	1, FastCall,0,0,0},
	{cmSyncBeat,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmReset,				0, 	0, 	0, 	1,	3, StdCall, 0,0,0},
	{cmMuteBell,			0, 	0, 	0, 	1,	3, StdCall, 0,0,0},
	{cmSelfCheck,			0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBroadcastTime,			0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmInspection ,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	
	//7
	{cmPublishAlram,			0, 	0, 	0, 	1,	2, FastCall, etFire,			0,		0},
	{cmPublishPreAlram,		0, 	0, 	0, 	1,	2, FastCall, etFire,			0,		0},
	{cmPublishPreAlramResume,	0, 	0, 	0, 	1,	2, FastCall, etFire,			0,		0},
	{cmTakeChargeAlram,		0, 	0, 	0, 	1,	2, FastCall, etSuperVi,			0,		0},
	{cmTakeChargeAlramResume,	0, 	0, 	0, 	1,	2, FastCall, etSuperViCancel,		0,		0},
	{cmConfirmAlram,			0, 	0, 	0, 	1,	2, FastCall, etFire,			0,		0},
	{cmThresholdHiAlram,		0, 	0, 	0, 	1,	2, FastCall, etSuperVi,			0,		0},
	{cmThresholdLowAlram,		0, 	0, 	0, 	1,	2, FastCall, etSuperVi,			0,		0},
	//15		
	{cmManualStart,			0, 	0, 	0, 	1,	2, FastCall, etLinkageStart,			0x05,		0},	//(0x06 0xB6 手动声光启动 及停止)
	{cmManualStop,			0, 	0, 	0, 	1,	2, FastCall, etLinkageStartCancel,		0x05,		0},
	{cmAutoDelayStart,		0, 	0, 	0, 	1,	2, FastCall, etSuperVi,				0,		0},
	{cmAutoStart,			0, 	0, 	0, 	1,	2, FastCall, etLinkageStart,			0x01,		0},
	{cmAutoStop,			0, 	0, 	0, 	1,	2, FastCall, etLinkageStartCancel,		0xB1,		0},
	{cmAck,				0, 	0, 	0, 	1,	2, FastCall, etLinkageFeedBack,		0x03,		0},
	{cmAckStop,				0, 	0, 	0, 	1,	2, FastCall, etLinkageFeedBackCancel,	0xB3,		0},
	{cmAckMiss,				0, 	0, 	0, 	1,	2, FastCall, etLinkageFeedBack,		0x04,		0},
	{cmAckHydrant,			0, 	0, 	0, 	1,	2, FastCall, etSuperVi,				0,		0},
	{cmAckFireAreaHydrant,		0, 	0, 	0, 	1,	2, FastCall, etSuperVi,				0,		0},
	//25
	{cmVAAlramStart,			0, 	0, 	0, 	1,	2, FastCall, etLinkageStart,			0x06,		0},
	{cmVAAlramStop,			0, 	0, 	0, 	1,	2, FastCall, etLinkageStartCancel,		0xB6,		0},
	{cmFireAreaVAAlramStart,	0, 	0, 	0, 	1,	2, FastCall, 0,					0x10,		0},	
	{cmFireAreaVAAlramStop,		0, 	0, 	0, 	1,	2, FastCall, 0,					0x11,		0},
	{cmFireAreaStart,			0, 	0, 	0, 	1,	2, FastCall, 0,					0x20,		0},
	{cmFireAreaStop,			0, 	0, 	0, 	1,	2, FastCall, 0,					0x21,		0},
	//31
	{cmMainManualAutoState,		0, 	0, 	0, 	1,	2, FastCall, etSuperVi,	0,0},
	{cmDirCtlManualAutoState,	0, 	0, 	0, 	1,	2, FastCall, etSuperVi,	0,0},
	//33
	{cmPortModuleErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,		0,0},
	{cmPortModuleErrRecover,	0, 	0, 	0, 	1,	2, FastCall, etFaultCancel,	0,0},	
	{cmCircuitErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,	0xE0,0},
	{cmOtherErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,	0xF0,0},
	{cmMainPowerErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,	0x10,0},
	{cmBKPowerErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,	0x20,0},
	{cmDC24PowerrErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,	0x30,0},
	{cmBatteryPowerrErr,		0, 	0, 	0, 	1,	2, FastCall, etFault,	0x40,0},
	{cmGNDConnectErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,	0x50,0},
	{cmTrialTimeUpErr,		0, 	0, 	0, 	1,	2, FastCall, etFault,	0x60,0},
	{xxcmOtherErr,			0, 	0, 	0, 	1,	2, FastCall, etFault,	0x70,0},
	{cmSYSErr,				0, 	0, 	0, 	1,	2, FastCall, etFault,	0x80,0},
	
	//45~53
	{cmAllPortAutoRegist,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmSinglePortAutoRegist,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmSinglePortAddrManualRegist,0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmClearAllRegist,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmClearSinglePortRegist,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmClearSinglePortAddrRegist,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmPortRegistProgress,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmPortRegistFinished,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmPortRegistAbort,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},

	//54~66
	{cmQueryVer,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryPortReg,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryRunState,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryRuntimeData,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryStaticData,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryMacCode,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQuerySens,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryAnalogRawData,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryVoltage,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryPortRunParam,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryAbout,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryCmdConfirm,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryPortPowerSet,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	
	//67~77
	{cmEpDeviceMask,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmEpDeviceMaskRemove,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmMaskRemoveAll,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmDeviceConfig,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmDeviceSetSens,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmDeviceSetLogicAddr,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmQueryDisplayPadAddrSegment,0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmSetDisplayPadAddrSegment,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmSetDisplayPadPositionInf,	0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmSendDisplayPadInf,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmAddDisplayPadAddrSegment,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
		
	//78~88
	{cmBusCtlPadConfig,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadAction,		0, 	0, 	0, 	1,	1, StdCall, etBusPadAction,0,0},
	{cmBusCtlPadState,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadNoAck,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadAllAckOk,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadAckLack,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadAutoOnActive,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadAutoNotActive,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadConfigReq,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmBusCtlPadConfigReq,		0, 	0, 	0, 	1,	1, StdCall, etBusPadRequst,0,0},
	{cmBusCtlPadManualState,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//89~97
	{cmDirectCtlPadConfig,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmDirectCtlPadAction ,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmDirectCtlPadSilence,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmDirectCtlPadManualState,	0, 	0, 	0, 	1,	1, StdCall, etDirectPadAction,0,0},
	{cmDirectCtlPadChannelState,	0, 	0, 	0, 	1,	1, StdCall, etDirectPadAction,0,0},
	{cmDirectCtlPadLinkageState,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmDirectCtlPadAutoNotActive,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmDirectPadConfigReq,		0, 	0, 	0, 	1,	1, StdCall, etDirectPadRequst,0,0},
	{cmDirectCtlPadQueryPort,	0, 	0, 	0, 	1,	1, StdCall, etDirectPadRequst,0,0},
	
	//98~106
	{cmVIrtualAlram,			0, 	0, 	0, 	1,	1, SimEvent, 0,0,0},
	{cmVIrtualAlramCancle,		0, 	0, 	0, 	1,	1, SimEvent, 0,0,0},
	{cmVIrtualStart,			0, 	0, 	0, 	1,	1, SimEvent, etLinkageStart,			0x01,0},
	{smVIrtualStop,			0, 	0, 	0, 	1,	1, SimEvent, etLinkageStartCancel,		0xB1,0},
	{cmVIrtualAck,			0, 	0, 	0, 	1,	1, SimEvent, etLinkageFeedBack,		0x03,0},
	{cmVIrtualAckStop,		0, 	0, 	0, 	1,	1, SimEvent, etLinkageFeedBackCancel,	0xB3,0},
	{cm104,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cm105,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cm106,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//107~127
	{cmDevLightOn,	0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmDevMute,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmDuplicateAddrCheckStart,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmDuplicateAddrCheckPrg,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmDuplicateAddrData,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmDuplicateAddrCheckEnd,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{113,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{114,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{115,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmSetConfigAddrSegment,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmQueryStaticDataAddrSegment,		0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{cmDuplicateAddrEpDeviceLed,			0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{119,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmEnterAdjustMode,		0, 	0, 	0, 	1,	1, StdCall, etDirectPadReport,0,0},
	{cmExitAdjustMode,		0, 	0, 	0, 	1,	1, StdCall, etDirectPadReport,0,0},
	{122,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{123,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{124,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{125,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{126,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmCtrlPowerOn,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//128		
	{128,		0, 	0, 	0, 	1,	1, FastCall, etLinkageFeedBack,		0x07,	0},	//0x07 消钮应答亮灯   			(0x06 0xB6 手动声光启动 及停止)
	{129,		0, 	0, 	0, 	1,	1, FastCall, etLinkageFeedBackCancel,	0xB7,	0},	//0xB7 消钮取消应答灭灯
	
	//130~140
	{cmAlternatingSpeakerSL,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{131,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	{132,			0, 	0, 	0, 	1,	1, StdCall, etConfig,0,0},
	{133,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{134,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{135,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{136,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{137,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{138,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{139,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmVIrtualSuperVi,		0, 	0, 	0, 	1,	1, SimEvent, etSuperVi,0,0},
	
	//141~150
	{141,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{142,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{143,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{144,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{145,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{146,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{147,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{148,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{149,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{cmQueryBoardModel,			0, 	0, 	0, 	1,	1, StdCall, etReport,0,0},
	
	//151~160
	{cmBusDataSyncRegisterReq,		0, 	0, 	0, 	1,	1, PortSync, 0,0,0},
	{cmBusDataSyncRegister,			0, 	0, 	0, 	1,	1, PortSync, 0,0,0},
	{cmBusDataSyncRegisterRes,		0, 	0, 	0, 	1,	1, PortSync, 0,0,0},
	{cmBusDataSyncIsolationReq,		0, 	0, 	0, 	1,	1, PortSync, 0,0,0},
	{cmBusDataSyncIsolation,		0, 	0, 	0, 	1,	1, PortSync, 0,0,0},
	{cmBusDataSyncIsolationRes,		0, 	0, 	0, 	1,	1, PortSync, 0,0,0},
	{157,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{158,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{159,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{160,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//161~170
	{141,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{142,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{143,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{144,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{145,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{146,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{147,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{148,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{149,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{150,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//171~180
	{141,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{142,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{143,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{144,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{145,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{146,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{147,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{148,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{149,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{150,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//181~190
	{141,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{142,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{143,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{144,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{145,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{146,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{147,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{148,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{149,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{150,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//191~200
	{141,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{142,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{143,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{144,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{145,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{146,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{147,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{148,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{149,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{150,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//201~210
	{201,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{202,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{dNetworkCmd_RemoteStartStopViaUserCodeSimulate,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{dNetworkCmd_AutoStartDelaySimulate,				0, 	0, 	0, 	1,	1, SimEvent, 0,0,0},
	{dNetworkCmd_SendRegRpy,						0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{dNetworkCmd_SendRegSeq,						0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{dNetworkCmd_SetSlaveAllow,						0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{dNetworkCmd_AutoStartDelay,						0, 	0, 	0, 	1,	1, FastCall, 0,0,0},
	{dNetworkCmd_NewTime,							0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{dNetworkCmd_RemoteStartStopViaUserCode,				0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	
	//211~220
	{211,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{212,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{213,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{214,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{215,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{216,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{217,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{218,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{219,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{220,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//221~230
	{221,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},	//Mask List Send
	{222,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{223,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{224,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{225,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{226,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{227,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{228,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{229,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{230,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//231~240
	{231,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{232,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{233,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{234,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{235,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{236,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{237,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{238,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{239,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	{240,		0, 	0, 	0, 	1,	1, StdCall, 0,0,0},
	
	//241~250
	{241,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{242,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{243,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{244,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{245,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{246,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{247,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{248,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{249,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{250,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	
	//251~255
	{251,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{252,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{253,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{254,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
	{255,		0, 	0, 	0, 	1,	1, NetNormalCall, 0,0,0},
};

int TInnerCan::CheckPathKissAss(unsigned char aP0, unsigned char aP1)
{
	if((aP0 == 0) || (aP1 == 0))return 1;
	if( aP0 <= dPORT_MAX_COUNT){
		if(aP1 > dEP_MAX_COUNT_PER_PORT)return 1;
	}else
	if( (aP0 >= dADDR_DIRECTPAD_START) && (aP0 <= dADDR_DIRECTPAD_END )){
		if(aP1 > dDIRECTCTL_KEY_MAX_COUNT)return 1;
	}else{
		return 1;
	}
	return 0;	
}

void TInnerCan::ProcRxMsg(void)
{
	unsigned char CtlByte, aP0, aP1, aP2, aMT, aDT, aCmd;
	unsigned int i;
	if(aRxMsg.Ava){
		aRxMsg.Ava = 0;
		if(aRxMsg.Ide.BitF.dAddr == 0){
			if( (aRxMsg.Ide.BitF.sAddr > 0) && (aRxMsg.Ide.BitF.sAddr < 5) ){
				MotherBoard.NoReportTick[aRxMsg.Ide.BitF.sAddr -1] = 0;
			}
		}
		if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][6] == FastCall){
			CtlByte = aRxMsg.Data.D8[0];
			
			Record.InnerMsgSetYear		(0, DateTime.Date.Split.Year);
			Record.InnerMsgSetMonth		(0, DateTime.Date.Split.Month);
			Record.InnerMsgSetDay		(0, DateTime.Date.Split.Day);
			Record.InnerMsgSetHour		(0, DateTime.Time.Split.Hour);
			Record.InnerMsgSetMinute	(0, DateTime.Time.Split.Minute);
			Record.InnerMsgSetSecond	(0, DateTime.Time.Split.Second);	
			Record.InnerMsgSet_mType	(0, CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7]);
			Record.InnerMsgSet_CtlNum	(0, MainCtl.fData.Split.MyNum );	//(0,aRxMsg.Data.D8[1]);
			
			if(aRxMsg.Ide.BitF.Cmd == cmPortModuleErr){
				if(CheckPathKissAss(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3]))return;
				Record.InnerMsgSet_P0		(0,aRxMsg.Data.D8[2]);
				Record.InnerMsgSet_P1		(0,aRxMsg.Data.D8[3]);
				Record.InnerMsgSet_P2		(0,aRxMsg.Data.D8[6]);
				Record.InnerMsgSet_dType	(0,aRxMsg.Data.D8[5]);
				Record.InnerMsgSet_Data0	(0,aRxMsg.Data.D8[6]);	//Fault Type
				Record.InnerMsgSet_Data1	(0,0x01);			//Set
				Record.InnerMsgSet_iByte0	(0,CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][8]);
				Record.InnerMsgSet_iByte1	(0,CtlByte);
				
				GetEpUserCodeAreaNumDevType(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3], &Record.iMsgRx.Splite.UserCode, &Record.iMsgRx.Splite.AreaNum, &Record.iMsgRx.Splite.dType);
			}else
			if(aRxMsg.Ide.BitF.Cmd == cmPortModuleErrRecover){
				if(CheckPathKissAss(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3]))return;
				Record.InnerMsgSet_P0		(0,aRxMsg.Data.D8[2]);
				Record.InnerMsgSet_P1		(0,aRxMsg.Data.D8[3]);
				Record.InnerMsgSet_P2		(0,aRxMsg.Data.D8[6]);
				Record.InnerMsgSet_dType	(0,aRxMsg.Data.D8[5]);
				Record.InnerMsgSet_Data0	(0,aRxMsg.Data.D8[6]);	//Fault Type
				Record.InnerMsgSet_Data1	(0,0x00);			//Recover
				Record.InnerMsgSet_iByte0	(0,CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][8]);
				Record.InnerMsgSet_iByte1	(0,CtlByte);

				GetEpUserCodeAreaNumDevType(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3], &Record.iMsgRx.Splite.UserCode, &Record.iMsgRx.Splite.AreaNum, &Record.iMsgRx.Splite.dType);
			}else
			if(aRxMsg.Ide.BitF.Cmd == cmCircuitErr){
				Record.InnerMsgSet_P0		(0,aRxMsg.Data.D8[2]);	//Cir Index
				Record.InnerMsgSet_P1		(0,0);
				Record.InnerMsgSet_P2		(0,0);
				Record.InnerMsgSet_dType	(0,0);		
				Record.InnerMsgSet_Data0	(0,0);
				Record.InnerMsgSet_Data1	(0,aRxMsg.Data.D8[4] + 0xE0);	//Is Set=1  Recover=0
				Record.InnerMsgSet_iByte0	(0,CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][8]);
				Record.InnerMsgSet_iByte1	(0,CtlByte);
			}else
			if(aRxMsg.Ide.BitF.Cmd == cmOtherErr){
				Record.InnerMsgSet_P0		(0,0xE0);			//Board Index
				Record.InnerMsgSet_P1		(0,0);
				Record.InnerMsgSet_P2		(0,aRxMsg.Data.D8[3]);	//Fault Type
				Record.InnerMsgSet_dType	(0,0);			
				Record.InnerMsgSet_Data0	(0,aRxMsg.Data.D8[3]);	//Fault Type
				Record.InnerMsgSet_Data1	(0,aRxMsg.Data.D8[4] + 0xF0);	//Is Set=1  Recover=0
				Record.InnerMsgSet_iByte0	(0,CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][8]);
				Record.InnerMsgSet_iByte1	(0,CtlByte);
			}else{
				Record.InnerMsgSet_P0		(0,aRxMsg.Data.D8[2]);
				Record.InnerMsgSet_P1		(0,aRxMsg.Data.D8[3]);
				Record.InnerMsgSet_P2		(0,aRxMsg.Data.D8[4]);
				Record.InnerMsgSet_dType	(0,aRxMsg.Data.D8[5]);
				Record.InnerMsgSet_Data0	(0,aRxMsg.Data.D8[6]);
				Record.InnerMsgSet_Data1	(0,aRxMsg.Data.D8[7]);
				Record.InnerMsgSet_iByte0	(0,CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][8]);
				Record.InnerMsgSet_iByte1	(0,CtlByte);
				
				GetEpUserCodeAreaNumDevType(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3], &Record.iMsgRx.Splite.UserCode, &Record.iMsgRx.Splite.AreaNum, &Record.iMsgRx.Splite.dType);
			}
			if( (aRxMsg.Ide.BitF.Cmd == cmPublishAlram) || (aRxMsg.Ide.BitF.Cmd == cmAutoStart) || (aRxMsg.Ide.BitF.Cmd == cmAutoStop) ||
				(aRxMsg.Ide.BitF.Cmd == cmAck) || (aRxMsg.Ide.BitF.Cmd == cmAckStop) || (aRxMsg.Ide.BitF.Cmd == cmAckHydrant) ){
				if(CheckPathKissAss(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3]))return;
			}
			if(Register.IsDevRegisting != 0x00A5A5A5){
				if(aRxMsg.Ide.BitF.Cmd == cmPublishAlram){
					if(CtlCenter.ieMsgFire.Count <1)Record.InnerMsgSet_Data1	(0,1);
					else Record.InnerMsgSet_Data1	(0,0);
				}
				if( (aRxMsg.Ide.BitF.Cmd == cmAutoStart) || (aRxMsg.Ide.BitF.Cmd == cmAutoStop) || (aRxMsg.Ide.BitF.Cmd == cmAck) || (aRxMsg.Ide.BitF.Cmd == cmAckStop) ){
					Record.InnerMsgSet_Data1	(0,0);
				}
				CtlCenter.iePushOneMsg(Record.iMsgRx, aRxMsg.Ide.BitF.Cmd);
			}
		}else
		if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][6] == StdCall){
			if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7] == etReport){
				CtlByte = InnerCan.aRxMsg.Data.D8[0];
				if(aRxMsg.Ide.BitF.Cmd == cmQueryRuntimeData){
					DevProperty.PushOneRealDataReport(aRxMsg.Data.D8[1], aRxMsg.Data.D8[2], aRxMsg.Data.D8[3], aRxMsg.Data.D8[4], aRxMsg.Data.D8[5], aRxMsg.Data.D8[6], aRxMsg.Data.D8[7]);
					DevStartStop.PushOneRealDataReport(aRxMsg.Data.D8[1], aRxMsg.Data.D8[2], aRxMsg.Data.D8[3], aRxMsg.Data.D8[4], aRxMsg.Data.D8[5], aRxMsg.Data.D8[6], aRxMsg.Data.D8[7]);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmEpDeviceMask){
					DevMask.PushOneDataRec(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8[1], aRxMsg.Data.D8[2], aRxMsg.Data.D8[3]);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmEpDeviceMaskRemove){
					DevMask.PushOneDataRec(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8[1], aRxMsg.Data.D8[2], aRxMsg.Data.D8[3]);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmInspection){
					CtlCenter.PushInspecRpy(aRxMsg.Data.D8[1], aRxMsg.Data.D8[2]);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmSinglePortAddrManualRegist){
					RegisterManual.PushRecData(aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmDeviceSetSens){
					DevProperty.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmQuerySens){
					DevProperty.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
					DevStartStop.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmDeviceConfig){
					DevProperty.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmQueryStaticData){
					DevProperty.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
					DevStartStop.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmQueryMacCode){
					DevProperty.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmSetDisplayPadPositionInf){
					DisplayPadDescpDownload.PushInnerCanData(aRxMsg.Ide.BitF.Cmd,  aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmSyncBeat){
					if(aRxMsg.Ide.BitF.dAddr == 0){
						if( (aRxMsg.Ide.BitF.sAddr > 0) && (aRxMsg.Ide.BitF.sAddr < 5) ){
							MotherBoard.NoReportTick[aRxMsg.Ide.BitF.sAddr -1] = 0;
						}
					}
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmQueryBoardModel){
					HwInf.InnerCanPushData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmQueryVer){
					HwInf.InnerCanPushData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmDuplicateAddrCheckPrg){
					DuplicateCheck.InnerCanPushData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmDuplicateAddrData){
					DuplicateCheck.InnerCanPushData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmDuplicateAddrCheckEnd){
					DuplicateCheck.InnerCanPushData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmSetConfigAddrSegment){
					DevOutputCfg.PushInnerCanData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
					DevSensitiveCfg.PushInnerCanData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
					DevVaCfg.PushInnerCanData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
				}else
				if(aRxMsg.Ide.BitF.Cmd == cmQueryStaticDataAddrSegment){
					DevOutputCfg.PushInnerCanData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);	
					DevSensitiveCfg.PushInnerCanData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
					DevVaCfg.PushInnerCanData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
				}
				else
				if(aRxMsg.Ide.BitF.Cmd == cmDeviceConfig){
					//DevOutputCfg
					//DevSensitiveCfg
				}else{
					Record.InnerMsgSetYear		(0, DateTime.Date.Split.Year);
					Record.InnerMsgSetMonth		(0, DateTime.Date.Split.Month);
					Record.InnerMsgSetDay		(0, DateTime.Date.Split.Day);
					Record.InnerMsgSetHour		(0, DateTime.Time.Split.Hour);
					Record.InnerMsgSetMinute	(0, DateTime.Time.Split.Minute);
					Record.InnerMsgSetSecond	(0, DateTime.Time.Split.Second);	
					Record.InnerMsgSet_mType	(0,CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7]);
					Record.InnerMsgSet_CtlNum	(0,MainCtl.fData.Split.MyNum );	//(0,aRxMsg.Data.D8[1]);
					Record.InnerMsgSet_P0		(0,aRxMsg.Data.D8[2]);
					Record.InnerMsgSet_P1		(0,aRxMsg.Data.D8[3]);
					Record.InnerMsgSet_P2		(0,aRxMsg.Data.D8[4]);
					Record.InnerMsgSet_dType	(0,aRxMsg.Data.D8[5]);
					Record.InnerMsgSet_Data0	(0,aRxMsg.Data.D8[6]);
					Record.InnerMsgSet_Data1	(0,aRxMsg.Data.D8[7]);
					Record.InnerMsgSet_iByte0	(0,CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][8]);
					Record.InnerMsgSet_iByte1	(0,CtlByte);
					
					if(aRxMsg.Ide.BitF.Cmd == cmQueryPortReg ){
						Record.InnerMsgSet_CtlNum(0,aRxMsg.Data.D8[1]);
					}else{
						GetEpUserCodeAreaNumDevType(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3], &Record.iMsgRx.Splite.UserCode, &Record.iMsgRx.Splite.AreaNum, &Record.iMsgRx.Splite.dType);
					}
					CtlCenter.iePushOneMsg(Record.iMsgRx, aRxMsg.Ide.BitF.Cmd);	
				}
			}else
			if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7] == etBusPadAction){
				BusPadGoAction(aRxMsg.Data.D8[2], aRxMsg.Data.D8[3]);
			}else
			if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7] == etBusPadRequst){
				if(aRxMsg.Ide.BitF.Cmd == cmBusCtlPadConfigReq){
					CtlCenter.DeviceRequest(cmBusCtlPadConfigReq, 0, aRxMsg.Data.D8[2]);
				}
			}else
			if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7] == etDirectPadAction){
				DirectUpLoad(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8);
			}else
			if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7] == etDirectPadRequst){
				
			}else
			if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][7] == etDirectPadReport){
				RunModeCfg.GetInnerCanData(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8[2]);
			}
		}else
		if(CmdActiveDefaultSet[aRxMsg.Ide.BitF.Cmd][6] == PortSync){
			CtlCenter.ProcPortSyncCmd(aRxMsg.Ide.BitF.Cmd, aRxMsg.Data.D8[1], aRxMsg.Data.D8[2]);
		}
	}
}

void TInnerCan::CmdSendReset()
{
	tData[0] = 0; tData[1] = 0; tData[2] = 0; tData[3] = 0;
	tData[4] = 0; tData[5] = 0; tData[6] = 0; tData[7] = 0;
	OBufInsert(1,cmReset,tData,1);
}

void TInnerCan::OBufFastInsert(unsigned char Pri, unsigned char Cmd, unsigned char *Data, unsigned char Len)
{
	int i;
	unsigned int aAddr;
	OutBufFast.WriteIndex++;
	if(OutBufFast.WriteIndex >= InnerFastTxBufCount)OutBufFast.WriteIndex = 0;

	OutBufFast.wBody.Ide.BitF.Pri = Pri & 0x03;
	OutBufFast.wBody.Ide.BitF.sLvl = 1;
	OutBufFast.wBody.Ide.BitF.dLvl = 7;
	OutBufFast.wBody.Ide.BitF.sAddr = 0;
	OutBufFast.wBody.Ide.BitF.dAddr = 127;
	OutBufFast.wBody.Ide.BitF.Cmd = Cmd;

	OutBufFast.wBody.Dlc = Len;
	for(i=0; i<Len; i++){
		OutBufFast.wBody.Data.D8[i] = Data[i];
	}
	aAddr = dAddrSdram_InnerCanFastOut + (OutBufFast.WriteIndex * 16);
	*(volatile unsigned int *)(aAddr    ) = OutBufFast.wBody.Ide.D32;
	*(volatile unsigned int *)(aAddr + 4) = OutBufFast.wBody.Data.D32[0];
	*(volatile unsigned int *)(aAddr + 8) = OutBufFast.wBody.Data.D32[1];
	*(volatile unsigned int *)(aAddr +12) = OutBufFast.wBody.Dlc;
	
}

void TInnerCan::OBufInsert(unsigned char Pri, unsigned char Cmd, unsigned char *Data, unsigned char Len)
{
	int i;
	unsigned int aAddr;
	OutBuf.WriteIndex++;
	if(OutBuf.WriteIndex >= InnerEventTxBufCount)OutBuf.WriteIndex = 0;

	OutBuf.wBody.Ide.BitF.Pri = Pri & 0x03;
	OutBuf.wBody.Ide.BitF.sLvl = 1;
	OutBuf.wBody.Ide.BitF.dLvl = 7;
	OutBuf.wBody.Ide.BitF.sAddr = 0;
	OutBuf.wBody.Ide.BitF.dAddr = 127;
	OutBuf.wBody.Ide.BitF.Cmd = Cmd;

	OutBuf.wBody.Dlc = Len;
	for(i=0; i<Len; i++){
		OutBuf.wBody.Data.D8[i] = Data[i];
	}
	aAddr = dAddrSdram_InnerCan + (OutBuf.WriteIndex * 16);
	*(volatile unsigned int *)(aAddr    ) = OutBuf.wBody.Ide.D32;
	*(volatile unsigned int *)(aAddr + 4) = OutBuf.wBody.Data.D32[0];
	*(volatile unsigned int *)(aAddr + 8) = OutBuf.wBody.Data.D32[1];
	*(volatile unsigned int *)(aAddr +12) = OutBuf.wBody.Dlc;
	
}

void TInnerCan::OBufPrcRecordAndEvent()
{
	unsigned char aCmd, aP0, aP1;
	unsigned int aAddr;
	
	aAddr = dAddrSdram_InnerCan + (OutBuf.ReadIndex * 16);
	OutBuf.rBody.Ide.D32 = *(volatile unsigned int *)(aAddr);
	OutBuf.rBody.Data.D32[0] = *(volatile unsigned int *)(aAddr+4);
	OutBuf.rBody.Data.D32[1] = *(volatile unsigned int *)(aAddr+8);
	OutBuf.rBody.Dlc = *(volatile unsigned int *)(aAddr +12);
	
	aCmd = OutBuf.rBody.Ide.D8[0];
	if( (aCmd == cmAutoStart) || (aCmd == cmAutoStop) ){
		Record.InnerMsgSetYear		(0, DateTime.Date.Split.Year);
		Record.InnerMsgSetMonth		(0, DateTime.Date.Split.Month);
		Record.InnerMsgSetDay		(0, DateTime.Date.Split.Day);
		Record.InnerMsgSetHour		(0, DateTime.Time.Split.Hour);
		Record.InnerMsgSetMinute	(0, DateTime.Time.Split.Minute);
		Record.InnerMsgSetSecond	(0, DateTime.Time.Split.Second);	
		Record.InnerMsgSet_mType	(0,CmdActiveDefaultSet[aCmd][7]);
		Record.InnerMsgSet_CtlNum	(0,MainCtl.fData.Split.MyNum );	//(0,aRxMsg.Data.D8[1]);
		
		Record.InnerMsgSet_P0		(0,OutBuf.rBody.Data.D8[2]);
		Record.InnerMsgSet_P1		(0,OutBuf.rBody.Data.D8[3]);
		Record.InnerMsgSet_P2		(0,OutBuf.rBody.Data.D8[4]);
		
		aP0 = OutBuf.rBody.Data.D8[2];
		aP1 = OutBuf.rBody.Data.D8[3];
		aP0--;
		aP1--;

		Record.InnerMsgSet_dType	(0,OutBuf.rBody.Data.D8[5]);
		Record.InnerMsgSet_Data0	(0,0);
		Record.InnerMsgSet_Data1	(0,0);
		
		/*if(aCmd == cmAutoStart){
			if(OutBuf.Body[OutBuf.ReadIndex].Data.D8[6]){
				Record.InnerMsgSet_iByte0	(0,0x05);
			}else{
				Record.InnerMsgSet_iByte0	(0,0x01);
			}
			Record.LinkageAdd(Record.iMsgRx);
			CtlCenter.iePushOneMsgLinkageStart(Record.iMsgRx);
			
			if(MainCtl.fData.Split.IsMaster == 0)
				ProtoC2C.SlaveDoSend2MasterMachine(Record.iMsgRx, cmAutoStart);
		}else{
			if(OutBuf.Body[OutBuf.ReadIndex].Data.D8[6]){
				Record.InnerMsgSet_iByte0	(0, 0xB5);
			}else{
				Record.InnerMsgSet_iByte0	(0, 0xB1);
			}
			Record.LinkageAdd(Record.iMsgRx);
			CtlCenter.iePushOneMsgLinkageStartCancel(Record.iMsgRx);
			
			if(MainCtl.fData.Split.IsMaster == 0)
				ProtoC2C.SlaveDoSend2MasterMachine(Record.iMsgRx, cmAutoStop);
		}*/
	}else
	if( aCmd == cmDirectCtlPadLinkageState){
		/*aP0 = OutBuf.Body[OutBuf.ReadIndex].Data.D8[2];
		aP1 = OutBuf.Body[OutBuf.ReadIndex].Data.D8[3];
		if(  (aP0 >= dADDR_DIRECTPAD_START) && ( aP0 <= dADDR_DIRECTPAD_END) && (aP1)){
				aP1--;
				if(aP1 < dDIRECTCTL_KEY_MAX_COUNT){
					aP0 = aP0 - dADDR_DIRECTPAD_START;
					if(DirectCtlBoard[aP0].IsRegisted[aP1]){
						Record.FastBuf.Splite.Year = DateTime.Date.Split.Year;
						Record.FastBuf.Splite.Month = DateTime.Date.Split.Month;
						Record.FastBuf.Splite.Day = DateTime.Date.Split.Day;
						Record.FastBuf.Splite.Hour = DateTime.Time.Split.Hour;
						Record.FastBuf.Splite.Minute = DateTime.Time.Split.Minute;
						Record.FastBuf.Splite.Second = DateTime.Time.Split.Second;
						Record.FastBuf.Splite.PCtlNum = MainCtl.fData.Split.MyNum;;
						Record.FastBuf.Splite.P0 = OutBuf.Body[OutBuf.ReadIndex].Data.D8[2];
						Record.FastBuf.Splite.P1 = OutBuf.Body[OutBuf.ReadIndex].Data.D8[3];
						Record.FastBuf.Splite.P2 = 0;

						Record.FastBuf.Splite.mType = etLinkageStart;
						Record.FastBuf.Splite.iByte0 = 0x01;
						
						Record.FastBuf.Splite.Data1 = 0;
						Record.LinkageAdd(Record.FastBuf);
						CtlCenter.ieManualPushOneMsgLinkageStart(Record.FastBuf);
					}
				}
		}*/
	}else
	if( (aCmd == 128) || (aCmd == 129) ){
		Record.InnerMsgSetYear		(0, DateTime.Date.Split.Year);
		Record.InnerMsgSetMonth		(0, DateTime.Date.Split.Month);
		Record.InnerMsgSetDay		(0, DateTime.Date.Split.Day);
		Record.InnerMsgSetHour		(0, DateTime.Time.Split.Hour);
		Record.InnerMsgSetMinute	(0, DateTime.Time.Split.Minute);
		Record.InnerMsgSetSecond	(0, DateTime.Time.Split.Second);	
		Record.InnerMsgSet_mType	(0, etLinkageFeedBack);
		Record.InnerMsgSet_CtlNum	(0, MainCtl.fData.Split.MyNum );	//(0,aRxMsg.Data.D8[1]);
		
		Record.InnerMsgSet_P0		(0,254);
		Record.InnerMsgSet_P1		(0,254);
		Record.InnerMsgSet_P2		(0,254);
		
		Record.InnerMsgSet_dType	(0,0);
		Record.InnerMsgSet_Data0	(0,0);
		Record.InnerMsgSet_Data1	(0,0);
		
		Record.InnerMsgSet_iByte0(0,CmdActiveDefaultSet[aCmd][8]);
		if(aCmd == 128){
			CtlCenter.iePushOneMsgLinkageFb(Record.iMsgRx);
			ExRecord.SetStateCodeFeedBack();
			FecBusCRT.SetStateCodeFeedBack();
			Record.LinkageAdd(Record.iMsgRx);
		}else{
			CtlCenter.iePushOneMsgLinkageFbCancel(Record.iMsgRx);
			ExRecord.SetStateCodeFeedBack();
			FecBusCRT.SetStateCodeFeedBack();
			Record.LinkageAdd(Record.iMsgRx);
		}
	}
}

int TInnerCan::CheckOutBufFastFinish()
{
	unsigned int aAddr;
	if(OutBufFast.ReadIndex != OutBufFast.WriteIndex){
		if(get_can_tx_complete()){
			OutBufFast.ReadIndex++;
			if(OutBufFast.ReadIndex >=InnerFastTxBufCount)OutBufFast.ReadIndex =0;
			
			aAddr = dAddrSdram_InnerCanFastOut + (OutBufFast.ReadIndex * 16);
			OutBufFast.rBody.Ide.D32 = *(volatile unsigned int *)(aAddr);
			OutBufFast.rBody.Data.D32[0] = *(volatile unsigned int *)(aAddr+4);
			OutBufFast.rBody.Data.D32[1] = *(volatile unsigned int *)(aAddr+8);
			OutBufFast.rBody.Dlc = *(volatile unsigned int *)(aAddr+12);
			if(OutBufFast.rBody.Ide.BitF.Cmd == cmBroadcastTime){
				tData[0] = 0; 
				tData[1] = MainCtl.fData.Split.MyNum;
				tData[2] = DateTime.Date.Split.Year; 
				tData[3] = DateTime.Date.Split.Month; 
				tData[4] = DateTime.Date.Split.Day;
				tData[5] = DateTime.Time.Split.Hour; 
				tData[6] = DateTime.Time.Split.Minute;
				tData[7] = DateTime.Time.Split.Second; 
				internal_can_send_data(OutBufFast.rBody.Ide.D32, tData, 8);
			}else{
				internal_can_send_data(OutBufFast.rBody.Ide.D32, OutBufFast.rBody.Data.D8, OutBufFast.rBody.Dlc);
			}
		}
		return 0;
	}else{
		return 1;
	}
}

void TInnerCan::OBufCheckSend()
{
	unsigned int aAddr;
	if(get_can_tx_complete()){
		if(OutBufFast.ReadIndex != OutBufFast.WriteIndex){
			OutBufFast.ReadIndex++;
			if(OutBufFast.ReadIndex >=InnerFastTxBufCount)OutBufFast.ReadIndex =0;
			
			aAddr = dAddrSdram_InnerCanFastOut + (OutBufFast.ReadIndex * 16);
			OutBufFast.rBody.Ide.D32 = *(volatile unsigned int *)(aAddr);
			OutBufFast.rBody.Data.D32[0] = *(volatile unsigned int *)(aAddr+4);
			OutBufFast.rBody.Data.D32[1] = *(volatile unsigned int *)(aAddr+8);
			OutBufFast.rBody.Dlc = *(volatile unsigned int *)(aAddr+12);
			if(OutBufFast.rBody.Ide.BitF.Cmd == cmBroadcastTime){
				tData[0] = 0; 
				tData[1] = MainCtl.fData.Split.MyNum;
				tData[2] = DateTime.Date.Split.Year; 
				tData[3] = DateTime.Date.Split.Month; 
				tData[4] = DateTime.Date.Split.Day;
				tData[5] = DateTime.Time.Split.Hour; 
				tData[6] = DateTime.Time.Split.Minute;
				tData[7] = DateTime.Time.Split.Second; 
				internal_can_send_data(OutBufFast.rBody.Ide.D32, tData, 8);
			}else{
				internal_can_send_data(OutBufFast.rBody.Ide.D32, OutBufFast.rBody.Data.D8, OutBufFast.rBody.Dlc);
			}
		}else
		if(OutBuf.ReadIndex != OutBuf.WriteIndex){
			OutBuf.ReadIndex++;
			if(OutBuf.ReadIndex >=InnerEventTxBufCount)OutBuf.ReadIndex =0;
			
			aAddr = dAddrSdram_InnerCan + (OutBuf.ReadIndex * 16);
			OutBuf.rBody.Ide.D32 = *(volatile unsigned int *)(aAddr);
			OutBuf.rBody.Data.D32[0] = *(volatile unsigned int *)(aAddr+4);
			OutBuf.rBody.Data.D32[1] = *(volatile unsigned int *)(aAddr+8);
			OutBuf.rBody.Dlc = *(volatile unsigned int *)(aAddr+12);
			if(OutBuf.rBody.Ide.BitF.Cmd == cmBroadcastTime){
				tData[0] = 0; 
				tData[1] = MainCtl.fData.Split.MyNum;
				tData[2] = DateTime.Date.Split.Year; 
				tData[3] = DateTime.Date.Split.Month; 
				tData[4] = DateTime.Date.Split.Day;
				tData[5] = DateTime.Time.Split.Hour; 
				tData[6] = DateTime.Time.Split.Minute;
				tData[7] = DateTime.Time.Split.Second; 
				internal_can_send_data(OutBuf.rBody.Ide.D32, tData, 8);
			}else{
				internal_can_send_data(OutBuf.rBody.Ide.D32, OutBuf.rBody.Data.D8, OutBuf.rBody.Dlc);
				//OBufPrcRecordAndEvent();
			}
		}else
		if(Buf4GuiSend.Inx_Out != Buf4GuiSend.Inx_In){
			Buf4GuiSend.Inx_Out++;
			if(Buf4GuiSend.Inx_Out >= Buf4GuiInxMax)Buf4GuiSend.Inx_Out = 0;
			internal_can_send_data(Buf4GuiSend.Body[Buf4GuiSend.Inx_Out].Ide.D32, Buf4GuiSend.Body[Buf4GuiSend.Inx_Out].Da, Buf4GuiSend.Body[Buf4GuiSend.Inx_Out].Len);
		}
	}
}

void TInnerCan::CmdSendCustom(TCanHeaderID aIde, unsigned char *p, unsigned int aLen)
{
	internal_can_send_data(aIde.D32, p, aLen);	
}

unsigned int TInnerCan::CmdSendCustomWithReturn(TCanHeaderID aIde, unsigned char *p, unsigned int aLen)
{
	return internal_can_send_data(aIde.D32, p, aLen);	
}

void TInnerCan::BusPadGoAction(unsigned char P0, unsigned char aKeyNum)
{
	unsigned char aP0;
	if( (P0>=dADDR_HANDPAD_START) && (P0 <= dADDR_HANDPAD_END) ){
		if( (aKeyNum >0) && (aKeyNum <= dHANDCTL_KEY_MAX_COUNT) ){
			aP0 = P0 - dADDR_HANDPAD_START;
			HandCtlBoard[aP0].KeyPress(MainCtl.fData.Split.MyNum, aP0+1, aKeyNum);
		}
	}
}

void TInnerCan::DirectUpLoad(unsigned char aCmd, unsigned char *Data)
{
	unsigned char aP0;
	if(aCmd == cmDirectCtlPadManualState){
		aP0 = Data[2];
		if( (aP0>=dADDR_DIRECTPAD_START) && (aP0<=dADDR_DIRECTPAD_END) ){
			aP0 = aP0 - dADDR_DIRECTPAD_START;
			DirectCtlBoard[aP0].dUploadAllowState(MainCtl.fData.Split.MyNum, aP0, Data[3]);
		}
	}else
	if(aCmd == cmDirectCtlPadChannelState){
		aP0 = Data[2];
		if( (aP0>=dADDR_DIRECTPAD_START) && (aP0<=dADDR_DIRECTPAD_END) ){
			aP0 = aP0 - dADDR_DIRECTPAD_START;
			DirectCtlBoard[aP0].dUploadNodeState(MainCtl.fData.Split.MyNum, aP0, Data[3], Data[4]);
		}
	}
}

void TInnerCan::DirectRequest(unsigned char aCmd, unsigned char *Data)
{
	unsigned char aP0;
	if(aCmd == cmBusCtlPadConfigReq){
		aP0 = Data[1];
		if( (aP0>=dADDR_DIRECTPAD_START) && (aP0<=dADDR_DIRECTPAD_END) ){
			aP0 = aP0 - dADDR_DIRECTPAD_START;
			DirectCtlBoard[aP0].SendPadCfg2Pad(aP0);
		}
	}else
	if(aCmd == cmDirectCtlPadQueryPort){
		aP0 = Data[2];
		if( (aP0>=dADDR_DIRECTPAD_START) && (aP0<=dADDR_DIRECTPAD_END) ){
			aP0 = aP0 - dADDR_DIRECTPAD_START;
		}
	}
}

void TInnerCan::TaskSecondUpdate()
{
	if( 	(DateTime.Time.Split.Minute == 4 ) &&
		(DateTime.Time.Split.Second == 5 ) ){
		tData[0] = 0; 
		tData[1] = MainCtl.fData.Split.MyNum;
		tData[2] = DateTime.Date.Split.Year; 
		tData[3] = DateTime.Date.Split.Month; 
		tData[4] = DateTime.Date.Split.Day;
		tData[5] = DateTime.Time.Split.Hour; 
		tData[6] = DateTime.Time.Split.Minute;
		tData[7] = DateTime.Time.Split.Second; 
		OBufInsert(1,cmBroadcastTime,tData,8);
	}
}

void TInnerCan::ForceSecondUpdate()
{
	tData[0] = 0; 
	tData[1] = MainCtl.fData.Split.MyNum;
	tData[2] = DateTime.Date.Split.Year; 
	tData[3] = DateTime.Date.Split.Month; 
	tData[4] = DateTime.Date.Split.Day;
	tData[5] = DateTime.Time.Split.Hour; 
	tData[6] = DateTime.Time.Split.Minute;
	tData[7] = DateTime.Time.Split.Second; 
	OBufInsert(1,cmBroadcastTime,tData,8);
}

void TInnerCan::LoadPreset(unsigned char aCmd)
{
	aTxMsg.Ide.BitF.Cmd 	= aCmd;
	aTxMsg.Data.D8[0] 	= CmdActiveDefaultSet[aCmd][3];
	aTxMsg.DelayMs 		= CmdActiveDefaultSet[aCmd][4];
	aTxMsg.Ide.BitF.Pri	= CmdActiveDefaultSet[aCmd][5];
}

void TInnerCan::SetTarget(u8 aPathLevel)
{
	aTxMsg.Ide.BitF.sLvl = 1;
	aTxMsg.Ide.BitF.sAddr = 0;
	aTxMsg.Ide.BitF.dAddr = 127;	//set Bost, if need, will be Overwrite
	if(aPathLevel < 10){
		aTxMsg.Ide.BitF.dLvl = aPathLevel;
	}else
	if(aPathLevel < 100){
		if(aPathLevel == 12) aTxMsg.Ide.BitF.dLvl = 5;
		if(aPathLevel == 23) aTxMsg.Ide.BitF.dLvl = 4;
	}else{
		aTxMsg.Ide.BitF.dLvl = 7;
	}
	aTxMsg.Dlc = 1;
}

void TInnerCan::SetTarget(u8 aPathLevel,  unsigned char Path1)
{
	SetTarget(aPathLevel);
	aTxMsg.Ide.BitF.dAddr = Path1;
	aTxMsg.Data.D8[1] = Path1;
	aTxMsg.Dlc = 2;
}

void TInnerCan::SetTarget(u8 aPathLevel,  unsigned char Path1, unsigned char Path2)
{
	SetTarget(aPathLevel,Path1);
	aTxMsg.Data.D8[2] = Path2;
	aTxMsg.Dlc = 3;
}

void TInnerCan::SetTarget(u8 aPathLevel,  unsigned char Path1, unsigned char Path2, unsigned char Path3)
{
	SetTarget(aPathLevel,Path1, Path2);
	aTxMsg.Data.D8[3] = Path3;
	aTxMsg.Dlc = 4;
}

void TInnerCan::SendCmdPowerOnFast()
{
	unsigned char Data[8];
	
	Data[0] = 0;
	Data[1] = MainCtl.fData.Split.MyNum;
	Data[2] = 0;
	Data[3] = 0;
	Data[4] = 0;
	Data[5] = 0;
	Data[6] = 0;
	
	OBufFastInsert(0, cmCtrlPowerOn, Data, 1);
}

void TInnerCan::GetEpUserCodeAreaNumDevType(unsigned char aP0, unsigned char aP1, unsigned int *pUc, unsigned short *pAreaNum, unsigned char *pDevType)
{
	if(aP0 ==0){*pUc =0; *pAreaNum =0; *pDevType = 0; return;}
	if(aP1 ==0){*pUc =0; *pAreaNum =0; *pDevType = 0; return;}
	
	if(aP0 <= dPORT_MAX_COUNT){
		if(aP1 >dEP_MAX_COUNT_PER_PORT){*pUc =0; *pAreaNum =0; *pDevType = 0; return;}
		aP0--; aP1--;
		*pUc = Port[aP0].UcList[aP1].Full;
		*pAreaNum = Port[aP0].Area[aP1];
		if(Port[aP0].AssignType[aP1]){
			*pDevType = Port[aP0].AssignType[aP1];
		}else{
			if(Port[aP0].ExistTable[aP1] == 0xA5){
				*pDevType = Port[aP0].dTypeTable[aP1];
			}else{
				*pDevType = 0;
			}
		}
	}else{
		*pUc = 0;
		*pAreaNum = 0;
		*pDevType = 0;
	}
}

void TInnerCan::SendCmdBroadcastFast(unsigned char aCdt)
{
	unsigned char Data[8];
	
	Data[0] = 0;
	Data[1] = aCdt;
	Data[2] = 0;
	Data[3] = 0;
	Data[4] = 0;
	Data[5] = 0;
	Data[6] = 0;
	
	OBufFastInsert(0, cmAlternatingSpeakerSL, Data, 2);	
}

void TInnerCan::SendCmdClearRegData()
{
	unsigned char Data[8];
	//0x00  0xFE	0x7F	0x5A	0xA5	0x26	0x82	0x79

	Data[0] = 0;
	Data[1] = 0xFE;
	Data[2] = 0x7F;
	Data[3] = 0x5A;
	Data[4] = 0xA5;
	Data[5] = 0x26;
	Data[6] = 0x82;
	Data[7] = 0x79;
	
	OBufFastInsert(0, cmClearAllRegist, Data, 8);	
}

void TInnerCan::SendCmdMaskRemoveAll()
{
	unsigned char Data[8];
	//0x00  0xXX
	Data[0] = 0;	
	OBufFastInsert(0, cmMaskRemoveAll, Data, 1);		
}

//f state set-------------------------------------------->
/*
void TInnerCan::fStateSetHandPadChannel(u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_HAND_CTL_CHANNEL;
	aTxMsg.Data.D8[2] = aOnOff;
	aTxMsg.Dlc = 3;
}
void TInnerCan::fStateSetHandPadChannel(u8 aPath1, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_HAND_CTL_CHANNEL;
	aTxMsg.Data.D8[3] = aOnOff;
	aTxMsg.Dlc = 4;	
}
void TInnerCan::fStateSetHandPadChannel(u8 aPath1, u8 aPath2, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_HAND_CTL_CHANNEL;
	aTxMsg.Data.D8[4] = aOnOff;
	aTxMsg.Dlc = 5;	
}

void TInnerCan::fStateSetDirectCtlChannel(u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_DIRECT_CTL_CHANNEL;
	aTxMsg.Data.D8[2] = aOnOff;
	aTxMsg.Dlc = 3;
}
void TInnerCan::fStateSetDirectCtlChannel(u8 aPath1, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_DIRECT_CTL_CHANNEL;
	aTxMsg.Data.D8[3] = aOnOff;
	aTxMsg.Dlc = 4;	
}
void TInnerCan::fStateSetDirectCtlChannel(u8 aPath1, u8 aPath2, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_DIRECT_CTL_CHANNEL;
	aTxMsg.Data.D8[4] = aOnOff;
	aTxMsg.Dlc = 5;	
}

void TInnerCan::fStateSetPort(u8 aIntv1, u8 aIntv2)
{
	LoadPreset(cmStateSetByType);
	SetTarget(1);
	aTxMsg.Data.D8[1] = dgTYPE_PORT;
	aTxMsg.Data.D8[2] = aIntv1;
	aTxMsg.Data.D8[3] = aIntv2;
	aTxMsg.Dlc = 4;
}
void TInnerCan::fStateSetPort(u8 aPath1, u8 aIntv1, u8 aIntv2)
{
	LoadPreset(cmStateSetByType);
	SetTarget(1,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_PORT;
	aTxMsg.Data.D8[3] = aIntv1;
	aTxMsg.Data.D8[4] = aIntv2;
	aTxMsg.Dlc = 5;
}

void TInnerCan::fStateSetMotherBoard(u8 aLocalInterLinkSelfRun)
{
	LoadPreset(cmStateSetByType);
	SetTarget(1);
	aTxMsg.Data.D8[1] = dgTYPE_MOTHER_BOARD;
	aTxMsg.Data.D8[2] = aLocalInterLinkSelfRun;
	aTxMsg.Dlc = 3;
}
void TInnerCan::fStateSetMotherBoard(u8 aPath1, u8 aLocalInterLinkSelfRun)
{
	LoadPreset(cmStateSetByType);
	SetTarget(1,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_MOTHER_BOARD;
	aTxMsg.Data.D8[3] = aLocalInterLinkSelfRun;
	aTxMsg.Dlc = 4;
}

void TInnerCan::fStateSetCommBoard(u8 aEn1, u8 aEn2, u8 aEn3, u8 aEn4)
{
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = aEn1;
	Fbit8.BitF.Bit1 = aEn2;
	Fbit8.BitF.Bit2 = aEn3;
	Fbit8.BitF.Bit3 = aEn4;
	
	LoadPreset(cmStateSetByType);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_COMM_MULTI;
	aTxMsg.Data.D8[2] = Fbit8.D8;
	aTxMsg.Dlc = 3;
}
void TInnerCan::fStateSetCommBoard(u8 aPath1, u8 aEn1, u8 aEn2, u8 aEn3, u8 aEn4)
{
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = aEn1;
	Fbit8.BitF.Bit1 = aEn2;
	Fbit8.BitF.Bit2 = aEn3;
	Fbit8.BitF.Bit3 = aEn4;
	
	LoadPreset(cmStateSetByType);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_COMM_MULTI;
	aTxMsg.Data.D8[3] = Fbit8.D8;
	aTxMsg.Dlc = 4;
}

void TInnerCan::fStateSetDisplayPad(u8 IsShow, u8 BackLightOnOff, u8 BeepOnOff, u8 IndexLongShow, u8 IndexShortShow)
{
	//IndexLongShow : Mask Value = 0xFF;
	//IndexShortShow : Mask Value = 0xFF;
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = IsShow;
	Fbit8.BitF.Bit1 = BackLightOnOff;
	Fbit8.BitF.Bit2 = BeepOnOff;
	
	LoadPreset(cmStateSetByType);
	SetTarget(123);
	aTxMsg.Data.D8[1] = dgTYPE_DISPLAY_PAD_I;
	aTxMsg.Data.D8[2] = Fbit8.D8;
	aTxMsg.Data.D8[3] = IndexLongShow;
	aTxMsg.Data.D8[4] = IndexShortShow;
	aTxMsg.Dlc = 5;	
}
void TInnerCan::fStateSetDisplayPad(u8 aPath1, u8 IsShow, u8 BackLightOnOff, u8 BeepOnOff, u8 IndexLongShow, u8 IndexShortShow)
{
	//IndexLongShow : Mask Value = 0xFF;
	//IndexShortShow : Mask Value = 0xFF;
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = IsShow;
	Fbit8.BitF.Bit1 = BackLightOnOff;
	Fbit8.BitF.Bit2 = BeepOnOff;
	
	LoadPreset(cmStateSetByType);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_DISPLAY_PAD_I;
	aTxMsg.Data.D8[3] = Fbit8.D8;
	aTxMsg.Data.D8[4] = IndexLongShow;
	aTxMsg.Data.D8[5] = IndexShortShow;
	aTxMsg.Dlc = 6;	
}
void TInnerCan::fStateSetDisplayPad(u8 aPath1, u8 aPath2, u8 IsShow, u8 BackLightOnOff, u8 BeepOnOff, u8 IndexLongShow, u8 IndexShortShow)
{
	//IndexLongShow : Mask Value = 0xFF;
	//IndexShortShow : Mask Value = 0xFF;
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = IsShow;
	Fbit8.BitF.Bit1 = BackLightOnOff;
	Fbit8.BitF.Bit2 = BeepOnOff;
	
	LoadPreset(cmStateSetByType);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_DISPLAY_PAD_I;
	aTxMsg.Data.D8[4] = Fbit8.D8;
	aTxMsg.Data.D8[5] = IndexLongShow;
	aTxMsg.Data.D8[6] = IndexShortShow;
	aTxMsg.Dlc = 7;	
}

void TInnerCan::fStateSetIsoOutput(u8 aGroupOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(123);
	aTxMsg.Data.D8[1] = dgTYPE_OUT_MODULE;
	aTxMsg.Data.D8[2] = aGroupOnOff;
	aTxMsg.Dlc = 3;	
}
void TInnerCan::fStateSetIsoOutput(u8 aPath1, u8 aGroupOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(3,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_OUT_MODULE;
	aTxMsg.Data.D8[3] = aGroupOnOff;
	aTxMsg.Dlc = 4;	
}
void TInnerCan::fStateSetIsoOutput(u8 aPath1, u8 aPath2, u8 aGroupOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(3,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_OUT_MODULE;
	aTxMsg.Data.D8[4] = aGroupOnOff;
	aTxMsg.Dlc = 5;	
}

void TInnerCan::fStateSetIsoInOut(u8 aGroupOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_OUT_MODULE;
	aTxMsg.Data.D8[2] = aGroupOnOff;
	aTxMsg.Dlc = 3;
}
void TInnerCan::fStateSetIsoInOut(u8 aPath1, u8 aGroupOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_INOUT_MODULE;
	aTxMsg.Data.D8[3] = aGroupOnOff;
	aTxMsg.Dlc = 4;
}
void TInnerCan::fStateSetIsoInOut(u8 aPath1, u8 aPath2, u8 aGroupOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_INOUT_MODULE;
	aTxMsg.Data.D8[4] = aGroupOnOff;
	aTxMsg.Dlc = 5;
}

void TInnerCan::fStateSetVaAlram(u8 aBellOnOff, u8 aLightOnOff)
{
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = aBellOnOff;
	Fbit8.BitF.Bit1 = aLightOnOff;
	
	LoadPreset(cmStateSetByType);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgType_VAALRAM;
	aTxMsg.Data.D8[2] = Fbit8.D8;
	aTxMsg.Dlc = 3;	
}
void TInnerCan::fStateSetVaAlram(u8 aPath1, u8 aBellOnOff, u8 aLightOnOff)
{
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = aBellOnOff;
	Fbit8.BitF.Bit1 = aLightOnOff;
	
	LoadPreset(cmStateSetByType);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgType_VAALRAM;
	aTxMsg.Data.D8[3] = Fbit8.D8;
	aTxMsg.Dlc = 4;	
}
void TInnerCan::fStateSetVaAlram(u8 aPath1, u8 aPath2, u8 aBellOnOff, u8 aLightOnOff)
{
	Tu8BitFiled Fbit8;
	Fbit8.BitF.Bit0 = aBellOnOff;
	Fbit8.BitF.Bit1 = aLightOnOff;
	
	LoadPreset(cmStateSetByType);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgType_VAALRAM;
	aTxMsg.Data.D8[4] = Fbit8.D8;
	aTxMsg.Dlc = 5;	
}

void TInnerCan::fStateSetBroke(u8 aBroke)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_BUS_BROKE;
	aTxMsg.Data.D8[2] = aBroke;
	aTxMsg.Dlc = 3;	
}
void TInnerCan::fStateSetBroke(u8 aPath1, u8 aBroke)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_BUS_BROKE;
	aTxMsg.Data.D8[3] = aBroke;
	aTxMsg.Dlc = 4;	
}
void TInnerCan::fStateSetBroke(u8 aPath1, u8 aPath2, u8 aBroke)
{
	LoadPreset(cmStateSetByType);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_BUS_BROKE;
	aTxMsg.Data.D8[4] = aBroke;
	aTxMsg.Dlc = 5;	
}

void TInnerCan::fStateSetExtCurrentSensor(u8 aEnable)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_EXTCURRENT_SENSOR_CHANNEL;
	aTxMsg.Data.D8[2] = aEnable;
	aTxMsg.Dlc = 3;
}
void TInnerCan::fStateSetExtCurrentSensor(u8 aPath1, u8 aEnable)
{
	LoadPreset(cmStateSetByType);
	SetTarget(12, aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_EXTCURRENT_SENSOR_CHANNEL;
	aTxMsg.Data.D8[3] = aEnable;
	aTxMsg.Dlc = 4;
}
void TInnerCan::fStateSetExtCurrentSensor(u8 aPath1, u8 aPath2, u8 aEnable)
{
	LoadPreset(cmStateSetByType);
	SetTarget(2, aPath1, aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_EXTCURRENT_SENSOR_CHANNEL;
	aTxMsg.Data.D8[4] = aEnable;
	aTxMsg.Dlc = 5;
}

void TInnerCan::fStateSetIsoOutputChannel(u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(123);
	aTxMsg.Data.D8[1] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[2] = aOnOff;
	aTxMsg.Dlc = 3;	
}
void TInnerCan::fStateSetIsoOutputChannel(u8 aPath1, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(123,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[3] = aOnOff;
	aTxMsg.Dlc = 4;	
}
void TInnerCan::fStateSetIsoOutputChannel(u8 aPath1, u8 aPath2, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(23,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[4] = aOnOff;
	aTxMsg.Dlc = 5;	
}
void TInnerCan::fStateSetIsoOutputChannel(u8 aPath1, u8 aPath2, u8 aPath3, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(3,aPath1,aPath2,aPath3);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = aPath3;
	aTxMsg.Data.D8[4] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[5] = aOnOff;
	aTxMsg.Dlc = 6;	
}

void TInnerCan::fStateSetIsoInOutChannel(u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(3);
	aTxMsg.Data.D8[1] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[2] = aOnOff;
	aTxMsg.Dlc = 3;	
}
void TInnerCan::fStateSetIsoInOutChannel(u8 aPath1, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(3,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[3] = aOnOff;
	aTxMsg.Dlc = 4;	
}
void TInnerCan::fStateSetIsoInOutChannel(u8 aPath1, u8 aPath2, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(3,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[4] = aOnOff;
	aTxMsg.Dlc = 5;	
}
void TInnerCan::fStateSetIsoInOutChannel(u8 aPath1, u8 aPath2, u8 aPath3, u8 aOnOff)
{
	LoadPreset(cmStateSetByType);
	SetTarget(3,aPath1,aPath2,aPath3);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = aPath3;
	aTxMsg.Data.D8[4] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[5] = aOnOff;
	aTxMsg.Dlc = 6;	
}

//f ParameterSet
void TInnerCan::fParameterSetHandPadChannel(u8 aAssignType, u8 aAssignRank)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_HAND_CTL_CHANNEL;
	aTxMsg.Data.D8[2] = aAssignType;
	aTxMsg.Data.D8[3] = aAssignRank;
	aTxMsg.Dlc = 4;		
}
void TInnerCan::fParameterSetHandPadChannel(u8 aPath1, u8 aAssignType, u8 aAssignRank)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_HAND_CTL_CHANNEL;
	aTxMsg.Data.D8[3] = aAssignType;
	aTxMsg.Data.D8[4] = aAssignRank;
	aTxMsg.Dlc = 5;	
}
void TInnerCan::fParameterSetHandPadChannel(u8 aPath1, u8 aPath2, u8 aAssignType, u8 aAssignRank)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_HAND_CTL_CHANNEL;
	aTxMsg.Data.D8[4] = aAssignType;
	aTxMsg.Data.D8[5] = aAssignRank;
	aTxMsg.Dlc = 6;		
}

void TInnerCan::fParameterSetDirectCtlChannel(u8 aAssignType, u8 aAssignRank, u8 aCLow, u8 aCHi)
{
	//aCLow aCHi	0=Ignore, 0=Default
	LoadPreset(cmDevParameterWrite);
	SetTarget(2);
	aTxMsg.Data.D8[1] = dgTYPE_DIRECT_CTL_CHANNEL;
	aTxMsg.Data.D8[2] = aAssignType;
	aTxMsg.Data.D8[3] = aAssignRank;
	aTxMsg.Data.D8[4] = aCLow;
	aTxMsg.Data.D8[5] = aCHi;
	aTxMsg.Dlc = 6;	
}
void TInnerCan::fParameterSetDirectCtlChannel(u8 aPath1, u8 aAssignType, u8 aAssignRank, u8 aCLow, u8 aCHi)
{
	//aCLow aCHi	0=Ignore, 0=Default
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_DIRECT_CTL_CHANNEL;
	aTxMsg.Data.D8[3] = aAssignType;
	aTxMsg.Data.D8[4] = aAssignRank;
	aTxMsg.Data.D8[5] = aCLow;
	aTxMsg.Data.D8[6] = aCHi;
	aTxMsg.Dlc = 7;	
}
void TInnerCan::fParameterSetDirectCtlChannel(u8 aPath1, u8 aPath2, u8 aAssignType, u8 aAssignRank, u8 aCLow, u8 aCHi)
{
	//aCLow aCHi	0=Ignore, 0=Default
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_DIRECT_CTL_CHANNEL;
	aTxMsg.Data.D8[4] = aAssignType;
	aTxMsg.Data.D8[5] = aAssignRank;
	aTxMsg.Data.D8[6] = aCLow;
	aTxMsg.Data.D8[7] = aCHi;
	aTxMsg.Dlc = 8;	
}

void TInnerCan::fParameterSetPort(u8 aSubItemCount, u8 aBrokeCurrent, u8 aShortCurrent, u8 aVLow)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(1);
	aTxMsg.Data.D8[1] = dgTYPE_PORT;
	aTxMsg.Data.D8[2] = aSubItemCount;
	aTxMsg.Data.D8[3] = aBrokeCurrent;
	aTxMsg.Data.D8[4] = aShortCurrent;
	aTxMsg.Data.D8[5] = aVLow;
	aTxMsg.Dlc = 6;	
}
void TInnerCan::fParameterSetPort(u8 aPath1, u8 aSubItemCount, u8 aBrokeCurrent, u8 aShortCurrent, u8 aVLow)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(1,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_PORT;
	aTxMsg.Data.D8[3] = aSubItemCount;
	aTxMsg.Data.D8[4] = aBrokeCurrent;
	aTxMsg.Data.D8[5] = aShortCurrent;
	aTxMsg.Data.D8[6] = aVLow;
	aTxMsg.Dlc = 7;	
}

void TInnerCan::fParameterSetMotherBoard(u8 aSubItemCount)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(1);
	aTxMsg.Data.D8[1] = dgTYPE_MOTHER_BOARD;
	aTxMsg.Data.D8[2] = aSubItemCount;
	aTxMsg.Dlc = 3;	
}
void TInnerCan::fParameterSetMotherBoard(u8 aPath1, u8 aSubItemCount)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(1,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_MOTHER_BOARD;
	aTxMsg.Data.D8[3] = aSubItemCount;
	aTxMsg.Dlc = 4;		
}
		
void TInnerCan::fParameterSetCommBoardChannel(u8 aPath1, u8 aChannel, u8 aCommType, u8 aSpeed, u8 aFerture)
{
	//aFerture = BIt0..3 Bits Bit4..5 Stop Bits   Bit6..7 Parity
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aChannel);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aChannel;
	aTxMsg.Data.D8[3] = dgTYPE_COMM_CHANNEL;
	aTxMsg.Data.D8[4] = aCommType;
	aTxMsg.Data.D8[5] = aSpeed;
	aTxMsg.Data.D8[6] = aFerture;
	aTxMsg.Dlc = 7;
}
		
void TInnerCan::fParameterSetDisplayPad(u8 IsDefaultShow, u8 IndexLongShow, u8 IndexShortShow, u8 aIntv)					
{
	// Mask Value = 0xFF;
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_DISPLAY_PAD_I;
	aTxMsg.Data.D8[2] = IsDefaultShow;
	aTxMsg.Data.D8[3] = IndexLongShow;
	aTxMsg.Data.D8[4] = IndexShortShow;
	aTxMsg.Data.D8[5] = aIntv;
	aTxMsg.Dlc = 6;	
}
void TInnerCan::fParameterSetDisplayPad(u8 aPath1, u8 IsDefaultShow, u8 IndexLongShow, u8 IndexShortShow, u8 aIntv)			
{
	// Mask Value = 0xFF;
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_DISPLAY_PAD_I;
	aTxMsg.Data.D8[3] = IsDefaultShow;
	aTxMsg.Data.D8[4] = IndexLongShow;
	aTxMsg.Data.D8[5] = IndexShortShow;
	aTxMsg.Data.D8[6] = aIntv;
	aTxMsg.Dlc = 7;	
}
void TInnerCan::fParameterSetDisplayPad(u8 aPath1, u8 aPath2, u8 IsDefaultShow, u8 IndexLongShow, u8 IndexShortShow, u8 aIntv)	// Mask Value = 0xFF;
{
	// Mask Value = 0xFF;
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_DISPLAY_PAD_I;
	aTxMsg.Data.D8[4] = IsDefaultShow;
	aTxMsg.Data.D8[5] = IndexLongShow;
	aTxMsg.Data.D8[6] = IndexShortShow;
	aTxMsg.Data.D8[7] = aIntv;
	aTxMsg.Dlc = 8;
}
		
void TInnerCan::fParameterSetIsoInput(u8 aSens1, u8 aSens2, u8 aSens3, u8 aSens4)	
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_IN_MODULE;
	aTxMsg.Data.D8[2] = aSens1;
	aTxMsg.Data.D8[3] = aSens2;
	aTxMsg.Data.D8[4] = aSens3;
	aTxMsg.Data.D8[5] = aSens4;
	aTxMsg.Dlc = 6;
}	
void TInnerCan::fParameterSetIsoInput(u8 aPath1, u8 aSens1, u8 aSens2, u8 aSens3, u8 aSens4)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_IN_MODULE;
	aTxMsg.Data.D8[3] = aSens1;
	aTxMsg.Data.D8[4] = aSens2;
	aTxMsg.Data.D8[5] = aSens3;
	aTxMsg.Data.D8[6] = aSens4;
	aTxMsg.Dlc = 7;
}	
void TInnerCan::fParameterSetIsoInput(u8 aPath1, u8 aPath2, u8 aSens1, u8 aSens2, u8 aSens3, u8 aSens4)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_IN_MODULE;
	aTxMsg.Data.D8[4] = aSens1;
	aTxMsg.Data.D8[5] = aSens2;
	aTxMsg.Data.D8[6] = aSens3;
	aTxMsg.Data.D8[7] = aSens4;
	aTxMsg.Dlc = 8;
}	
		
void TInnerCan::fParameterSetIsoInputChannel(u8 aAssignType, u8 aAssignRank)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(123);
	aTxMsg.Data.D8[1] = dgTYPE_IN_CHANNEL;
	aTxMsg.Data.D8[2] = aAssignType;
	aTxMsg.Data.D8[3] = aAssignRank;
	aTxMsg.Dlc = 4;
}	
void TInnerCan::fParameterSetIsoInputChannel(u8 aPath1, u8 aAssignType, u8 aAssignRank)				
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(123,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_IN_CHANNEL;
	aTxMsg.Data.D8[3] = aAssignType;
	aTxMsg.Data.D8[4] = aAssignRank;
	aTxMsg.Dlc = 5;	
}
void TInnerCan::fParameterSetIsoInputChannel(u8 aPath1, u8 aPath2, u8 aAssignType, u8 aAssignRank)		
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(123,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_IN_CHANNEL;
	aTxMsg.Data.D8[4] = aAssignType;
	aTxMsg.Data.D8[5] = aAssignRank;
	aTxMsg.Dlc = 6;		
}
void TInnerCan::fParameterSetIsoInputChannel(u8 aPath1, u8 aPath2, u8 aPath3, u8 aAssignType, u8 aAssignRank)			
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(123,aPath1,aPath2,aPath3);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = aPath3;
	aTxMsg.Data.D8[4] = dgTYPE_IN_CHANNEL;
	aTxMsg.Data.D8[5] = aAssignType;
	aTxMsg.Data.D8[6] = aAssignRank;
	aTxMsg.Dlc = 7;		
}
		
void TInnerCan::fParameterSetIsoOutput(u8 aThreshold1, u8 aThreshold2, u8 aThreshold3, u8 aThreshold4)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_OUT_MODULE;
	aTxMsg.Data.D8[2] = aThreshold1;
	aTxMsg.Data.D8[3] = aThreshold2;
	aTxMsg.Data.D8[4] = aThreshold3;
	aTxMsg.Data.D8[5] = aThreshold4;
	aTxMsg.Dlc = 6;
}	
void TInnerCan::fParameterSetIsoOutput(u8 aPath1,  u8 aThreshold1, u8 aThreshold2, u8 aThreshold3, u8 aThreshold4)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_OUT_MODULE;
	aTxMsg.Data.D8[3] = aThreshold1;
	aTxMsg.Data.D8[4] = aThreshold2;
	aTxMsg.Data.D8[5] = aThreshold3;
	aTxMsg.Data.D8[6] = aThreshold4;
	aTxMsg.Dlc = 7;
}	
void TInnerCan::fParameterSetIsoOutput(u8 aPath1, u8 aPath2, u8 aThreshold1, u8 aThreshold2, u8 aThreshold3, u8 aThreshold4)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_OUT_MODULE;
	aTxMsg.Data.D8[4] = aThreshold1;
	aTxMsg.Data.D8[5] = aThreshold2;
	aTxMsg.Data.D8[6] = aThreshold3;
	aTxMsg.Data.D8[7] = aThreshold4;
	aTxMsg.Dlc = 8;	
}

void TInnerCan::fParameterSetIsoOutputChannel(u8 aAssignType, u8 aAssignRank)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(123);
	aTxMsg.Data.D8[1] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[2] = aAssignType;
	aTxMsg.Data.D8[3] = aAssignRank;
	aTxMsg.Dlc = 5;
}	
void TInnerCan::fParameterSetIsoOutputChannel(u8 aPath1, u8 aAssignType, u8 aAssignRank)					
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(123,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[3] = aAssignType;
	aTxMsg.Data.D8[4] = aAssignRank;
	aTxMsg.Dlc = 5;		
}
void TInnerCan::fParameterSetIsoOutputChannel(u8 aPath1, u8 aPath2, u8 aAssignType, u8 aAssignRank)			
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(23,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[4] = aAssignType;
	aTxMsg.Data.D8[5] = aAssignRank;
	aTxMsg.Dlc = 6;	
}
void TInnerCan::fParameterSetIsoOutputChannel(u8 aPath1, u8 aPath2, u8 aPath3, u8 aAssignType, u8 aAssignRank)	
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(3,aPath1,aPath2,aPath3);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = aPath3;
	aTxMsg.Data.D8[4] = dgTYPE_OUT_CHANNEL;
	aTxMsg.Data.D8[5] = aAssignType;
	aTxMsg.Data.D8[6] = aAssignRank;
	aTxMsg.Dlc = 7;		
}
	
void TInnerCan::fParameterSetIsoInOut(u8 aSens1, u8 aSens2, u8 aThreshold1, u8 aThreshold2)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_INOUT_MODULE;
	aTxMsg.Data.D8[2] = aSens1;
	aTxMsg.Data.D8[3] = aSens2;
	aTxMsg.Data.D8[4] = aThreshold1;
	aTxMsg.Data.D8[5] = aThreshold2;
	aTxMsg.Dlc = 6;
}	
void TInnerCan::fParameterSetIsoInOut(u8 aPath1,  u8 aSens1, u8 aSens2, u8 aThreshold1, u8 aThreshold2)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_INOUT_MODULE;
	aTxMsg.Data.D8[3] = aSens1;
	aTxMsg.Data.D8[4] = aSens2;
	aTxMsg.Data.D8[5] = aThreshold1;
	aTxMsg.Data.D8[6] = aThreshold2;
	aTxMsg.Dlc = 7;
}	
void TInnerCan::fParameterSetIsoInOut(u8 aPath1, u8 aPath2, u8 aSens1, u8 aSens2, u8 aThreshold1, u8 aThreshold2)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_INOUT_MODULE;
	aTxMsg.Data.D8[4] = aSens1;
	aTxMsg.Data.D8[5] = aSens2;
	aTxMsg.Data.D8[6] = aThreshold1;
	aTxMsg.Data.D8[7] = aThreshold2;
	aTxMsg.Dlc = 8;
}	
		
void TInnerCan::fParameterSetVaAlram()
{
	//No Any Function
}	

void TInnerCan::fParameterSetBroke(u8 aBrokeCurrent, u8 aTimeDelay)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_BUS_BROKE;
	aTxMsg.Data.D8[2] = aBrokeCurrent;
	aTxMsg.Data.D8[3] = aTimeDelay;
	aTxMsg.Dlc = 4;
}
void TInnerCan::fParameterSetBroke(u8 aPath1, u8 aBrokeCurrent, u8 aTimeDelay)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_BUS_BROKE;
	aTxMsg.Data.D8[3] = aBrokeCurrent;
	aTxMsg.Data.D8[4] = aTimeDelay;
	aTxMsg.Dlc = 5;
}
void TInnerCan::fParameterSetBroke(u8 aPath1, u8 aPath2, u8 aBrokeCurrent, u8 aTimeDelay)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_BUS_BROKE;
	aTxMsg.Data.D8[4] = aBrokeCurrent;
	aTxMsg.Data.D8[5] = aTimeDelay;
	aTxMsg.Dlc = 6;
}
		
void TInnerCan::fParameterSetExtCurrentSensor(u8 aCRatio, u8 aLowThreshold, u8 aHiThreshold)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_EXTCURRENT_SENSOR_CHANNEL;
	aTxMsg.Data.D8[2] = aCRatio;
	aTxMsg.Data.D8[3] = aLowThreshold;
	aTxMsg.Data.D8[4] = aHiThreshold;
	aTxMsg.Dlc = 5;	
}
void TInnerCan::fParameterSetExtCurrentSensor(u8 aPath1, u8 aCRatio, u8 aLowThreshold, u8 aHiThreshold)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_EXTCURRENT_SENSOR_CHANNEL;
	aTxMsg.Data.D8[3] = aCRatio;
	aTxMsg.Data.D8[4] = aLowThreshold;
	aTxMsg.Data.D8[5] = aHiThreshold;
	aTxMsg.Dlc = 6;	
}
void TInnerCan::fParameterSetExtCurrentSensor(u8 aPath1, u8 aPath2, u8 aCRatio, u8 aLowThreshold, u8 aHiThreshold)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_EXTCURRENT_SENSOR_CHANNEL;
	aTxMsg.Data.D8[4] = aCRatio;
	aTxMsg.Data.D8[5] = aLowThreshold;
	aTxMsg.Data.D8[6] = aHiThreshold;
	aTxMsg.Dlc = 7;	
}
		
void TInnerCan::fParameterSetSmoke(u8 Sens, u8 aTimeDelay, u8 A, u8 B)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12);
	aTxMsg.Data.D8[1] = dgTYPE_SMOKE_DETECTOR_I;
	aTxMsg.Data.D8[2] = Sens;
	aTxMsg.Data.D8[3] = aTimeDelay;
	aTxMsg.Data.D8[4] = A;
	aTxMsg.Data.D8[5] = B;
	aTxMsg.Dlc = 6;	
}
void TInnerCan::fParameterSetSmoke(u8 aPath1, u8 Sens, u8 aTimeDelay, u8 A, u8 B)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(12,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_SMOKE_DETECTOR_I;
	aTxMsg.Data.D8[3] = Sens;
	aTxMsg.Data.D8[4] = aTimeDelay;
	aTxMsg.Data.D8[5] = A;
	aTxMsg.Data.D8[6] = B;
	aTxMsg.Dlc = 7;	
}
void TInnerCan::fParameterSetSmoke(u8 aPath1, u8 aPath2, u8 Sens, u8 aTimeDelay, u8 A, u8 B)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_SMOKE_DETECTOR_I;
	aTxMsg.Data.D8[4] = Sens;
	aTxMsg.Data.D8[5] = aTimeDelay;
	aTxMsg.Data.D8[6] = A;
	aTxMsg.Data.D8[7] = B;
	aTxMsg.Dlc = 8;	
}
		
void TInnerCan::fParameterSetTempe(u8 aThreshold1, u8 aThreshold2, u8 aIndex)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2);
	aTxMsg.Data.D8[1] = dgTYPE_TEMPE_DETECTOR_I;
	aTxMsg.Data.D8[2] = aThreshold1;
	aTxMsg.Data.D8[3] = aThreshold2;
	aTxMsg.Data.D8[4] = aIndex;
	aTxMsg.Dlc = 5;		
}
void TInnerCan::fParameterSetTempe(u8 aPath1, u8 aThreshold1, u8 aThreshold2, u8 aIndex)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = dgTYPE_TEMPE_DETECTOR_I;
	aTxMsg.Data.D8[3] = aThreshold1;
	aTxMsg.Data.D8[4] = aThreshold2;
	aTxMsg.Data.D8[5] = aIndex;
	aTxMsg.Dlc = 6;		
}
void TInnerCan::fParameterSetTempe(u8 aPath1, u8 aPath2, u8 aThreshold1, u8 aThreshold2, u8 aIndex)
{
	LoadPreset(cmDevParameterWrite);
	SetTarget(2,aPath1,aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = dgTYPE_TEMPE_DETECTOR_I;
	aTxMsg.Data.D8[4] = aThreshold1;
	aTxMsg.Data.D8[5] = aThreshold2;
	aTxMsg.Data.D8[6] = aIndex;
	aTxMsg.Dlc = 7;	
}
*/

//CMD ------------------>

unsigned int TInnerCan::CmdSyncBeat(void)
{
	LoadPreset(cmSyncBeat);
	SetTarget(123);
	return 0;
}

unsigned int TInnerCan::CmdReset()
{
	LoadPreset(cmReset);
	SetTarget(123);
	return 0;
}

unsigned int TInnerCan::CmdMuteBell()
{
	LoadPreset(cmMuteBell);
	SetTarget(123);
	return 0;
}

unsigned int TInnerCan::CmdSelfCheck()
{
	LoadPreset(cmSelfCheck);
	SetTarget(123);
	return 0;
}

unsigned int TInnerCan::CmdBroadcastTime()
{
	LoadPreset(cmBroadcastTime);
	SetTarget(123);
	aTxMsg.Data.D8[1] = 0;
	aTxMsg.Data.D8[2] = 0;
	aTxMsg.Data.D8[3] = 0;
	aTxMsg.Data.D8[4] = 0;
	aTxMsg.Data.D8[5] = 0;
	aTxMsg.Data.D8[6] = 0;
	aTxMsg.Dlc += 6;
	return 0;
}

unsigned int TInnerCan::CmdInspection()
{
	LoadPreset(cmInspection);
	SetTarget(123);
	return 0;
}


//Reg------------>
/*
unsigned int TInnerCan::CmdRegCheckDeviceExist(u8 aPath1)
{
	LoadPreset(cmRegCheckDeviceExist);
	SetTarget(1,aPath1);
	return 0;		
}
unsigned int TInnerCan::CmdRegCheckDeviceExist(u8 aPath1, u8 aPath2)
{
	LoadPreset(cmRegCheckDeviceExist);
	SetTarget(12,aPath1,aPath2);
	return 0;		
}
unsigned int TInnerCan::CmdRegCheckDeviceExist(u8 aPath1, u8 aPath2, u8 aPath3)
{
	LoadPreset(cmRegCheckDeviceExist);
	SetTarget(12, aPath1, aPath2, aPath3);
	return 0;		
}

unsigned int TInnerCan::CmdRegRescanDevList(u8 aPath1)
{
	LoadPreset(cmRegRescanDevList);
	SetTarget(1,aPath1);	
	return 0;
}

unsigned int TInnerCan::CmdRegQueryRescanDevListDone(u8 aPath1)
{
	LoadPreset(cmRegQueryRescanDevListDone);
	SetTarget(1,aPath1);
	return 0;		
}

unsigned int TInnerCan::CmdRegRequstDeviceList(u8 aPath1)
{
	LoadPreset(cmRegRequstDeviceList);
	SetTarget(1,aPath1);
	return 0;		
}
//Reg <---------------

//Adj Mode----------->
unsigned int TInnerCan::CmdAdjustModeEnter()
{
	LoadPreset(cmAdjustModeEnter);
	SetTarget(123);
	return 0;
}

unsigned int TInnerCan::CmdAdjustModeExit()
{
	LoadPreset(cmAdjustModeExit);
	SetTarget(123);	
	return 0;		
}

unsigned int TInnerCan::CmdAdjustModeCompare(u8 aActiveOrNot)
{
	LoadPreset(cmAdjustModeCompare);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aActiveOrNot;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdAdjustModeCompareCancel()
{
	LoadPreset(cmAdjustModeCompareCancel);
	SetTarget(123);
	return 0;	
}
//Adj Mode   <-------------

unsigned int TInnerCan::CmdManualAllow()
{
	LoadPreset(cmManualAllow);
	SetTarget(123);
	return 0;	
}

unsigned int TInnerCan::CmdManualNotAllow()
{
	LoadPreset(cmManualNotAllow);
	SetTarget(123);
	return 0;			
}

unsigned int TInnerCan::CmdManualCompareAllow(u8 aActiveOrNot)
{
	LoadPreset(cmManualCompareAllow);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aActiveOrNot;
	aTxMsg.Dlc += 1;
	return 0;		
}

unsigned int TInnerCan::CmdManualCompareAllowCancel()
{
	LoadPreset(cmManualCompareAllowCancel);
	SetTarget(123);	
	return 0;
}

//自动
unsigned int TInnerCan::CmdAutoAllow()
{
	LoadPreset(cmAutoAllow);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdAutoNotAllow()
{
	LoadPreset(cmAutoNotAllow);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdAutoCompareAllow(u8 aActiveOrNot)
{
	LoadPreset(cmAutoCompareAllow);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aActiveOrNot;
	aTxMsg.Dlc += 1;
	return 0;
}

unsigned int TInnerCan::CmdAutoCompareAllowCancel()
{
	LoadPreset(cmAutoCompareAllowCancel);
	SetTarget(123);
	return 0;
}

//喷洒设定 mode
unsigned int TInnerCan::CmdSplashAllow()
{
	LoadPreset(cmSplashAllow);
	SetTarget(123);
	return 0;	
}

unsigned int TInnerCan::CmdSplashNotAllow()
{
	LoadPreset(cmSplashNotAllow);
	SetTarget(123);
	return 0;	
}

unsigned int TInnerCan::CmdSplashCompare(u8 aActiveOrNot)
{
	LoadPreset(cmSplashCompare);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aActiveOrNot;
	aTxMsg.Dlc += 1;
	return 0;	
}

unsigned int TInnerCan::CmdSplashCompareCancel()
{
	LoadPreset(cmSplashCompareCancel);
	SetTarget(123);
	return 0;	
}

//屏蔽
unsigned int TInnerCan::CmdMaskAll()
{
	LoadPreset(cmMaskAll);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdMaskAllRecover()
{
	LoadPreset(cmMaskAllRecover);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdMaskTypeDevice(u8 aPath1, u8 aType)
{
	LoadPreset(cmMaskTypeDevice);
	SetTarget(1,aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Dlc += 1;
	return 0;	
}

unsigned int TInnerCan::CmdMaskTypeDevice(u8 aPath1,u8 aPath2, u8 aType)
{
	LoadPreset(cmMaskTypeDevice);
	SetTarget(12, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Dlc += 1;
	return 0;	
}

unsigned int TInnerCan::CmdMaskTypeDevice(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType)
{
	LoadPreset(cmMaskTypeDevice);
	SetTarget(123, aPath1, aPath2, aPath3);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdMaskTypeDeviceRecover(u8 aPath1, u8 aType)
{
	LoadPreset(cmMaskTypeDeviceRecover);
	SetTarget(1,aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdMaskTypeDeviceRecover(u8 aPath1,u8 aPath2, u8 aType)
{
	LoadPreset(cmMaskTypeDeviceRecover);
	SetTarget(12, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Dlc += 1;
	return 0;	
}

unsigned int TInnerCan::CmdMaskTypeDeviceRecover(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType)
{
	LoadPreset(cmMaskTypeDeviceRecover);
	SetTarget(123, aPath1, aPath2, aPath3);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Dlc += 1;
	return 0;
}

unsigned int TInnerCan::CmdMask(u8 aPath1)
{
	LoadPreset(cmMask);
	SetTarget(1, aPath1);
	return 0;	
}

unsigned int TInnerCan::CmdMask(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmMask);
	SetTarget(2, aPath1, aPath2);
	return 0;	
}

unsigned int TInnerCan::CmdMask(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmMask);
	SetTarget(3, aPath1, aPath2, aPath3);
	return 0;	
}

unsigned int TInnerCan::CmdMaskRecover(u8 aPath1)
{
	LoadPreset(cmMaskRecover);
	SetTarget(1, aPath1);
	return 0;		
}

unsigned int TInnerCan::CmdMaskRecover(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmMaskRecover);
	SetTarget(2, aPath1, aPath2);
	return 0;		
}

unsigned int TInnerCan::CmdMaskRecover(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmMaskRecover);
	SetTarget(3, aPath1, aPath2, aPath3);
	return 0;	
}

unsigned int TInnerCan::CmdMaskAllTemp()
{
	LoadPreset(cmMaskAllTemp);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdMaskAllTempRecover()
{
	LoadPreset(cmMaskAllTempRecover);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdMaskStateCompare(u8 aPath1, u8 aActiveOrNot)
{
	LoadPreset(cmMaskStateCompare);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[2] = aActiveOrNot;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdMaskStateCompare(u8 aPath1,u8 aPath2, u8 aActiveOrNot)
{
	LoadPreset(cmMaskStateCompare);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aActiveOrNot;
	aTxMsg.Dlc += 1;
	return 0;	
}

unsigned int TInnerCan::CmdMaskStateCompare(u8 aPath1,u8 aPath2,u8 aPath3, u8 aActiveOrNot)
{
	LoadPreset(cmMaskStateCompare);
	SetTarget(3, aPath1, aPath2, aPath3);
	aTxMsg.Data.D8[4] = aActiveOrNot;
	aTxMsg.Dlc += 1;
	return 0;	
}

unsigned int TInnerCan::CmdMaskStateCompareRecover(u8 aPath1)
{
	LoadPreset(cmMaskStateCompareRecover);
	SetTarget(123, aPath1);	
	return 0;
}

unsigned int TInnerCan::CmdMaskStateCompareRecover(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmMaskStateCompareRecover);
	SetTarget(23, aPath1, aPath2);
	return 0;		
}

unsigned int TInnerCan::CmdMaskStateCompareRecover(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmMaskStateCompareRecover);
	SetTarget(3, aPath1, aPath2, aPath3);
	return 0;	
}

//按类激活或取消火报状态
unsigned int TInnerCan::CmdFireAlramSetTypeActive(u8 aType)
{
	LoadPreset(cmFireAlramSetTypeActive);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetTypeActive(u8 aPath1, u8 aType)
{
	LoadPreset(cmFireAlramSetTypeActive);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetTypeActive(u8 aPath1,u8 aPath2, u8 aType)
{
	LoadPreset(cmFireAlramSetTypeActive);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Dlc += 1;	
	return 0;	
}

unsigned int TInnerCan::CmdFireAlramSetTypeActive(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType)
{
	LoadPreset(cmFireAlramSetTypeDeActive);
	SetTarget(3, aPath1, aPath2, aPath2);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetTypeDeActive(u8 aType)
{
	LoadPreset(cmFireAlramSetTypeDeActive);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetTypeDeActive(u8 aPath1, u8 aType)
{
	LoadPreset(cmFireAlramSetTypeDeActive);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetTypeDeActive(u8 aPath1,u8 aPath2, u8 aType)
{
	LoadPreset(cmFireAlramSetTypeDeActive);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Dlc += 1;	
	return 0;	
}

unsigned int TInnerCan::CmdFireAlramSetTypeDeActive(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType)
{
	LoadPreset(cmFireAlramSetTypeDeActive);
	SetTarget(3, aPath1, aPath2, aPath2);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramQueryByType(u8 aType, u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByType);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aType;
	aTxMsg.Data.D8[2] = aActiveOrNot;
	aTxMsg.Dlc += 2;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramQueryByType(u8 aPath1, u8 aType, u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByType);
	SetTarget(123,aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Data.D8[3] = aActiveOrNot;
	aTxMsg.Dlc += 2;
	return 0;	
}

unsigned int TInnerCan::CmdFireAlramQueryByType(u8 aPath1,u8 aPath2, u8 aType, u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByType);
	SetTarget(23,aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Data.D8[4] = aActiveOrNot;
	aTxMsg.Dlc += 2;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramQueryByType(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType, u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByType);
	SetTarget(3,aPath1, aPath2, aPath3);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Data.D8[5] = aActiveOrNot;
	aTxMsg.Dlc += 2;
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetActive()
{
	LoadPreset(cmFireAlramSetActive);
	SetTarget(123);
	return 0;
}
		
unsigned int TInnerCan::CmdFireAlramSetActive(u8 aPath1)
{
	LoadPreset(cmFireAlramSetActive);
	SetTarget(123,aPath1);
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetActive(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmFireAlramSetActive);
	SetTarget(23,aPath1, aPath2);	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetActive(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmFireAlramSetActive);
	SetTarget(3,aPath1, aPath2, aPath3);
	return 0;	
}

unsigned int TInnerCan::CmdFireAlramSetDeActive()
{
	LoadPreset(cmFireAlramSetDeActive);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetDeActive(u8 aPath1)
{
	LoadPreset(cmFireAlramSetDeActive);
	SetTarget(123,aPath1);	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetDeActive(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmFireAlramSetDeActive);
	SetTarget(23,aPath1, aPath2);	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramSetDeActive(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmFireAlramSetDeActive);
	SetTarget(3,aPath1, aPath2, aPath3);
	return 0;	
}

unsigned int TInnerCan::CmdFireAlramQueryByPath(u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByPath);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aActiveOrNot;
	aTxMsg.Dlc +=1;
	return 0;
}

unsigned int TInnerCan::CmdFireAlramQueryByPath(u8 aPath1, u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByPath);
	SetTarget(123,aPath1);
	aTxMsg.Data.D8[2] = aActiveOrNot;
	aTxMsg.Dlc +=1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramQueryByPath(u8 aPath1,u8 aPath2, u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByPath);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aActiveOrNot;
	aTxMsg.Dlc +=1;	
	return 0;
}

unsigned int TInnerCan::CmdFireAlramQueryByPath(u8 aPath1,u8 aPath2,u8 aPath3, u8 aActiveOrNot)
{
	LoadPreset(cmFireAlramQueryByPath);
	SetTarget(3, aPath1, aPath2, aPath3);
	aTxMsg.Data.D8[4] = aActiveOrNot;
	aTxMsg.Dlc +=1;	
	return 0;
}


//按地址激活或取消灭火行为
unsigned int TInnerCan::CmdExtinguishSetTypeEnter(u8 aType)
{
	LoadPreset(cmExtinguishSetTypeEnter);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishSetTypeEnter(u8 aPath1, u8 aType)
{
	LoadPreset(cmExtinguishSetTypeEnter);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishSetTypeEnter(u8 aPath1,u8 aPath2, u8 aType)
{
	LoadPreset(cmExtinguishSetTypeEnter);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Dlc += 1;	
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishSetTypeEnter(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType)
{
	LoadPreset(cmExtinguishSetTypeEnter);
	SetTarget(3, aPath1, aPath2, aPath2);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishSetTypeExit(u8 aType)
{
	LoadPreset(cmExtinguishSetTypeExit);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishSetTypeExit(u8 aPath1, u8 aType)
{
	LoadPreset(cmExtinguishSetTypeExit);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishSetTypeExit(u8 aPath1,u8 aPath2, u8 aType)
{
	LoadPreset(cmExtinguishSetTypeExit);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Dlc += 1;	
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishSetTypeExit(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType)
{
	LoadPreset(cmExtinguishSetTypeExit);
	SetTarget(3, aPath1, aPath2, aPath2);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishQueryStateByType(u8 aType)
{
	LoadPreset(cmExtinguishQueryStateByType);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishQueryStateByType(u8 aPath1, u8 aType)
{
	LoadPreset(cmExtinguishQueryStateByType);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[2] = aType;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishQueryStateByType(u8 aPath1,u8 aPath2, u8 aType)
{
	LoadPreset(cmExtinguishQueryStateByType);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aType;
	aTxMsg.Dlc += 1;	
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishQueryStateByType(u8 aPath1,u8 aPath2,u8 aPath3, u8 aType)
{
	LoadPreset(cmExtinguishQueryStateByType);
	SetTarget(3, aPath1, aPath2, aPath2);
	aTxMsg.Data.D8[4] = aType;
	aTxMsg.Dlc += 1;
	return 0;
}

unsigned int TInnerCan::CmdExtinguishEnter()
{
	LoadPreset(cmExtinguishEnter);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishEnter(u8 aPath1)
{
	LoadPreset(cmExtinguishEnter);
	SetTarget(123, aPath1);
	return 0;
}

unsigned int TInnerCan::CmdExtinguishEnter(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmExtinguishEnter);
	SetTarget(23, aPath1, aPath2);
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishEnter(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmExtinguishEnter);
	SetTarget(3, aPath1, aPath2, aPath2);
	return 0;
}

unsigned int TInnerCan::CmdExtinguishExit()
{
	LoadPreset(cmExtinguishExit);
	SetTarget(123);	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishExit(u8 aPath1)
{
	LoadPreset(cmExtinguishExit);
	SetTarget(123, aPath1);
	return 0;
}

unsigned int TInnerCan::CmdExtinguishExit(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmExtinguishExit);
	SetTarget(23, aPath1, aPath2);
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishExit(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmExtinguishExit);
	SetTarget(3, aPath1, aPath2, aPath3);
	return 0;
}

unsigned int TInnerCan::CmdExtinguishQueryStateByPath(u8 aActiveOrNot)
{
	LoadPreset(cmExtinguishQueryStateByPath);
	SetTarget(123);
	aTxMsg.Data.D8[1] = aActiveOrNot;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishQueryStateByPath(u8 aPath1, u8 aActiveOrNot)
{
	LoadPreset(cmExtinguishQueryStateByPath);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[2] = aActiveOrNot;
	aTxMsg.Dlc += 1;	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishQueryStateByPath(u8 aPath1,u8 aPath2, u8 aActiveOrNot)
{
	LoadPreset(cmExtinguishQueryStateByPath);
	SetTarget(23, aPath1, aPath2);
	aTxMsg.Data.D8[3] = aActiveOrNot;
	aTxMsg.Dlc += 1;	
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishQueryStateByPath(u8 aPath1,u8 aPath2,u8 aPath3, u8 aActiveOrNot)
{
	LoadPreset(cmExtinguishQueryStateByPath);
	SetTarget(3, aPath1, aPath2, aPath2);
	aTxMsg.Data.D8[4] = aActiveOrNot;
	aTxMsg.Dlc += 1;
	return 0;
}

unsigned int TInnerCan::CmdExtinguishGetState()
{
	
	return 0;
}

unsigned int TInnerCan::CmdExtinguishGetState(u8 aPath1)
{
	LoadPreset(cmExtinguishGetState);
	SetTarget(1, aPath1);
	return 0;		
}

unsigned int TInnerCan::CmdExtinguishGetState(u8 aPath1,u8 aPath2)
{
	LoadPreset(cmExtinguishGetState);
	SetTarget(2, aPath1, aPath2);
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishGetState(u8 aPath1,u8 aPath2,u8 aPath3)
{
	LoadPreset(cmExtinguishGetState);
	SetTarget(3, aPath1, aPath2, aPath3);
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishEnterViaUserCode(unsigned int aUc)
{
	LoadPreset(cmExtinguishEnterViaUserCode);
	SetTarget(123);
	aTxMsg.Data.D8[1] = static_cast<unsigned char>(aUc & 0x000000FF) ;
	aTxMsg.Data.D8[2] = static_cast<unsigned char>((aUc >> 8)& 0x000000FF) ;
	aTxMsg.Data.D8[3] = static_cast<unsigned char>((aUc >> 16)& 0x000000FF) ;
	aTxMsg.Dlc += 3;
	return 0;
}

unsigned int TInnerCan::CmdExtinguishExitViaUserCode(unsigned int aUc)
{
	LoadPreset(cmExtinguishExitViaUserCode);
	SetTarget(123);
	aTxMsg.Data.D8[1] = static_cast<unsigned char>(aUc & 0x000000FF) ;
	aTxMsg.Data.D8[2] = static_cast<unsigned char>((aUc >> 8)& 0x000000FF) ;
	aTxMsg.Data.D8[3] = static_cast<unsigned char>((aUc >> 16)& 0x000000FF) ;
	aTxMsg.Dlc += 3;
	return 0;	
}

unsigned int TInnerCan::CmdExtinguishGetStateViaUserCode(unsigned int aUc)
{
	LoadPreset(cmExtinguishGetStateViaUserCode);
	SetTarget(123);
	aTxMsg.Data.D8[1] = static_cast<unsigned char>(aUc & 0x000000FF) ;
	aTxMsg.Data.D8[2] = static_cast<unsigned char>((aUc >> 8)& 0x000000FF) ;
	aTxMsg.Data.D8[3] = static_cast<unsigned char>((aUc >> 16)& 0x000000FF) ;
	aTxMsg.Dlc += 3;	
	return 0;
}
*/

//_________________________________________________
//按行为设定状态	1个行为 带 1 个参数
unsigned int TInnerCan::CmdStateSet(TBehaviorCode aBehaviorCode, u8 aPrm)
{
		
	return 0;
}
unsigned int TInnerCan::CmdStateSet(u8 aPath1, TBehaviorCode aBehaviorCode, u8 aPrm)
{
		
	return 0;
}
unsigned int TInnerCan::CmdStateSet(u8 aPath1, u8 aPath2, TBehaviorCode aBehaviorCode, u8 aPrm)
{
		
	return 0;
}
unsigned int TInnerCan::CmdStateSet(u8 aPath1, u8 aPath2, u8 aPath3, TBehaviorCode aBehaviorCode, u8 aPrm)
{
		
	return 0;
}
//按行为设定状态	1个行为
/*
unsigned int TInnerCan::CmdStateSet(TBehaviorCode aBehaviorCode)
{
	LoadPreset(cmBehaviorSet1);
	SetTarget(123);
	aTxMsg.Data.D8[1] = static_cast<unsigned char>(aBehaviorCode);
	aTxMsg.Dlc = 2;	
	return 0;		
}
unsigned int TInnerCan::CmdStateSet(u8 aPath1, TBehaviorCode aBehaviorCode)
{
	LoadPreset(cmBehaviorSet1);
	SetTarget(123, aPath1);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = static_cast<unsigned char>(aBehaviorCode);
	aTxMsg.Dlc = 3;	
	return 0;		
}
unsigned int TInnerCan::CmdStateSet(u8 aPath1, u8 aPath2, TBehaviorCode aBehaviorCode)
{
	LoadPreset(cmBehaviorSet1);
	SetTarget(123, aPath1, aPath2);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = static_cast<unsigned char>(aBehaviorCode);
	aTxMsg.Dlc = 4;	
	return 0;		
}
unsigned int TInnerCan::CmdStateSet(u8 aPath1, u8 aPath2, u8 aPath3, TBehaviorCode aBehaviorCode)
{
	LoadPreset(cmBehaviorSet1);
	SetTarget(123, aPath1, aPath2, aPath3);
	aTxMsg.Data.D8[1] = aPath1;
	aTxMsg.Data.D8[2] = aPath2;
	aTxMsg.Data.D8[3] = aPath3;
	aTxMsg.Data.D8[4] = static_cast<unsigned char>(aBehaviorCode);
	aTxMsg.Dlc = 5;	
	return 0;	
}
*/
unsigned int CmdStateSet();
unsigned int CmdStateRead();
unsigned int CmdStateSetViaUserCode();
unsigned int CmdStateReadViaUserCode();
unsigned int CmdStateReport();
































