/**
  ******************************************************************************
  * @file    BLV_Logic_Edit.c
  * @author  BLW RCU  development Team
  * @version V1.0.0
  * @date    2021年11月06日
  * @brief   定义局部变量，将相应的设备和动作按照固定格式描述出来，添加到指定链表
	* @log    202205172012 增加配置解析功能
  ******************************************************************************
  */

#include "includes.h"

#include "BLV_Nor_Dev_LVoutputFun.h"
#include "BLV_Nor_Dev_ServiceFun.h"
#include "BLV_Nor_Dev_CurtainFun.h"

#include "BLV_Logic_Edit.h"

/*项目逻辑开始头文件*/
#include "BLV_Logic_FangFeiYuan_Edit.h"
#include "BLV_Logic_NanBuGaoErFu_Edit.h"
#include "BLV_Logic_JinJiangDuCheng_Edit.h"
#include "BLV_Logic_Lize_Edit.h"
#include "BLV_Logic_GaoXiongHanLai_Edit.h"
#include "BLV_Logic_LuZhou_Edit.h"
#include "BLV_Logic_MingYueSuitRoom_Edit.h"
#include "BLV_Logic_ChaoHu_Edit.h"
#include "BLV_Logic_YiWuRuiGe_Edit.h"
#include "BLV_Logic_ShiJiYuan_Edit.h"
#include "BLV_Logic_FuLaiHuaKai_Edit.h"
#include "BLV_Logic_HaoTian_Edit.h"
#include "BLV_Logic_C5ChuChang_Edit.h"
#include "BLV_Logic_LanYueDianJing_Edit.h"
#include "BLV_Logic_ShuYu_Edit.h"
#include "BLV_Logic_KuErLe_Edit.h"
#include "BLV_Logic_TianQuanHuiGuan_Edit.h"
#include "BLV_Logic_QingHai_Edit.h"
#include "BLV_Logic_WangYu_Edit.h"
#include "BLV_Logic_QDgaizao_Edit.h"
#include "BLV_Logic_LiangZhi_Edit.h"
#include "BLV_Logic_ZhuJiang_Edit.h"
#include "BLV_Logic_ChangShaWYN_Edit.h"
#include "BLV_Logic_YanCheng_Edit.h"
#include "BLV_Logic_MaYi_Edit.h"
#include "BLV_Logic_ChunLong_Edit.h"
#include "BLV_Logic_HaErBin_Edit.h"
#include "BLV_Logic_LiFeng_Edit.h"
#include "BLV_Logic_ShenZhenWYN_Edit.h"
#include "BLV_Logic_ZhuHaoZB_Edit.h"  
#include "BLV_Logic_GSZTC9_Edit.h"
#include "BLV_Logic_JiaoZuoHSBD_Edit.h"  
#include "BLV_Logic_ZhanXiangC12_Edit.h"
#include "BLV_Logic_YuYaoChaoMan_Edit.h" 
#include "BLV_Logic_WanZaiWYN_Edit.h"
#include "BLV_Logic_C5Modle_Edit.h"
#include "BLV_Logic_GuanTaoLF_Edit.h" 
#include "BLV_Logic_DaZhouYR_Edit.h"  
#include "BLV_Logic_C12PadZX_Edit.h"
#include "BLV_Logic_WYNHaoMian_Edit.h"
#include "BLV_Logic_TuoHaiMY_Edit.h"  
#include "BLV_Logic_JinJiangHengHe_Edit.h"  
#include "BLV_Logic_XinChao_Edit.h"
#include "BLV_Logic_JiAn_Edit.h"
#include "BLV_Logic_XiYuan_Edit.h"
#include "BLV_Logic_HongHao_Edit.h"
#include "BLV_Logic_YiYou_Edit.h"
#include "BLV_Logic_WaiMaoC12_Edit.h"
#include "BLV_Logic_QiangDianC9_Edit.h"
#include "BLV_Logic_ChiFeng_Edit.h" 
#include "BLV_Logic_OuChuangYuan_Edit.h"
#include "BLV_Logic_YuCiWYN_Edit.h"
#include "BLV_Logic_MiDu_Edit.h"
#include "BLV_Logic_TianJinZMAXC12_Edit.h"  
#include "BLV_Logic_YunYingQJ_Edit.h" 
#include "BLV_Logic_MMDB_Edit.h" 
#include "BLV_Logic_ZZZMAX_Edit.h"
#include "BLV_Logic_YinChuanMZDX_Edit.h"
#include "BLV_Logic_ManYue_Edit.h"
#include "BLV_Logic_SiJiJinZuo_Edit.h"
#include "BLV_Logic_BuErJin_Edit.h"
#include "BLV_Logic_Pakistan_Edit.h"
#include "BLV_Logic_JinHai_Edit.h"
#include "BLV_Logic_TongHuaHongYuan_Edit.h"
#include "BLV_Logic_SJJZ2_Edit.h"
#include "BLV_Logic_HaiRong_Edit.h"
#include "BLV_Logic_BeijingZMAXC12_Edit.h"  
#include "BLV_Logic_ChaoMan_Edit.h"
#include "BLV_Logic_LeChen_Edit.h"
#include "BLV_Logic_HZMYZMAXC12_Edit.h"   
#include "BLV_Logic_BeiJingHuiYi_Edit.h"
#include "BLV_Logic_YZZTC12_Edit.h"
#include "BLV_Logic_HuangShanMinSu_Edit.h"
#include "BLV_Logic_CaiFu1Hao_Edit.h"
#include "BLV_Logic_HaiLuo_Edit.h"
#include "BLV_Logic_WYNRL_Edit.h"
#include "BLV_Logic_CMXG_Edit.h"
#include "BLV_Logic_YongLi_Edit.h"
#include "BLV_Logic_YuJiuDian_Edit.h"
#include "BLV_Logic_WYNXiZangNaQu_Edit.h"
#include "BLV_Logic_WangYuDJ_Edit.h"
#include "BLV_Logic_YangLuo_Edit.h"
#include "BLV_Logic_HongYuan_Edit.h"
#include "BLV_Logic_YanYuan_Edit.h"
#include "BLV_Logic_YiLiSi_Edit.h"
#include "BLV_Logic_GuangXin_Edit.h"
#include "BLV_Logic_TaiWanVVO_Edit.h" 
#include "BLV_Logic_ChangAn_Edit.h"
#include "BLV_Logic_JingDu_Edit.h"
#include "BLV_Logic_XinJiangMinSu_Edit.h"
#include "BLV_Logic_HaoXiangYuan_Edit.h"
#include "BLV_Logic_AMan_Edit.h"
#include "BLV_Logic_ZMAXChengDuHZZX_Edit.h"
#include "BLV_Logic_NanChengHengLi_Edit.h"
#include "BLV_Logic_BoErMan_Edit.h"
#include "BLV_Logic_NCGX_Edit.h"
#include "BLV_Logic_JYJD_Edit.h"
#include "BLV_Logic_GuChengChaoMan_Edit.h"
#include "BLV_Logic_GongSiJieDai_Edit.h"
#include "BLV_Logic_ManYueLanTing_Edit.h"
#include "BLV_Logic_EErDuoSi_Edit.h"
#include "BLV_Logic_WanZaiWeiYeNa_Edit.h"
#include "BLV_Logic_ChaoManJiLin_Edit.h"
#include "BLV_Logic_TaiZhouST_Edit.h"
#include "BLV_Logic_YunJin_Edit.h"
#include "BLV_Logic_GaoQiaoMinSu_Edit.h"
#include "BLV_Logic_YiLangYangBanJian_Edit.h"
#include "BLV_Logic_DeZhouChaoMan_Edit.h"
#include "BLV_Logic_HeMeiQinTang_Edit.h"
#include "BLV_Logic_C5ZhanXiang_Edit.h"
#include "BLV_Logic_AnQiGaoSW_Edit.h"
/*项目逻辑结束头文件*/

/*本地函数声明开始*/
void SRAM_Dev_Data_Check(void);
/*本地函数声明结束*/
/*项目文件信息 - 512Byte*/ 
const S_Project_Information Pro_Bask_Info __attribute__((at(0xC000))) = {
	.pro_coding 	= ProCode,								//项目编码
	.pro_housetype 	= HouseType,								//本项目中对应的户型
	.pro_version 	= {SoftwareVer},					//本项目的软件版本号
	.pro_mcutype 	= {MCU_TYPE},						//项目使用的主控模块型号
	.pro_floortype 	= {Center_Control_TYPE},			//项目使用的中控主机型号
	.pro_remark		= {ProName},			//项目备注信息    
};


#if (0 == LOGIC_FILE_EN) 
Struct_Pro_Logic_Get ProLogicGetGather[] = //拥有所有项目的设备存在于逻辑  所有的设备类型，与相应的驱动。同类型的设备拥有相同的驱动接口 
{
#if JinJiangDuCheng
	11,         ProLogic_JinJiangDuCheng_Get
#endif	
#if	FangFeiYuan
	20,         ProLogic_FangFeiYuan_Get,
#endif
#if NanBuGaoErFu	
	30,         ProLogic_NanBuGaoErFu_Get,
#endif
#if Lize
  18,         ProLogic_Lize_Get,
#endif
#if GaoXiongHanLai
	35,       ProLogic_GaoXiongHanLai_Get,
#endif	
#if LuZhou	
	PROJECTNO,     ProLogic_LuZhou_Get,
#endif
#if YiWuRuiGe
	31,         ProLogic_YiWuRuiGe_Get,
#endif	
#if ChengDuZAMX
	37,         ProLogic_ChengDuZAMX_Get,
#endif
#if MingYue
  10,        ProLogic_MingYue_Get,
#endif
#if ChaoHu
  1,  ProLogic_ChaoHu_Get,
#endif
#if BaiYin 
  33, ProLogic_BaiYin_Get,
#endif
#if KeChuang
	19, ProLogic_KeChuang_Get,
#endif
#if C12ZhanTing
	41, ProLogic_C12ZhanTing_Get,
#endif
#if ShiJiYuan
	38, ProLogic_ShiJiYuan_Get,
#endif
#if FuLaiHuaKai
  24,ProLogic_FuLaiHuaKai_Get,
#endif
#if HaoTian
  32,ProLogic_HaoTian_Get,
#endif
#if ShangShangZuo
  27,ProLogic_ShangShangZuo_Get,
#endif
#if ChangPingChaoMan
  43,ProLogic_ChangPingChaoMan_Get,
#endif
#if ZGZMAX
  44,ProLogic_ZGZMAX_Get,
#endif
#if DianJing
  45,ProLogic_DianJing_Get,
#endif
#if GuiZhouBanShiChu
  39,ProLogic_GuiZhouBanShiChu_Get,
#endif
#if TianFengDengShi
  40,ProLogic_TianFengDengShi_Get,
#endif
#if C5ChuChang
  15,ProLogic_C5ChuChang_Get,
#endif
#if LanYue
  PROJECTNO,ProLogic_LanYue_Get,
#endif
#if  ShuYu
	PROJECTNO, ProLogic_ShuYu_Get,
#endif
#if  KuErLe
	PROJECTNO, ProLogic_KuErLe_Get,
#endif
#if  HuiZhouChaoMan
	47, ProLogic_HuiZhouChaoMan_Get,
#endif
#if  WuYue
	PROJECTNO, ProLogic_WuYue_Get,
#endif
#if  FeiJieDianJing
	PROJECTNO, ProLogic_FeiJieDianJing_Get,
#endif
#if  GuangZhouChaoMan
	PROJECTNO, ProLogic_GuangZhouChaoMan_Get,
#endif
#if  TianQuanHuiGuan
	PROJECTNO, ProLogic_TianQuanHuiGuan_Get,
#endif
#if  ChaoManNanHai
	PROJECTNO, ProLogic_ChaoManNanHai_Get,
#endif
#if  C12ZhanXiang
	PROJECTNO, ProLogic_C12ZhanXiang_Get,
#endif
#if  LiuYueLiu
	PROJECTNO, ProLogic_LiuYueLiu_Get,
#endif
#if  TianJinZMAX
	PROJECTNO, ProLogic_TianJinZMAX_Get,
#endif
#if  YunDuan
	PROJECTNO, ProLogic_YunDuan_Get,
#endif
#if  C5ZhanBan
	PROJECTNO, ProLogic_C5ZhanBan_Get,
#endif
#if  QingHai
	PROJECTNO, ProLogic_QingHai_Get,
#endif
#if  WYN
	PROJECTNO, ProLogic_WYN_Get,
#endif
#if WenDeMu
	PROJECTNO, ProLogic_WenDeMu_Get,
#endif
#if WangYu
	PROJECTNO, ProLogic_WangYu_Get,
#endif
#if QDgaizao
	PROJECTNO, ProLogic_QDgaizao_Get,
#endif
#if WuHuDianJing
		PROJECTNO, ProLogic_WuHuDianJing_Get,
#endif
#if LiangZhi
		PROJECTNO, ProLogic_LiangZhi_Get,
#endif
#if ChangShaWYN
		PROJECTNO, ProLogic_ChangShaWYN_Get,
#endif
#if ZhuJiang
		PROJECTNO, ProLogic_ZhuJiang_Get,
#endif
#if BeijingErHuan
		PROJECTNO, ProLogic_BeijingErHuan_Get,
#endif
#if BaiSeYueZi
		PROJECTNO, ProLogic_BaiSeYueZi_Get,
#endif
#if YanCheng
		PROJECTNO, ProLogic_YanCheng_Get,
#endif
#if MaYi
		PROJECTNO, ProLogic_MaYi_Get,
#endif
#if XinShengYue
		PROJECTNO, ProLogic_XinShengYue_Get,
#endif
#if KaiYuan
		PROJECTNO, ProLogic_KaiYuan_Get,
#endif
#if ChunLong
		PROJECTNO, ProLogic_ChunLong_Get,   
#endif
#if HaiLin
		PROJECTNO, ProLogic_HaiLin_Get,   
#endif
#if PuHua
		PROJECTNO, ProLogic_PuHua_Get,   
#endif
#if HaErBin
		PROJECTNO, ProLogic_HaErBin_Get,       
#endif
#if JiaYi
		PROJECTNO, ProLogic_JiaYi_Get,       
#endif
#if LongTing
		PROJECTNO, ProLogic_LongTing_Get,       
#endif
#if XuZhou
		PROJECTNO, ProLogic_XuZhou_Get,       
#endif
#if HeGe
    PROJECTNO, ProLogic_HeGe_Get,
#endif
#if LiFeng
    PROJECTNO, ProLogic_LiFeng_Get,   
#endif
#if SZWYN
    PROJECTNO, ProLogic_ShenZhenWYN_Get,   
#endif
#if ZHUHAOZB
    PROJECTNO, ProLogic_ZhuHaoZB_Get,     
#endif
#if GSZTC9
    PROJECTNO, ProLogic_GSZTC9_Get,   
#endif
#if JZHSBD
    PROJECTNO, ProLogic_JiaoZuoHSBD_Get,   
#endif
#if ZhanXiangC12
    PROJECTNO, ProLogic_ZhanXiangC12_Get,   
#endif
#if YYCM
    PROJECTNO, ProLogic_YuYaoChaoMan_Get,   
#endif
#if WZWYN
    PROJECTNO, ProLogic_WanZaiWYN_Get,   
#endif
#if C5Modle
    PROJECTNO, ProLogic_C5Modle_Get,   
#endif
#if GuanTaoLF
    PROJECTNO, ProLogic_GuanTaoLF_Get,   
#endif
#if DaZhouYR
    PROJECTNO, ProLogic_DaZhouYR_Get,   
#endif
#if C12PadZX
    PROJECTNO, ProLogic_C12PadZX_Get,   
#endif
#if WYNHaoMian
    PROJECTNO, ProLogic_WYNHaoMian_Get,   
#endif
#if TuoHaiMY
    PROJECTNO, ProLogic_TuoHaiMY_Get,   
#endif
#if AnQiGao
		PROJECTNO, ProLogic_AnQiGao_Get,
#endif
#if JinJiangHengHe
		PROJECTNO, ProLogic_JinJiangHengHe_Get,
#endif
#if ChangShaXY
		PROJECTNO, ProLogic_ChangShaXY_Get,
#endif
#if XinChao
		PROJECTNO, ProLogic_XinChao_Get,
#endif
#if JiAn
		PROJECTNO, ProLogic_JiAn_Get,
#endif
#if XiYuan
		PROJECTNO, ProLogic_XiYuan_Get,
#endif
#if HongHao
		PROJECTNO, ProLogic_HongHao_Get,
#endif
#if YiYou
		PROJECTNO, ProLogic_YiYou_Get,
#endif
#if WaiMao
		PROJECTNO, ProLogic_WaiMao_Get,
#endif
#if QiangDianC9
		PROJECTNO, ProLogic_QiangDianC9_Get,
#endif
#if ChiFeng
		PROJECTNO, ProLogic_ChiFeng_Get,
#endif
#if OuChuangYuan
		PROJECTNO, ProLogic_OuChuangYuan_Get,
#endif
#if YCWYN
		PROJECTNO, ProLogic_YuCiWYN_Get,
#endif
#if MiDu
		PROJECTNO, ProLogic_MiDu_Get,
#endif
#if TianJinZMAXC12
		PROJECTNO, ProLogic_TianJinZMAXC12_Get,
#endif
#if YYQJ
		PROJECTNO, ProLogic_YunYingQJ_Get,
#endif
#if MMDB
		PROJECTNO, ProLogic_MMDB_Get,
#endif
#if ZZZMAX
		PROJECTNO, ProLogic_ZZZMAX_Get,
#endif
#if YinChuanMZDX
		PROJECTNO, ProLogic_YinChuanMZDX_Get,
#endif
#if ManYue
		PROJECTNO, ProLogic_ManYue_Get,
#endif
#if SiJiJinZuo
		PROJECTNO, ProLogic_SiJiJinZuo_Get,
#endif
#if BuErJin
		PROJECTNO, ProLogic_BuErJin_Get,
#endif
#if Pakistan
		PROJECTNO, ProLogic_Pakistan_Get,
#endif
#if JinHai
		PROJECTNO, ProLogic_JinHai_Get,
#endif
#if THHY
		PROJECTNO, ProLogic_THHY_Get,
#endif
#if SJJZ2
		PROJECTNO, ProLogic_SJJZ2_Get,
#endif
#if HaiRong
		PROJECTNO, ProLogic_HaiRong_Get,
#endif
#if BeijingZMAXC12
		PROJECTNO, ProLogic_BeijingZMAXC12_Get,
#endif
#if ChaoMan
		PROJECTNO, ProLogic_ChaoMan_Get,
#endif
#if LeChen
		PROJECTNO, ProLogic_LeChen_Get,
#endif
#if HZMYZMAXC12
		PROJECTNO, ProLogic_HZMYZMAXC12_Get,
#endif
#if BeiHui
		PROJECTNO, ProLogic_BeiHui_Get,
#endif
#if YZZTC12
		PROJECTNO, ProLogic_YZZTC12_Get,
#endif
#if HSMS
		PROJECTNO, ProLogic_HSMS_Get,
#endif
#if CaiFu1Hao
		PROJECTNO, ProLogic_CaiFu1Hao_Get,
#endif
#if HAILUO
		PROJECTNO, ProLogic_HaiLuo_Get,
#endif
#if WYNRL
		PROJECTNO, ProLogic_WYNRL_Get,
#endif
#if CMXG
		PROJECTNO, ProLogic_CMXG_Get,
#endif
#if YongLi
		PROJECTNO, ProLogic_YongLi_Get,
#endif
#if YuJiuDian
		PROJECTNO, ProLogic_YuJiuDian_Get,
#endif
#if WYNXiZangNaQu
		PROJECTNO, ProLogic_WYNXiZangNaQu_Get,
#endif
#if WangYuDJ
		PROJECTNO, ProLogic_WangYuDJ_Get,
#endif
#if YangLuo
		PROJECTNO, ProLogic_YangLuo_Get,
#endif
#if HongYuan
		PROJECTNO, ProLogic_HongYuan_Get,
#endif
#if YanYuan
		PROJECTNO, ProLogic_YanYuan_Get,
#endif
#if YiLiSi
		PROJECTNO, ProLogic_YiLiSi_Get,
#endif
#if GuangXin
		PROJECTNO, ProLogic_GuangXin_Get,
#endif
#if TWVVO
		PROJECTNO, ProLogic_TaiWanVVO_Get,
#endif
#if ChangAn
		PROJECTNO, ProLogic_ChangAn_Get,
#endif
#if LiTing
		PROJECTNO, ProLogic_LiTing_Get,
#endif
#if JingDu
		PROJECTNO, ProLogic_JingDu_Get,
#endif
#if XinJiangMinSu
		PROJECTNO, ProLogic_XinJiangMinSu_Get, 
#endif
#if HaoXiangYuan
		PROJECTNO, ProLogic_HaoXiangYuan_Get,
#endif
#if AMan
		PROJECTNO, ProLogic_AMan_Get,
#endif
#if ZMAXChengDuHZZX
		PROJECTNO, ProLogic_ZMAXChengDuHZZX_Get,
#endif
#if NanChengHengLi
		PROJECTNO, ProLogic_NanChengHengLi_Get,
#endif
#if BoErMan
		PROJECTNO, ProLogic_BoErMan_Get,
#endif
#if NCGX
		PROJECTNO, ProLogic_NCGX_Get,
#endif
#if JYJD
		PROJECTNO, ProLogic_JYJD_Get,
#endif
#if GuChengChaoMan
		PROJECTNO, ProLogic_GuChengChaoMan_Get,
#endif
#if GongSiJieDai
		PROJECTNO, ProLogic_GongSiJieDai_Get,
#endif
#if ManYueLanTing
		PROJECTNO, ProLogic_ManYueLanTing_Get,
#endif
#if EErDuoSi
		PROJECTNO, ProLogic_EErDuoSi_Get,
#endif
#if WanZaiWeiYeNa
		PROJECTNO, ProLogic_WanZaiWeiYeNa_Get,
#endif
#if ChaoManJiLin
		PROJECTNO, ProLogic_ChaoManJiLin_Get,
#endif
#if TaiZhouST
		PROJECTNO, ProLogic_TaiZhouST_Get,
#endif
#if YunJin
		PROJECTNO, ProLogic_YunJin_Get,
#endif
#if GaoQiaoMinSu
		PROJECTNO, ProLogic_GaoQiaoMinSu_Get,
#endif
#if YiLangYangBanJian
		PROJECTNO, ProLogic_YiLangYangBanJian_Get,
#endif
#if DeZhouChaoMan
		PROJECTNO, ProLogic_DeZhouChaoMan_Get,
#endif
#if HeMeiQinTang
		PROJECTNO, ProLogic_HeMeiQinTang_Get,
#endif
#if C5ZhanXiang
		PROJECTNO, ProLogic_C5ZhanXiang_Get,
#endif
#if AnQiGaoSW 
		PROJECTNO, ProLogic_AnQiGaoSW_Get,
#endif
};

#define PRONUMMAX  sizeof(ProLogicGetGather)/sizeof(Struct_Pro_Logic_Get)

void Pro_Logic_Get(uint16_t ProNo)
{
	uint16_t i;
	
	for(i = 0; i < PRONUMMAX; i++)
	{
		if((ProLogicGetGather[i].ProjectNo == ProNo) && (NULL != ProLogicGetGather[i].ProLogicInit))
		{
			ProLogicGetGather[i].ProLogicInit();      
		}
	}
}
#endif

#define LOGIC_DEBUG_INFO_EN	0x00


/**
* @name 动作条件参数数据初始化
* @para 无
* @ret  无
* @attention
*/
void DevAction_CondData_Init(void)
{
//	uint32_t Season;
//	
//	SRAM_Read_Buff((uint8_t *)&Season,4,SRAM_Register_Start_ADDRESS + Register_SeasonStatus_OFFSET); Get_Authorize_Lock_Status();
	DevActionGlobal.DevActionU64Cond.RcuLockState = Get_Authorize_Lock_Status();//SRAM_Read_DW(SRAM_Register_Start_ADDRESS + Register_MandateLock_OFFSET);//拿到授权状态 与授权关联的，可配置成正常才能使用。状态由正常变到授权就触发拔卡标记
}
/**
* @name 动作下标得到
* @para 
*   Dev_processing_addr   设备节点地址
*   BUS_Public            公有数据
* @ret  无
* @attention
*/
void Action_Coord_Get(uint32_t Dev_processing_addr, Device_Public_Information_G *BUS_Public)
{
	uint16_t i;
	uint32_t DevActionAddr;
	
	for(i = 0; i < DevActionGlobal.DevActionNum; i++)    //
	{
		DevActionAddr = SRAM_DevAction_List_Start_Addr + i*SRAM_DevAction_List_Size;

		if(SRAM_Read_DW(DevActionAddr+sizeof(Dev_Action_Core)+sizeof(Dev_Action_Input)+sizeof(Dev_Action_Cond)+sizeof(Dev_Action_State)-4) == Dev_processing_addr) //拥有相同的输入触发节点    DevActionInfo.DevActionState.DevAddrIn
		{
			BUS_Public->ActionCoord = i;  //当前第一个触发节点与设备输入节点一致的动作
			break;
		}
	}
}

/**
* @name 设备下标得到
* @para 无
* @ret  无
* @attention
*/
void Dev_Coord_Get(void)
{
	uint16_t i;    //遍历设备 
	uint32_t Dev_processing_addr;
	Device_Public_Information_G BUS_Public;   //公有全局数据
	
	for(i = 0; i < DevActionGlobal.DevNum; i++)
	{
		Dev_processing_addr = SRAM_Device_List_Start_Addr + i*SRAM_Device_List_Size;
		SRAM_DMA_Read_Buff((uint8_t *)&BUS_Public, sizeof(Device_Public_Information_G), Dev_processing_addr);	//拷贝所有公有数据	
		BUS_Public.DevCoord = i;    //拿到设备下标
		Action_Coord_Get(Dev_processing_addr, &BUS_Public);   //拿到动作下标
		
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"当前设备准备重新保存,地址:%08X，设备类型:%d，设备地址:%d，设备下标:%d，动作下标:%d", Dev_processing_addr, BUS_Public.type, BUS_Public.addr, BUS_Public.DevCoord, BUS_Public.ActionCoord);
		switch(BUS_Public.type)
		{
			case Dev_Host_HVout:  //类型为继电器
				if((ENUM_RS485_DEV_PRO_01 == BUS_Public.Protocol)&&(0x00 == BUS_Public.addr))  //1号协议 地址为0
				{
					NOR_HVOUT_INFO DevHVoutInfo;       //继电器局部变量
					SRAM_DMA_Read_Buff((uint8_t *)&DevHVoutInfo,sizeof(NOR_HVOUT_INFO),Dev_processing_addr+Dev_Privately);
				
					DevHVoutInfo.DevC5IOAddr = Find_AllDevice_List_Information(DEV_C5IO_Type, 0x00); //拿到C5IO存储地址
					Dbg_Println(DBG_BIT_DEVICE_STATUS_bit,"DevHVoutInfo.DevC5IOAddr:%08X", DevHVoutInfo.DevC5IOAddr);			
					SRAM_DMA_Write_Buff((uint8_t *)&DevHVoutInfo,sizeof(NOR_HVOUT_INFO),Dev_processing_addr+Dev_Privately);   //继电器私有数据重新写入
				}
				break;
		}		
		/*重新保存当前设备*/
		BUS_Public.check = 0x00;
		SRAM_Write_Byte(BUS_Public.check, Dev_processing_addr+Dev_Check);   //清校验
		SRAM_Write_Word(BUS_Public.DevCoord, Dev_processing_addr+Dev_Coord);  //重新写入设备下标
		SRAM_Write_Word(BUS_Public.ActionCoord, Dev_processing_addr+Dev_ActionCoord);  //重新写入动作下标
		
		BUS_Public.check = Dev_CheckSum(Dev_processing_addr,BUS_Public.data_len); //重新计算整包校验  DoubleData_CheckSum((uint8_t *)&BUS_Public, sizeof(Device_Public_Information_G), (uint8_t *)&Rs485SwiInfo, sizeof(RS485_SWI_INFO));
		SRAM_Write_Byte(BUS_Public.check, Dev_processing_addr+Dev_Check);   //重新写入校验
		

		
	}
}
/**
* @name 宝来威所有设备数据初始化 设备初始化 动作初始化
* @para 无
* @ret  无
* @attention
*/
void BLV_DevAction_AllData_Init(void)
{
	memset((void *)&BUS485_Info,0,sizeof(BLV_BUS_Manage_G));
	memset(&Poll485_Info,0,sizeof(BLV_POLL_Manage_G));
	memset((void *)&Act485_Info,0,sizeof(BLV_ACTIVE_Manage_G));
	memset((void *)&NorDevInfoGlobal,0,sizeof(BLV_NORDEV_Manage_G));
	memset((void *)&DevActionGlobal,0,sizeof(BLV_DevAction_Manage_G));     //全局参数全部清0   
	
	DevActionGlobal.DimGlobalValue = 100;                           	   //默认亮度100
	DevActionGlobal.Last_DimGlobalValue = DevActionGlobal.DimGlobalValue;	
	
	SRAM_PowerOn_Restore_ParaInfo();
	
	DevAction_CondData_Init(); //动作条件参数数据初始化
	
#if LOGIC_FILE_EN	
	LOGIC_FILE_Check();   // 
#else
	Pro_Logic_Get(PROJECTNO);   //项目设备与动作初始化
#endif	
	
	DevAction_ReuseFlag_Get();   //复用标志置位   触发节点和扩展设备重新得到  带延时的扩展设备 需要新增到设备链表
	
//	DevDly_Add(&DevAction_Info);    /*遍历所有的扩展设备，带延时的，需要新增到设备链表，为带延时的扩展设备进行延时节点赋值*/

//	Expand_Scene_Get();    //为扩展设备的场景进行赋值 

	Expand_DevDly_Get(); /*为不带延时的的扩展设备进行延时节点赋值*/
	
	Dev_Coord_Get();      //拿到设备下标和动作下标
	
	DevActionGlobal.DevLockAddr = Find_AllDevice_List_Information(DEV_RS485_WxLock, DevActionGlobal.Lock485Addr);  //
	DevActionGlobal.pc_addr = Find_Device_List_Information(DEV_PCTEST_TYPE,DEV_PCTEST_Addr);

}



/********************************************************************************************************************************************************************/

/*******************************************************************************
* Function Name  : Logic_File_Read 
* Description    : 逻辑文件读取到SRAM中
* Input          : 
* Return         :
*******************************************************************************/
void Logic_File_Read(void)
{
	
}

uint8_t Flash_read_Byte(uint32_t addr)
{
	uint8_t data[2] = {0};
	Flash_Read(data,1,addr);
	return data[0];
}





uint32_t Data_Uint8_Convert_To_Uint32(uint8_t *data)
{
	uint32_t rev_data = 0;
	
	rev_data = data[3];
	rev_data<<=8;
	rev_data |= data[2];
	rev_data<<=8;
	rev_data |= data[1];
	rev_data<<=8;
	rev_data |= data[0];
	
	return rev_data;
}

uint16_t Data_Uint8_Convert_To_Uint16(uint8_t *data)
{
	uint16_t rev_data = 0;
	
	rev_data = data[1];
	rev_data<<=8;
	rev_data |= data[0];
	
	return rev_data;
}

char device_temp_string[32] = {0};

char *Logic_Info_DeviceType_To_String(uint8_t type)
{
	memset(device_temp_string,0,sizeof(device_temp_string));
	#if LOGIC_DEBUG_INFO_EN
	switch(type)
	{
		case Dev_Host_Invalid:	
			strncpy(device_temp_string,(const char *)"场景",sizeof("场景"));
			break;
		case Dev_Host_HVout:
			strncpy(device_temp_string,(const char *)"强电继电器",sizeof("强电继电器"));
			break;
		case Dev_Host_LVinput:
			strncpy(device_temp_string,(const char *)"弱电输入",sizeof("弱电输入"));
			break;
		case Dev_Host_LVoutput:
			strncpy(device_temp_string,(const char *)"弱电输出",sizeof("弱电输出"));
			break;
		case Dev_Host_Service:
			strncpy(device_temp_string,(const char *)"服务信息",sizeof("服务信息"));
			break;
		case Dev_NodeCurtain:
			strncpy(device_temp_string,(const char *)"干节点窗帘",sizeof("干节点窗帘"));
			break;
		case DEV_RS485_SWT:
			strncpy(device_temp_string,(const char *)"开关",sizeof("开关"));
			break;
		case DEV_RS485_TEMP:
			strncpy(device_temp_string,(const char *)"空调",sizeof("空调"));
			break;
		case DEV_RS485_INFRARED:
			strncpy(device_temp_string,(const char *)"红外",sizeof("红外"));
			break;
		case DEV_RS485_AirDetect:
			strncpy(device_temp_string,(const char *)"空气检测",sizeof("空气检测"));
			break;
		case DEV_RS485_CARD:
			strncpy(device_temp_string,(const char *)"插卡取电",sizeof("插卡取电"));
			break;
		case DEV_RS485_HEATER:
			strncpy(device_temp_string,(const char *)"地暖",sizeof("地暖"));
			break;
		case Dev_RCU_NET:
			strncpy(device_temp_string,(const char *)"RCU设备网络",sizeof("RCU设备网络"));
			break;
		case DEV_RS485_CURTAIN:
			strncpy(device_temp_string,(const char *)"窗帘",sizeof("窗帘"));
			break;
		case DEV_RS485_RELAY:
			strncpy(device_temp_string,(const char *)"继电器",sizeof("继电器"));
			break;
		case DEV_RS485_IR_SEND:
			strncpy(device_temp_string,(const char *)"红外发送",sizeof("红外发送"));
			break;
		case DEV_RS485_DIMMING:
			strncpy(device_temp_string,(const char *)"直流调光",sizeof("直流调光"));
			break;
		case DEV_RS485_TRAIC:
			strncpy(device_temp_string,(const char *)"可控硅调光",sizeof("可控硅调光"));
			break;
		case DEV_RS485_STRIP:
			strncpy(device_temp_string,(const char *)"灯带",sizeof("灯带"));
			break;
		case DEV_RS485_CoreCtrl:
			strncpy(device_temp_string,(const char *)"中控",sizeof("中控"));
			break;
		case DEV_RS485_WxLock:
			strncpy(device_temp_string,(const char *)"微信锁",sizeof("微信锁"));
			break;
		case DEV_RS485_MUSIC:
			strncpy(device_temp_string,(const char *)"背景音乐",sizeof("背景音乐"));
			break;
		case DEV_NET_ROOMSTATE:
			strncpy(device_temp_string,(const char *)"房态下发",sizeof("房态下发"));
			break;
		case Dev_Host_PWMLight:
			strncpy(device_temp_string,(const char *)"主机本地调光",sizeof("主机本地调光"));
			break;
		case DEV_RS485_PWM:
			strncpy(device_temp_string,(const char *)"485PWM调光",sizeof("485PWM调光"));
			break;
		case DEV_PB_LED:
			strncpy(device_temp_string,(const char *)"总线调光",sizeof("总线调光"));
			break;
		case DEV_RCU_POWER:
			strncpy(device_temp_string,(const char *)"RCU电源",sizeof("RCU电源"));
			break;
		case DEV_RS485_A9_IO_SWT:
			strncpy(device_temp_string,(const char *)"A9IO开关",sizeof("A9IO开关"));
			break;
		case DEV_RS485_A9_IO_EXP:
			strncpy(device_temp_string,(const char *)"A9IO扩展",sizeof("A9IO扩展"));
			break;
		case DEV_RS485_A9_IO_POWER:
			strncpy(device_temp_string,(const char *)"A9IO电源",sizeof("A9IO电源"));
			break;
		case DEV_RS485_RFGatewayCycle:
			strncpy(device_temp_string,(const char *)"无线网关轮询",sizeof("无线网关轮询"));
			break;
		case DEV_RS485_RFGatewayHost:
			strncpy(device_temp_string,(const char *)"无线网关主动",sizeof("无线网关主动"));
			break;
		case DEV_RS485_RFGatewayDoor:
			strncpy(device_temp_string,(const char *)"无线门磁",sizeof("无线门磁"));
			break;
		case DEV_RS485_AirReveal:
			strncpy(device_temp_string,(const char *)"空气参数显示",sizeof("空气参数显示"));
			break;
		case DEV_RS485_RFGatewayRelayPir:
			strncpy(device_temp_string,(const char *)"无线继电器红外",sizeof("无线继电器红外"));
			break;
		case Dev_Host_TimeCtrl:
			strncpy(device_temp_string,(const char *)"时间同步",sizeof("时间同步"));
			break;
		case Dev_Rs458_MonitorCtrl:
			strncpy(device_temp_string,(const char *)"监控控制",sizeof("监控控制"));
			break;
		case Dev_Rs458_RotaryCtrl:
			strncpy(device_temp_string,(const char *)"旋钮开关控制",sizeof("旋钮开关控制"));
			break;
		case Dev_BUS_C5IO:
			strncpy(device_temp_string,(const char *)"BLV_CSIO",sizeof("BLV_CSIO"));
			break;
		
	}
	#endif
	return device_temp_string;
}

