Commit e7d3c114 authored by limm's avatar limm

1,增加绑定解绑操作!

parent 5459550e
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -166,8 +166,8 @@ bool APP_PreCommandHandlerCallback(EmberAfClusterCommand* cmd) ...@@ -166,8 +166,8 @@ bool APP_PreCommandHandlerCallback(EmberAfClusterCommand* cmd)
{ {
uint8_t datavalue = cmd->buffer[i + 3]; uint8_t datavalue = cmd->buffer[i + 3];
iKonkeAfSelfPrint("##### datavalue (%d),%d \r\n",datavalue,cmd->buffer[i + 3] ); iKonkeAfSelfPrint("##### datavalue (%d),%d \r\n",datavalue,cmd->buffer[i + 3] );
if( (((datavalue == 3)||(datavalue == 4)||(datavalue == 7)||(datavalue == 8))&&(g_sDevice_Info.Device_Type == Device_Type_Air_Condition)) || if( (((datavalue == 3)||(datavalue == 4)||(datavalue == 7)||(datavalue == 8))&&(endpoint == 1)) ||
(((datavalue == 1)||(datavalue == 2))&&(g_sDevice_Info.Device_Type == Device_Type_Floor_Heating))) (((datavalue == 1)||(datavalue == 2))&&(endpoint == 2)))
{ {
temp_data = datavalue; temp_data = datavalue;
Control_MCU(&g_sMsgNode,endpoint,CMD_SYSTEM,temp_data); Control_MCU(&g_sMsgNode,endpoint,CMD_SYSTEM,temp_data);
...@@ -282,7 +282,7 @@ bool APP_PreCommandHandlerCallback(EmberAfClusterCommand* cmd) ...@@ -282,7 +282,7 @@ bool APP_PreCommandHandlerCallback(EmberAfClusterCommand* cmd)
{ {
uint8_t datavalue = cmd->buffer[i + 3]; uint8_t datavalue = cmd->buffer[i + 3];
iKonkeAfSelfPrint("#####delay off, datavalue (%d),%d \r\n",datavalue,cmd->buffer[i + 3] ); iKonkeAfSelfPrint("#####delay off, datavalue (%d),%d \r\n",datavalue,cmd->buffer[i + 3] );
if( (datavalue > 0)&&(datavalue <= 240)){ if( (datavalue >= 0)&&(datavalue <= 240)){
Control_MCU(&g_sMsgNode,endpoint,CMD_DELAY_OFF,datavalue); Control_MCU(&g_sMsgNode,endpoint,CMD_DELAY_OFF,datavalue);
kZclClusterSetPermitReportInfo(endpoint, ZCL_OPT_TUNNEL_CLUSTER_ID, false, false, false, false); kZclClusterSetPermitReportInfo(endpoint, ZCL_OPT_TUNNEL_CLUSTER_ID, false, false, false, false);
// if(g_sMsgNode.buffer[POLAD_INDEX] == TP_SUCCESS) // if(g_sMsgNode.buffer[POLAD_INDEX] == TP_SUCCESS)
...@@ -378,6 +378,30 @@ bool APP_PreCommandHandlerCallback(EmberAfClusterCommand* cmd) ...@@ -378,6 +378,30 @@ bool APP_PreCommandHandlerCallback(EmberAfClusterCommand* cmd)
} }
return false; return false;
} }
BIND_Info_Store Bind_Addr_Table = {
.addr1 = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},
.addr2 = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff},
.bind_flag1 = 0,
.bind_flag2 = 0};
void kSetBindConfigInfo(BIND_Info_Store* info)
{
halCommonSetToken(TOKEN_BINDIND_ADDR_TABLE, info);
}
BIND_Info_Store kGetBindConfigInfo(void)
{
halCommonGetToken(&Bind_Addr_Table, TOKEN_BINDIND_ADDR_TABLE);
return Bind_Addr_Table;
}
void Reset_Binding_Token(void)
{
memset(Bind_Addr_Table.addr1,0xff,EUI64_SIZE);
memset(Bind_Addr_Table.addr1,0xff,EUI64_SIZE);
Bind_Addr_Table.bind_flag1 = Bind_Addr_Table.bind_flag2 = 0;
kSetBindConfigInfo(&Bind_Addr_Table);
}
EmberEventControl ikkGetBindInfoEventControl; EmberEventControl ikkGetBindInfoEventControl;
bool IS_IEE_Addr_Exist(EmberEUI64 addr) bool IS_IEE_Addr_Exist(EmberEUI64 addr)
{ {
...@@ -393,42 +417,67 @@ bool IS_IEE_Addr_Exist(EmberEUI64 addr) ...@@ -393,42 +417,67 @@ bool IS_IEE_Addr_Exist(EmberEUI64 addr)
} }
return false; return false;
} }
void ikkGetBindInfoEventHandler(void ) void ikkGetBindInfoEventHandler(void )
{ {
EmberBindingTableEntry result; EmberBindingTableEntry result;
static uint8_t is_blinding_flag = 0;
EmberEUI64 g_Eui64GatewayAddr; EmberEUI64 g_Eui64GatewayAddr;
static EmberEUI64 g_Eui64BindDeviceAddr = {0xFF,0XFF,0XFF,0XFF,0xFF,0XFF,0XFF,0XFF};
kNwkGetGateWayEui64(g_Eui64GatewayAddr); kNwkGetGateWayEui64(g_Eui64GatewayAddr);
emberEventControlSetInactive(ikkGetBindInfoEventControl); emberEventControlSetInactive(ikkGetBindInfoEventControl);
for(int index = 0; index < emberAfGetBindingTableSize(); ++index ) { for(int index = 0; index < emberAfGetBindingTableSize(); ++index ) {
EmberStatus status = emberGetBinding(index, &result); EmberStatus status = emberGetBinding(index, &result);
if( (status == EMBER_SUCCESS && result.type == EMBER_UNICAST_BINDING )&&result.clusterId == 0xFCC0) {
if( status == EMBER_SUCCESS && result.type == EMBER_UNICAST_BINDING ) { if(memcmp(result.identifier, g_Eui64GatewayAddr, EUI64_SIZE) != 0)
if( result.clusterId == 0xFCC0 ) {
iKonkeAfSelfPrint("mac=%x-%x-%x-%x\r\n",result.identifier[0],result.identifier[1],result.identifier[2],result.identifier[3]);
if((Bind_Addr_Table.bind_flag1 == 0)&&
(memcmp(Bind_Addr_Table.addr2,result.identifier,EUI64_SIZE)))
{ {
if(memcmp(result.identifier, g_Eui64GatewayAddr, EUI64_SIZE) != 0) memcpy(Bind_Addr_Table.addr1,result.identifier,EUI64_SIZE);
if(result.local != g_sDevice_Info.Device_Type)
{ {
memcpy(g_Eui64BindDeviceAddr,result.identifier,EUI64_SIZE); g_sDevice_Info.Binding_Device_SrcEP[0] = result.local;
iKonkeAfSelfPrint("local EP = %d,remote ep = %d\r\n",result.local,result.remote); Binging_Info_Notify(1,result.local); //bind
if((result.local != g_sDevice_Info.Device_Type)&&(is_blinding_flag == 0)) Bind_Addr_Table.bind_flag1 = 1;
{ iKonkeAfSelfPrint("send blind1 info,ep = %d\r\n",g_sDevice_Info.Binding_Device_SrcEP[0]);
g_sDevice_Info.Binding_Device_SrcEP = result.local; kSetBindConfigInfo(&Bind_Addr_Table);
Binging_Info_Notify(result.local);
is_blinding_flag = 1;
iKonkeAfSelfPrint("send blind info\r\n");
}
} }
else if((!IS_IEE_Addr_Exist(g_Eui64BindDeviceAddr))&&(is_blinding_flag)) }
if((Bind_Addr_Table.bind_flag2 == 0)&&
(memcmp(Bind_Addr_Table.addr1,result.identifier,EUI64_SIZE)))
{
memcpy(Bind_Addr_Table.addr2,result.identifier,EUI64_SIZE);
if(result.local != g_sDevice_Info.Device_Type)
{ {
is_blinding_flag = 0; g_sDevice_Info.Binding_Device_SrcEP[1] = result.local;
g_sDevice_Info.Binding_Device_SrcEP = 0; Binging_Info_Notify(1,result.local); //bind
Binging_Info_Notify(g_sDevice_Info.Binding_Device_SrcEP); Bind_Addr_Table.bind_flag2 = 1;
iKonkeAfSelfPrint("send unblind info\r\n"); kSetBindConfigInfo(&Bind_Addr_Table);
iKonkeAfSelfPrint("send blind2 info,ep = %d\r\n",g_sDevice_Info.Binding_Device_SrcEP[1]);
} }
} }
} }
else if((!IS_IEE_Addr_Exist(Bind_Addr_Table.addr1))&&(Bind_Addr_Table.bind_flag1))
{
Bind_Addr_Table.bind_flag1 = 0;
Binging_Info_Notify(0,g_sDevice_Info.Binding_Device_SrcEP[0]); //unbind
iKonkeAfSelfPrint("send unblind1 info,ep = %d\r\n",g_sDevice_Info.Binding_Device_SrcEP[0]);
g_sDevice_Info.Binding_Device_SrcEP[0] = 0;
memset(Bind_Addr_Table.addr1,0xff,EUI64_SIZE);
kSetBindConfigInfo(&Bind_Addr_Table);
}
else if((!IS_IEE_Addr_Exist(Bind_Addr_Table.addr2))&&(Bind_Addr_Table.bind_flag2))
{
Bind_Addr_Table.bind_flag2 = 0;
Binging_Info_Notify(0,g_sDevice_Info.Binding_Device_SrcEP[1]); //unbind
iKonkeAfSelfPrint("send unblind2 info,ep = %d\r\n",g_sDevice_Info.Binding_Device_SrcEP[1]);
g_sDevice_Info.Binding_Device_SrcEP[1] = 0;
memset(Bind_Addr_Table.addr2,0xff,EUI64_SIZE);
kSetBindConfigInfo(&Bind_Addr_Table);
}
} }
}
emberEventControlSetDelayMS(ikkGetBindInfoEventControl, 2000); emberEventControlSetDelayMS(ikkGetBindInfoEventControl, 2000);
} }
bool emberAfThermostatClusterSetpointRaiseLowerCallback(uint8_t mode, bool emberAfThermostatClusterSetpointRaiseLowerCallback(uint8_t mode,
...@@ -687,7 +736,7 @@ kk_err_t PrivateClusterHandler(EmberAfClusterCommand* cmd) ...@@ -687,7 +736,7 @@ kk_err_t PrivateClusterHandler(EmberAfClusterCommand* cmd)
else if(cmd->apsFrame->sourceEndpoint == 3) else if(cmd->apsFrame->sourceEndpoint == 3)
sDevice_attr_new.fan.wind_speed = dataValue; sDevice_attr_new.fan.wind_speed = dataValue;
data_type = ZCL_ENUM8_ATTRIBUTE_TYPE; data_type = ZCL_ENUM8_ATTRIBUTE_TYPE;
Control_MCU(&g_sMsgNode,cmd->apsFrame->sourceEndpoint,CMD_CALI_TEMPER,dataValue); Control_MCU(&g_sMsgNode,cmd->apsFrame->sourceEndpoint,CMD_WIND_SPEED,dataValue);
} }
break; break;
case FCC0_ATTR_ON_OFF: case FCC0_ATTR_ON_OFF:
......
...@@ -52,12 +52,17 @@ EmberStatus Write_Attr(bool Report,uint8_t ep,uint16_t cluster,uint16_t attr, ui ...@@ -52,12 +52,17 @@ EmberStatus Write_Attr(bool Report,uint8_t ep,uint16_t cluster,uint16_t attr, ui
#define Write_MinTemp_Attr(x,ep,data) Write_Attr(x,ep,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_MIN_HEAT_SETPOINT_LIMIT_ATTRIBUTE_ID,(uint8_t*)data,ZCL_INT16S_ATTRIBUTE_TYPE) #define Write_MinTemp_Attr(x,ep,data) Write_Attr(x,ep,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_MIN_HEAT_SETPOINT_LIMIT_ATTRIBUTE_ID,(uint8_t*)data,ZCL_INT16S_ATTRIBUTE_TYPE)
typedef struct
{
EmberEUI64 addr1,addr2;
uint8_t bind_flag1,bind_flag2;
}BIND_Info_Store;
typedef struct typedef struct
{ {
uint8_t Device_Type; uint8_t Device_Type;
uint8_t Device_subType; uint8_t Device_subType;
uint8_t Binding_Device_SrcEP; uint8_t is_support_winddirect;
uint8_t Binding_Device_SrcEP[2];
uint8_t mcu_software_version; uint8_t mcu_software_version;
uint8_t mcu_hardware_version; uint8_t mcu_hardware_version;
}DEVICVE_INFO_ST; }DEVICVE_INFO_ST;
...@@ -65,7 +70,8 @@ typedef struct ...@@ -65,7 +70,8 @@ typedef struct
extern DEVICVE_INFO_ST g_sDevice_Info; extern DEVICVE_INFO_ST g_sDevice_Info;
uint8_t Read_Zigbee_Version(void); uint8_t Read_Zigbee_Version(void);
kk_err_t PrivateClusterHandler(EmberAfClusterCommand* cmd); kk_err_t PrivateClusterHandler(EmberAfClusterCommand* cmd);
BIND_Info_Store kGetBindConfigInfo(void);
void Reset_Binding_Token(void);
/**********************common interface*******************************/ /**********************common interface*******************************/
uint8_t Get_Device_Endpoint(void); uint8_t Get_Device_Endpoint(void);
uint8_t Get_Binding_Device_EP(void); uint8_t Get_Binding_Device_EP(void);
......
...@@ -674,12 +674,13 @@ void kNwkFactoryReset(bool is_nwk_indicator) ...@@ -674,12 +674,13 @@ void kNwkFactoryReset(bool is_nwk_indicator)
kk_err_t kNwkClusterBindingObjIsOK(uint8_t endpoint, uint16_t cluster ) kk_err_t kNwkClusterBindingObjIsOK(uint8_t endpoint, uint16_t cluster )
{ {
EmberBindingTableEntry result; EmberBindingTableEntry result;
kNwkGetGateWayEui64(g_Eui64GatewayAddr);
for(int index = 0; index < emberAfGetBindingTableSize(); ++index ) { for(int index = 0; index < emberAfGetBindingTableSize(); ++index ) {
EmberStatus status = emberGetBinding(index, &result); EmberStatus status = emberGetBinding(index, &result);
if( status == EMBER_SUCCESS && result.type == EMBER_UNICAST_BINDING ) { if( status == EMBER_SUCCESS && result.type == EMBER_UNICAST_BINDING ) {
if( result.local == endpoint && result.clusterId == cluster ) { if( result.local == endpoint && result.clusterId == cluster && !MEMCOMPARE(result.identifier, g_Eui64GatewayAddr, EUI64_SIZE)) {
return KET_OK; return KET_OK;
} }
} }
...@@ -700,7 +701,6 @@ kk_err_t kNwkClusterBindingObjIsOK(uint8_t endpoint, uint16_t cluster ) ...@@ -700,7 +701,6 @@ kk_err_t kNwkClusterBindingObjIsOK(uint8_t endpoint, uint16_t cluster )
static kk_err_t kNwkClusterBindingObjSet(uint8_t endpoint, uint16_t cluster_id, EmberEUI64 eui64 ) static kk_err_t kNwkClusterBindingObjSet(uint8_t endpoint, uint16_t cluster_id, EmberEUI64 eui64 )
{ {
kk_err_t err = KET_OK; kk_err_t err = KET_OK;
EmberStatus status = emberAfPushEndpointNetworkIndex(1); EmberStatus status = emberAfPushEndpointNetworkIndex(1);
if( status == EMBER_SUCCESS ) { if( status == EMBER_SUCCESS ) {
...@@ -714,7 +714,7 @@ static kk_err_t kNwkClusterBindingObjSet(uint8_t endpoint, uint16_t cluster_id, ...@@ -714,7 +714,7 @@ static kk_err_t kNwkClusterBindingObjSet(uint8_t endpoint, uint16_t cluster_id,
if( EMBER_SUCCESS == status ) { if( EMBER_SUCCESS == status ) {
if( entry.type == EMBER_UNICAST_BINDING ) { if( entry.type == EMBER_UNICAST_BINDING ) {
if( entry.local == endpoint && entry.clusterId == cluster_id ) { if( entry.local == endpoint && entry.clusterId == cluster_id && !MEMCOMPARE(entry.identifier, eui64, EUI64_SIZE)) {
valid_index = index; valid_index = index;
break; break;
} }
...@@ -765,7 +765,7 @@ kk_err_t kNwkClusterBindingInspect(void ) ...@@ -765,7 +765,7 @@ kk_err_t kNwkClusterBindingInspect(void )
for(int ix = 0; ix < BINDING_CLUSTER_MAXN; ++ix ) { for(int ix = 0; ix < BINDING_CLUSTER_MAXN; ++ix ) {
if( g_lstBindingClusterConf[ix].cluster != CLUSTER_UNKNOW ) { if( g_lstBindingClusterConf[ix].cluster != CLUSTER_UNKNOW ) {
kk_err_t err = kNwkClusterBindingObjIsOK(g_lstBindingClusterConf[ix].endpoint, g_lstBindingClusterConf[ix].cluster); kk_err_t err = kNwkClusterBindingObjIsOK(g_lstBindingClusterConf[ix].endpoint, g_lstBindingClusterConf[ix].cluster);
if( err == KET_ERR_NON_EXIST ) { if( err != KET_OK ) {
kNwkClusterBindingObjSet(g_lstBindingClusterConf[ix].endpoint, g_lstBindingClusterConf[ix].cluster, g_Eui64GatewayAddr); kNwkClusterBindingObjSet(g_lstBindingClusterConf[ix].endpoint, g_lstBindingClusterConf[ix].cluster, g_Eui64GatewayAddr);
} }
}else { }else {
...@@ -1810,6 +1810,7 @@ void kUserJoinSucceedProcedureEventHandler(void ) ...@@ -1810,6 +1810,7 @@ void kUserJoinSucceedProcedureEventHandler(void )
default: break; default: break;
} }
} }
/** @brief Incoming Packet Filter /** @brief Incoming Packet Filter
* *
* ** REQUIRES INCLUDING THE PACKET-HANDOFF PLUGIN ** * ** REQUIRES INCLUDING THE PACKET-HANDOFF PLUGIN **
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
#define CREATOR_IS_KONKE_GATEWAY (0x0007) #define CREATOR_IS_KONKE_GATEWAY (0x0007)
#define NVM3KEY_IS_KONKE_GATEWAY ( NVM3KEY_DOMAIN_USER | 0x0007 ) #define NVM3KEY_IS_KONKE_GATEWAY ( NVM3KEY_DOMAIN_USER | 0x0007 )
#define CREATOR_BINDIND_ADDR_TABLE (0x0008)
#define NVM3KEY_BINDIND_ADDR_TABLE ( NVM3KEY_DOMAIN_USER | 0x0008 )
//#define CREATOR_OPTTUNNEL_CMEI_FLG 0x0007 //#define CREATOR_OPTTUNNEL_CMEI_FLG 0x0007
//#define NVM3KEY_OPTTUNNEL_CMEI_FLG ( NVM3KEY_DOMAIN_USER | 0x0007 ) //#define NVM3KEY_OPTTUNNEL_CMEI_FLG ( NVM3KEY_DOMAIN_USER | 0x0007 )
...@@ -40,6 +41,13 @@ ...@@ -40,6 +41,13 @@
#endif #endif
#ifdef DEFINETYPES #ifdef DEFINETYPES
typedef struct{
EmberEUI64 addr1;
EmberEUI64 addr2;
uint8_t bind_flag1;
uint8_t bind_flag2;
}BIND_Info;
typedef BIND_Info tokTypeBindInfo;
//typedef uint8_t tokTypeChunk[33]; //typedef uint8_t tokTypeChunk[33];
#endif //DEFINETYPES #endif //DEFINETYPES
...@@ -51,7 +59,7 @@ DEFINE_BASIC_TOKEN(SINGLE_BOARD_TEST_FLG, uint8_t, 0) ...@@ -51,7 +59,7 @@ DEFINE_BASIC_TOKEN(SINGLE_BOARD_TEST_FLG, uint8_t, 0)
DEFINE_BASIC_TOKEN(FULL_DEVICE_TEST_FLG, uint8_t, 0) DEFINE_BASIC_TOKEN(FULL_DEVICE_TEST_FLG, uint8_t, 0)
DEFINE_BASIC_TOKEN(AGING_TEST_FLG , uint8_t, 0) DEFINE_BASIC_TOKEN(AGING_TEST_FLG , uint8_t, 0)
DEFINE_BASIC_TOKEN(INDICATOR_NOT_DISTURB_MODE_FLG, uint8_t, 0) DEFINE_BASIC_TOKEN(INDICATOR_NOT_DISTURB_MODE_FLG, uint8_t, 0)
DEFINE_BASIC_TOKEN(BINDIND_ADDR_TABLE, tokTypeBindInfo, {{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},{0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF},0,0})
DEFINE_BASIC_TOKEN(NODE_ID, uint16_t, 0xFFFF) DEFINE_BASIC_TOKEN(NODE_ID, uint16_t, 0xFFFF)
DEFINE_BASIC_TOKEN(IS_KONKE_GATEWAY, uint8_t, 0) DEFINE_BASIC_TOKEN(IS_KONKE_GATEWAY, uint8_t, 0)
......
...@@ -135,13 +135,16 @@ SensorStatusSt g_stSensorStatusBuffer = { ...@@ -135,13 +135,16 @@ SensorStatusSt g_stSensorStatusBuffer = {
}; };
extern uint8_t generatedDefaults[]; extern uint8_t generatedDefaults[];
#define Software_Version 0x11 #define Software_Version 0x12
#define Hardware_Version 0x10 #define Hardware_Version 0x10
#define MODEID_AIR_MEIDI 0x03008611 //美的线控器
#define MODEID_FAN_Pannel 0x03008604 //新风面板 #define MODEID_FAN_Pannel 0x03008604 //新风面板
#define MODEID_ELECTRIC_FLOOR_HEATING 0x03008603 //电地暖 #define MODEID_ELECTRIC_FLOOR_HEATING 0x03008603 //电地暖
#define MODEID_FAN_CONTROL_PANNEL 0x03008601 //风机盘管 #define MODEID_FAN_CONTROL_PANNEL 0x03008601 //风机盘管
extern BIND_Info_Store Bind_Addr_Table;
void Rewrite_Modeid(uint8_t *modeid,uint8_t software,uint8_t hardware) void Rewrite_Modeid(uint8_t *modeid,uint8_t software,uint8_t hardware)
{ {
uint8_t Modeid_Temp[] = "3AFE101003008611" ; uint8_t Modeid_Temp[] = "3AFE101003008611" ;
...@@ -186,6 +189,7 @@ void Rewrite_Modeid(uint8_t *modeid,uint8_t software,uint8_t hardware) ...@@ -186,6 +189,7 @@ void Rewrite_Modeid(uint8_t *modeid,uint8_t software,uint8_t hardware)
iKonkeAfSelfPrint("Finish Rewrite Modeid :\r\n"); iKonkeAfSelfPrint("Finish Rewrite Modeid :\r\n");
iKonkeAfSelfPrintBuffer(Modeid_Temp,sizeof(Modeid_Temp)-1,1); iKonkeAfSelfPrintBuffer(Modeid_Temp,sizeof(Modeid_Temp)-1,1);
} }
typedef struct { typedef struct {
_IO uint8_t src_endpoint; _IO uint8_t src_endpoint;
_IO uint16_t group_id; _IO uint16_t group_id;
...@@ -425,6 +429,10 @@ void kUserNetworkStatusNotify(NwkStatusEnum nwkst ) ...@@ -425,6 +429,10 @@ void kUserNetworkStatusNotify(NwkStatusEnum nwkst )
//恢复所有绑定属性上报使能 //恢复所有绑定属性上报使能
//kSystemSetupStatusSet(SETUP_STATUS_EXIT, 10); //kSystemSetupStatusSet(SETUP_STATUS_EXIT, 10);
Push_Netwaork_Status(IN_LINE); Push_Netwaork_Status(IN_LINE);
kGetBindConfigInfo();
iKonkeAfSelfPrint("mac 1,falge=%d mac=%x-%x-%x\r\n",Bind_Addr_Table.bind_flag1, Bind_Addr_Table.addr1[0], Bind_Addr_Table.addr1[1],Bind_Addr_Table.addr1[3]);
iKonkeAfSelfPrint("mac 2,falge=%d mac=%x-%x-%x\r\n",Bind_Addr_Table.bind_flag2, Bind_Addr_Table.addr1[0], Bind_Addr_Table.addr2[1],Bind_Addr_Table.addr2[3]);
emberEventControlSetActive(ikkGetBindInfoEventControl); emberEventControlSetActive(ikkGetBindInfoEventControl);
iKonkeAfSelfPrint("Joined Network RandTime(%dms) CurrentTime(%ld)\r\n", randTimeMS, currentTimeMS); iKonkeAfSelfPrint("Joined Network RandTime(%dms) CurrentTime(%ld)\r\n", randTimeMS, currentTimeMS);
...@@ -445,6 +453,7 @@ void kUserNetworkStatusNotify(NwkStatusEnum nwkst ) ...@@ -445,6 +453,7 @@ void kUserNetworkStatusNotify(NwkStatusEnum nwkst )
case (ENS_LEAVED): case (ENS_LEAVED):
{ {
Push_Netwaork_Status(OUT_LINE); Push_Netwaork_Status(OUT_LINE);
Reset_Binding_Token();
//network leave open led blink when humanbody exist //network leave open led blink when humanbody exist
//打开打扰模式,即感应到人后快闪2次 //打开打扰模式,即感应到人后快闪2次
kSetIndicatorNotDisturbModeFlg(false); kSetIndicatorNotDisturbModeFlg(false);
...@@ -723,11 +732,11 @@ bool kZclClusterReportChangeCallback(uint8_t endpoint, EmberAfClusterId clusterI ...@@ -723,11 +732,11 @@ bool kZclClusterReportChangeCallback(uint8_t endpoint, EmberAfClusterId clusterI
emberEventControlSetInactive(kTargetTemperDelayReportAttrEventControl); emberEventControlSetInactive(kTargetTemperDelayReportAttrEventControl);
} }
//有多控绑定发给其它子设备, 不发给网关 //有多控绑定发给其它子设备, 不发给网关
if( kZclNodeIsBindNotGatewayIeeeAddress(endpoint, ZCL_OPT_TUNNEL_CLUSTER_ID) == true) { // if( kZclNodeIsBindNotGatewayIeeeAddress(endpoint, ZCL_OPT_TUNNEL_CLUSTER_ID) == true) {
iKonkeAfSelfPrint("Multi Control,none report gateway!!!\r\n"); // iKonkeAfSelfPrint("Multi Control,none report gateway!!!\r\n");
//kOptTunnelReportingPlagiarizeOriginal(endpoint, clusterId, attributeId, CLUSTER_MASK_SERVER); // //kOptTunnelReportingPlagiarizeOriginal(endpoint, clusterId, attributeId, CLUSTER_MASK_SERVER);
return false; // return false;
} // }
//kZclClusterSetPermitReportInfo(endpoint, clusterId, true, false, true, false); //kZclClusterSetPermitReportInfo(endpoint, clusterId, true, false, true, false);
return true; return true;
} }
...@@ -965,7 +974,9 @@ kk_err_t kUserOODMessageIncoming(uint8_t channel, uint8_t opcode, uint8_t args_i ...@@ -965,7 +974,9 @@ kk_err_t kUserOODMessageIncoming(uint8_t channel, uint8_t opcode, uint8_t args_i
} }
iKonkeAfSelfPrint("--------------------------------------\r\n"); //test iKonkeAfSelfPrint("--------------------------------------\r\n"); //test
if( g_sDevice_Info.mcu_software_version == 0xff) //未读取到版本,重新请求一次 if( (g_sDevice_Info.mcu_software_version == 0xff) || //未读取到版本,重新请求一次
((g_sDevice_Info.Device_Type == Device_Type_Air_Condition)&&(g_sDevice_Info.Device_subType == 0)&&
(sDevice_attr_last.air_condition.air_brand == 0xff) ) ) //未读到空调品牌
{ {
Query_MCU_Info(); Query_MCU_Info();
Rewite_Attr_Witchout_Report(); Rewite_Attr_Witchout_Report();
...@@ -974,62 +985,56 @@ kk_err_t kUserOODMessageIncoming(uint8_t channel, uint8_t opcode, uint8_t args_i ...@@ -974,62 +985,56 @@ kk_err_t kUserOODMessageIncoming(uint8_t channel, uint8_t opcode, uint8_t args_i
case (0x00): // get the device snap. case (0x00): // get the device snap.
{ {
uint8_t i = 0; uint8_t i = 0;
if(g_sDevice_Info.Device_Type == 1)
{ args_in_out[i++] = sDevice_attr_last.air_condition.error;
args_in_out[i++] = sDevice_attr_last.air_condition.error; args_in_out[i++] = g_sDevice_Info.mcu_software_version;
args_in_out[i++] = g_sDevice_Info.mcu_software_version; args_in_out[i++] = g_sDevice_Info.mcu_hardware_version;
args_in_out[i++] = g_sDevice_Info.mcu_hardware_version; args_in_out[i++] = sDevice_attr_last.air_condition.on_off;
args_in_out[i++] = sDevice_attr_last.air_condition.on_off; args_in_out[i++] = sDevice_attr_last.air_condition.system_type;
args_in_out[i++] = sDevice_attr_last.air_condition.system_type; args_in_out[i++] = sDevice_attr_last.air_condition.set_temperature>>8;
args_in_out[i++] = sDevice_attr_last.air_condition.set_temperature>>8; args_in_out[i++] = sDevice_attr_last.air_condition.set_temperature&0xff;
args_in_out[i++] = sDevice_attr_last.air_condition.set_temperature&0xff; args_in_out[i++] = sDevice_attr_last.air_condition.real_temperature>>8;
args_in_out[i++] = sDevice_attr_last.air_condition.real_temperature>>8; args_in_out[i++] = sDevice_attr_last.air_condition.real_temperature&0xff;
args_in_out[i++] = sDevice_attr_last.air_condition.real_temperature&0xff; args_in_out[i++] = sDevice_attr_last.air_condition.wind_speed;
args_in_out[i++] = sDevice_attr_last.air_condition.wind_speed; args_in_out[i++] = sDevice_attr_last.air_condition.power_off_time;
args_in_out[i++] = sDevice_attr_last.air_condition.power_off_time; args_in_out[i++] = sDevice_attr_last.air_condition.lock_flage;
args_in_out[i++] = sDevice_attr_last.air_condition.lock_flage; args_in_out[i++] = sDevice_attr_last.air_condition.correct_temperature;
args_in_out[i++] = sDevice_attr_last.air_condition.correct_temperature; args_in_out[i++] = sDevice_attr_last.air_condition.screen_save_time;
args_in_out[i++] = sDevice_attr_last.air_condition.screen_save_time; args_in_out[i++] = (g_sDevice_Info.is_support_winddirect)?(sDevice_attr_last.air_condition.air_wind_direct):(0xff);
args_in_out[i++] = sDevice_attr_last.air_condition.air_wind_direct; args_in_out[i++] = sDevice_attr_last.air_condition.filter_wash_time >>8;
args_in_out[i++] = sDevice_attr_last.air_condition.filter_wash_time >>8; args_in_out[i++] = sDevice_attr_last.air_condition.filter_wash_time &0xff;
args_in_out[i++] = sDevice_attr_last.air_condition.filter_wash_time &0xff; args_in_out[i++] = sDevice_attr_last.air_condition.no_disturb_mode;
args_in_out[i++] = sDevice_attr_last.air_condition.no_disturb_mode; //空调线控器
} args_in_out[i++] = sDevice_attr_last.air_condition.air_brand;
else if( g_sDevice_Info.Device_Type == 2) args_in_out[i++] = sDevice_attr_last.air_condition.air_type;
{
args_in_out[i++] = sDevice_attr_last.floor_heating.error; args_in_out[i++] = sDevice_attr_last.floor_heating.error;
args_in_out[i++] = g_sDevice_Info.mcu_software_version; args_in_out[i++] = sDevice_attr_last.floor_heating.on_off;
args_in_out[i++] = g_sDevice_Info.mcu_hardware_version; args_in_out[i++] = sDevice_attr_last.floor_heating.system_type;
args_in_out[i++] = sDevice_attr_last.floor_heating.on_off; args_in_out[i++] = sDevice_attr_last.floor_heating.set_temperature>>8;
args_in_out[i++] = sDevice_attr_last.floor_heating.system_type; args_in_out[i++] = sDevice_attr_last.floor_heating.set_temperature&0xff;
args_in_out[i++] = sDevice_attr_last.floor_heating.set_temperature>>8; args_in_out[i++] = sDevice_attr_last.floor_heating.real_temperature>>8;
args_in_out[i++] = sDevice_attr_last.floor_heating.set_temperature&0xff; args_in_out[i++] = sDevice_attr_last.floor_heating.real_temperature&0xff;
args_in_out[i++] = sDevice_attr_last.floor_heating.real_temperature>>8; args_in_out[i++] = sDevice_attr_last.floor_heating.power_off_time;
args_in_out[i++] = sDevice_attr_last.floor_heating.real_temperature&0xff; args_in_out[i++] = sDevice_attr_last.floor_heating.lock_flage;
args_in_out[i++] = sDevice_attr_last.floor_heating.power_off_time; args_in_out[i++] = sDevice_attr_last.floor_heating.correct_temperature;
args_in_out[i++] = sDevice_attr_last.floor_heating.lock_flage; args_in_out[i++] = sDevice_attr_last.floor_heating.screen_save_time;
args_in_out[i++] = sDevice_attr_last.floor_heating.correct_temperature; args_in_out[i++] = sDevice_attr_last.floor_heating.no_disturb_mode;
args_in_out[i++] = sDevice_attr_last.floor_heating.screen_save_time;
args_in_out[i++] = sDevice_attr_last.floor_heating.no_disturb_mode; args_in_out[i++] = sDevice_attr_last.fan.error;
} args_in_out[i++] = sDevice_attr_last.fan.on_off;
else if( g_sDevice_Info.Device_Type == 3) args_in_out[i++] = sDevice_attr_last.fan.system_type;
{ args_in_out[i++] = sDevice_attr_last.fan.real_temperature>>8;
args_in_out[i++] = sDevice_attr_last.fan.error; args_in_out[i++] = sDevice_attr_last.fan.real_temperature&0xff;
args_in_out[i++] = g_sDevice_Info.mcu_software_version; args_in_out[i++] = sDevice_attr_last.fan.wind_speed;
args_in_out[i++] = g_sDevice_Info.mcu_hardware_version; args_in_out[i++] = sDevice_attr_last.fan.power_off_time;
args_in_out[i++] = sDevice_attr_last.fan.on_off; args_in_out[i++] = sDevice_attr_last.fan.lock_flage;
args_in_out[i++] = sDevice_attr_last.fan.system_type; args_in_out[i++] = sDevice_attr_last.fan.correct_temperature;
args_in_out[i++] = sDevice_attr_last.fan.real_temperature>>8; args_in_out[i++] = sDevice_attr_last.fan.screen_save_time;
args_in_out[i++] = sDevice_attr_last.fan.real_temperature&0xff; args_in_out[i++] = sDevice_attr_last.fan.filter_wash_time >>8;
args_in_out[i++] = sDevice_attr_last.fan.wind_speed; args_in_out[i++] = sDevice_attr_last.fan.filter_wash_time &0xff;
args_in_out[i++] = sDevice_attr_last.fan.power_off_time; args_in_out[i++] = sDevice_attr_last.fan.no_disturb_mode;
args_in_out[i++] = sDevice_attr_last.fan.lock_flage;
args_in_out[i++] = sDevice_attr_last.fan.correct_temperature;
args_in_out[i++] = sDevice_attr_last.fan.screen_save_time;
args_in_out[i++] = sDevice_attr_last.fan.filter_wash_time >>8;
args_in_out[i++] = sDevice_attr_last.fan.filter_wash_time &0xff;
args_in_out[i++] = sDevice_attr_last.fan.no_disturb_mode;
}
iKonkeAfSelfPrint("OOOOOOPCODE: 1(%d), 2(%d), 3(%d)\r\n", args_in_out[1], args_in_out[2], args_in_out[3]); iKonkeAfSelfPrint("OOOOOOPCODE: 1(%d), 2(%d), 3(%d)\r\n", args_in_out[1], args_in_out[2], args_in_out[3]);
*length_in_out = i; *length_in_out = i;
break; break;
...@@ -1058,7 +1063,10 @@ kk_err_t kUserOODMessageIncoming(uint8_t channel, uint8_t opcode, uint8_t args_i ...@@ -1058,7 +1063,10 @@ kk_err_t kUserOODMessageIncoming(uint8_t channel, uint8_t opcode, uint8_t args_i
args_in_out[0] = ERR_NO_COMMAND_FORMAT; args_in_out[0] = ERR_NO_COMMAND_FORMAT;
}else { }else {
kSetIndicatorNotDisturbModeFlg(mode); kSetIndicatorNotDisturbModeFlg(mode);
Set_No_Disturb_Mode(mode); if(channel == 0)
Set_No_Disturb_Mode(g_sDevice_Info.Device_Type,mode);
else
Set_No_Disturb_Mode(channel,mode);
args_in_out[0] = ERR_NO_NONE; args_in_out[0] = ERR_NO_NONE;
} }
iKonkeAfSelfPrint("Disturb Mode(%d)\r\n", mode); iKonkeAfSelfPrint("Disturb Mode(%d)\r\n", mode);
...@@ -1106,6 +1114,7 @@ void kkSystemSetUpEventHandler(void ) ...@@ -1106,6 +1114,7 @@ void kkSystemSetUpEventHandler(void )
{ {
case SETUP_STATUS_INIT: case SETUP_STATUS_INIT:
if( emberAfNetworkState() == EMBER_JOINED_NETWORK ) { if( emberAfNetworkState() == EMBER_JOINED_NETWORK ) {
}else { }else {
} }
iKonkeAfSelfPrint("System setup event.\r\n"); iKonkeAfSelfPrint("System setup event.\r\n");
...@@ -1317,7 +1326,7 @@ void Process_Device_TypeCallback(uint8_t device_type,uint8_t device_subtype) ...@@ -1317,7 +1326,7 @@ void Process_Device_TypeCallback(uint8_t device_type,uint8_t device_subtype)
{ {
case Device_Type_Air_Condition: case Device_Type_Air_Condition:
{ {
modeid = MODEID_FAN_CONTROL_PANNEL; modeid = MODEID_AIR_MEIDI;
} }
break; break;
case Device_Type_Floor_Heating: case Device_Type_Floor_Heating:
......
...@@ -475,7 +475,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -475,7 +475,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
if(sDevice_attr_last.air_condition.on_off != device_attr->on_off) if(sDevice_attr_last.air_condition.on_off != device_attr->on_off)
{ {
iKonkeAfSelfPrint("on-off current = %d,last = %d\r\n",device_attr->on_off,sDevice_attr_last.air_condition.on_off); iKonkeAfSelfPrint("on-off current = %d,last = %d\r\n",device_attr->on_off,sDevice_attr_last.air_condition.on_off);
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
if(Is_Recall_Scense_Cmd(channel_id,ZCL_ON_OFF_CLUSTER_ID)) if(Is_Recall_Scense_Cmd(channel_id,ZCL_ON_OFF_CLUSTER_ID))
kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, true, false, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, true, false, false);
else else
...@@ -487,6 +487,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -487,6 +487,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_ON_OFF, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_ON_OFF,
CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_ON_OFF_CLUSTER_ID,ZCL_ON_OFF_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.air_condition.on_off = device_attr->on_off; sDevice_attr_last.air_condition.on_off = device_attr->on_off;
} }
...@@ -501,7 +505,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -501,7 +505,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
temp = temp*10; temp = temp*10;
real_temper = 65536 - temp; real_temper = 65536 - temp;
} }
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
...@@ -510,6 +514,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -510,6 +514,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Current_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Current_Temperature,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
} }
iKonkeAfSelfPrint("real_temperature current = %d,last = %d\r\n", iKonkeAfSelfPrint("real_temperature current = %d,last = %d\r\n",
device_attr->real_temperature,sDevice_attr_last.air_condition.real_temperature); device_attr->real_temperature,sDevice_attr_last.air_condition.real_temperature);
...@@ -519,7 +527,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -519,7 +527,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
{ {
int16s set_temper = 0; int16s set_temper = 0;
set_temper = (device_attr->set_temperature)*10; set_temper = (device_attr->set_temperature)*10;
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID)) if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID))
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, true, false, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, true, false, false);
else else
...@@ -531,6 +539,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -531,6 +539,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Target_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Target_Temperature,
CLUSTER_MASK_SERVER,(uint8_t *)&set_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&set_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&set_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
} }
iKonkeAfSelfPrint("set_temperature current = %d,last = %d\r\n", iKonkeAfSelfPrint("set_temperature current = %d,last = %d\r\n",
device_attr->set_temperature,sDevice_attr_last.air_condition.set_temperature); device_attr->set_temperature,sDevice_attr_last.air_condition.set_temperature);
...@@ -538,18 +550,21 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -538,18 +550,21 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.system_type != device_attr->system_type) if(sDevice_attr_last.air_condition.system_type != device_attr->system_type)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID)) if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID))
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, true, false, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, false, false);
else else
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_SYSTEM_MODE_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_SYSTEM_MODE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false ,false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode,
CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_SYSTEM_MODE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
iKonkeAfSelfPrint("system_type current = %d,last = %d\r\n", iKonkeAfSelfPrint("system_type current = %d,last = %d\r\n",
device_attr->system_type,sDevice_attr_last.air_condition.system_type); device_attr->system_type,sDevice_attr_last.air_condition.system_type);
...@@ -557,7 +572,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -557,7 +572,7 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.wind_speed != device_attr->wind_speed) if(sDevice_attr_last.air_condition.wind_speed != device_attr->wind_speed)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_FAN_CONTROL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_FAN_CONTROL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_FAN_CONTROL_CLUSTER_ID,ZCL_FAN_CONTROL_FAN_MODE_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_FAN_CONTROL_CLUSTER_ID,ZCL_FAN_CONTROL_FAN_MODE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE);
...@@ -566,6 +581,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -566,6 +581,10 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Fan_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Fan_Mode,
CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_FAN_CONTROL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_FAN_CONTROL_CLUSTER_ID,ZCL_FAN_CONTROL_FAN_MODE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
iKonkeAfSelfPrint("wind_speed current = %d,last = %d\r\n", iKonkeAfSelfPrint("wind_speed current = %d,last = %d\r\n",
device_attr->wind_speed,sDevice_attr_last.air_condition.wind_speed); device_attr->wind_speed,sDevice_attr_last.air_condition.wind_speed);
...@@ -573,14 +592,14 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -573,14 +592,14 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.error != device_attr->error) if(sDevice_attr_last.air_condition.error != device_attr->error)
{ {
if(channel_id == 1) if(channel_id == g_sDevice_Info.Device_Type)
{ {
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code,
CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code,
CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
...@@ -589,14 +608,14 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -589,14 +608,14 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
if(sDevice_attr_last.air_condition.lock_flage != device_attr->lock_flage) if(sDevice_attr_last.air_condition.lock_flage != device_attr->lock_flage)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
EmberAfStatus status = emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock, EmberAfStatus status = emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock,
CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
iKonkeAfSelfPrint("write result =0x%x\r\n",status); iKonkeAfSelfPrint("write result =0x%x\r\n",status);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock,
CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
...@@ -604,13 +623,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -604,13 +623,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.power_off_time != device_attr->power_off_time) if(sDevice_attr_last.air_condition.power_off_time != device_attr->power_off_time)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off,
CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off,
CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
...@@ -618,13 +637,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -618,13 +637,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.air_wind_direct != device_attr->air_wind_direct) if(sDevice_attr_last.air_condition.air_wind_direct != device_attr->air_wind_direct)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Swing_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Swing_Mode,
CLUSTER_MASK_SERVER,&device_attr->air_wind_direct,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->air_wind_direct,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Swing_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Swing_Mode,
CLUSTER_MASK_SERVER,&device_attr->air_wind_direct,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->air_wind_direct,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
...@@ -633,13 +652,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -633,13 +652,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
if(sDevice_attr_last.air_condition.screen_save_time != device_attr->screen_save_time) if(sDevice_attr_last.air_condition.screen_save_time != device_attr->screen_save_time)
{ {
uint8_t screen_save = device_attr->screen_save_time; uint8_t screen_save = device_attr->screen_save_time;
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time,
CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time,
CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
...@@ -647,13 +666,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -647,13 +666,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.filter_wash_time != device_attr->filter_wash_time) if(sDevice_attr_last.air_condition.filter_wash_time != device_attr->filter_wash_time)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time,
CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time,
CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE);
} }
...@@ -661,13 +680,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -661,13 +680,13 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.correct_temperature != device_attr->correct_temperature) if(sDevice_attr_last.air_condition.correct_temperature != device_attr->correct_temperature)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_CALIBRATION_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_CALIBRATION_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Calibration_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Calibration_Temperature,
CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE);
} }
...@@ -675,19 +694,27 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a ...@@ -675,19 +694,27 @@ void AirAttributeChangedReceiveReport(uint8_t channel_id , AIR_ATTR_ST *device_a
} }
if(sDevice_attr_last.air_condition.no_disturb_mode != device_attr->no_disturb_mode) if(sDevice_attr_last.air_condition.no_disturb_mode != device_attr->no_disturb_mode)
{ {
if(channel_id == 1){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode,
CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode,
CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.air_condition.no_disturb_mode = device_attr->no_disturb_mode; sDevice_attr_last.air_condition.no_disturb_mode = device_attr->no_disturb_mode;
} }
print_all_attr_vaule(1); if(sDevice_attr_last.air_condition.air_brand != device_attr->air_brand)
{
sDevice_attr_last.air_condition.air_brand = device_attr->air_brand;
}
if(sDevice_attr_last.air_condition.no_disturb_mode != device_attr->no_disturb_mode)
{
sDevice_attr_last.air_condition.air_type = device_attr->air_type;
}
print_all_attr_vaule(channel_id);
} }
void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATING_ATTR *device_attr) void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATING_ATTR *device_attr)
...@@ -707,7 +734,7 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -707,7 +734,7 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
/**************************************Z3标准上报**************************************************/ /**************************************Z3标准上报**************************************************/
if(sDevice_attr_last.floor_heating.on_off != device_attr->on_off) if(sDevice_attr_last.floor_heating.on_off != device_attr->on_off)
{ {
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
if(Is_Recall_Scense_Cmd(channel_id,ZCL_ON_OFF_CLUSTER_ID)) if(Is_Recall_Scense_Cmd(channel_id,ZCL_ON_OFF_CLUSTER_ID))
kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, true, false, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, true, false, false);
else else
...@@ -719,6 +746,10 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -719,6 +746,10 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_ON_OFF, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_ON_OFF,
CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_ON_OFF_CLUSTER_ID,ZCL_ON_OFF_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.floor_heating.on_off = device_attr->on_off; sDevice_attr_last.floor_heating.on_off = device_attr->on_off;
} }
...@@ -733,7 +764,7 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -733,7 +764,7 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
temp = temp*10; temp = temp*10;
real_temper = 65536 - temp; real_temper = 65536 - temp;
} }
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
...@@ -742,6 +773,10 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -742,6 +773,10 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Current_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Current_Temperature,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
} }
iKonkeAfSelfPrint("real_temperature current = %d,last = %d\r\n", iKonkeAfSelfPrint("real_temperature current = %d,last = %d\r\n",
device_attr->real_temperature,sDevice_attr_last.floor_heating.real_temperature); device_attr->real_temperature,sDevice_attr_last.floor_heating.real_temperature);
...@@ -750,7 +785,7 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -750,7 +785,7 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
if(sDevice_attr_last.floor_heating.set_temperature != device_attr->set_temperature) if(sDevice_attr_last.floor_heating.set_temperature != device_attr->set_temperature)
{ {
int16s set_temper = device_attr->set_temperature*10; int16s set_temper = device_attr->set_temperature*10;
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID)) if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID))
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, true, false, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, true, false, false);
else else
...@@ -762,12 +797,16 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -762,12 +797,16 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Target_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Target_Temperature,
CLUSTER_MASK_SERVER,(uint8_t *)&set_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&set_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_OCCUPIED_HEATING_SETPOINT_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&set_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.floor_heating.set_temperature = device_attr->set_temperature; sDevice_attr_last.floor_heating.set_temperature = device_attr->set_temperature;
} }
if(sDevice_attr_last.floor_heating.system_type != device_attr->system_type) if(sDevice_attr_last.floor_heating.system_type != device_attr->system_type)
{ {
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID)) if(Is_Recall_Scense_Cmd(channel_id,ZCL_THERMOSTAT_CLUSTER_ID))
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, true, false, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, true, false, false);
else else
...@@ -779,19 +818,23 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -779,19 +818,23 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode,
CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_SYSTEM_MODE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.floor_heating.system_type = device_attr->system_type; sDevice_attr_last.floor_heating.system_type = device_attr->system_type;
} }
if(sDevice_attr_last.floor_heating.error != device_attr->error) if(sDevice_attr_last.floor_heating.error != device_attr->error)
{ {
if(channel_id == 2) if(channel_id == g_sDevice_Info.Device_Type)
{ {
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code,
CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code,
CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
...@@ -800,13 +843,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -800,13 +843,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
if(sDevice_attr_last.floor_heating.lock_flage != device_attr->lock_flage) if(sDevice_attr_last.floor_heating.lock_flage != device_attr->lock_flage)
{ {
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock,
CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock,
CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
...@@ -814,13 +857,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -814,13 +857,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
} }
if(sDevice_attr_last.floor_heating.power_off_time != device_attr->power_off_time) if(sDevice_attr_last.floor_heating.power_off_time != device_attr->power_off_time)
{ {
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off,
CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off,
CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
...@@ -829,13 +872,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -829,13 +872,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
if(sDevice_attr_last.floor_heating.screen_save_time != device_attr->screen_save_time) if(sDevice_attr_last.floor_heating.screen_save_time != device_attr->screen_save_time)
{ {
uint8_t screen_save = device_attr->screen_save_time; uint8_t screen_save = device_attr->screen_save_time;
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time,
CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time,
CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
...@@ -843,13 +886,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -843,13 +886,13 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
} }
if(sDevice_attr_last.floor_heating.correct_temperature != device_attr->correct_temperature) if(sDevice_attr_last.floor_heating.correct_temperature != device_attr->correct_temperature)
{ {
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_THERMOSTAT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_CALIBRATION_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_THERMOSTAT_CLUSTER_ID,ZCL_LOCAL_TEMPERATURE_CALIBRATION_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Calibration_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Calibration_Temperature,
CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE);
} }
...@@ -857,19 +900,19 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN ...@@ -857,19 +900,19 @@ void FloorHeatingAttributeChangedReceiveReport(uint8_t channel_id , FLOOR_HEATIN
} }
if(sDevice_attr_last.floor_heating.no_disturb_mode != device_attr->no_disturb_mode) if(sDevice_attr_last.floor_heating.no_disturb_mode != device_attr->no_disturb_mode)
{ {
if(channel_id == 2){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode,
CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode,
CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.floor_heating.no_disturb_mode = device_attr->no_disturb_mode; sDevice_attr_last.floor_heating.no_disturb_mode = device_attr->no_disturb_mode;
} }
print_all_attr_vaule(2); print_all_attr_vaule(channel_id);
} }
void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_attr) void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_attr)
{ {
...@@ -888,7 +931,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -888,7 +931,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
/**************************************Z3标准上报**************************************************/ /**************************************Z3标准上报**************************************************/
if(sDevice_attr_last.fan.on_off != device_attr->on_off) if(sDevice_attr_last.fan.on_off != device_attr->on_off)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
if(Is_Recall_Scense_Cmd(channel_id,ZCL_ON_OFF_CLUSTER_ID)) if(Is_Recall_Scense_Cmd(channel_id,ZCL_ON_OFF_CLUSTER_ID))
kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, true, false, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, true, false, false);
else else
...@@ -900,6 +943,9 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -900,6 +943,9 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_ON_OFF, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_ON_OFF,
CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_ON_OFF_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_ON_OFF_CLUSTER_ID,ZCL_ON_OFF_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->on_off,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.fan.on_off = device_attr->on_off; sDevice_attr_last.fan.on_off = device_attr->on_off;
} }
...@@ -914,7 +960,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -914,7 +960,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
temp = temp*10; temp = temp*10;
real_temper = 65536 - temp; real_temper = 65536 - temp;
} }
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_TEMP_MEASUREMENT_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_TEMP_MEASUREMENT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_TEMP_MEASUREMENT_CLUSTER_ID,ZCL_TEMP_MEASURED_VALUE_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_TEMP_MEASUREMENT_CLUSTER_ID,ZCL_TEMP_MEASURED_VALUE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
...@@ -923,19 +969,22 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -923,19 +969,22 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Current_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Current_Temperature,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_TEMP_MEASUREMENT_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_TEMP_MEASUREMENT_CLUSTER_ID,ZCL_TEMP_MEASURED_VALUE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,(uint8_t *)&real_temper,ZCL_INT16S_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.fan.real_temperature = device_attr->real_temperature; sDevice_attr_last.fan.real_temperature = device_attr->real_temperature;
} }
if(sDevice_attr_last.fan.system_type != device_attr->system_type) if(sDevice_attr_last.fan.system_type != device_attr->system_type)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode,
CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_System_Mode,
CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->system_type,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
...@@ -943,7 +992,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -943,7 +992,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
} }
if(sDevice_attr_last.fan.wind_speed != device_attr->wind_speed) if(sDevice_attr_last.fan.wind_speed != device_attr->wind_speed)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_FAN_CONTROL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_FAN_CONTROL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_FAN_CONTROL_CLUSTER_ID,ZCL_FAN_CONTROL_FAN_MODE_ATTRIBUTE_ID, emberAfWriteAttribute(channel_id,ZCL_FAN_CONTROL_CLUSTER_ID,ZCL_FAN_CONTROL_FAN_MODE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE);
...@@ -952,19 +1001,23 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -952,19 +1001,23 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Fan_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Fan_Mode,
CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE);
kZclClusterSetPermitReportInfo(channel_id, ZCL_FAN_CONTROL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_FAN_CONTROL_CLUSTER_ID,ZCL_FAN_CONTROL_FAN_MODE_ATTRIBUTE_ID,
CLUSTER_MASK_SERVER,&device_attr->wind_speed,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.fan.wind_speed = device_attr->wind_speed; sDevice_attr_last.fan.wind_speed = device_attr->wind_speed;
} }
if(sDevice_attr_last.fan.error != device_attr->error) if(sDevice_attr_last.fan.error != device_attr->error)
{ {
if(channel_id == 3) if(channel_id == g_sDevice_Info.Device_Type)
{ {
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code,
CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Error_Code,
CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->error,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
...@@ -973,13 +1026,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -973,13 +1026,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
if(sDevice_attr_last.fan.lock_flage != device_attr->lock_flage) if(sDevice_attr_last.fan.lock_flage != device_attr->lock_flage)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock,
CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Child_Lock,
CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->lock_flage,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
...@@ -987,13 +1040,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -987,13 +1040,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
} }
if(sDevice_attr_last.fan.power_off_time != device_attr->power_off_time) if(sDevice_attr_last.fan.power_off_time != device_attr->power_off_time)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off,
CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Delay_Off,
CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->power_off_time,ZCL_INT8U_ATTRIBUTE_TYPE);
} }
...@@ -1002,13 +1055,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -1002,13 +1055,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
if(sDevice_attr_last.fan.screen_save_time != device_attr->screen_save_time) if(sDevice_attr_last.fan.screen_save_time != device_attr->screen_save_time)
{ {
uint8_t screen_save = device_attr->screen_save_time; uint8_t screen_save = device_attr->screen_save_time;
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time,
CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Screen_Saver_Time,
CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&screen_save,ZCL_ENUM8_ATTRIBUTE_TYPE);
} }
...@@ -1016,13 +1069,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -1016,13 +1069,13 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
} }
if(sDevice_attr_last.fan.filter_wash_time != device_attr->filter_wash_time) if(sDevice_attr_last.fan.filter_wash_time != device_attr->filter_wash_time)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time,
CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Filter_Clean_Time,
CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,(uint8_t *)&device_attr->filter_wash_time,ZCL_INT16U_ATTRIBUTE_TYPE);
} }
...@@ -1030,7 +1083,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -1030,7 +1083,7 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
} }
if(sDevice_attr_last.fan.correct_temperature != device_attr->correct_temperature) if(sDevice_attr_last.fan.correct_temperature != device_attr->correct_temperature)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Calibration_Temperature, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_Calibration_Temperature,
CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->correct_temperature,ZCL_INT8S_ATTRIBUTE_TYPE);
...@@ -1044,19 +1097,19 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a ...@@ -1044,19 +1097,19 @@ void FanAttributeChangedReceiveReport(uint8_t channel_id , FAN_ATTR_ST *device_a
} }
if(sDevice_attr_last.fan.no_disturb_mode != device_attr->no_disturb_mode) if(sDevice_attr_last.fan.no_disturb_mode != device_attr->no_disturb_mode)
{ {
if(channel_id == 3){ if(channel_id == g_sDevice_Info.Device_Type){
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, false);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode,
CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
else{ else{
kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, false, true); kZclClusterSetPermitReportInfo(channel_id, ZCL_OPT_TUNNEL_CLUSTER_ID, true, false, true, true);
emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode, emberAfWriteAttribute(channel_id,ZCL_OPT_TUNNEL_CLUSTER_ID,FCC0_ATTR_No_Disturb_Mode,
CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE); CLUSTER_MASK_SERVER,&device_attr->no_disturb_mode,ZCL_BOOLEAN_ATTRIBUTE_TYPE);
} }
sDevice_attr_last.fan.no_disturb_mode = device_attr->no_disturb_mode; sDevice_attr_last.fan.no_disturb_mode = device_attr->no_disturb_mode;
} }
print_all_attr_vaule(3); print_all_attr_vaule(channel_id);
} }
extern void JoinCompleteCallback(NwkJoinCompltEnum nwkcomplt ); extern void JoinCompleteCallback(NwkJoinCompltEnum nwkcomplt );
...@@ -1135,11 +1188,11 @@ void Command_Process_Handler(DATA_FIELDED *Data_Field) ...@@ -1135,11 +1188,11 @@ void Command_Process_Handler(DATA_FIELDED *Data_Field)
//处理设备类型回调函数 //处理设备类型回调函数
Process_Device_TypeCallback(g_sDevice_Info.Device_Type,g_sDevice_Info.Device_subType); Process_Device_TypeCallback(g_sDevice_Info.Device_Type,g_sDevice_Info.Device_subType);
if(g_sDevice_Info.Device_Type == 1) if(channel_id == 1)
AirAttributeChangedReceiveReport(channel_id,(AIR_ATTR_ST *)&Data_Field->uiPaload[5]); AirAttributeChangedReceiveReport(channel_id,(AIR_ATTR_ST *)&Data_Field->uiPaload[5]);
else if(g_sDevice_Info.Device_Type == 2) else if(channel_id == 2)
FloorHeatingAttributeChangedReceiveReport(channel_id,(FLOOR_HEATING_ATTR *)&Data_Field->uiPaload[5]); FloorHeatingAttributeChangedReceiveReport(channel_id,(FLOOR_HEATING_ATTR *)&Data_Field->uiPaload[5]);
else if(g_sDevice_Info.Device_Type == 3) else if(channel_id == 3)
FanAttributeChangedReceiveReport(channel_id,(FAN_ATTR_ST *)&Data_Field->uiPaload[5]); FanAttributeChangedReceiveReport(channel_id,(FAN_ATTR_ST *)&Data_Field->uiPaload[5]);
} }
break; break;
...@@ -1147,11 +1200,11 @@ void Command_Process_Handler(DATA_FIELDED *Data_Field) ...@@ -1147,11 +1200,11 @@ void Command_Process_Handler(DATA_FIELDED *Data_Field)
{ {
static uint32_t count = 0; static uint32_t count = 0;
iKonkeAfSelfPrint("####Test ,Receive Updata msg count =%d\r\n",count++); iKonkeAfSelfPrint("####Test ,Receive Updata msg count =%d\r\n",count++);
if(g_sDevice_Info.Device_Type == 1) if(channel_id == 1)
AirAttributeChangedReceiveReport(channel_id,(AIR_ATTR_ST *)Data_Field->uiPaload); AirAttributeChangedReceiveReport(channel_id,(AIR_ATTR_ST *)Data_Field->uiPaload);
else if(g_sDevice_Info.Device_Type == 2) else if(channel_id == 2)
FloorHeatingAttributeChangedReceiveReport(channel_id,(FLOOR_HEATING_ATTR *)Data_Field->uiPaload); FloorHeatingAttributeChangedReceiveReport(channel_id,(FLOOR_HEATING_ATTR *)Data_Field->uiPaload);
else if(g_sDevice_Info.Device_Type == 3) else if(channel_id == 3)
FanAttributeChangedReceiveReport(channel_id,(FAN_ATTR_ST *)Data_Field->uiPaload); FanAttributeChangedReceiveReport(channel_id,(FAN_ATTR_ST *)Data_Field->uiPaload);
Data_Field->ucData_Field_Len = 4; Data_Field->ucData_Field_Len = 4;
} }
...@@ -1280,14 +1333,16 @@ void Query_MCU_Info(void) ...@@ -1280,14 +1333,16 @@ void Query_MCU_Info(void)
CMD_Control_Emplement(&g_sMsgNode,g_sDevice_Info.Device_Type,OPCODE_GENERAL_MCU_DATA_QUERY,&data,1); CMD_Control_Emplement(&g_sMsgNode,g_sDevice_Info.Device_Type,OPCODE_GENERAL_MCU_DATA_QUERY,&data,1);
} }
void Binging_Info_Notify(uint8_t device_type) void Binging_Info_Notify(uint8_t bind_or_unbind,uint8_t device_type)
{ {
uint8_t data = device_type; uint8_t data[2] = 0;
CMD_Control_Emplement(&g_sMsgNode,g_sDevice_Info.Device_Type,OPCODE_GENERAL_BING_DEVICE,&data,1); data[0] = bind_or_unbind;
data[1] = device_type;
CMD_Control_Emplement(&g_sMsgNode,g_sDevice_Info.Device_Type,OPCODE_GENERAL_BING_DEVICE,data,2);
} }
void Set_No_Disturb_Mode(uint8_t mode) void Set_No_Disturb_Mode(uint8_t channel_id,uint8_t mode)
{ {
Control_MCU(&g_sMsgNode,g_sDevice_Info.Device_Type,CMD_NO_DISTURB_MODE,mode); Control_MCU(&g_sMsgNode,channel_id,CMD_NO_DISTURB_MODE,mode);
} }
void Set_LCD_OFF(void) void Set_LCD_OFF(void)
{ {
......
...@@ -94,6 +94,8 @@ typedef struct ...@@ -94,6 +94,8 @@ typedef struct
uint16_t screen_save_time; //屏保时间 uint16_t screen_save_time; //屏保时间
int8_t correct_temperature; //温度校准值 int8_t correct_temperature; //温度校准值
uint8_t no_disturb_mode; //勿扰模式 uint8_t no_disturb_mode; //勿扰模式
uint8_t air_brand; //空调品牌
uint8_t air_type; //空调类型
}__attribute__((packed))AIR_ATTR_ST; }__attribute__((packed))AIR_ATTR_ST;
typedef struct typedef struct
{ {
...@@ -163,8 +165,8 @@ typedef struct ...@@ -163,8 +165,8 @@ typedef struct
uint8_t uiPaload[50]; uint8_t uiPaload[50];
}DATA_FIELDED; }DATA_FIELDED;
void Query_MCU_Info(void); void Query_MCU_Info(void);
void Binging_Info_Notify(uint8_t device_type); void Binging_Info_Notify(uint8_t bind_or_unbind,uint8_t device_type);
void Set_No_Disturb_Mode(uint8_t mode); void Set_No_Disturb_Mode(uint8_t channel_id,uint8_t mode);
void Set_LCD_OFF(void); void Set_LCD_OFF(void);
void Set_OTA_CMD(uint8_t OTA_Status); void Set_OTA_CMD(uint8_t OTA_Status);
void Rewite_Attr_Witchout_Report(void); void Rewite_Attr_Witchout_Report(void);
......
...@@ -103,8 +103,8 @@ useHwConfigurator=true ...@@ -103,8 +103,8 @@ useHwConfigurator=true
--version:2 --version:2
} }
{setupId:token {setupId:token
application=PATH(ABSOLUTE):D:\Users\11730\SimplicityStudio\v4_workspace\KKAllToOneThermostatPanelMG21SDK665\00ikonke-app\ikk-tokens.h application=PATH(ISC_RELATIVE):00ikonke-app/ikk-tokens.h
manufacturing=PATH(ABSOLUTE):D:\Users\11730\SimplicityStudio\v4_workspace\KKAllToOneThermostatPanelMG21SDK665\00ikonke-app\ikk-mfgtokens.h manufacturing=PATH(ISC_RELATIVE):00ikonke-app/ikk-mfgtokens.h
} }
{setupId:zclAfv2 {setupId:zclAfv2
intMap:ManufacturingCode = 4712 intMap:ManufacturingCode = 4712
...@@ -157,7 +157,7 @@ beginAttrList:REPORTABLE ...@@ -157,7 +157,7 @@ beginAttrList:REPORTABLE
cl:0xFCC0, at:0x100C, di:server, mf:0x0000 cl:0xFCC0, at:0x100C, di:server, mf:0x0000
endAttrList:REPORTABLE endAttrList:REPORTABLE
beginAttributeDefaults beginAttributeDefaults
cl:0x0000, at:0x0001, di:server, mf:0x0000 => 0x10 cl:0x0000, at:0x0001, di:server, mf:0x0000 => 0x11
cl:0x0000, at:0x0003, di:server, mf:0x0000 => 0x10 cl:0x0000, at:0x0003, di:server, mf:0x0000 => 0x10
cl:0x0000, at:0x0004, di:server, mf:0x0000 => Konke cl:0x0000, at:0x0004, di:server, mf:0x0000 => Konke
cl:0x0000, at:0x0005, di:server, mf:0x0000 => 3AFE101003008611 cl:0x0000, at:0x0005, di:server, mf:0x0000 => 3AFE101003008611
...@@ -796,4 +796,4 @@ AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A] ...@@ -796,4 +796,4 @@ AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE,50 AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE,50
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_HARDWARE_VERSION,0x10 AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_HARDWARE_VERSION,0x10
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_IMAGE_TYPE_ID,17061 AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_IMAGE_TYPE_ID,17061
AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION,0x11 AppPluginOption(efr32~family[M]~series[2]~device_configuration[1]~performance[A]~radio[020]~flash[768K]~temp[I]~package[M]~pins[32]~!module+iar):EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION,0x12
...@@ -90,14 +90,14 @@ def GBL(): ...@@ -90,14 +90,14 @@ def GBL():
def OTA(): def OTA():
if not '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x11 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"': if not '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x12 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"':
sys.exit(0) sys.exit(0)
print (" ") print (" ")
print ("This creates a ZigBee OTA file if the OTA Client Policy Plugin has been enabled.") print ("This creates a ZigBee OTA file if the OTA Client Policy Plugin has been enabled.")
print ("It uses the parameters defined there. ") print ("It uses the parameters defined there. ")
print (" ") print (" ")
# wine needed by postbuild script under studio for mac/linux # wine needed by postbuild script under studio for mac/linux
IMAGE_BUILDER = '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x11 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"'.replace("\t", "\\t") IMAGE_BUILDER = '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x12 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"'.replace("\t", "\\t")
WINE_CMD = WINE.replace("cmd /C ","") if not "echo" in IMAGE_BUILDER else WINE WINE_CMD = WINE.replace("cmd /C ","") if not "echo" in IMAGE_BUILDER else WINE
OTA_COMMAND = WINE_CMD + IMAGE_BUILDER OTA_COMMAND = WINE_CMD + IMAGE_BUILDER
OTA_COMMAND = OTA_COMMAND.replace("%PROJECT_DIR%", PROJECT_DIR) OTA_COMMAND = OTA_COMMAND.replace("%PROJECT_DIR%", PROJECT_DIR)
......
...@@ -90,14 +90,14 @@ def GBL(): ...@@ -90,14 +90,14 @@ def GBL():
def OTA(): def OTA():
if not '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x10 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"': if not '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x11 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"':
sys.exit(0) sys.exit(0)
print (" ") print (" ")
print ("This creates a ZigBee OTA file if the OTA Client Policy Plugin has been enabled.") print ("This creates a ZigBee OTA file if the OTA Client Policy Plugin has been enabled.")
print ("It uses the parameters defined there. ") print ("It uses the parameters defined there. ")
print (" ") print (" ")
# wine needed by postbuild script under studio for mac/linux # wine needed by postbuild script under studio for mac/linux
IMAGE_BUILDER = '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x10 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"'.replace("\t", "\\t") IMAGE_BUILDER = '"%PROJECT_DIR%\..\\..\\..\\..\\..\\..\\SiliconLabs\\SimplicityStudio\\v4\\developer\\sdks\\gecko_sdk_suite\\v2.6\\protocol\\zigbee\\tool\\image-builder\\image-builder-windows.exe" --create "%TARGET_BPATH%.ota" --version 0x11 --manuf-id 0x1268 --image-type 17061 --tag-id 0x0000 --tag-file "%TARGET_BPATH%.gbl" --string "EBL kkAllInOneFloorHeatingMG21SDK665V1"'.replace("\t", "\\t")
WINE_CMD = WINE.replace("cmd /C ","") if not "echo" in IMAGE_BUILDER else WINE WINE_CMD = WINE.replace("cmd /C ","") if not "echo" in IMAGE_BUILDER else WINE
OTA_COMMAND = WINE_CMD + IMAGE_BUILDER OTA_COMMAND = WINE_CMD + IMAGE_BUILDER
OTA_COMMAND = OTA_COMMAND.replace("%PROJECT_DIR%", PROJECT_DIR) OTA_COMMAND = OTA_COMMAND.replace("%PROJECT_DIR%", PROJECT_DIR)
......
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
#define CUSTOMER_APPLICATION_VERSION EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION #define CUSTOMER_APPLICATION_VERSION EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION
// User options for plugin OTA Bootload Cluster Client Policy // User options for plugin OTA Bootload Cluster Client Policy
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_IMAGE_TYPE_ID 17061 #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_IMAGE_TYPE_ID 17061
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION 17 #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION 18
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_HARDWARE_VERSION 16 #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_HARDWARE_VERSION 16
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_EBL_VERIFICATION #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_EBL_VERIFICATION
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_DELETE_FAILED_DOWNLOADS #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_DELETE_FAILED_DOWNLOADS
......
...@@ -344,7 +344,7 @@ ...@@ -344,7 +344,7 @@
#define CUSTOMER_APPLICATION_VERSION EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION #define CUSTOMER_APPLICATION_VERSION EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION
// User options for plugin OTA Bootload Cluster Client Policy // User options for plugin OTA Bootload Cluster Client Policy
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_IMAGE_TYPE_ID 17061 #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_IMAGE_TYPE_ID 17061
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION 16 #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_FIRMWARE_VERSION 17
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_HARDWARE_VERSION 16 #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_HARDWARE_VERSION 16
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_EBL_VERIFICATION #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_EBL_VERIFICATION
#define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_DELETE_FAILED_DOWNLOADS #define EMBER_AF_PLUGIN_OTA_CLIENT_POLICY_DELETE_FAILED_DOWNLOADS
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
// Generated attributes // Generated attributes
#define GENERATED_ATTRIBUTES { \ #define GENERATED_ATTRIBUTES { \
{ 0x0000, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 0 / Basic / ZCL version*/\ { 0x0000, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 0 / Basic / ZCL version*/\
{ 0x0001, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x10 } }, /* 1 / Basic / application version*/\ { 0x0001, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x11 } }, /* 1 / Basic / application version*/\
{ 0x0002, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 2 / Basic / stack version*/\ { 0x0002, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x01 } }, /* 2 / Basic / stack version*/\
{ 0x0003, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x10 } }, /* 3 / Basic / hardware version*/\ { 0x0003, ZCL_INT8U_ATTRIBUTE_TYPE, 1, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)0x10 } }, /* 3 / Basic / hardware version*/\
{ 0x0004, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)&(generatedDefaults[0]) } }, /* 4 / Basic / manufacturer name*/\ { 0x0004, ZCL_CHAR_STRING_ATTRIBUTE_TYPE, 33, (ATTRIBUTE_MASK_SINGLETON), { (uint8_t*)&(generatedDefaults[0]) } }, /* 4 / Basic / manufacturer name*/\
......
...@@ -141,8 +141,16 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] = ...@@ -141,8 +141,16 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] =
{ 0x0019, (EmberAfAttributeMetadata*)&(generatedAttributes[22]), 4, 15, (CLUSTER_MASK_CLIENT| CLUSTER_MASK_INIT_FUNCTION| CLUSTER_MASK_DEFAULT_RESPONSE_FUNCTION), emberAfFuncArrayOtaBootloadClusterClient, }, \ { 0x0019, (EmberAfAttributeMetadata*)&(generatedAttributes[22]), 4, 15, (CLUSTER_MASK_CLIENT| CLUSTER_MASK_INIT_FUNCTION| CLUSTER_MASK_DEFAULT_RESPONSE_FUNCTION), emberAfFuncArrayOtaBootloadClusterClient, }, \
{ 0x0201, (EmberAfAttributeMetadata*)&(generatedAttributes[32]), 8, 12, (CLUSTER_MASK_SERVER| CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION), emberAfFuncArrayThermostatClusterServer, }, \ { 0x0201, (EmberAfAttributeMetadata*)&(generatedAttributes[32]), 8, 12, (CLUSTER_MASK_SERVER| CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION), emberAfFuncArrayThermostatClusterServer, }, \
{ 0xFCC0, (EmberAfAttributeMetadata*)&(generatedAttributes[50]), 13, 16, (CLUSTER_MASK_SERVER), NULL, }, \ { 0xFCC0, (EmberAfAttributeMetadata*)&(generatedAttributes[50]), 13, 16, (CLUSTER_MASK_SERVER), NULL, }, \
{ 0x0000, (EmberAfAttributeMetadata*)&(generatedAttributes[0]), 9, 0, (CLUSTER_MASK_SERVER), NULL, }, \
{ 0x0003, (EmberAfAttributeMetadata*)&(generatedAttributes[9]), 1, 2, (CLUSTER_MASK_CLIENT), NULL, }, \
{ 0x0003, (EmberAfAttributeMetadata*)&(generatedAttributes[10]), 2, 4, (CLUSTER_MASK_SERVER| CLUSTER_MASK_INIT_FUNCTION| CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION), emberAfFuncArrayIdentifyClusterServer, }, \
{ 0x0004, (EmberAfAttributeMetadata*)&(generatedAttributes[12]), 2, 3, (CLUSTER_MASK_SERVER| CLUSTER_MASK_INIT_FUNCTION), emberAfFuncArrayGroupsClusterServer, }, \
{ 0x0005, (EmberAfAttributeMetadata*)&(generatedAttributes[14]), 6, 8, (CLUSTER_MASK_SERVER| CLUSTER_MASK_INIT_FUNCTION), emberAfFuncArrayScenesClusterServer, }, \
{ 0x0006, (EmberAfAttributeMetadata*)&(generatedAttributes[20]), 2, 3, (CLUSTER_MASK_SERVER| CLUSTER_MASK_INIT_FUNCTION| CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION), emberAfFuncArrayOnOffClusterServer, }, \
{ 0x0019, (EmberAfAttributeMetadata*)&(generatedAttributes[22]), 4, 15, (CLUSTER_MASK_CLIENT| CLUSTER_MASK_INIT_FUNCTION| CLUSTER_MASK_DEFAULT_RESPONSE_FUNCTION), emberAfFuncArrayOtaBootloadClusterClient, }, \
{ 0x0202, (EmberAfAttributeMetadata*)&(generatedAttributes[40]), 3, 4, (CLUSTER_MASK_SERVER| CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION), emberAfFuncArrayFanControlClusterServer, }, \ { 0x0202, (EmberAfAttributeMetadata*)&(generatedAttributes[40]), 3, 4, (CLUSTER_MASK_SERVER| CLUSTER_MASK_ATTRIBUTE_CHANGED_FUNCTION), emberAfFuncArrayFanControlClusterServer, }, \
{ 0x0402, (EmberAfAttributeMetadata*)&(generatedAttributes[43]), 4, 8, (CLUSTER_MASK_SERVER), NULL, }, \ { 0x0402, (EmberAfAttributeMetadata*)&(generatedAttributes[43]), 4, 8, (CLUSTER_MASK_SERVER), NULL, }, \
{ 0xFCC0, (EmberAfAttributeMetadata*)&(generatedAttributes[50]), 13, 16, (CLUSTER_MASK_SERVER), NULL, }, \
{ 0x0021, (EmberAfAttributeMetadata*)&(generatedAttributes[26]), 6, 27, (CLUSTER_MASK_CLIENT), NULL, }, \ { 0x0021, (EmberAfAttributeMetadata*)&(generatedAttributes[26]), 6, 27, (CLUSTER_MASK_CLIENT), NULL, }, \
} }
...@@ -151,8 +159,8 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] = ...@@ -151,8 +159,8 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] =
#define GENERATED_ENDPOINT_TYPES { \ #define GENERATED_ENDPOINT_TYPES { \
{ (EmberAfCluster*)&(generatedClusters[0]), 12, 71 }, \ { (EmberAfCluster*)&(generatedClusters[0]), 12, 71 }, \
{ (EmberAfCluster*)&(generatedClusters[12]), 9, 63 }, \ { (EmberAfCluster*)&(generatedClusters[12]), 9, 63 }, \
{ (EmberAfCluster*)&(generatedClusters[21]), 2, 12 }, \ { (EmberAfCluster*)&(generatedClusters[21]), 10, 63 }, \
{ (EmberAfCluster*)&(generatedClusters[23]), 1, 27 }, \ { (EmberAfCluster*)&(generatedClusters[31]), 1, 27 }, \
} }
...@@ -175,7 +183,7 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] = ...@@ -175,7 +183,7 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] =
#define ATTRIBUTE_SINGLETONS_SIZE (90) #define ATTRIBUTE_SINGLETONS_SIZE (90)
// Total size of attribute storage // Total size of attribute storage
#define ATTRIBUTE_MAX_SIZE 173 #define ATTRIBUTE_MAX_SIZE 224
// Array of endpoints that are supported // Array of endpoints that are supported
#define FIXED_ENDPOINT_ARRAY { 1, 2, 3, 242 } #define FIXED_ENDPOINT_ARRAY { 1, 2, 3, 242 }
...@@ -317,8 +325,22 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] = ...@@ -317,8 +325,22 @@ const EmberAfGenericClusterFunction emberAfFuncArrayFanControlClusterServer[] =
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 2, 0xFCC0, 0x100A, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \ { EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 2, 0xFCC0, 0x100A, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 2, 0xFCC0, 0x100B, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \ { EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 2, 0xFCC0, 0x100B, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 2, 0xFCC0, 0x100C, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \ { EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 2, 0xFCC0, 0x100C, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0x0006, 0x0000, CLUSTER_MASK_SERVER, 0x0000, 1, 0, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0x0202, 0x0000, CLUSTER_MASK_SERVER, 0x0000, 1, 0, 0 }, \ { EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0x0202, 0x0000, CLUSTER_MASK_SERVER, 0x0000, 1, 0, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0x0402, 0x0000, CLUSTER_MASK_SERVER, 0x0000, 1, 0, 0 }, \ { EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0x0402, 0x0000, CLUSTER_MASK_SERVER, 0x0000, 1, 0, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1000, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1001, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1002, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1003, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1004, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1005, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1006, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1007, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1008, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x1009, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x100A, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x100B, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
{ EMBER_ZCL_REPORTING_DIRECTION_REPORTED, 3, 0xFCC0, 0x100C, CLUSTER_MASK_SERVER, 0x0000, 1, 65534, 0 }, \
} }
#define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (41) #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (55)
#endif // SILABS_AF_ENDPOINT_CONFIG #endif // SILABS_AF_ENDPOINT_CONFIG
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// Token header for the Reporting plugin. // Token header for the Reporting plugin.
// Custom MFG token header file // Custom MFG token header file
#include "../../KKAllToOneThermostatPanelMG21SDK665/00ikonke-app/ikk-mfgtokens.h" #include "00ikonke-app/ikk-mfgtokens.h"
#ifdef CUSTOM_TOKEN_HEADER #ifdef CUSTOM_TOKEN_HEADER
#include CUSTOM_TOKEN_HEADER #include CUSTOM_TOKEN_HEADER
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "../../../../../../SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v2.6/protocol/zigbee/app/framework/plugin/reporting/reporting-tokens.h" #include "../../../../../../SiliconLabs/SimplicityStudio/v4/developer/sdks/gecko_sdk_suite/v2.6/protocol/zigbee/app/framework/plugin/reporting/reporting-tokens.h"
// Custom token header file // Custom token header file
#include "../../KKAllToOneThermostatPanelMG21SDK665/00ikonke-app/ikk-tokens.h" #include "00ikonke-app/ikk-tokens.h"
#ifdef CUSTOM_TOKEN_HEADER #ifdef CUSTOM_TOKEN_HEADER
#include CUSTOM_TOKEN_HEADER #include CUSTOM_TOKEN_HEADER
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment