can't use report in JN5168

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

can't use report in JN5168

1,043 Views
leoxie
Contributor I

hello,every one,

      

the status was returned "E_ZCL_ERR_ATTRIBUTE_IS_SERVER" when I using "eZCL_CreateLocalReport",using "eZCL_ReportAllAttributes" can't report too.

the code is shown as follow:

/***************************************************************************** * * MODULE: JN-AN-1189 * * COMPONENT: app_reporting.c * * DESCRIPTION: ZHA Demo : Stack <-> Mains Power Outlet-App Interaction (Implementation) * **************************************************************************** * * This software is owned by NXP B.V. and/or its supplier and is protected * under applicable copyright laws. All rights are reserved. We grant You, * and any third parties, a license to use this software solely and * exclusively on NXP products [NXP Microcontrollers such as JN5168, JN5164, * JN5161, JN5148, JN5142, JN5139]. * You, and any third parties must reproduce the copyright and warranty notice * and any other legend of ownership on each copy or partial copy of the * software. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Copyright NXP B.V. 2014. All rights reserved * ***************************************************************************/ /****************************************************************************/ /*** Include files ***/ /****************************************************************************/ #include #include #include "dbg.h" #include "os.h" #include "os_gen.h" #include "pdum_gen.h" #include "pdm.h" #include "pdum_gen.h" #include "zps_gen.h" #include "zps_apl.h" #include "zps_apl_aib.h" #include "zps_nwk_sap.h" #include "app_common.h" #include "PDM_IDs.h" #include "zcl_options.h" #include "app_zbp_utilities.h" #include "zcl_common.h" #include "app_reporting.h" #include "IASZone.h" #ifdef CLD_GROUPS #include "groups.h" #include "Groups_internal.h" #endif /****************************************************************************/ /*** Macro Definitions ***/ /****************************************************************************/ #define DEBUG_REPORT #ifndef DEBUG_REPORT #define TRACE_REPORT FALSE #else #define TRACE_REPORT TRUE #endif #define NUMBER_OF_REPORTS_MAX 2 /****************************************************************************/ /*** Type Definitions ***/ /****************************************************************************/ /****************************************************************************/ /*** Local Function Prototypes ***/ /****************************************************************************/ /****************************************************************************/ /*** Exported Variables ***/ /****************************************************************************/ /****************************************************************************/ /*** Local Variables ***/ /****************************************************************************/ /*Just Two reports for time being*/ PRIVATE tsReports asSavedReports[NUMBER_OF_REPORTS_MAX]; /****************************************************************************/ /*** Exported Functions ***/ /****************************************************************************/ /**************************************************************************** * * NAME: eRestoreReports * * DESCRIPTION: * Loads the reporting information from the EEPROM/PDM * * RETURNS: * void * ****************************************************************************/ PUBLIC OS_teStatus eRestoreReports( void ) { /* Restore any report data that is previously saved to flash */ uint16 u16ByteRead; PDM_teStatus eStatusReportReload = PDM_eReadDataFromRecord(PDM_ID_APP_IASZONE_NODE, asSavedReports, sizeof(asSavedReports), &u16ByteRead); DBG_vPrintf(TRACE_REPORT,"eStatusReportReload=%d\n",eStatusReportReload); /* Restore any application data previously saved to flash */ return (eStatusReportReload); } /**************************************************************************** * * NAME: vMakeSupportedAttributesReportable * * DESCRIPTION: * Makes the attributes reportable for On Off and Level control * * RETURNS: * void * ****************************************************************************/ PUBLIC void vMakeSupportedAttributesReportable(void) { uint16 u16AttributeEnum; uint16 u16ClusterId; uint8 i; tsZCL_AttributeReportingConfigurationRecord *psAttributeReportingConfigurationRecord; DBG_vPrintf(TRACE_REPORT, "\n\r%s", __FUNCTION__); for(i = 0; i < NUMBER_OF_REPORTS_MAX; i++) { teZCL_Status eStatus; u16AttributeEnum = asSavedReports[i].sAttributeReportingConfigurationRecord.u16AttributeEnum; u16ClusterId = asSavedReports[i].u16ClusterID; psAttributeReportingConfigurationRecord = &(asSavedReports[i].sAttributeReportingConfigurationRecord); eStatus = eZCL_SetReportableFlag(1, u16ClusterId, TRUE, FALSE, u16AttributeEnum); DBG_vPrintf(TRACE_REPORT, "\n\reZCL_SetReportableFlag: %x\n", eStatus); eStatus = eZCL_CreateLocalReport(1, u16ClusterId, 0, TRUE, psAttributeReportingConfigurationRecord); DBG_vPrintf(TRACE_REPORT, "\n\reZCL_CreateLocalReport: %x\n", eStatus); } } /**************************************************************************** * * NAME: vLoadDefaultConfigForReportable * * DESCRIPTION: * Loads a default configuration * * RETURNS: * void * ****************************************************************************/ PUBLIC void vLoadDefaultConfigForReportable(void) { uint8 u8Index; /* For OnOff attribute in ON Off Cluster */ asSavedReports[0].u16ClusterID = SECURITY_AND_SAFETY_CLUSTER_ID_IASZONE; asSavedReports[0].sAttributeReportingConfigurationRecord.eAttributeDataType = E_ZCL_ENUM16; asSavedReports[0].sAttributeReportingConfigurationRecord.u16AttributeEnum = E_CLD_IASZONE_ATTR_ID_ZONE_TYPE; asSavedReports[0].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval = 2;//HA_SYSTEM_MAX_REPORT_INTERVAL; asSavedReports[0].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval = 5; //HA_SYSTEM_MIN_REPORT_INTERVAL; asSavedReports[0].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField = 0; asSavedReports[0].sAttributeReportingConfigurationRecord.u8DirectionIsReceived = 0; asSavedReports[0].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange = 0; asSavedReports[1].u16ClusterID = SECURITY_AND_SAFETY_CLUSTER_ID_IASZONE; asSavedReports[1].sAttributeReportingConfigurationRecord.eAttributeDataType = E_ZCL_BMAP16; asSavedReports[1].sAttributeReportingConfigurationRecord.u16AttributeEnum = E_CLD_IASZONE_ATTR_ID_ZONE_STATUS; asSavedReports[1].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval = 3;//HA_SYSTEM_MAX_REPORT_INTERVAL; asSavedReports[1].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval = 6; //HA_SYSTEM_MIN_REPORT_INTERVAL; asSavedReports[1].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField = 0; asSavedReports[1].sAttributeReportingConfigurationRecord.u8DirectionIsReceived = 0; asSavedReports[1].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange = 1; DBG_vPrintf(TRACE_REPORT,"\nLoaded Defaults Records \n"); for(u8Index = 0; u8Index < NUMBER_OF_REPORTS_MAX; u8Index++) { DBG_vPrintf(TRACE_REPORT,"\nCluster %d",asSavedReports[u8Index].u16ClusterID); DBG_vPrintf(TRACE_REPORT,"\nAtt Dta Type = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.eAttributeDataType); DBG_vPrintf(TRACE_REPORT,"\nAttr No = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16AttributeEnum); DBG_vPrintf(TRACE_REPORT,"\nMax = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval); DBG_vPrintf(TRACE_REPORT,"\nMin = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval); DBG_vPrintf(TRACE_REPORT,"\nTimeOut = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField); DBG_vPrintf(TRACE_REPORT,"\nDirection = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u8DirectionIsReceived); DBG_vPrintf(TRACE_REPORT,"\nChange = %d\n",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange); } /*Save this Records*/ PDM_eSaveRecordData(PDM_ID_APP_IASZONE_NODE, asSavedReports, sizeof(asSavedReports)); } /**************************************************************************** * * NAME: vSaveReportableRecord * * DESCRIPTION: * Loads a default configuration * * RETURNS: * void * ****************************************************************************/ PUBLIC void vSaveReportableRecord(uint8 u8Index,uint16 u16ClusterID, tsZCL_AttributeReportingConfigurationRecord* psAttributeReportingConfigurationRecord) { asSavedReports[u8Index].u16ClusterID = u16ClusterID; memcpy(&(asSavedReports[u8Index].sAttributeReportingConfigurationRecord),psAttributeReportingConfigurationRecord,sizeof(tsZCL_AttributeReportingConfigurationRecord)); DBG_vPrintf(TRACE_REPORT,"\nSaving Records \n"); DBG_vPrintf(TRACE_REPORT,"\nCluster %d",asSavedReports[u8Index].u16ClusterID); DBG_vPrintf(TRACE_REPORT,"\nAtt Dta Type = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.eAttributeDataType); DBG_vPrintf(TRACE_REPORT,"\nAttr No = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16AttributeEnum); DBG_vPrintf(TRACE_REPORT,"\nMax = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval); DBG_vPrintf(TRACE_REPORT,"\nMin = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval); DBG_vPrintf(TRACE_REPORT,"\nTimeOut = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField); DBG_vPrintf(TRACE_REPORT,"\nDirection = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u8DirectionIsReceived); DBG_vPrintf(TRACE_REPORT,"\nChange = %d\n\n",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange); /*Save this Records*/ PDM_eSaveRecordData(PDM_ID_APP_IASZONE_NODE, asSavedReports, sizeof(asSavedReports)); } /****************************************************************************/ /*** END OF FILE ***/ /****************************************************************************/