char *Logic_Info_DevicePort_To_String(uint8_t type)
{
	memset(device_temp_string,0,sizeof(device_temp_string));
	#if LOGIC_DEBUG_INFO_EN
	switch(type)
	{
		case Polling_Port:
			strncpy(device_temp_string,(const char *)"Polling_Port",sizeof("Polling_Port"));
			break;
		case Active_Port:
			strncpy(device_temp_string,(const char *)"Active_Port",sizeof("Active_Port"));
			break;
		case Bus_port:
			strncpy(device_temp_string,(const char *)"Bus_port",sizeof("Bus_port"));
			break;
	}
	#endif
	return device_temp_string;
}



void Logic_Info_DeviceAction_Condition_To_String(uint8_t *data)
{
	LOGIC_ACTIVE_CONDITION_G temp_condition;
	memset(&temp_condition,0,sizeof(LOGIC_ACTIVE_CONDITION_G));
	
	memcpy((char *)&temp_condition,(const char *)data,sizeof(LOGIC_ACTIVE_CONDITION_G));
	#if LOGIC_DEBUG_INFO_EN
	switch(temp_condition.DevActionOutFlag)	//动作输出使能 
	{
		case 0x00:	//正常
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作输出使能 - 正常");
			break;
		case 0x01:	//锁定
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作输出使能 - 锁定");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作输出使能 - Error:%d",temp_condition.DevActionOutFlag);
			break;
	}
	
	switch(temp_condition.RoomState)	//房态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"房态 - 不判断");
			break;
		case 0x01:	//出租
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"房态 - 出租");
			break;
		case 0x02:	//退房
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"房态 - 退房");
			break;
		case 0x03:	//待租
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"房态 - 待租");
			break;
		case 0x04:	//空房
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"房态 - 空房");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"房态 - Error:%d",temp_condition.RoomState);
			break;
	}
	
	switch(temp_condition.EleCtrlFlag)	//取电服务控制 
	{
		case 0x00:	//不执行
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"取电服务控制 - 不执行");
			break;
		case 0x01:	//执行
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"取电服务控制 - 执行");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"取电服务控制 - Error:%d",temp_condition.EleCtrlFlag);
			break;
	}
	
	switch(temp_condition.EleState)	//取电状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"取电状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"取电状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"取电状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"取电状态 - Error:%d",temp_condition.EleState);
			break;
	}
	
	switch(temp_condition.DndState)	//勿扰状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"勿扰状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"勿扰状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"勿扰状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"勿扰状态 - Error:%d",temp_condition.DndState);
			break;
	}
	
	switch(temp_condition.CleanState)	//清理状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"清理状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"清理状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"清理状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"清理状态 - Error:%d",temp_condition.CleanState);
			break;
	}
	
	switch(temp_condition.CallState)	//呼叫状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"呼叫状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"呼叫状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"呼叫状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"呼叫状态 - Error:%d",temp_condition.CallState);
			break;
	}
	
	switch(temp_condition.WashState)	//洗衣状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"洗衣状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"洗衣状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"洗衣状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"洗衣状态 - Error:%d",temp_condition.WashState);
			break;
	}
	
	switch(temp_condition.CheckOutState)	//退房状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"退房状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"退房状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"退房状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"退房状态 - Error:%d",temp_condition.CheckOutState);
			break;
	}
	
	switch(temp_condition.WaitState)	//稍后状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"稍后状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"稍后状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"稍后状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"稍后状态 - Error:%d",temp_condition.WaitState);
			break;
	}
	
	switch(temp_condition.SosState)	//SOS状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"SOS状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"SOS状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"SOS状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"SOS状态 - Error:%d",temp_condition.SosState);
			break;
	}
	
	switch(temp_condition.RentState)	//预约待租状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"预约待租状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"预约待租状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"预约待租状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"预约待租状态 - Error:%d",temp_condition.RentState);
			break;
	}
	
	switch(temp_condition.LockState)	//开锁状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"开锁状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"开锁状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"开锁状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"开锁状态 - Error:%d",temp_condition.LockState);
			break;
	}
	
	switch(temp_condition.LuggageState)	//行李状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"行李状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"行李状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"行李状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"行李状态 - Error:%d",temp_condition.LuggageState);
			break;
	}
	
	switch(temp_condition.StrongState)	//保险箱状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"保险箱状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"保险箱状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"保险箱状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"保险箱状态 - Error:%d",temp_condition.StrongState);
			break;
	}
	
	switch(temp_condition.DoorState)	//门磁状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"门磁状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"门磁状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"门磁状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"门磁状态 - Error:%d",temp_condition.DoorState);
			break;
	}
	
	switch(temp_condition.WarningState)	//提示音状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"提示音状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"提示音状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"提示音状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"提示音状态 - Error:%d",temp_condition.WarningState);
			break;
	}
	
	switch(temp_condition.BacklightState)	//背光状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"背光状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"背光状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"背光状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"背光状态 - Error:%d",temp_condition.BacklightState);
			break;
	}
	
	switch(temp_condition.SeasonState)	//季节 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"季节 - 不判断");
			break;
		case 0x01:	//春
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"季节 - 春");
			break;
		case 0x02:	//夏
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"季节 - 夏");
			break;
		case 0x03:	//秋
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"季节 - 秋");
			break;
		case 0x04:	//冬
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"季节 - 冬");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"季节 - Error:%d",temp_condition.SeasonState);
			break;
	}
	
	switch(temp_condition.TimeState)	//时间 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"时间 - 不判断");
			break;
		case 0x01:	//全天
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"时间 - 全天");
			break;
		case 0x02:	//白天
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"时间 - 白天");
			break;
		case 0x03:	//黑夜
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"时间 - 黑夜");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"时间 - Error:%d",temp_condition.TimeState);
			break;
	}
	
	switch(temp_condition.NeightState)	//起夜状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"起夜状态 - 不判断");
			break;
		case 0x01:	//开
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"起夜状态 - 开");
			break;
		case 0x02:	//关
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"起夜状态 - 关");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"起夜状态 - Error:%d",temp_condition.NeightState);
			break;
	}
	
	switch(temp_condition.RcuLockState)	//锁定状态 
	{
		case 0x00:	//不判断
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"锁定状态 - 不判断");
			break;
		case 0x01:	//锁定
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"锁定状态 - 锁定");
			break;
		case 0x02:	//正常
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"锁定状态 - 正常");
			break;
		default:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"锁定状态 - Error:%d",temp_condition.RcuLockState);
			break;
	}
	#endif
}

/*******************************************************************************
* Function Name  : Logic_FrameType_LogicInfo_TempProcessing 
* Description    : 逻辑文件中 - 逻辑信息 临时处理
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_LogicInfo_TempProcessing(uint8_t *data,uint16_t len)  
{
	uint16_t temp_len = 0;
	uint32_t temp_data = 0;
	char temp_str[36];
	memset(temp_str,0,sizeof(temp_str));
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	
//	#if LOGIC_DEBUG_INFO_EN
	
	strncpy(temp_str,(const char *)&data[temp_len],32);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑发布作者:%s",temp_str);
	temp_len += 32;
	
	memcpy(temp_str,&data[temp_len],4);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"配置软件版本:%d-%d-%d-%d",temp_str[0],temp_str[1],temp_str[2],temp_str[3]);
	temp_len += 4;
	
	strncpy(temp_str,(const char *)&data[temp_len],7);
	temp_data = temp_str[0]*256+temp_str[1];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑发布时间: %04d-%02d-%02d %02d:%02d:%02d \r\n",temp_data,temp_str[2],temp_str[3],temp_str[4],temp_str[5],temp_str[6]);
	temp_len += 7;
	
	strncpy(temp_str,(const char *)&data[temp_len],32);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"项目名称:%s",temp_str);
	temp_len += 32;
	
	temp_data = Data_Uint8_Convert_To_Uint32(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"项目编号:%d",temp_data);
	temp_len += 4;
	
	strncpy(temp_str,(const char *)&data[temp_len],32);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"项目分组:%s",temp_str);
	temp_len += 32;
	
	strncpy(temp_str,(const char *)&data[temp_len],32);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"房型别名:%s",temp_str);
	temp_len += 32;
	
	strncpy(temp_str,(const char *)&data[temp_len],3);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑数据版本:%d-%d-%d",temp_str[0],temp_str[1],temp_str[2]);
	temp_len += 3;
	
	//机型名称 - 64Byte
//	strncpy(temp_str,(const char *)&data[temp_len],3);
//	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑数据版本:%d-%d-%d",temp_str[0],temp_str[1],temp_str[2]);
	temp_len += 64;
	
	//时间偏移量 - 2Byte
	g_time_info.timezone = data[temp_len+1];
	g_time_info.timezone <<= 8;
	g_time_info.timezone |= data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"时区偏移量:%d",g_time_info.timezone);
	
//	#endif
}

/*******************************************************************************
* Function Name  : Read_LogicFile_Information 
* Description    : 读取逻辑文件信息 - 
	这个在Flash存储第一条数据便是这数据信息 - 有就有，没有那就没有
	特别注意传递进来的buff数组够大，否则会导致数组越界
* Input          : 
	select	:
		0x00:查询全部信息
		0x01:查询发布作者 - 32Byte
		0x02:查询软件版本 - 4Byte
		0x03:查询发布时间 - 7Byte
		0x04:查询酒店名称 - 32Byte
		0x05:查询酒店代号 - 4Byte
		0x06:查询项目分组 - 32Byte
		0x07:查询房型别名 - 32Byte
		0x08:查询版本号 - 3Byte
	buff	：存放数据地址
* Return         :
	0x00：查询成功
	0x01：查询失败
*******************************************************************************/
#define LogicFile_InfoDetails_Len						0x92
#define LogicFile_InfoDetails_Author_Offset				0x0000			//发布作者 - 32Byte
#define LogicFile_Infodetails_SWVersion_Offset			0x0020			//软件版本 - 4Byte
#define LogicFile_Infodetails_ReleaseDate_Offset		0x0026			//发布时间 - 7Byte
#define LogicFile_Infodetails_HotelName_Offset			0x002B			//酒店名称 - 32Byte
#define LogicFile_Infodetails_HotelCode_Offset			0x004B			//酒店代号 - 4Byte
#define LogicFile_Infodetails_HotelGroupName_Offset		0x004F			//项目分组 - 32Byte
#define LogicFile_Infodetails_HomeName_Offset			0x006F			//房型别名 - 32Byte
#define LogicFile_Infodetails_Version_Offset			0x008F			//版本号 - 3Byte

uint8_t Read_LogicFile_Information(uint8_t select,uint8_t *buff)
{
	uint32_t temp = 0,file_len = 0;
	uint8_t md5[16];
	uint8_t file_info[30];
	uint8_t rev= 0x01;
	memset(file_info,0,sizeof(file_info));
	memset(md5,0,sizeof(md5));
	
	/*1、先读取逻辑文件标志位*/
	Flash_Read(file_info,24,FLASH_LOGIC_DataFlag_ADDRESS);
	
	temp = file_info[3];
	temp <<= 8;
	temp |= file_info[2];
	temp <<= 8;
	temp |= file_info[1];
	temp <<= 8;
	temp |= file_info[0];
	
	if(temp != LOGIC_DataFlag)
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑文件标志位不符，不作处理:%08X",temp);
		return 0x01;
	}
	
	file_len = file_info[7];
	file_len <<= 8;
	file_len |= file_info[6];
	file_len <<= 8;
	file_len |= file_info[5];
	file_len <<= 8;
	file_len |= file_info[4];
	
	if((file_len != 0x00) &&(file_len > 0x70000))
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑文件长度不对:%08X",file_len);
		return 0x01;
	}
	
	MD5Digest_FLASH(FLASH_LOGIC_DataStart_ADDRESS, file_len,(char *)&md5[0]); 
	
	if(0==strncmp((const char *)md5,(const char *)&file_info[8],16))
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"MD5校验成功!");
	}else {
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"MD5校验错误，不作处理 Len:%08X",file_len);
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"升级配置失败，Md5错误:%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X%02X,%02X,%02X,%02X,%02X,%02X",md5[0],md5[1],md5[2],md5[3],md5[4],md5[5],md5[6],md5[7],md5[8],md5[9],md5[10],md5[11],md5[12],md5[13],md5[14],md5[15]);
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"File Md5:%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X",\
			file_info[8],file_info[9],\
			file_info[10],file_info[11],\
			file_info[12],file_info[13],\
			file_info[14],file_info[15],\
			file_info[16],file_info[17],\
			file_info[18],file_info[19],\
			file_info[21],file_info[21],\
			file_info[22],file_info[23]);
		
		/*擦除Flash中的配置文件标志位和MD5值*/
		memset(file_info,0,sizeof(file_info));
		Flash_Write(file_info,24,FLASH_LOGIC_DataFlag_ADDRESS);
		
		return 0x01;
	}
	
	if((Flash_read_Byte(FLASH_LOGIC_DataStart_ADDRESS+Logic_D_Hear_L) == 0xCC) && (Flash_read_Byte(FLASH_LOGIC_DataStart_ADDRESS+Logic_D_Hear_H) == 0xC0))
	{
		uint8_t temp_data[4];
		uint16_t temp_len = 0;
		Flash_Read(temp_data,4,FLASH_LOGIC_DataStart_ADDRESS+Logic_D_Len_L);
		temp_len = temp_data[1];
		temp_len <<= 8;
		temp_len |= temp_data[0];
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"找到文件，读取数据长度:%d",temp_len);
		if((temp_len <= file_len) && (temp_len <= 1024))	//目前包长最大1024
		{
			uint16_t temp_crc = 0,data_crc = 0;
			uint16_t data_frame = 0,data_sn = 0;
			uint8_t temp_buff[temp_len];
			memset(temp_buff,0,sizeof(temp_buff));
			
			Flash_Read(temp_buff,temp_len,FLASH_LOGIC_DataStart_ADDRESS);
			temp_crc = NetCRC16_Data(temp_buff ,temp_len,Logic_D_CRC_L);
			
			data_crc = temp_buff[Logic_D_CRC_H];
			data_crc <<= 8;
			data_crc |= temp_buff[Logic_D_CRC_L];
			
			if(data_crc == temp_crc)
			{
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
				
				data_frame = temp_buff[Logic_D_FrameNum_H];
				data_frame <<= 8;
				data_frame |= temp_buff[Logic_D_FrameNum_L];
				
				data_sn = temp_buff[Logic_D_Frame_H];
				data_sn <<= 8;
				data_sn |= temp_buff[Logic_D_Frame_L];
				
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
				Dbg_Print_Buff(DBG_BIT_LOGIC_STATUS_bit,"逻辑帧数据" ,temp_buff,temp_len);
				
				if(temp_buff[Logic_D_FrameType] == Logic_FrameType_LogicInfo)
				{
					switch(select)
					{
						case 0x00:	//查询全部信息
							memcpy(buff,&temp_buff[Logic_D_Para],LogicFile_InfoDetails_Len);
							rev = 0x00;
							break;
						case 0x01:	//查询发布作者 - 32Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_InfoDetails_Author_Offset],32);
							rev = 0x00;
							break;
						case 0x02:	//查询软件版本 - 4Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_Infodetails_SWVersion_Offset],4);
							rev = 0x00;
							break;
						case 0x03:	//查询发布时间 - 7Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_Infodetails_ReleaseDate_Offset],7);
							rev = 0x00;
							break;
						case 0x04:	//查询酒店名称 - 32Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_Infodetails_HotelName_Offset],32);
							rev = 0x00;
							break;
						case 0x05:	//查询酒店代号 - 4Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_Infodetails_HotelCode_Offset],4);
							rev = 0x00;
							break;
						case 0x06:	//查询项目分组 - 32Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_Infodetails_HotelGroupName_Offset],32);
							rev = 0x00;
							break;
						case 0x07:	//查询房型别名 - 32Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_Infodetails_HomeName_Offset],32);
							rev = 0x00;
							break;
						case 0x08:	//查询版本号 - 3Byte
							memcpy(buff,&temp_buff[Logic_D_Para + LogicFile_Infodetails_Version_Offset],3);
							rev = 0x00;
							break;
					}
				}

			}else {
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验失败!");
			}
			
		}else{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"读取数据长度不在范围内:%08X - %d",temp_len);
		}
	}else {
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"不是逻辑文件数据包头!%02X %02X",Flash_read_Byte(FLASH_LOGIC_DataStart_ADDRESS+Logic_D_Hear_L) , Flash_read_Byte(FLASH_LOGIC_DataStart_ADDRESS+Logic_D_Hear_H));
	}
	
	return rev;
}

