I am using cc2538(SmartRF06+CC2538EM) and Z-Stack Home 1.2.1 and build test SampleTemperatureSensor(ZR)+SampleThermostat(ZC)...
By follow pdf doc... Test zcl_SendReportCmd() command OK by Key(UP/Down) from SampleTemperatureSensor(ZR) to SampleThermostat(ZC).
because I want to support same control function for SampleTemperatureSensor(ZR) with SampleThermostat(ZC)...
but after add below patch code by copy from SampleTemperatureSensor(ZR) to SampleThermostat(ZC) => test zcl_SendReportCmd() command FAIL by Key(UP(HAL_KEY_SW_1)) from SampleThermostat(ZC) to SampleTemperatureSensor(ZR), and I can't got any packet by sniffer tool(Ubiqua) ???
Trace program run flow... cann't find any issue => zclSampleTemperatureSensor_SendTemp()->zcl_SendReportCmd()->zcl_SendCommand()->AF_DataRequest()->APSDE_DataReq()... but the APSDE_DataReq without source code... so I don't what's happen ??? maybe I am lose something...
Please help: I need the SampleTemperatureSensor(ZR) with the send and receive zcl command function.
thanks.
----
diff --git a/Projects/zstack/HomeAutomation/SampleThermostat/Source/zcl_samplethermostat.c b/Projects/zstack/HomeAutomation/SampleThermostat/Source/zcl_samplethermostat.c
index e009fa9..c4dd130 100644
--- a/Projects/zstack/HomeAutomation/SampleThermostat/Source/zcl_samplethermostat.c
+++ b/Projects/zstack/HomeAutomation/SampleThermostat/Source/zcl_samplethermostat.c
@@ -427,6 +427,29 @@ uint16 zclSampleThermostat_event_loop( uint8 task_id, uint16 events )
return 0;
}
+static void zclSampleTemperatureSensor_SendTemp( void )
+{
+#ifdef ZCL_REPORT
+ zclReportCmd_t *pReportCmd;
+ int16 zclSampleTemperatureSensor_MeasuredValue = 2200; // 22.00C
+
+ pReportCmd = osal_mem_alloc( sizeof(zclReportCmd_t) + sizeof(zclReport_t) );
+ if ( pReportCmd != NULL )
+ {
+ pReportCmd->numAttr = 1;
+ pReportCmd->attrList[0].attrID = ATTRID_MS_TEMPERATURE_MEASURED_VALUE;
+ pReportCmd->attrList[0].dataType = ZCL_DATATYPE_INT16;
+ pReportCmd->attrList[0].attrData = (void *)(&zclSampleTemperatureSensor_MeasuredValue);
+
+ zcl_SendReportCmd( SAMPLETHERMOSTAT_ENDPOINT, &zclSampleThermostat_DstAddr,
+ ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
+ pReportCmd, ZCL_FRAME_SERVER_CLIENT_DIR, TRUE, zclSampleThermostatSeqNum++ );
+ }
+
+ osal_mem_free( pReportCmd );
+#endif // ZCL_REPORT
+}
+
/*********************************************************************
* @fn zclSampleThermostat_HandleKeys
*
@@ -446,6 +469,8 @@ static void zclSampleThermostat_HandleKeys( byte shift, byte keys )
{
if ( keys & HAL_KEY_SW_1 )
{
+ zclSampleTemperatureSensor_SendTemp();
+
// in heating mode
if ( giThermostatScreenMode == THERMOSTAT_HEATMODE )
{
----