0 Kudos
2 Replies

621 Views
mario_castaneda
NXP TechSupport
NXP TechSupport

Hi Leo,

I was checking your code. Did you modify this define NUMBER_OF_REPORTS_MAX?

/* Only one reportable attribute that is On/Off attribute */
#define MAINS_POWER_OUTLET_NUMBER_OF_REPORTS 1

Could you please modify that value with 1?

Best Regards,

Mario

0 Kudos

621 Views
leoxie
Contributor I

Dear Mario,

thanks very much for your reply.

It's only sent a on/off report when I call "eZCL_ReportAllAttributes" in Mainpoweroutlet demo,but It's nothing is sent when I call "eZCL_ReportAllAttributes" in IAS ZONE demo.

also I try to modify MAINS_POWER_OUTLET_NUMBER_OF_REPORTS to 3 ,but still nothing is sent.

/*****************************************************************************
*
* MODULE: JN-AN-1189
*
* COMPONENT: app_reporting.c
*
* DESCRIPTION: ZHA Demo : Stack <-> Mains Power Outlet-App Interaction (Implementation)
*
****************************************************************************
*
* This software is owned by NXP B.V. and/or its supplier and is protected
* under applicable copyright laws. All rights are reserved. We grant You,
* and any third parties, a license to use this software solely and
* exclusively on NXP products [NXP Microcontrollers such as JN5168, JN5164,
* JN5161, JN5148, JN5142, JN5139].
* You, and any third parties must reproduce the copyright and warranty notice
* and any other legend of ownership on each copy or partial copy of the
* software.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Copyright NXP B.V. 2014. All rights reserved
*
***************************************************************************/
/****************************************************************************/
/*** Include files ***/
/****************************************************************************/
#include <jendefs.h>
#include <string.h>
#include "dbg.h"
#include "os.h"
#include "os_gen.h"
#include "pdum_gen.h"
#include "pdm.h"
#include "pdum_gen.h"
#include "zps_gen.h"
#include "zps_apl.h"
#include "zps_apl_aib.h"
#include "zps_nwk_sap.h"
#include "app_common.h"
#include "PDM_IDs.h"
#include "zcl_options.h"
#include "app_zbp_utilities.h"
#include "zcl_common.h"
#include "app_reporting.h"