/*******************************************************************************
* Function Name  : Logic_FrameType_Global_TempProcessing 
* Description    : 逻辑文件中 - 全局信息 临时处理
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_Global_TempProcessing(uint8_t *data,uint16_t len)
{
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
}





//LOGICFILE_Content_Of_Statistical Lfile_stat;

/*******************************************************************************
* Function Name  : Logic_FrameType_DeviceAction_TempProcessing 
* Description    : 逻辑文件中 - 设备存在协议支持判断
* Input          : 
* Return         :
0x00	:有对应的协议
*******************************************************************************/
uint8_t Logic_DeviceType_Legal_Judgment(LOGICFILE_DEVICE_INFO *dev_info)
{
	uint8_t rev = 0x01;
	
	switch(dev_info->type)
	{
		case Dev_Host_Invalid:	//场景
			if((dev_info->version == 0x00) && (dev_info->port == 0x00))	rev = 0x00;
			break;
		case Dev_Host_HVout:		//强电继电器
			if((dev_info->version == 0x01) && (dev_info->port == Bus_port))	rev = 0x00;				//BLV_Cx主机继电器
			else if((dev_info->version == 0x02) && (dev_info->port == Polling_Port)) rev = 0x00;	//A9IO继电器
			else if((dev_info->version == 0x03) && (dev_info->port == Active_Port))	rev = 0x00;		//强电开关
			break;
		case Dev_Host_LVinput:		//弱电输入
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;					//BLV_Cx主机弱电输入 - 普通设备
			else if((dev_info->version == 0x02) && (dev_info->port == Polling_Port)) rev = 0x00;	//485红外感应
			else if((dev_info->version == 0x03) && (dev_info->port == Active_Port))	rev = 0x00;		//6路弱电输入
			break;
		case Dev_Host_LVoutput:		//弱电输出
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;					//BLV_Cx主机弱电输出 - 普通设备
			break;
		case Dev_Host_Service:		//服务信息
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;					//服务信息设备
			break;
		case Dev_NodeCurtain:		//干接点窗帘
			if((dev_info->version == 0x00) && (dev_info->port == 0x00))	rev = 0x00;					//干接点窗帘设备
			break;
		case DEV_RS485_SWT:			//开关
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;			//T1触摸开关
			else if((dev_info->version == 0x02) && (dev_info->port == Active_Port)) rev = 0x00;		//C7T/C43开关
			else if((dev_info->version == 0x03) && (dev_info->port == Polling_Port)) rev = 0x00;	//A9IO开关
			break;
		case DEV_RS485_TEMP:		//空调
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port))	rev = 0x00;			//T1温控器
			else if((dev_info->version == 0x02) && (dev_info->port == Active_Port)) rev = 0x00;		//C7T/C43温控器
			else if((dev_info->version == 0x03) && (dev_info->port == Polling_Port))	rev = 0x00;	//T1四管温控器
			else if((dev_info->version == 0x04) && (dev_info->port == Active_Port))	rev = 0x00;	    //T1主动温控器
			break;
		case DEV_RS485_INFRARED:	//红外
			//这个设备暂时没有对接
			break;
		case DEV_RS485_AirDetect:	//空气检测
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port)) rev = 0x00;			//M702空气质量检测
			break;
		case DEV_RS485_CARD:		//插卡取电
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port))	rev = 0x00;			//BLW插卡取电（轮训）
			else if((dev_info->version == 0x02) && (dev_info->port == Active_Port))	rev = 0x00;	    //BLW插卡取电(主动)
			break;
		case DEV_RS485_HEATER:		//地暖
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port))	rev = 0x00;	  	//宝来威地暖
			if((dev_info->version == 0x02) && (dev_info->port == Active_Port))	rev = 0x00;	  	//CLED地暖
			break;
		case Dev_RCU_NET:			//RCU设备网络
			//这个设备暂时没有对接
			break;
		case DEV_RS485_CURTAIN:		//485窗帘
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;			//杜亚窗帘
			if((dev_info->version == 0x02) && (dev_info->port == Active_Port))	rev = 0x00;			//丙申窗帘
			break;
		case DEV_RS485_RELAY:		//继电器
			//这个设备预计取消
			break;
		case DEV_RS485_IR_SEND:		//红外发送
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port))	rev = 0x00;			//轮训红外转发设备
			if((dev_info->version == 0x02) && (dev_info->port == Active_Port))	rev = 0x00;			//主动红外转发设备
            if((dev_info->version == 0x03) && (dev_info->port == Polling_Port))	rev = 0x00;			//轮训红外转发设备
			if((dev_info->version == 0x04) && (dev_info->port == Active_Port))	rev = 0x00;			//主动红外转发设备
			break;
		case DEV_RS485_DIMMING:		//直流调光
			//这个设备预计取消 - 合并到485PWM调光中
			break;
		case DEV_RS485_TRAIC:		//可控硅调光
			//这个设备预计取消 - 合并到485PWM调光中
			break;
		case DEV_RS485_STRIP:		//灯带
//			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port)) rev = 0x00;			//合并到PWM调光里面
			break;
		case DEV_RS485_CoreCtrl:	//中控
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port)) rev = 0x00;			//小宝语音
			break;
		case DEV_RS485_WxLock:		//微信锁	
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port)) rev = 0x00;			//BLW微信锁
			else if((dev_info->version == 0x02) && (dev_info->port == Polling_Port)) rev = 0x00;	//福瑞狗微信锁
			else if((dev_info->version == 0x03) && (dev_info->port == Polling_Port)) rev = 0x00;	//创佳微信锁
            else if((dev_info->version == 0x04) && (dev_info->port == Active_Port)) rev = 0x00;	    //杨格锁，2025-12-19
			break;
		case DEV_RS485_MUSIC:		//背景音乐
			if((dev_info->version == 0x01) && (dev_info->port == Bus_port))	rev = 0x00;				//BLV_Cx背景音乐
			else if((dev_info->version == 0x02) && (dev_info->port == Active_Port))	rev = 0x00;		//BLW背景音乐和小宝音乐
			else if((dev_info->version == 0x06) && (dev_info->port == Polling_Port)) rev = 0x00;	//华尔思音乐
			break;
		case DEV_NET_ROOMSTATE:		//房态下发
			//这个设备暂时没有对接
			break;
		case Dev_Host_PWMLight:		//主机本地调光
			//这个设备预计取消
			break;
		case DEV_RS485_PWM:			//485PWM调光
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port)) rev = 0x00;			//PWM调光
			else if((dev_info->version == 0x02) && (dev_info->port == Polling_Port)) rev = 0x00;	//A9LD调光
			else if((dev_info->version == 0x03) && (dev_info->port == Active_Port))	rev = 0x00;		//C7T滑动条调光
			else if((dev_info->version == 0x04) && (dev_info->port == Polling_Port)) rev = 0x00;	//A8PB调光
			else if((dev_info->version == 0x05) && (dev_info->port == Bus_port)) rev = 0x00;		//C12调光
			else if((dev_info->version == 0x06) && (dev_info->port == Polling_Port)) rev = 0x00;		//宝来威灯带调光		
			break;
		case DEV_PB_LED:			//总线调光
			//这个设备预计取消
			break;
		case DEV_RCU_POWER:			//RCU电源
			//这个设备预计取消
			break;
		case DEV_RS485_A9_IO_SWT:	//A9IO开关
			//这个设备预计取消
			break;
		case DEV_RS485_A9_IO_EXP:	//A9IO扩展
			//这个设备预计取消
			break;
		case DEV_RS485_A9_IO_POWER:	//A9IO电源
			//这个设备预计取消
			break;
		case DEV_RS485_RFGatewayCycle:	//无线网关轮询
			//这个设备预计取消
			break;
		case DEV_RS485_RFGatewayHost:	//无线网关主动
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;			//RF主网关
			break;
		case DEV_RS485_RFGatewayDoor:	//无线门磁
			//这个设备预计取消
			break;
		case DEV_RS485_AirReveal:		//空气参数显示
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;			//C7T空气质量显示
			break;
		case DEV_RS485_RFGatewayRelayPir:	//无线继电器红外
			//这个设备预计取消
			break;
		case Dev_Host_TimeCtrl:			//时间同步
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;			//C7T时间同步
			break;
		case Dev_Rs458_MonitorCtrl:		//监控控制
			//这个设备预计取消
			break;
		case Dev_Rs458_RotaryCtrl:		//旋钮开关控制
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;			//旋钮开关  协议1
			if((dev_info->version == 0x02) && (dev_info->port == Active_Port))	rev = 0x00;			//旋钮开关  协议2
			break;
		case Dev_BUS_C5IO:				//BLV_CSIO
			if((dev_info->version == 0x01) && (dev_info->port == Bus_port))	rev = 0x00;				//BLV_CxIO设备
			break;
		case Dev_RS485_CardState:
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;	  //主动端口插卡同步
			if((dev_info->version == 0x02) && (dev_info->port == Polling_Port))	rev = 0x00;	  //轮询端口插卡同步
			break;
		case DEV_RS485_FreshAir:	//485新风
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port))	rev = 0x00;	  //宝来威新风
			if((dev_info->version == 0x02) && (dev_info->port == Active_Port))	rev = 0x00;	  //CLED新风
			break;
		case DEV_RS485_LCD:        //LCD1602
			if((dev_info->version == 0x01) && (dev_info->port == Bus_port))	    rev = 0x00;	  //LCD1602
			break;
		case Dev_Rs485_PB20:
			if((dev_info->version == 0x01) && (dev_info->port == Bus_port))	    rev = 0x00;	  //PB20
			break;
		case Dev_Rs485_PB20_LD:
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))			rev = 0x00;	  //PB20_LED			
			break;
		case Dev_Rs485_PB20_LS:
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))			rev = 0x00;	  //PB20_LightStrip			
			break;
		case Dev_Rs485_PB20_Relay:
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))			rev = 0x00;	  //PB20_Relay			
			break;
		case DEV_Virtual_NoCard:		
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;			  //虚拟断电设备
			break;
		case DEV_Virtual_Card:		
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;			  //虚拟无卡取电设备
			break;
		case DEV_Virtual_ColorTemp:
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;			  //色温调节
			break;
		#if Dev_485_BLE_Music_Flag
		case Dev_485_BLE_Music:
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;	  //蓝牙音频
			break;
		#endif
		#if Dev_Nor_Carbon_Flag
		case DEV_Carbon_Saved:
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;			  //碳达人
			break;
		#endif
		#if Dev_Nor_Scene_Restore_Flag
		case Dev_Scene_Restore:
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;			  //场景还原
			break;
		#endif
		#if Dev_Nor_GlobalSet_Flag          //2025-07-15,YYW,全局设置
		case Dev_Virtual_GlobalSet:
			if((dev_info->version == 0x01) && (dev_info->port == 0x00))	rev = 0x00;			  //全局设置
			break;
		#endif 
        #if Dev_485_Energy_Monitor_Flag       
		case Dev_Energy_Monitor:
			if((dev_info->version == 0x01) && (dev_info->port == Polling_Port))	rev = 0x00;			  //能耗监测
			if((dev_info->version == 0x01) && (dev_info->port == Active_Port))	rev = 0x00;			  //能耗监测
			break;
        #endif 
	}
	
	return rev;
}


/*******************************************************************************
* Function Name  : Logic_FrameType_DeviceExist_TempProcessing 
* Description    : 逻辑文件中 - 设备存在 临时处理
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_DeviceExist_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	uint32_t temp_len = 0;
	char temp_str[38] = {0};
	LOGICFILE_DEVICE_INFO temp_dev_info;
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	
	memcpy(&temp_dev_info,data,sizeof(LOGICFILE_DEVICE_INFO));
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备类型:%d - %s",temp_dev_info.type,Logic_Info_DeviceType_To_String(temp_dev_info.type));
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备地址:%d",temp_dev_info.addr);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备端口:%d - %s",temp_dev_info.port,Logic_Info_DevicePort_To_String(temp_dev_info.port));
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备波特率:%d",temp_dev_info.baud);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备协议版本:%d",temp_dev_info.version);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备通讯重发次数:%d",temp_dev_info.retry);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备通讯等待时间:%dms",temp_dev_info.writ_time);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备输入回路数:%d",temp_dev_info.input_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备输出回路数:%d",temp_dev_info.output_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"父设备类型:%d",temp_dev_info.parent_type);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"父设备地址:%d",temp_dev_info.parent_addr);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"父设备端口:%d",temp_dev_info.parent_port);
	
	temp_len += sizeof(LOGICFILE_DEVICE_INFO);
	
	if((temp_len + temp_dev_info.input_num*4 + temp_dev_info.output_num*32) > len)	
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备输出回路别名长度不对:%d - %d",temp_len + temp_dev_info.input_num*4 + temp_dev_info.output_num*16,len);
	}
	
	/*输入回路设置信息 - 输入回路*4Byte*/
	temp_len += temp_dev_info.input_num*4;
	
	/*输出回路别名 - 输出回路*32Byte 2022-06-07 将别名长度改为32Byte*/
	for(uint16_t i=0;i<temp_dev_info.output_num;i++)
	{
		memcpy(temp_str,&data[temp_len],32);
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备输出回路:%d - %s",i+1,temp_str);
		temp_len += 32;
	}
	
	Lfile_info->device_num += 1;
	
	switch(temp_dev_info.port)
	{
		case Bus_port:
			if(Logic_DeviceType_Legal_Judgment(&temp_dev_info) == 0x00)	{
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"该设备有对应处理协议--");
				
				if(Lfile_info->Bus_device_num < BusDevice_NumMax)
				{
					Lfile_info->Bus_device_addr[Lfile_info->Bus_device_num] = data_addr;
					Lfile_info->Bus_device_num += 1;
				}
			}
			break;
		case Polling_Port:
			if(Logic_DeviceType_Legal_Judgment(&temp_dev_info) == 0x00){
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"该设备有对应处理协议--");
				
				if(Lfile_info->Polling_device_num < PollingDevice_NumMax)
				{
					Lfile_info->Polling_device_addr[Lfile_info->Polling_device_num] = data_addr;
					Lfile_info->Polling_device_num += 1;
				}
				
			}
			break;
		case Active_Port:
			if(Logic_DeviceType_Legal_Judgment(&temp_dev_info) == 0x00){
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"该设备有对应处理协议--");
				
				if(Lfile_info->Active_device_num < ActiveDevice_NumMax)
				{
					Lfile_info->Active_device_addr[Lfile_info->Active_device_num] = data_addr;
					Lfile_info->Active_device_num += 1;
				}
			}
			break;
		case 0x00:		//特殊设备 - 普通设备
			if(Logic_DeviceType_Legal_Judgment(&temp_dev_info) == 0x00){
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"该设备有对应处理协议--");
				
				if(Lfile_info->Nor_device_num < NorDevice_NumMax)
				{
					Lfile_info->Nor_device_addr[Lfile_info->Nor_device_num] = data_addr;
					Lfile_info->Nor_device_num += 1;
				}
			}
			break;
		default:
			break;
	}
	
}



char *Logic_Device_DelayUnit_To_String(uint8_t type)
{
	memset(device_temp_string,0,sizeof(device_temp_string));
	
	#if LOGIC_DEBUG_INFO_EN
	switch(type)
	{
		case 0x01:
			strncpy(device_temp_string,(const char *)"ms",sizeof("ms"));
			break;
		case 0x02:
			strncpy(device_temp_string,(const char *)"s",sizeof("s"));
			break;
		case 0x03:
			strncpy(device_temp_string,(const char *)"min",sizeof("min"));
			break;
		
	}
	#endif
	
	return device_temp_string;
}