#ifdef CLD_GROUPS
#include "groups.h"
#include "Groups_internal.h"
#endif
/****************************************************************************/
/*** Macro Definitions ***/
/****************************************************************************/
#define DEBUG_REPORT

#ifndef DEBUG_REPORT
#define TRACE_REPORT FALSE
#else
#define TRACE_REPORT TRUE
#endif

/****************************************************************************/
/*** Type Definitions ***/
/****************************************************************************/

/****************************************************************************/
/*** Local Function Prototypes ***/
/****************************************************************************/


/****************************************************************************/
/*** Exported Variables ***/
/****************************************************************************/

/****************************************************************************/
/*** Local Variables ***/
/****************************************************************************/
/*Just Two reports for time being*/
PRIVATE tsReports asSavedReports[MAINS_POWER_OUTLET_NUMBER_OF_REPORTS];

/****************************************************************************/
/*** Exported Functions ***/
/****************************************************************************/
/****************************************************************************
*
* NAME: eRestoreReports
*
* DESCRIPTION:
* Loads the reporting information from the EEPROM/PDM
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC OS_teStatus eRestoreReports( void )
{
/* Restore any report data that is previously saved to flash */
uint16 u16ByteRead;
PDM_teStatus eStatusReportReload = PDM_eReadDataFromRecord(PDM_ID_APP_REPORTS,
asSavedReports,
sizeof(asSavedReports),
&u16ByteRead);

DBG_vPrintf(TRACE_REPORT,"eStatusReportReload=%d\n",eStatusReportReload);
/* Restore any application data previously saved to flash */