char *Logic_Data_Service_Info_To_String(uint8_t id)
{
	memset(device_temp_string,0,sizeof(device_temp_string));
	
	#if LOGIC_DEBUG_INFO_EN
	
	switch(id)
	{
		case 0x01:
			strncpy(device_temp_string,(const char *)"入住服务",sizeof("入住服务"));
			break;
		case 0x02:
			strncpy(device_temp_string,(const char *)"勿扰服务",sizeof("勿扰服务"));
			break;
		case 0x03:
			strncpy(device_temp_string,(const char *)"清理服务",sizeof("清理服务"));
			break;
		case 0x04:
			strncpy(device_temp_string,(const char *)"呼叫服务",sizeof("呼叫服务"));
			break;
		case 0x05:
			strncpy(device_temp_string,(const char *)"洗衣服务",sizeof("洗衣服务"));
			break;
		case 0x06:
			strncpy(device_temp_string,(const char *)"退房服务",sizeof("退房服务"));
			break;
		case 0x07:
			strncpy(device_temp_string,(const char *)"稍后服务",sizeof("稍后服务"));
			break;
		case 0x08:
			strncpy(device_temp_string,(const char *)"SOS服务",sizeof("SOS服务"));
			break;
		case 0x09:
			strncpy(device_temp_string,(const char *)"送餐服务",sizeof("送餐服务"));
			break;
		case 0x0A:
			strncpy(device_temp_string,(const char *)"开锁服务",sizeof("开锁服务"));
			break;
		case 0x0B:
			strncpy(device_temp_string,(const char *)"行李服务",sizeof("行李服务"));
			break;
		case 0x0C:
			strncpy(device_temp_string,(const char *)"保险箱服务",sizeof("保险箱服务"));
			break;
		case 0x0D:
			strncpy(device_temp_string,(const char *)"门磁服务",sizeof("门磁服务"));
			break;
		default:
			strncpy(device_temp_string,(const char *)"自定义服务",sizeof("自定义服务"));
			break;
	}
	
	#endif
	
	return device_temp_string;
}	


char *Logic_Data_Music_folder_To_String(uint8_t id)
{
	memset(device_temp_string,0,sizeof(device_temp_string));
	
	#if LOGIC_DEBUG_INFO_EN
	
	switch(id)
	{
		case BLV_C5MUSIC_Music_Dir:
			strncpy(device_temp_string,(const char *)"音乐",sizeof("音乐"));
			break;
		case BLV_C5MUSIC_Warning_Dir:
			strncpy(device_temp_string,(const char *)"提示音",sizeof("提示音"));
			break;
		case BLV_C5MUSIC_Helpsleep_Dir:
			strncpy(device_temp_string,(const char *)"助眠",sizeof("助眠"));
			break;
		case BLV_C5MUSIC_Doorbell_Dir:
			strncpy(device_temp_string,(const char *)"门铃",sizeof("门铃"));
			break;
		case BLV_C5MUSIC_Greet_Dir:
			strncpy(device_temp_string,(const char *)"欢迎词",sizeof("欢迎词"));
			break;
		case BLV_C5MUSIC_Helpsleep1_Dir:
			strncpy(device_temp_string,(const char *)"助眠冥想",sizeof("助眠冥想"));
			break;
		case BLV_C5MUSIC_Helpsleep2_Dir:
			strncpy(device_temp_string,(const char *)"助眠海浪",sizeof("助眠海浪"));
			break;
		case BLV_C5MUSIC_Helpsleep3_Dir:
			strncpy(device_temp_string,(const char *)"助眠森林",sizeof("助眠森林"));
			break;
		default:
			strncpy(device_temp_string,(const char *)"未知文件夹",sizeof("未知文件夹"));
			break;
	}
	
	#endif
	
	return device_temp_string;
}

/*******************************************************************************
* Function Name  : Logic_FrameType_DeviceAction_TempProcessing 
* Description    : 逻辑文件中 - 设备动作数据解析 - 8Byte
* Input          : 
* Return         :
*******************************************************************************/
void Logic_Device_Action_Data_Analysis(uint8_t *data)
{
	#if LOGIC_DEBUG_INFO_EN
	
	LOGIC_DEVICE_ACTIVE_G temp_active;
	memcpy(&temp_active,data,sizeof(LOGIC_DEVICE_ACTIVE_G));
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"****************************");
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备类型:%d - %s",temp_active.type,Logic_Info_DeviceType_To_String(temp_active.type));
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备地址:%d",temp_active.addr);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制回路:%d",temp_active.loop);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备执行方式:%d",temp_active.execute);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备执行内容:%d",temp_active.content);
	
	Dbg_Print(DBG_BIT_LOGIC_STATUS_bit,"控制动作详细解析:",temp_active.addr);
	
	
	switch(temp_active.type)
	{
		case Dev_Host_Invalid:	
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开\r\n");
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关\r\n");
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误\r\n");
					break;
			}
			break;
		case Dev_Host_HVout:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开\r\n");
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关\r\n");
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误\r\n");
					break;
			}
			break;
		case Dev_Host_LVinput:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"弱电输入没有控制内容\r\n");
			break;
		case Dev_Host_LVoutput:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 调光亮度值:%d\r\n",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 调光亮度值:%d\r\n",temp_active.content);
					break;
				case 0x03:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"对应场景 调光亮度值:%d\r\n",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误\r\n");
					break;
			}
			break;
		case Dev_Host_Service:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"%s ",Logic_Data_Service_Info_To_String(temp_active.loop));
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开\r\n",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关\r\n",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误\r\n");
					break;
			}
			break;
		case Dev_NodeCurtain:
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"窗帘开\r\n",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"窗帘关\r\n",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误\r\n");
					break;
			}
			break;
		case DEV_RS485_SWT:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开关背光回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 调光亮度值:%d\r\n",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 调光亮度值:%d\r\n",temp_active.content);
					break;
				case 0x03:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"与场景有关 调光亮度值:%d\r\n",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误\r\n");
					break;
			}
			break;
		case DEV_RS485_TEMP:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"空调控制状态:");
			{
				uint8_t temp_1 = 0;
				uint8_t tempstate = temp_active.execute;
				
				temp_1 = (tempstate >> 6) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开机 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关机");
						break;
				}
				
				temp_1 = (tempstate >> 4) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"制冷 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"制热 ");
						break;
					case 0x03:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"送风 ");
						break;
					case 0x00:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"自动 ");
						break;
				}
				
				temp_1 = (tempstate >> 2) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"低速 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"中速 ");
						break;
					case 0x03:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"高速 ");
						break;
					case 0x00:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"自动 ");
						break;
				}
				
				temp_1 = (tempstate >> 0) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"低速 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"中速 ");
						break;
					case 0x03:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"高速 ");
						break;
					case 0x00:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"自动 ");
						break;
				}
				Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"设置温度:%d\r\n",temp_active.content);
			}
			break;
		case DEV_RS485_INFRARED:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"红外感应没有控制内容\r\n");
			break;
		case DEV_RS485_AirDetect:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"空气检测没有控制内容\r\n");
			break;
		case DEV_RS485_CARD:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"插卡取电没有控制内容\r\n");
			
			break;
		case DEV_RS485_HEATER:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"地暖控制状态:");
			{
				uint8_t temp_1 = 0;
				uint8_t tempstate = temp_active.execute;
				
				temp_1 = (tempstate >> 6) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开机 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关机");
						break;
				}
				
				temp_1 = (tempstate >> 4) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"制冷 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"制热 ");
						break;
					case 0x03:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"送风 ");
						break;
					case 0x00:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"自动 ");
						break;
				}
				
				temp_1 = (tempstate >> 2) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"低速 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"中速 ");
						break;
					case 0x03:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"高速 ");
						break;
					case 0x00:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"自动 ");
						break;
				}
				
				temp_1 = (tempstate >> 0) & 0x03;
				switch(temp_1)
				{
					case 0x01:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"低速 ");
						break;
					case 0x02:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"中速 ");
						break;
					case 0x03:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"高速 ");
						break;
					case 0x00:
						Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"自动 ");
						break;
				}
				Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"设置温度:%d\r\n",temp_active.content);
			}
			break;
		case Dev_RCU_NET:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"RCU设备网络没有控制内容\r\n");
			break;
		case DEV_RS485_CURTAIN:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"窗帘没有控制内容\r\n");
			break;
		case DEV_RS485_RELAY:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"继电器回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开\r\n");
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关\r\n");
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误\r\n");
					break;
			}
			break;
		case DEV_RS485_IR_SEND:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"红外发送-%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 ");
					switch(temp_active.content)
					{
						case 0x00:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"转发内容");
							break;
						case 0x01:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"静音");
							break;
						case 0x02:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"待机");
							break;
						case 0x03:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"音量加");
							break;
						case 0x04:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"音量减");
							break;
						case 0x05:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"频道加");
							break;
						case 0x06:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"频道减");
							break;
						case 0x07:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"上");
							break;
						case 0x08:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"下");
							break;
						case 0x09:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"左");
							break;
						case 0x0A:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"右");
							break;
						case 0x0B:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"OK");
							break;
						case 0x0C:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"主页");
							break;
						case 0x0D:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"菜单");
							break;
						case 0x0E:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"信源");
							break;
						case 0x0F:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"回看");
							break;
						default:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"参数错误");
							break;
					}
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 ");
					switch(temp_active.content)
					{
						case 0x00:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"转发内容");
							break;
						case 0x01:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"静音");
							break;
						case 0x02:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"待机");
							break;
						case 0x03:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"音量加");
							break;
						case 0x04:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"音量减");
							break;
						case 0x05:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"频道加");
							break;
						case 0x06:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"频道减");
							break;
						case 0x07:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"上");
							break;
						case 0x08:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"下");
							break;
						case 0x09:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"左");
							break;
						case 0x0A:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"右");
							break;
						case 0x0B:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"OK");
							break;
						case 0x0C:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"主页");
							break;
						case 0x0D:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"菜单");
							break;
						case 0x0E:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"信源");
							break;
						case 0x0F:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"回看");
							break;
						default:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"内容不对");
							break;
					}
					break;
				case 0x03:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"匹配 ");
					switch(temp_active.content)
					{
						case 0x01:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"空调");
							break;
						case 0x02:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"电视");
							break;
						default:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"内容不对");
							break;
					}
					break;
				case 0x04:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"电视 ");
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"频道:%d ",temp_active.content);
					break;
			}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_DIMMING:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"直流调光回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 亮度:%d",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 亮度:%d",temp_active.content);
					break;
				case 0x07:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向上循环");
					break;
				case 0x08:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向下循环");
					break;
				case 0x09:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"停止调光");
					break;
				case 0x0A:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向上调光 亮度:%d",temp_active.content);
					break;
				case 0x0B:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向下调光 亮度:%d",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"执行方式与内容不对");
					break;
			}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_TRAIC:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"可控硅调光回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 亮度:%d",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 亮度:%d",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"执行方式与内容不对");
					break;
			}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_STRIP:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"灯带调光回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 亮度:%d",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 亮度:%d",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"执行方式与内容不对");
					break;
			}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_CoreCtrl:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"中控没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_WxLock:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"微信锁没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_MUSIC:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"背景音乐:%d ",temp_active.loop);
			
		{
			uint8_t function = temp_active.execute & 0x0F;
			uint8_t function_para = (temp_active.execute >> 4) & 0x0F;
			
			switch(function)
			{
				case 0x00:
					switch(function_para)
					{
						case 0x01:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开始播放");
							break;
						case 0x02:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"停止播放");
							break;
						case 0x03:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"上一曲");
							break;
						case 0x04:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"下一曲");
							break;
						case 0x05:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"音量加");
							break;
						case 0x06:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"音量减");
							break;
						case 0x07:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"设置音乐音量:%d",temp_active.content);
							break;
						case 0x08:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"设置提示音音量:%d",temp_active.content);
							break;
						case 0x09:
							Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"设置门铃音量:%d",temp_active.content);
							break;
					}
					break;
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开机");
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关机");
					break;
				case 0x03:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"场景开时播放 %s-%d",Logic_Data_Music_folder_To_String(function_para),temp_active.content);
					break;
				case 0x04:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"场景关时播放 %s-%d",Logic_Data_Music_folder_To_String(function_para),temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"执行方式与内容不对");
					break;
			}
			
		}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_NET_ROOMSTATE:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"房态下发没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case Dev_Host_PWMLight:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"主机本地调光回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 亮度:%d",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 亮度:%d",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"执行方式与内容不对");
					break;
			}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_PWM:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"485PWM调光回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 亮度:%d",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 亮度:%d",temp_active.content);
					break;
				case 0x07:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向上循环");
					break;
				case 0x08:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向下调光");
					break;
				case 0x09:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"停止调光");
					break;
				case 0x0A:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向上调光 亮度:%d",temp_active.content);
					break;
				case 0x0B:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"向下调光 亮度:%d",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"执行方式与内容不对");
					break;
			}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_PB_LED:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"PB总线调光回路:%d ",temp_active.loop);
			switch(temp_active.execute)
			{
				case 0x01:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"开 亮度:%d",temp_active.content);
					break;
				case 0x02:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"关 亮度:%d",temp_active.content);
					break;
				default:
					Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"执行方式与内容不对");
					break;
			}
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RCU_POWER:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"RCU电源没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_A9_IO_SWT:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"A9IO开关没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_A9_IO_EXP:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"A9IO扩展没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_A9_IO_POWER:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"A9IO电源没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_RFGatewayCycle:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"无线网关轮询没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_RFGatewayHost:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"无线网关主动没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_RFGatewayDoor:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"无线门磁没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_AirReveal:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"空气参数没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case DEV_RS485_RFGatewayRelayPir:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"无线继电器红外没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case Dev_Host_TimeCtrl:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"时间同步没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case Dev_Rs458_MonitorCtrl:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"监控控制没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case Dev_Rs458_RotaryCtrl:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"旋钮开关控制没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
		case Dev_BUS_C5IO:
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"BLV_CSIO没有控制内容");
			Dbg_NoTick_Print(DBG_BIT_LOGIC_STATUS_bit,"\r\n");
			break;
	}
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"执行延时时间:%d%s",temp_active.delay_time,Logic_Device_DelayUnit_To_String(temp_active.delay_unit));
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"****************************");
	
	#endif
}



/*******************************************************************************
* Function Name  : Logic_FrameType_DeviceAction_TempProcessing 
* Description    : 逻辑文件中 - 设备动作 临时处理
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_DeviceAction_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	char temp_str[38] = {0};
	uint32_t temp_len = 0;
	uint32_t temp_data = 0;
	uint8_t temp_num = 0;
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	
	Lfile_info->active_num += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备类型:%d - %s",temp_data,Logic_Info_DeviceType_To_String(temp_data));
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备地址:%d",temp_data);
	temp_len += 1;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"事件编号:%d",temp_data);
	temp_len += 2;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"输入回路:%d",temp_data);
	temp_len += 2;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"输入事件:0x%04x",temp_data);
	temp_len += 2;
	
	temp_data = data[temp_len];
	Logic_Info_DeviceAction_Condition_To_String(&data[temp_len]);	//动作条件解析
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件1:%02X",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件2:%02X",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件3:%02X",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件4:%02X",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件5:%02X",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件6:%02X",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件7:%02X",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行条件8:%02X",temp_data);
	temp_len += 1;
	
	temp_len += 32;		//2022-05-29 增加条件保留32Byte
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作执行方式:%02X",temp_data);
	temp_len += 1;
	
	strncpy(temp_str,(const char *)&data[temp_len],32);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"动作别名:%s",temp_str);
	Dbg_Print_Buff(DBG_BIT_LOGIC_STATUS_bit,"动作别名数据" ,&data[temp_len],32);
	temp_len += 32;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"场景编号:%d",temp_data);
	temp_len += 2;		//场景编号
	
	temp_len += 32;		//2022-05-29 保留
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"输出动作数:%02X",temp_data);
	temp_len += 1;
	
	if((temp_len + temp_data*8) > len)
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"输出动作数长度不对:%d - %d",temp_len + temp_data*8,len);
		return ;
	}
	temp_num = temp_data;
	//解析动作
	for(uint16_t i=0;i<temp_num;i++)
	{
		Logic_Device_Action_Data_Analysis(&data[temp_len]);
//		memcpy(&temp_active,&data[temp_len],sizeof(LOGIC_DEVICE_ACTIVE_G));
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"****************************");
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备类型:%d - %s",temp_active.type,Logic_Info_DeviceType_To_String(temp_active.type));
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备地址:%d",temp_active.addr);
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制回路:%d",temp_active.loop);
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备执行方式:%d",temp_active.execute);
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制设备执行内容:%d",temp_active.content);
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"执行延时时间:%d%s",temp_active.delay_time,Logic_Device_DelayUnit_To_String(temp_active.delay_unit));
//		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"****************************");
		temp_len+=8;
	}
	
#if LOGIC_FILE_EN
	Logic_DevAction_Add(data, len);
#endif
}

/*******************************************************************************
* Function Name  : Logic_FrameType_VoiceMap_TempProcessing 
* Description    : 逻辑文件中 - 语音映射表 临时处理
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_VoiceMap_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	uint32_t temp_len = 0;
	uint32_t temp_data = 0;
	
	Lfile_info->voicemap_num += 1;
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	
//	temp_data = data[temp_len];
//	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"词条总数:%d ",temp_data);
//	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"词条输入类型:%d",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"词条输入地址:%d",temp_data);   
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制类型:%d - %s",temp_data,Logic_Info_DeviceType_To_String(temp_data));
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制地址:%d",temp_data);
	temp_len += 1;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"控制回路:%d",temp_data);
	temp_len += 2;
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"当前词条下标:%d",Lfile_info->voicemap_num);  
	
	Dbg_Print_Buff(DBG_BIT_LOGIC_STATUS_bit, "当前词条对应关系:", data, 6);
	if(XIAOBAO_SCENE_TYPE != data[0])  //不是场景
	{

		if(0x00 != data[4]&&(data[2]!=Dev_Host_Invalid))
		{
			data[4]--;
		}
	}
	Voice_Map_Dev_Add(&data[0]);
}

#if RS485_PB20Fun_Flag
/*******************************************************************************
* Function Name  : Logic_FrameType_DevCheckMap_TempProcessing 
* Description    : 逻辑文件中 - 巡检设备回路添加
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_DevCheckMap_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	uint32_t temp_len = 0;
	uint32_t temp_data = 0;
	
	Lfile_info->devcheckmap_num += 1;
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	

	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"巡检设备类型:%d",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"巡检设备地址:%d",temp_data);   
	temp_len += 1;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"巡检设备回路:%d",temp_data);
	temp_len += 2;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备功率下限:%d W",temp_data);
	temp_len += 2;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备功率上限:%d W",temp_data);
	temp_len += 2;
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"当前巡检下标:%d",Lfile_info->devcheckmap_num);  
	
	Dbg_Print_Buff(DBG_BIT_LOGIC_STATUS_bit, "当前巡检设备详情:", data, 8);

	Dev_Check_Map_Add(&data[0]);
}
#endif


/*******************************************************************************
* Function Name  : Logic_FrameType_VCCondition_TempProcessing 
* Description    : 逻辑文件中 - 无卡取电条件信息添加
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_VCCondition_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	uint32_t temp_len = 0;
	uint32_t temp_data = 0;
	
	uint32_t list_addr = 0;
	
	uint8_t condata[len + 4];       //条件信息 + 4个字节时间戳
	memset(condata, 0 , sizeof(condata));

	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	

	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 有人无人标记:%d",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 条件组:%d",temp_data);   
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 条件序号:%d",temp_data);   
	temp_len += 1;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 延时时间:%d",temp_data);
	temp_len += 2;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 延时单位:%d",temp_data);   
	temp_len += 1;
	
	for(uint8_t i = 0; i < 11; i++)
	{
		temp_data = data[temp_len];
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 端口%02d状态:%d",i,temp_data);   
		temp_len += 1;
	}
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 超时时间:%d",temp_data);
	temp_len += 2;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电条件 超时单位:%d",temp_data);   
	temp_len += 1;
	
	if(data[0] == 0x01)           //无人至有人逻辑标记
	{
		if(DevActionGlobal.VC_ConNToSSubset < (VC_CONDSUB_MAX * VC_CONDGROUP_MAX / 2))      
		{ 
			list_addr = SRAM_VCard_ConNToS_Start_Addr + DevActionGlobal.VC_ConNToSSubset * sizeof(CONDITION_STRUCT);   //拿到新地址
			memcpy(condata,data,len);
			SRAM_DMA_Write_Buff(condata, sizeof(CONDITION_STRUCT), list_addr);      //接着写入数据
			DevActionGlobal.VC_ConNToSSubset++;
			if((data[1] > DevActionGlobal.VC_ConNToSGruop) && (data[1] <= VC_CONDGROUP_MAX))
			{
				DevActionGlobal.VC_ConNToSGruop = data[1];
				
			}
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 无人至有人条件添加成功,当前条件地址:%08X 当前条件计数:%d ",list_addr ,DevActionGlobal.VC_ConNToSSubset);		
		}
		else
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 无人至有人条件超过数量上限");
		}
	}
	else if( (data[0] == 0x02) || (data[0] == 0x03) || (data[0] == 0x04) )      //有人至无人逻辑标记
	{
		if(DevActionGlobal.VC_ConSToNSubset < (VC_CONDSUB_MAX * VC_CONDGROUP_MAX / 2))      
		{
			list_addr = SRAM_VCard_ConSToN_Start_Addr + DevActionGlobal.VC_ConSToNSubset * sizeof(CONDITION_STRUCT);   //拿到新地址
			memcpy(condata,data,len);
			SRAM_DMA_Write_Buff(condata, sizeof(CONDITION_STRUCT), list_addr);      //接着写入数据
			DevActionGlobal.VC_ConSToNSubset++;
			if((data[1] > DevActionGlobal.VC_ConSToNGruop) && (data[1] <= VC_CONDGROUP_MAX))
			{
				DevActionGlobal.VC_ConSToNGruop = data[1];
			}
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 有人至无人条件添加成功,当前条件地址:%08X 当前条件计数:%d ",list_addr ,DevActionGlobal.VC_ConSToNSubset);		
		}
		else
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 有人至无人条件超过数量上限");
		}
	}
}

/*******************************************************************************
* Function Name  : Logic_FrameType_VCPortInfor_TempProcessing 
* Description    : 逻辑文件中 - 无卡取电映射端口信息添加
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_VCPortInfor_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	uint32_t temp_len = 0;
	uint32_t temp_data = 0;
	
	uint32_t list_addr = 0;

	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 映射端口类型:%d",temp_data);
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 映射端口地址:%d",temp_data);   
	temp_len += 1;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 映射端口回路:%d",temp_data);
	temp_len += 2;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 端口触发阈值:%d",temp_data);   
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 虚拟端口号:%d",temp_data);   
	temp_len += 1;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 启用统计标记:%d",temp_data);   
	temp_len += 1;
	

	if(DevActionGlobal.VC_PortNum < VIRTUAL_PORT_MAX)      
	{ 
		list_addr = SRAM_VCard_PortInf_Start_Addr + DevActionGlobal.VC_PortNum * sizeof(VPORT_INFO_STRUCT);   //拿到新地址

		SRAM_DMA_Write_Buff(data,sizeof(VPORT_INFO_STRUCT), list_addr);      //接着写入数据
		DevActionGlobal.VC_PortNum++;
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 映射添加成功,当前端口地址:%08X 当前端口计数:%d ",list_addr ,DevActionGlobal.VC_PortNum);		//	
	}
	else
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电映射端口超过数量上限: %d", VIRTUAL_PORT_MAX);
	}

}


/*******************************************************************************
* Function Name  : Logic_FrameType_VCProperty_TempProcessing 
* Description    : 逻辑文件中 - 无卡取电公共属性添加
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_VCProperty_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	uint32_t temp_len = 0;
	uint32_t temp_data = 0;
	
	uint32_t list_addr = 0;
	
	uint8_t tempflag = 0x00;

	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	

	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 窗口检测启用标记:%d",temp_data);
	temp_len += 1;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 窗口检测时间:%d",temp_data);
	temp_len += 2;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 检测时间单位:%d",temp_data);   
	temp_len += 1;
	
	/*窗口检测时间 不超过10个小时*/
	switch(data[3])
	{
		case 0x01:      //秒
			if(Data_Uint8_Convert_To_Uint16(&data[1]) <= (60 * 60 * 10))
			{
				tempflag = 0x01;
			}
			break;
		case 0x02:      //分
			if(Data_Uint8_Convert_To_Uint16(&data[1]) <= (60 * 10))
			{
				tempflag = 0x01;
			}
			break;
		case 0x03:      //时
			if(Data_Uint8_Convert_To_Uint16(&data[1]) <= 10)
			{
				tempflag = 0x01;
			}
			break;
	}
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 按键触发无人至有人启用标志:%d",temp_data);   
	temp_len += 1;
	
	temp_data = Data_Uint8_Convert_To_Uint16(&data[temp_len]);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 最后一步超时时间:%d",temp_data);
	temp_len += 2;
	
	temp_data = data[temp_len];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电 最后一步超时时间单位:%d",temp_data);   
	temp_len += 1;
	
	if(tempflag == 0x01)      
	{ 
		list_addr = SRAM_VCard_Property_Start_Addr;  
		if(len < 1024)
		{
			SRAM_DMA_Write_Buff(data, len, list_addr);      //接着写入数据
		}
	}
	else
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"无卡取电检测时间超过上限");
	}

}


/*******************************************************************************
* Description    : 逻辑文件中 - 色温调节端口映射信息
* Input          : 
* Return         :
*******************************************************************************/
void Logic_FrameType_ColorTempMap_TempProcessing(uint32_t data_addr,LOGICFILE_Content_Of_Statistical *Lfile_info,uint8_t *data,uint16_t len)
{
	uint32_t temp_len = 0;
	uint32_t temp_data = 0;
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%s",__func__);
	
	Lfile_info->ColorTemp_Map_Addr = data_addr;		//将该包数据先记录下来，等设备初始化完成后，在进行添加
	
	temp_data = data[temp_len++];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"色温设备地址:%d",temp_data);

	temp_data = data[temp_len++];
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"色温回路映射数量:%d",temp_data);
	
	
}


/*******************************************************************************
* Function Name  : LOGIC_FILE_Analysis 
* Description    : 逻辑文件读取到SRAM中
* Input          : 
* Return         :
*******************************************************************************/
void LOGIC_FILE_Analysis(LOGICFILE_Content_Of_Statistical *Lfile_info,uint32_t data_len)
{
	uint32_t read_addr = 0;
	uint8_t temp_data[4] = {0};
	uint16_t temp_frame_num = 0;	//逻辑总包数
	uint16_t temp_frame_id = 0;		//逻辑当前数
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"LOGIC_FILE_Analysis Len:%d",data_len);
	
	read_addr = FLASH_LOGIC_DataStart_ADDRESS;
	for(uint32_t i=0;i<data_len;i++)
	{
		if((Flash_read_Byte(read_addr+Logic_D_Hear_L) == 0xCC) && (Flash_read_Byte(read_addr+Logic_D_Hear_H) == 0xC0))
		{
			uint16_t temp_len = 0;
			Flash_Read(temp_data,4,read_addr+Logic_D_Len_L);
			temp_len = temp_data[1];
			temp_len <<= 8;
			temp_len |= temp_data[0];
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"找到文件，读取数据长度:%d",temp_len);
			if(((i+temp_len) <= data_len) && (temp_len <= 1536))	//目前包长最大1024
			{
				uint16_t temp_crc = 0,data_crc = 0;
				uint16_t data_frame = 0,data_sn = 0;
		
				memset(Temp_Flash_Buff,0,sizeof(Temp_Flash_Buff));
				
				Flash_Read(Temp_Flash_Buff,temp_len,read_addr);
				temp_crc = NetCRC16_Data(Temp_Flash_Buff ,temp_len,Logic_D_CRC_L);
				
				data_crc = Temp_Flash_Buff[Logic_D_CRC_H];
				data_crc <<= 8;
				data_crc |= Temp_Flash_Buff[Logic_D_CRC_L];
				
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验:%04X %04X",data_crc,temp_crc);
				
				if(data_crc == temp_crc)
				{
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
					
					
					data_frame = Temp_Flash_Buff[Logic_D_FrameNum_H];
					data_frame <<= 8;
					data_frame |= Temp_Flash_Buff[Logic_D_FrameNum_L];
					
					data_sn = Temp_Flash_Buff[Logic_D_Frame_H];
					data_sn <<= 8;
					data_sn |= Temp_Flash_Buff[Logic_D_Frame_L];
					
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
					
					if((temp_frame_num != 0x00) && (temp_frame_num != data_frame)) Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Frame总数不对");
					if((temp_frame_id != 0x00) && ((temp_frame_id+1) != data_sn)) Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"当前Frame SN不对");
					
					Dbg_Print_Buff(DBG_BIT_LOGIC_STATUS_bit,"逻辑帧数据" ,Temp_Flash_Buff,temp_len);
					
					temp_frame_id = data_sn;
					temp_frame_num = data_frame;
					
					switch(Temp_Flash_Buff[Logic_D_FrameType])
					{
						case Logic_FrameType_LogicInfo:
							//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic_FrameType_LogicInfo - 逻辑信息");
							Logic_FrameType_LogicInfo_TempProcessing(&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						case Logic_FrameType_Global:
							//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic_FrameType_Global - 全局信息");
							Logic_FrameType_Global_TempProcessing(&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						case Logic_FrameType_DeviceExist:
							//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic_FrameType_DeviceExist - 设备存在");
							Logic_FrameType_DeviceExist_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						case Logic_FrameType_DeviceAction:
							//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic_FrameType_DeviceAction - 设备动作");
							Logic_FrameType_DeviceAction_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						#if RS485_MUSIC_BLW_Flag
						case Logic_FrameType_VoiceMap:
							//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic_FrameType_VoiceMap - 小宝语音映射");
							Logic_FrameType_VoiceMap_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						#endif
						#if RS485_PB20Fun_Flag
						case Logic_FrameType_DevCheckMap:
							Logic_FrameType_DevCheckMap_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						#endif
						#if Dev_Nor_VirtualCard_Flag
						case Logic_FrameType_VCCondition:
							Logic_FrameType_VCCondition_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						case Logic_FrameType_VCPortInfor:
							Logic_FrameType_VCPortInfor_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						case Logic_FrameType_VCProperty:
							Logic_FrameType_VCProperty_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						#endif
						case Logic_FrameType_ColorTempMap:
							Logic_FrameType_ColorTempMap_TempProcessing(read_addr,Lfile_info,&Temp_Flash_Buff[Logic_D_Para],temp_len - Logic_D_Para);
							break;
						default:
							break;
					}
					
					read_addr+=temp_len-1;
					i+=temp_len - 1;
				}else {
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验失败!%04X %04X",data_crc,temp_crc);
				}
				
			}else{
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"读取数据长度不在范围内:%08X - %d",read_addr,temp_len);
			}
		}else {
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"不是逻辑文件数据包头! %d - %08x",i,read_addr);
		}
		
		read_addr++;
	}
	
}

void Logic_Device_Add_To_List(uint8_t type,uint8_t *data,uint16_t len)
{
	LOGICFILE_DEVICE_INFO temp_dev_info;
	
	memcpy(&temp_dev_info,data,sizeof(LOGICFILE_DEVICE_INFO));
	
	if(temp_dev_info.port != type)
	{
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"端口类型与数据端口类型不符!");
		return;
	}
	switch(temp_dev_info.port)
	{
		case Bus_port:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"-------Bus总线---------");
			switch(temp_dev_info.type)
			{
				case Dev_Host_HVout:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Bus总线增加强电继电器设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_HVout_For_Logic_Init(&temp_dev_info,data,len);
					//BLV_Nor_Dev_HVout_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);    //轮询主动总线在里面计数
					break;
				case Dev_BUS_C5IO: 
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加C5IO设备 地址: %d",temp_dev_info.addr);
					BLV_BUS_CSIO_For_Logic_Init(&temp_dev_info,data,len);
					break;
				case DEV_C5MUSIC_Type:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加背景音乐设备 地址: %d",temp_dev_info.addr);	
					BLV_BUS_C5MUSIC_For_Logic_Init(&temp_dev_info,data,len);

					break;
				#if RS485_LED_Flag
				case DEV_RS485_PWM:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加C12调光设备 地址: %d",temp_dev_info.addr);
					BLW_RS485_LED_For_Logic_Init(&temp_dev_info,data,len);   
					//BLW_RS485_LED_Data_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);   //轮询主动总线在里面计数
					break;
				#endif
				#if RS485_LCD_1602_Flag
				case DEV_RS485_LCD:
					BLW_RS485_LCD_For_Logic_Init(&temp_dev_info,data,len);
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加LCD1602设备 地址: %d",temp_dev_info.addr);
					break;
				#endif
				#if RS485_PB20Fun_Flag
				case Dev_Rs485_PB20:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加PB20总线设备 地址: %d",temp_dev_info.addr);
					BLV_RS485_PB20_For_Logic_Init(&temp_dev_info,data,len);   
					break;
				#endif
			}
			break;
		case Polling_Port:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"-------轮询总线---------");
			switch(temp_dev_info.type)
			{
				case Dev_Host_HVout:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加485轮询继电器设备 地址: %d",temp_dev_info.addr);	
					BLV_Nor_Dev_HVout_For_Logic_Init(&temp_dev_info,data,len);
					//BLV_Nor_Dev_HVout_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);    //轮询主动总线在里面计数				
					break;
				case DEV_RS485_SWT:   //开关
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加485轮询开关设备 地址: %d",temp_dev_info.addr);	
					BLW_RS485_Switch_For_Logic_Init(&temp_dev_info,data,len);				
					//BLW_RS485_Switch_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);//轮询主动端口计数在函数里面					
					break;
				case DEV_RS485_TEMP:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加轮询温控器设备 地址: %d",temp_dev_info.addr);	
					BLW_RS485_TempFun_For_Logic_Init(&temp_dev_info,data,len);
					
					break;
				#if Dev_485_Card_Polling_Flag
				case DEV_RS485_CARD:
				    //Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加插卡取电设备 地址: %d",temp_dev_info.addr);	
					BLV_RS485_Card_Data_For_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
				#if Dev_485_IrSend_Polling_Flag
				case DEV_IRTYPE:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加红外转发设备 地址: %d",temp_dev_info.addr);										
					RS485_IrSend_Data_For_Logic_Init(&temp_dev_info,data,len);   
					break;
				#endif
				#if RS485_LED_Flag
				case DEV_RS485_PWM:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加轮询PWM调光设备 地址: %d, 调光协议:%d",temp_dev_info.addr,temp_dev_info.version);							
					BLW_RS485_LED_For_Logic_Init(&temp_dev_info,data,len);   
					//BLW_RS485_LED_Data_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);   //轮询主动在里面计数 
					break;
				#endif
				case DEV_RS485_STRIP:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加RGB调光设备 地址: %d",temp_dev_info.addr);		
//          BLV_485_Dev_RGB_Light_Belt_Logic_Init(&temp_dev_info,data,len);   			
//					BLV_485_Dev_RGB_Light_Belt_Init(DevBuf[DEVDATALEN*i + 1]);     
//					Poll485_Info.device_num += 1;	
					break;
				#if Dev_485_Pir_Flag
				case Dev_Host_LVinput:   
					switch(temp_dev_info.version)
					{
						case 0x02:      //485红外感应
							//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加485红外感应设备 地址: %d",temp_dev_info.addr);												
							BLV_485_Dev_Pir_Data_Logic_Init(&temp_dev_info,data,len); 
							Poll485_Info.device_num += 1;	
							break;
					}
					break;
				#endif
				#if RS485_WxLock_Flag
				case DEV_RS485_WxLock: 
				    Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"轮询:增加微信锁设备 地址: %d",temp_dev_info.addr);		
					BLW_RS485_WeixinLockFun_Logic_Init(&temp_dev_info,data,len);           
					break;
				#endif
				case DEV_RS485_AirDetect:		
				#if RS485_AirDetect_Flag