return (eStatusReportReload);
}

/****************************************************************************
*
* NAME: vMakeSupportedAttributesReportable
*
* DESCRIPTION:
* Makes the attributes reportable for On Off and Level control
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void vMakeSupportedAttributesReportable(void)
{
uint16 u16AttributeEnum;
uint16 u16ClusterId;
uint8 i;

tsZCL_AttributeReportingConfigurationRecord *psAttributeReportingConfigurationRecord;

DBG_vPrintf(TRACE_REPORT, "%s\n", __FUNCTION__);

for(i = 0; i < MAINS_POWER_OUTLET_NUMBER_OF_REPORTS; i++)
{
teZCL_Status eStatus;

u16AttributeEnum = asSavedReports[i].sAttributeReportingConfigurationRecord.u16AttributeEnum;
u16ClusterId = asSavedReports[i].u16ClusterID;
psAttributeReportingConfigurationRecord = &(asSavedReports[i].sAttributeReportingConfigurationRecord);
eStatus = eZCL_SetReportableFlag(1, u16ClusterId, TRUE, FALSE, u16AttributeEnum);
DBG_vPrintf(TRACE_REPORT, "eZCL_SetReportableFlag: %d\n", eStatus);
eStatus = eZCL_CreateLocalReport(1, u16ClusterId, 0, TRUE, psAttributeReportingConfigurationRecord);
DBG_vPrintf(TRACE_REPORT, "eZCL_CreateLocalReport: %d\n", eStatus);
}
}

/****************************************************************************
*
* NAME: vLoadDefaultConfigForReportable
*
* DESCRIPTION:
* Loads a default configuration
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void vLoadDefaultConfigForReportable(void)
{
uint8 u8Index;

/* For OnOff attribute in ON Off Cluster */
asSavedReports[0].u16ClusterID = GENERAL_CLUSTER_ID_ONOFF;
asSavedReports[0].sAttributeReportingConfigurationRecord.eAttributeDataType = E_ZCL_BOOL;
asSavedReports[0].sAttributeReportingConfigurationRecord.u16AttributeEnum = E_CLD_ONOFF_ATTR_ID_ONOFF;
asSavedReports[0].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval = HA_SYSTEM_MAX_REPORT_INTERVAL;
asSavedReports[0].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval = HA_SYSTEM_MIN_REPORT_INTERVAL;
asSavedReports[0].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField = 0;
asSavedReports[0].sAttributeReportingConfigurationRecord.u8DirectionIsReceived = 0;
asSavedReports[0].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange = 10;

/* For OnOff attribute in ON Off Cluster */
asSavedReports[1].u16ClusterID = GENERAL_CLUSTER_ID_ONOFF;
asSavedReports[1].sAttributeReportingConfigurationRecord.eAttributeDataType = E_ZCL_BOOL;
asSavedReports[1].sAttributeReportingConfigurationRecord.u16AttributeEnum = E_CLD_ONOFF_ATTR_ID_GLOBAL_SCENE_CONTROL;
asSavedReports[1].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval = HA_SYSTEM_MAX_REPORT_INTERVAL;
asSavedReports[1].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval = HA_SYSTEM_MIN_REPORT_INTERVAL;
asSavedReports[1].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField = 0;
asSavedReports[1].sAttributeReportingConfigurationRecord.u8DirectionIsReceived = 0;
asSavedReports[1].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange = 12;

/* For OnOff attribute in ON Off Cluster */
asSavedReports[2].u16ClusterID = GENERAL_CLUSTER_ID_ONOFF;
asSavedReports[2].sAttributeReportingConfigurationRecord.eAttributeDataType = E_ZCL_BOOL;
asSavedReports[2].sAttributeReportingConfigurationRecord.u16AttributeEnum = E_CLD_ONOFF_ATTR_ID_ON_TIME;
asSavedReports[2].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval = HA_SYSTEM_MAX_REPORT_INTERVAL;
asSavedReports[2].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval = HA_SYSTEM_MIN_REPORT_INTERVAL;
asSavedReports[2].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField = 0;
asSavedReports[2].sAttributeReportingConfigurationRecord.u8DirectionIsReceived = 0;
asSavedReports[2].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange = 14;

DBG_vPrintf(TRACE_REPORT,"\nLoaded Defaults Records \n");