//					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加空气质量检测设备 地址: %d",temp_dev_info.addr);				
					BLW_RS485_AirDetect_For_Logic_Init(&temp_dev_info,data,len);
				#endif
					break;
				case DEV_RS485_MUSIC:    //背景音乐
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"轮询端口增加485背景音乐设备 地址: %d",temp_dev_info.addr);										
					BLW_RS485_Music_Data_Logic_Init(&temp_dev_info,data,len);
					//BLW_RS485_Music_Data_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);      //轮询主动端口计数在函数里面
					break;
//				case Dev_RS485_CardState:
//					BLW_RS485_CardState_For_Logic_Init(&temp_dev_info,data,len);
//					break;
				#if RS485_FreshAir_Flag
				case DEV_RS485_FreshAir:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"轮询端口增加485新风设备 地址: %d",temp_dev_info.addr);
					BLW_RS485_FreshAirFun_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
				#if RS485_FloorHeat_Flag
				case DEV_RS485_HEATER:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"轮询端口增加485新风设备 地址: %d",temp_dev_info.addr);
					BLW_RS485_FloorHeatFun_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
				case Dev_Energy_Monitor:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"轮询端口增加485能耗监测设备 地址: %d",temp_dev_info.addr);
					BLV_RS485_EnrgyMonitor_Data_For_Logic_Init(&temp_dev_info,data,len);
					break;
			}
			break;
		case Active_Port:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"-------主动总线---------");
			switch(temp_dev_info.type)
			{
				case Dev_Host_HVout:
					//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加485主动继电器设备 地址: %d",temp_dev_info.addr);	
					BLV_Nor_Dev_HVout_For_Logic_Init(&temp_dev_info,data,len);
					//BLV_Nor_Dev_HVout_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);    //轮询主动总线在里面计数				
					break;
				#if RS485_Dev_IN_CH6
				case Dev_Host_LVinput:   

					switch(temp_dev_info.version)      //协议
					{
						case 0x03:      //4`185 6路输入
							//Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加485 6路输入设备 地址: %d",temp_dev_info.addr);									
							BLV_485_DEV_IN_CH6_Data_Logic_Init(&temp_dev_info,data,len); 
							Act485_Info.device_num += 1;									
							break;
					}
					break;
				#endif
				case DEV_SWI_TYPE:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加485主动开关设备 地址: %d",temp_dev_info.addr);	
					//BLW_RS485_Switch_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);//轮询主动端口计数在函数里面
					BLW_RS485_Switch_For_Logic_Init(&temp_dev_info,data,len);

					break;
				case DEV_RS485_TEMP:
				    Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加主动温控器设备 地址: %d",temp_dev_info.addr);					
						BLW_RS485_TempFun_For_Logic_Init(&temp_dev_info,data,len);
					
//					BLWOut_RS485_Temp_Data_Init(DevBuf[DEVDATALEN*i + 1]);
//					BLWOut_RS485_TempT1_Data_Init(DevBuf[DEVDATALEN*i + 1]);
//					Poll485_Info.device_num += 1;
					break;
				#if RS485_LED_Flag
				case DEV_RS485_PWM:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加主动PWM调光设备 地址: %d",temp_dev_info.addr);	
					BLW_RS485_LED_For_Logic_Init(&temp_dev_info,data,len);   
					//BLW_RS485_LED_Data_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);    //轮询主动端口计数在函数里面
					break;
				#endif
				#if RS485_RFGatewayHost_Flag
				case DEV_RS485_RFGatewayHost:   //主网关
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加主网关设备 地址: %d",temp_dev_info.addr);	
					BLW_RS485_RF_GatewayHost_Logic_Init(&temp_dev_info,data,len);   
					//BLW_RS485_RF_GatewayHost_Init(DevBuf[DEVDATALEN*i + 1]);
					Act485_Info.device_num += 1;									
					break;
				#endif
				#if RS485_WxLock_Flag
				case DEV_RS485_WxLock:
				    Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"主动:增加微信锁设备 地址: %d",temp_dev_info.addr);	
					 BLW_RS485_WeixinLockFun_Logic_Init(&temp_dev_info,data,len);        //轮询主动端口计数在函数里面  
					break;
				#endif
				#if RS485_MUSIC_BLW_Flag
				case DEV_XiaoBao_Type:
				    Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加小宝设备 地址: %d",temp_dev_info.addr);										
					BLV_485_Dev_XiaoBao_Logic_Init(&temp_dev_info,data,len);
					//BLV_485_Dev_XiaoBao_Init(DevBuf[DEVDATALEN*i + 1]);
					Act485_Info.device_num += 1;
					break;
				#endif
				case DEV_RS485_MUSIC:    //背景音乐
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"主动端口增加背景音乐设备 地址: %d",temp_dev_info.addr);										
					BLW_RS485_Music_Data_Logic_Init(&temp_dev_info,data,len);
					//BLW_RS485_Music_Data_Init(DEVDATALEN, &DevBuf[DEVDATALEN*i]);      //轮询主动端口计数在函数里面
					break;
				#if RS485_AirReveal_Flag
				case DEV_RS485_AirReveal:         //空气质量显示
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加空气质量显示设备 地址: %d",temp_dev_info.addr);
					BLW_RS485_AirReveal_For_Logic_Init(&temp_dev_info,data,len);
					Act485_Info.device_num += 1;
					break;
				#endif 
				case DEV_PCTEST_TYPE:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加PC调试设备 地址: %d",temp_dev_info.addr);					
					//BLV_PC_DEVICE_TEST_Init();
					//Act485_Info.device_num += 1;
					break;
				case Dev_Host_TimeCtrl:  //时间设备
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加时间设备 地址: %d",temp_dev_info.addr);					
					BLV_485_Dev_Time_Logic_Init(&temp_dev_info,data,len);
				  //BLV_485_Dev_Time_Init(DevBuf[DEVDATALEN*i + 1]);  
					Act485_Info.device_num += 1;					
					break;
				#if RS485_Curtain_Flag
				case DEV_RS485_CURTAIN:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加485窗帘设备 地址: %d",temp_dev_info.addr);
					BLW_RS485_Curtain_For_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
//				case Dev_RS485_CardState:
//					BLW_RS485_CardState_For_Logic_Init(&temp_dev_info,data,len);
//					break;
				#if RS485_FreshAir_Flag
				case DEV_RS485_FreshAir:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"主动端口增加485新风设备 地址: %d",temp_dev_info.addr);
					BLW_RS485_FreshAirFun_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
				#if RS485_FloorHeat_Flag
				case DEV_RS485_HEATER:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"主动端口增加485地暖设备 地址: %d",temp_dev_info.addr);
					BLW_RS485_FloorHeatFun_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
                #if RS485_Switch_Rotary_Flag
                case Dev_Rs458_RotaryCtrl:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加旋钮 设备地址: %d",temp_dev_info.addr);
					BLW_RS485_Rotary_Switch_For_Logic_Init(&temp_dev_info,data,len);
					break;
                #endif
				#if Dev_485_Card_Active_Flag
				case DEV_RS485_CARD:
				    Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加主动插卡取电 设备地址: %d",temp_dev_info.addr);	
					BLV_RS485_Card_Data_For_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
				#if Dev_485_IrSend_Active_Flag
				case DEV_IRTYPE:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加主动红外转发设备 地址: %d",temp_dev_info.addr);										
					RS485_IrSend_Data_For_Logic_Init(&temp_dev_info,data,len);   
					break;
                #endif
				#if Dev_485_BLE_Music_Flag
				case Dev_485_BLE_Music:
					BLV_RS485_BLE_Music_For_Logic_Init(&temp_dev_info,data,len);
					break;
				#endif
				case Dev_Energy_Monitor:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加主动 485能耗监测设备 地址: %d",temp_dev_info.addr);
					BLV_RS485_EnrgyMonitor_Data_For_Logic_Init(&temp_dev_info,data,len);
					break;
			}
			break;
		case 0x00:
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"-------普通设备总线---------");			
			switch(temp_dev_info.type)
			{
				case Dev_Host_Service:
				    Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加服务信息设备 地址: %d",temp_dev_info.addr);																				
//					BLV_Nor_Dev_Service_Init(DevBuf[DEVDATALEN*i + 1]);
					BLV_Nor_Dev_Service_For_Logic_Init(&temp_dev_info,data,len);
					NorDevInfoGlobal.NorDeviceNum += 1;
					break;
				case Dev_Host_LVinput:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加弱电输入设备 地址: %d",temp_dev_info.addr);																			
					BLV_BUS_CSIO_DI_For_Logic_Init(&temp_dev_info,data,len);
					NorDevInfoGlobal.NorDeviceNum += 1;
					break;
				case Dev_Host_HVout:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加强电继电器设备 地址: %d",temp_dev_info.addr);																			

					break;
				case Dev_Host_LVoutput:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加弱电输出设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_LVoutput_Init(temp_dev_info.addr);

					NorDevInfoGlobal.NorDeviceNum += 1;							
					break;
				case Dev_NodeCurtain:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加干接点窗帘设备 地址: %d",temp_dev_info.addr);																			
					BLV_Nor_Dev_Curtain_Logic_Init(&temp_dev_info,data,len);       
//					BLV_Nor_Dev_Curtain_Init(DevBuf[DEVDATALEN*i + 1]);
					NorDevInfoGlobal.NorDeviceNum += 1;							
					break;
				#if RS485_PB20_LD_Flag
				case Dev_Rs485_PB20_LD:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加PB20_LED设备 地址: %d",temp_dev_info.addr);
					BLV_RS485_PB20_LED_For_Logic_Init(&temp_dev_info,data,len);
					NorDevInfoGlobal.NorDeviceNum += 1;
					break;
				#endif
				#if RS485_PB20_LS_Flag
				case Dev_Rs485_PB20_LS:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加PB20_LS设备 地址: %d",temp_dev_info.addr);
					BLV_RS485_PB20_Strip_For_Logic_Init(&temp_dev_info,data,len);
					NorDevInfoGlobal.NorDeviceNum += 1;
					break;
				#endif
				#if RS485_PB20_Relay_Flag
				case Dev_Rs485_PB20_Relay:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加PB20_Relay设备 地址: %d",temp_dev_info.addr);
					BLV_RS485_PB20_Relay_For_Logic_Init(&temp_dev_info,data,len);
					NorDevInfoGlobal.NorDeviceNum += 1;
					break;
				#endif
				#if Dev_Nor_NoCard_Flag
				case DEV_Virtual_NoCard:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加虚拟无卡断电设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_NoCard_For_Logic_Init(&temp_dev_info,data,len);  
					NorDevInfoGlobal.NorDeviceNum += 1;	
					break;
				#endif
				#if Dev_Nor_VirtualCard_Flag
				case DEV_Virtual_Card:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加虚拟无卡取电设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_VirtualCard_For_Logic_Init(&temp_dev_info,data,len); 
					NorDevInfoGlobal.NorDeviceNum += 1;	
					break;
				#endif
				#if Dev_Nor_ColorTemp
				case DEV_Virtual_ColorTemp:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加色温调节设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_ColorTemp_Init(&temp_dev_info,data,len);  
					NorDevInfoGlobal.NorDeviceNum += 1;	
					break;
				#endif
				#if Dev_Nor_Carbon_Flag
				case DEV_Carbon_Saved:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加碳达人设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_Carbon_For_Logic_Init(&temp_dev_info,data,len);  
					NorDevInfoGlobal.NorDeviceNum += 1;	
					break;
				#endif
				#if Dev_Nor_Scene_Restore_Flag
				case Dev_Scene_Restore:
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加场景还原设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_SceneRestore_For_Logic_Init(&temp_dev_info,data,len);  
					NorDevInfoGlobal.NorDeviceNum += 1;	
					break;
				#endif
                //2025-07-14,YYW,全局设置 - 初始化
                #if Dev_Nor_GlobalSet_Flag
                case Dev_Virtual_GlobalSet:
 					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"增加全局设置设备 地址: %d",temp_dev_info.addr);
					BLV_Nor_Dev_GlobalSet_For_Logic_Init(&temp_dev_info,data,len);  
					NorDevInfoGlobal.NorDeviceNum += 1;	                   
                    break;
                #endif
			}
			break;
	}
}

/*******************************************************************************
* Function Name  : Logic_File_To_Device_Init 
* Description    : 逻辑文件中 - 设备存在 - 初始化函数
* Input          : 
	dev_info 	：设备结构体
	data		：输入设置数组
	len			：输入设置数组长度
* Return         :
*******************************************************************************/
void Logic_File_Device_Init(LOGICFILE_Content_Of_Statistical *Lfile_info,uint32_t data_len)
{

	uint32_t read_addr = 0;
	uint8_t temp_data[4] = {0};
	uint16_t temp_frame_num = 0;	//逻辑总包数
	uint16_t temp_frame_id = 0;		//逻辑当前数
	
	uint16_t device_Init_num = 0;
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"LOGIC_FILE_Analysis Len:%d",data_len);
	
	read_addr = FLASH_LOGIC_DataStart_ADDRESS;
	for(uint32_t i=0;i<data_len;i++)
	{
		if((Flash_read_Byte(read_addr+Logic_D_Hear_L) == 0xCC) && (Flash_read_Byte(read_addr+Logic_D_Hear_H) == 0xC0))
		{
			uint16_t temp_len = 0;
			Flash_Read(temp_data,4,read_addr+Logic_D_Len_L);
			temp_len = temp_data[1];
			temp_len <<= 8;
			temp_len |= temp_data[0];
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"%d 找到文件，读取数据长度:%d",i,temp_len);
			if(((i+temp_len) < data_len) && (temp_len <= 1024))	//目前包长最大1024
			{
				uint16_t temp_crc = 0,data_crc = 0;
				uint16_t data_frame = 0,data_sn = 0;
				uint8_t temp_buff[temp_len];
				memset(temp_buff,0,sizeof(temp_buff));
				
				Flash_Read(temp_buff,temp_len,read_addr);
				temp_crc = NetCRC16_Data(temp_buff ,temp_len,Logic_D_CRC_L);
				
				data_crc = temp_buff[Logic_D_CRC_H];
				data_crc <<= 8;
				data_crc |= temp_buff[Logic_D_CRC_L];
				
				if(data_crc == temp_crc)
				{
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
					
					data_frame = temp_buff[Logic_D_FrameNum_H];
					data_frame <<= 8;
					data_frame |= temp_buff[Logic_D_FrameNum_L];
					
					data_sn = temp_buff[Logic_D_Frame_H];
					data_sn <<= 8;
					data_sn |= temp_buff[Logic_D_Frame_L];
					
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
					
					if((temp_frame_num != 0x00) && (temp_frame_num != data_frame)) Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Frame总数不对");
					if((temp_frame_id != 0x00) && ((temp_frame_id+1) != data_sn)) Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"当前Frame SN不对");
					
					temp_frame_id = data_sn;
					temp_frame_num = data_frame;
					
					if(temp_buff[Logic_D_FrameType] == Logic_FrameType_DeviceExist)
					{
						
						//Logic_Device_Add_To_List(&temp_buff[Logic_D_Para],temp_len - Logic_D_Para);
						
						device_Init_num++;
						if(Lfile_info->device_num <= device_Init_num) {
							Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic File 设备初始化完毕");
							break;
						}
					}
					
					read_addr+=temp_len-1;
					i+=temp_len - 1;
				}else {
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验失败!");
				}
				
			}else{
				Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"读取数据长度不在范围内:%08X - %d",read_addr,temp_len);
			}
		}else {
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"不是逻辑文件数据包头! %d - %08x",i,read_addr);
		}
		
		read_addr++;
	}
}

/*******************************************************************************
* Function Name  : LOGIC_FILE_Check 
* Description    : 逻辑文件读取到SRAM中
* Input          : 
* Return         :
*******************************************************************************/
uint8_t LOGIC_FILE_Check(void)
{
	uint32_t temp = 0;
	uint32_t file_len = 0;
	uint8_t file_info[24];
	uint8_t md5[16];
	LOGICFILE_Content_Of_Statistical Lfile_stat;
	
	memset(md5,0,sizeof(md5));
	memset(file_info,0,sizeof(file_info));
	memset(&Lfile_stat,0,sizeof(LOGICFILE_Content_Of_Statistical));		//文件统计
	
	//读取MD5值并校验
	Flash_Read(file_info,24,FLASH_LOGIC_DataFlag_ADDRESS);
	
	temp = file_info[3];
	temp <<= 8;
	temp |= file_info[2];
	temp <<= 8;
	temp |= file_info[1];
	temp <<= 8;
	temp |= file_info[0];
	
	if(temp == LOGIC_DataFlag)
	{
		file_len = file_info[7];
		file_len <<= 8;
		file_len |= file_info[6];
		file_len <<= 8;
		file_len |= file_info[5];
		file_len <<= 8;
		file_len |= file_info[4];
		
		if((file_len != 0x00) &&(file_len >= 0x70000))
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑文件长度不对:%08X",file_len);
			return 0x01;
		}
		
		MD5Digest_FLASH(FLASH_LOGIC_DataStart_ADDRESS, file_len,(char *)&md5[0]); 
		
		if(0==strncmp((const char *)md5,(const char *)&file_info[8],16))
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"MD5校验成功!");
		}else {
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"MD5校验错误，不作处理 Len:%08X",file_len);
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"升级配置失败，Md5错误:%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X%02X,%02X,%02X,%02X,%02X,%02X",md5[0],md5[1],md5[2],md5[3],md5[4],md5[5],md5[6],md5[7],md5[8],md5[9],md5[10],md5[11],md5[12],md5[13],md5[14],md5[15]);
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"UDP Md5:%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X,%02X",\
				file_info[8],file_info[9],\
				file_info[10],file_info[11],\
				file_info[12],file_info[13],\
				file_info[14],file_info[15],\
				file_info[16],file_info[17],\
				file_info[18],file_info[19],\
				file_info[21],file_info[21],\
				file_info[22],file_info[23]);
			return 0x01;
		}
		
		/*文件解析 - 先全部遍历一遍，找到所以的数据类型*/
		LOGIC_FILE_Analysis(&Lfile_stat,file_len);
		

			
	}else {
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"逻辑文件标志位不符，不作处理:%08X",temp);
	}
	
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--------------------");
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备存在总数：%d",Lfile_stat.device_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--BUS设备存在：%d",Lfile_stat.Bus_device_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--Polling设备存在：%d",Lfile_stat.Polling_device_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--Active设备存在：%d",Lfile_stat.Active_device_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--普通设备存在：%d",Lfile_stat.Nor_device_num);

	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--------------------");
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"设备动作总数：%d",Lfile_stat.active_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--------------------");
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"映射表总数：%d",Lfile_stat.voicemap_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"巡检表总数：%d",Lfile_stat.devcheckmap_num);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"--------------------");
	
	/*将逻辑表中的设备进行初始化*/
	memset((void *)&BUS485_Info,0,sizeof(BLV_BUS_Manage_G));
	memset((void *)&Poll485_Info,0,sizeof(BLV_POLL_Manage_G));
	memset((void *)&Act485_Info,0,sizeof(BLV_ACTIVE_Manage_G));
	
	
	SRAM_Write_DW(SRAM_Device_List_Start_Addr,SRAM_BUS_Device_List_Addr);
	//添加BUS设备
	for(uint8_t i=0;i<Lfile_stat.Bus_device_num;i++)
	{
		uint32_t data_addr = Lfile_stat.Bus_device_addr[i];
		uint16_t temp_crc = 0,data_crc = 0;
		uint16_t data_frame = 0,data_sn = 0;
		uint16_t data_len = 0;
	
		Flash_Read(file_info,4,data_addr+Logic_D_Len_L);
		
		data_len = file_info[1];
		data_len <<= 8;
		data_len |= file_info[0];
		
		uint8_t dev_buff[data_len];
		memset(dev_buff,0,sizeof(dev_buff));
				
		Flash_Read(dev_buff,data_len,data_addr);
		temp_crc = NetCRC16_Data(dev_buff ,data_len,Logic_D_CRC_L);

		data_crc = dev_buff[Logic_D_CRC_H];
		data_crc <<= 8;
		data_crc |= dev_buff[Logic_D_CRC_L];

		if(data_crc == temp_crc)
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
			
			data_frame = dev_buff[Logic_D_FrameNum_H];
			data_frame <<= 8;
			data_frame |= dev_buff[Logic_D_FrameNum_L];
			
			data_sn = dev_buff[Logic_D_Frame_H];
			data_sn <<= 8;
			data_sn |= dev_buff[Logic_D_Frame_L];
			
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
			
			if(dev_buff[Logic_D_FrameType] == Logic_FrameType_DeviceExist)
			{
				Logic_Device_Add_To_List(Bus_port,&dev_buff[Logic_D_Para],data_len - Logic_D_Para);
			}
		}
	}

	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"BUS总线设备个数:%d", BUS485_Info.device_num);	
	BUS485_Info.Last_list_addr = SRAM_Device_List_Start_Addr;
	BUS485_Info.port_mode = Port_Normal_Mode;
	
	BUS485_Info.baud = 115200;
	BUS485_Info.BaudRateCfg = &UART3_ChangeBaud;
	BUS485_Info.BUS_Start = B_IDLE;
	/*BLV_BUS端口初始化*/
	USART_INIT(USART_3,BUS485_Info.baud);
	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"BUS485 Device Info Endaddr:%08X ---",SRAM_Read_DW(SRAM_BUS_Device_List_Addr));
	
	Poll485_Info.Last_list_addr = SRAM_Read_DW(SRAM_BUS_Device_List_Addr);
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"Poll485_Info addr:%08X ----",Poll485_Info.Last_list_addr);
	
	SRAM_Write_DW(Poll485_Info.Last_list_addr,SRAM_POLL_Device_List_Addr);		//初始化Polling起始地址
	
	TempPrompt_Fun_Init();       //2026-03-13 
	
	//添加轮询设备
	for(uint8_t i=0;i<Lfile_stat.Polling_device_num;i++)
	{
		uint32_t data_addr = Lfile_stat.Polling_device_addr[i];
		uint16_t temp_crc = 0,data_crc = 0;
		uint16_t data_frame = 0,data_sn = 0;
		uint16_t data_len = 0;
	
		Flash_Read(file_info,4,data_addr+Logic_D_Len_L);
		
		data_len = file_info[1];
		data_len <<= 8;
		data_len |= file_info[0];
		
		uint8_t dev_buff[2048];
		memset(dev_buff,0,sizeof(dev_buff));
				
		Flash_Read(dev_buff,data_len,data_addr);
		temp_crc = NetCRC16_Data(dev_buff ,data_len,Logic_D_CRC_L);

		data_crc = dev_buff[Logic_D_CRC_H];
		data_crc <<= 8;
		data_crc |= dev_buff[Logic_D_CRC_L];

		if(data_crc == temp_crc)
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
			
			data_frame = dev_buff[Logic_D_FrameNum_H];
			data_frame <<= 8;
			data_frame |= dev_buff[Logic_D_FrameNum_L];
			
			data_sn = dev_buff[Logic_D_Frame_H];
			data_sn <<= 8;
			data_sn |= dev_buff[Logic_D_Frame_L];
			
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
			
			if(dev_buff[Logic_D_FrameType] == Logic_FrameType_DeviceExist)
			{
				Logic_Device_Add_To_List(Polling_Port,&dev_buff[Logic_D_Para],data_len - Logic_D_Para);
			}
		}
	}
	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"默认添加轮询插卡状态同步设备");	
	BLW_RS485_CardState_AddTo_PollingPort();     //2023-10-31
	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"轮询总线设备个数:%d", Poll485_Info.device_num);	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"BLV_POLL_dev END:%08X",SRAM_Read_DW(SRAM_POLL_Device_List_Addr));
	
	/*端口初始化*/
	Poll485_Info.port_mode = Port_Normal_Mode;
	Poll485_Info.baud = 9600;

#if (USE_CORE_TYPE == 1)   //使用C1F核心板
	Poll485_Info.BaudRateCfg = &UART0_ChangeBaud;
	USART_INIT(USART_0,Poll485_Info.baud);     //C1F的轮询口是串口0
#elif (USE_CORE_TYPE == 2)   //使用C1核心板
	Poll485_Info.BaudRateCfg = &UART1_ChangeBaud;
	USART_INIT(USART_1,Poll485_Info.baud);    //C1的轮询口是串口1
#endif  //USE_CORE_TYPE == CORE_TYPE_C1F
		
	
	
	Act485_Info.Last_list_addr = SRAM_Read_DW(SRAM_POLL_Device_List_Addr);	//主动设备起始地址
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"Act485_Info addr:%08X ----",Act485_Info.Last_list_addr);
	SRAM_Write_DW(Act485_Info.Last_list_addr,SRAM_ACTIVE_Device_List_Addr);	//初始化主动设备信息起始地址
	Act485_Info.device_num = 0;
	//添加主动设备
	for(uint8_t i=0;i<Lfile_stat.Active_device_num;i++)
	{
		uint32_t data_addr = Lfile_stat.Active_device_addr[i];
		uint16_t temp_crc = 0,data_crc = 0;
		uint16_t data_frame = 0,data_sn = 0;
		uint16_t data_len = 0;
	
		Flash_Read(file_info,4,data_addr+Logic_D_Len_L);
		
		data_len = file_info[1];
		data_len <<= 8;
		data_len |= file_info[0];
		
		uint8_t dev_buff[2048];
		memset(dev_buff,0,sizeof(dev_buff));
				
		Flash_Read(dev_buff,data_len,data_addr);
		temp_crc = NetCRC16_Data(dev_buff ,data_len,Logic_D_CRC_L);

		data_crc = dev_buff[Logic_D_CRC_H];
		data_crc <<= 8;
		data_crc |= dev_buff[Logic_D_CRC_L];

		if(data_crc == temp_crc)
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
			
			data_frame = dev_buff[Logic_D_FrameNum_H];
			data_frame <<= 8;
			data_frame |= dev_buff[Logic_D_FrameNum_L];
			
			data_sn = dev_buff[Logic_D_Frame_H];
			data_sn <<= 8;
			data_sn |= dev_buff[Logic_D_Frame_L];
			
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
			
			if(dev_buff[Logic_D_FrameType] == Logic_FrameType_DeviceExist)
			{
				Logic_Device_Add_To_List(Active_Port,&dev_buff[Logic_D_Para],data_len - Logic_D_Para);
			}
		}
	}
	/*增加测试接口*/
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"默认添加PC调试接口 ");	
	BLV_PC_DEVICE_TEST_Init();
	Act485_Info.device_num += 1;
	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"默认添加主动插卡状态同步设备");	
	BLW_RS485_CardState_AddTo_ActivePort();      //2023-10-31
	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"主动总线设备个数:%d", Act485_Info.device_num);	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"Active Device End List:%08X" , SRAM_Read_DW(SRAM_ACTIVE_Device_List_Addr));

	Act485_Info.Act_Start = B_IDLE;
	Act485_Info.baud = 9600;
	Act485_Info.port_mode = Port_Normal_Mode;
	Act485_Info.BaudRateCfg = &UART2_ChangeBaud;
	/*初始化主动端口*/
	USART_INIT(USART_2,Act485_Info.baud);
	
	
	temp = SRAM_Read_DW(SRAM_ACTIVE_Device_List_Addr);
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"Act485 Device Info Endaddr:%08X ----",temp);
	
	SRAM_Write_DW(temp,SRAM_NORMAL_Device_List_Addr);
	Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"普通设备存在:%08X",temp);
	//添加普通设备
	for(uint8_t i=0;i<Lfile_stat.Nor_device_num;i++)
	{
		uint32_t data_addr = Lfile_stat.Nor_device_addr[i];
		uint16_t temp_crc = 0,data_crc = 0;
		uint16_t data_frame = 0,data_sn = 0;
		uint16_t data_len = 0;
	
		Flash_Read(file_info,4,data_addr+Logic_D_Len_L);
		
		data_len = file_info[1];
		data_len <<= 8;
		data_len |= file_info[0];
		
		uint8_t dev_buff[2048];
		memset(dev_buff,0,sizeof(dev_buff));
				
		Flash_Read(dev_buff,data_len,data_addr);
		temp_crc = NetCRC16_Data(dev_buff ,data_len,Logic_D_CRC_L);

		data_crc = dev_buff[Logic_D_CRC_H];
		data_crc <<= 8;
		data_crc |= dev_buff[Logic_D_CRC_L];

		if(data_crc == temp_crc)
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
			
			data_frame = dev_buff[Logic_D_FrameNum_H];
			data_frame <<= 8;
			data_frame |= dev_buff[Logic_D_FrameNum_L];
			
			data_sn = dev_buff[Logic_D_Frame_H];
			data_sn <<= 8;
			data_sn |= dev_buff[Logic_D_Frame_L];
			
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
			
			if(dev_buff[Logic_D_FrameType] == Logic_FrameType_DeviceExist)
			{
				Logic_Device_Add_To_List(0x00,&dev_buff[Logic_D_Para],data_len - Logic_D_Para);
			}
		}
	}
	
	
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"默认添加白天黑夜虚拟时间设备");
	BLV_Nor_Dev_VirtualTime_Default_Init();          //2024-08-02
	NorDevInfoGlobal.NorDeviceNum++;
	
	temp = SRAM_Read_DW(SRAM_NORMAL_Device_List_Addr);
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"Nor Device Info Endaddr:%08X ----",temp);
	
	/*处理新增协议 - 色温调节回路映射信息处理*/
	if(Lfile_stat.ColorTemp_Map_Addr != 0x00)
	{
		uint32_t data_addr = Lfile_stat.ColorTemp_Map_Addr;
		uint16_t temp_crc = 0,data_crc = 0;
		uint16_t data_frame = 0,data_sn = 0;
		uint16_t data_len = 0;
	
		Flash_Read(file_info,4,data_addr+Logic_D_Len_L);
		
		data_len = file_info[1];
		data_len <<= 8;
		data_len |= file_info[0];
		
		uint8_t dev_buff[2048];
		memset(dev_buff,0,sizeof(dev_buff));
				
		Flash_Read(dev_buff,data_len,data_addr);
		temp_crc = NetCRC16_Data(dev_buff ,data_len,Logic_D_CRC_L);

		data_crc = dev_buff[Logic_D_CRC_H];
		data_crc <<= 8;
		data_crc |= dev_buff[Logic_D_CRC_L];

		if(data_crc == temp_crc)
		{
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"CRC校验成功");
			
			data_frame = dev_buff[Logic_D_FrameNum_H];
			data_frame <<= 8;
			data_frame |= dev_buff[Logic_D_FrameNum_L];
			
			data_sn = dev_buff[Logic_D_Frame_H];
			data_sn <<= 8;
			data_sn |= dev_buff[Logic_D_Frame_L];
			
			Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"Logic Data SN:%d,NUM:%d",data_sn,data_frame);
			
			if(dev_buff[Logic_D_FrameType] == Logic_FrameType_ColorTempMap)
			{
				/*数据内容进行处理*/
				data_addr = Find_Device_List_Information(DEV_Virtual_ColorTemp,dev_buff[Logic_D_Para]);
				if(data_addr != 0x00){
					Dev_ColorTemp_LoopBound(data_addr,&dev_buff[Logic_D_Para],data_len - Logic_D_Para);
				}else{
					Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"没找到色温设备");
				}
			}
		}
	}
	
	DevActionGlobal.DevNum = BUS485_Info.device_num + Poll485_Info.device_num + Act485_Info.device_num + NorDevInfoGlobal.NorDeviceNum;
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"BUS485_Info.device_num:%d",        BUS485_Info.device_num);  
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"Poll485_Info.device_num:%d",       Poll485_Info.device_num);  
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"Act485_Info.device_num:%d",        Act485_Info.device_num);  
	Dbg_Println(DBG_BIT_SYS_STATUS_bit,"NorDevInfoGlobal.NorDeviceNum:%d", NorDevInfoGlobal.NorDeviceNum);  
	SRAM_Dev_Data_Check();
	
	return 0x00;
}


void SRAM_Dev_Data_Check(void)
{
	uint16_t i;    //遍历设备 
	uint32_t Dev_processing_addr;
	Device_Public_Information_G BUS_Public;   //公有全局数据
	
	for(i = 0; i < DevActionGlobal.DevNum; i++)
	{
		Dev_processing_addr = SRAM_Device_List_Start_Addr + i*SRAM_Device_List_Size;
		SRAM_DMA_Read_Buff((uint8_t *)&BUS_Public, sizeof(Device_Public_Information_G), Dev_processing_addr);	//拷贝所有公有数据	
		
		Dbg_Println(DBG_BIT_LOGIC_STATUS_bit,"当前设备下标:%d,地址:%08X，设备类型:%d，设备地址:%d", i, Dev_processing_addr, BUS_Public.type, BUS_Public.addr);
		Dbg_Print_Buff(DBG_BIT_NET_STATUS_bit,"BUS_Public Data:",(uint8_t *)&BUS_Public, sizeof(BUS_Public));  

		/*重新保存当前设备*/
		
//		BUS_Public.check = 0x00;
//		SRAM_Write_Byte(BUS_Public.check, Dev_processing_addr+Dev_Check);   //清校验
//		SRAM_Write_Word(BUS_Public.DevCoord, Dev_processing_addr+Dev_Coord);  //重新写入设备下标
//		SRAM_Write_Word(BUS_Public.ActionCoord, Dev_processing_addr+Dev_ActionCoord);  //重新写入动作下标
//		
//		BUS_Public.check = Dev_CheckSum(Dev_processing_addr,BUS_Public.data_len); //重新计算整包校验  DoubleData_CheckSum((uint8_t *)&BUS_Public, sizeof(Device_Public_Information_G), (uint8_t *)&Rs485SwiInfo, sizeof(RS485_SWI_INFO));
//		SRAM_Write_Byte(BUS_Public.check, Dev_processing_addr+Dev_Check);   //重新写入校验
		

		
	}
	
}