for(u8Index = 0; u8Index < MAINS_POWER_OUTLET_NUMBER_OF_REPORTS; u8Index++)
{
DBG_vPrintf(TRACE_REPORT,"\nCluster %d",asSavedReports[u8Index].u16ClusterID);
DBG_vPrintf(TRACE_REPORT,"\nAtt Dta Type = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.eAttributeDataType);
DBG_vPrintf(TRACE_REPORT,"\nAttr No = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16AttributeEnum);
DBG_vPrintf(TRACE_REPORT,"\nMax = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval);
DBG_vPrintf(TRACE_REPORT,"\nMin = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval);
DBG_vPrintf(TRACE_REPORT,"\nTimeOut = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField);
DBG_vPrintf(TRACE_REPORT,"\nDirection = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u8DirectionIsReceived);
DBG_vPrintf(TRACE_REPORT,"\nChange = %d\n",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange);
}
/*Save this Records*/
PDM_eSaveRecordData(PDM_ID_APP_REPORTS,
asSavedReports,
sizeof(asSavedReports));
}

The log:


Deice Power Up!
PWRM Init OSCON and RAMON
PDUM iniaialise....

System initial ...
HAL_LEDS_Init ...
HAL_Buttons_Init ...

APP_vInitialiseNode .....
eStatusReportReload=0
Link key:5a,69,67,42,65,65,41,6c,6c,69,61,6e,63,65,30,39,
Restore default channel:134215680
Default mask saved = 0x07fff800, Mask Set to = 0x00002000
HA initailise status:0
HA register endpoint status:0

eZCL_SetSupportedSecurity: 0x0
ZCL Device information:
ZCL Device APP version:1
ZCL Device HW version:1
ZCL Device mode identifier:ZHA-MainsPowerOutlet
ZCL Device manufacture:YCD
ZCL Device code date:20170109
ZCL Device out status:1


Loaded Defaults Records

Cluster 6
Att Dta Type = 16
Attr No = 0
Max = 60
Min = 1
TimeOut = 0
Direction = 0
Change = 10

Cluster 6
Att Dta Type = 16
Attr No = 16384
Max = 60
Min = 1
TimeOut = 0
Direction = 0
Change = 12

Cluster 6
Att Dta Type = 16
Attr No = 16385
Max = 60
Min = 1
TimeOut = 0
Direction = 0
Change = 14
vMakeSupportedAttributesReportable
eZCL_SetReportableFlag: 0
eZCL_CreateLocalReport: 0
eZCL_SetReportableFlag: 0
eZCL_CreateLocalReport: 0

The code:


/****************************************************************************
*
* NAME: vSaveReportableRecord
*
* DESCRIPTION:
* Loads a default configuration
*
* RETURNS:
* void
*
****************************************************************************/
PUBLIC void vSaveReportableRecord(uint8 u8Index,uint16 u16ClusterID, tsZCL_AttributeReportingConfigurationRecord* psAttributeReportingConfigurationRecord)
{
asSavedReports[u8Index].u16ClusterID = u16ClusterID;
memcpy(&(asSavedReports[u8Index].sAttributeReportingConfigurationRecord),psAttributeReportingConfigurationRecord,sizeof(tsZCL_AttributeReportingConfigurationRecord));

DBG_vPrintf(TRACE_REPORT,"\nSaving Records \n");

DBG_vPrintf(TRACE_REPORT,"\nCluster %d",asSavedReports[u8Index].u16ClusterID);
DBG_vPrintf(TRACE_REPORT,"\nAtt Dta Type = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.eAttributeDataType);
DBG_vPrintf(TRACE_REPORT,"\nAttr No = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16AttributeEnum);
DBG_vPrintf(TRACE_REPORT,"\nMax = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MaximumReportingInterval);
DBG_vPrintf(TRACE_REPORT,"\nMin = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16MinimumReportingInterval);
DBG_vPrintf(TRACE_REPORT,"\nTimeOut = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u16TimeoutPeriodField);
DBG_vPrintf(TRACE_REPORT,"\nDirection = %d",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.u8DirectionIsReceived);
DBG_vPrintf(TRACE_REPORT,"\nChange = %d\n\n",asSavedReports[u8Index].sAttributeReportingConfigurationRecord.uAttributeReportableChange.zuint8ReportableChange);

/*Save this Records*/
PDM_eSaveRecordData(PDM_ID_APP_REPORTS,
asSavedReports,
sizeof(asSavedReports));
}
/****************************************************************************/
/*** END OF FILE ***/
/****************************************************************************/

0 Kudos