Hai,
I have a problem in configuring the end device, my code is here
uint16 zclSampleThermostat_event_loop( uint8 task_id, uint16 events )
{
afIncomingMSGPacket_t *MSGpkt;
(void)task_id; // Intentionally unreferenced parameter
if ( events & SYS_EVENT_MSG )
{
while ( (MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( zclSampleThermostat_TaskID )) )
{
switch ( MSGpkt->hdr.event )
{
#ifdef ZCL_EZMODE
case ZDO_CB_MSG:
zclSampleThermostat_ProcessZDOMsgs( (zdoIncomingMsg_t *)MSGpkt );
break;
#endif
case SERIAL_RCV_TASK:
{
// Packet Received from UART
Serial_IncomingPacket( (stSerialInPkt *) MSGpkt);
break;
}
case MT_SYS_APP_MSG:
// Message received from MT
zclSampleThermostat_ProcessAppMsg( ((mtSysAppMsg_t *)MSGpkt)->endpoint,
((mtSysAppMsg_t *)MSGpkt)->appDataLen,
((mtSysAppMsg_t *)MSGpkt)->appData );
break;
case ZCL_INCOMING_MSG:
// Incoming ZCL Foundation command/response messages
//zclSampleThermostat_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );
Send_configcomand_ZED( (zclIncomingMsg_t *)MSGpkt);
break;
case KEY_CHANGE:
zclSampleThermostat_HandleKeys( ((keyChange_t *)MSGpkt)->state, ((keyChange_t *)MSGpkt)->keys );
break;
case ZDO_STATE_CHANGE:
zclSampleThermostat_NwkState = (devStates_t)(MSGpkt->hdr.status);
// now on the network
if ( ( zclSampleThermostat_NwkState == DEV_ZB_COORD ) ||
( zclSampleThermostat_NwkState == DEV_ROUTER ) ||
( zclSampleThermostat_NwkState == DEV_END_DEVICE ) )
{
#ifndef HOLD_AUTO_START
// display main mode
giThermostatScreenMode = THERMOSTAT_MAINMODE;
zclSampleThermostat_LcdDisplayUpdate();
#endif
#ifdef ZCL_EZMODE
zcl_EZModeAction( EZMODE_ACTION_NETWORK_STARTED, NULL );
#endif // ZCL_EZMODE
}
default:
{
}
break;
}
// Release the memory
osal_msg_deallocate( (uint8 *)MSGpkt );
}
// return unprocessed events
return (events ^ SYS_EVENT_MSG);
}
void Send_configcomand_ZED(zclIncomingMsg_t *MSGpkt)
{
// Test for Unicast
zclCfgReportCmd_t stConfig;
uint16 u16ReportTimeIntMin;
uint16 u16ReportTimeIntMax;
uint16 u16ReportIntTimeout;
u16ReportTimeIntMin = 0;
u16ReportTimeIntMax = 0;
u16ReportIntTimeout = 0;
zclSampleThermostat_DstAddr.addr.shortAddr = MSGpkt->srcAddr.addr.shortAddr;
zclSampleThermostat_DstAddr.addrMode = (afAddrMode_t) Addr16Bit;
zclSampleThermostat_DstAddr.endPoint = MSGpkt->srcAddr.endPoint;
zclSampleThermostat_DstAddr.panId = MSGpkt->srcAddr.panId;
u16ReportTimeIntMin = 5120; /* configuring End Device Report Interval 20 Seconds */
u16ReportTimeIntMax = u16ReportTimeIntMin; /* Max Report Interval */
stConfig.numAttr = 1;
stConfig.attrList[0].attrID = ATTRID_MS_TEMPERATURE_MEASURED_VALUE;
stConfig.attrList[0].dataType = ZCL_DATATYPE_UINT8;
stConfig.attrList[0].direction = ZCL_SEND_ATTR_REPORTS;
stConfig.attrList[0].minReportInt = u16ReportTimeIntMin;
stConfig.attrList[0].maxReportInt = u16ReportTimeIntMax;
stConfig.attrList[0].timeoutPeriod = u16ReportIntTimeout;
zcl_SendConfigReportCmd( SAMPLETHERMOSTAT_ENDPOINT, &zclSampleThermostat_DstAddr,
ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
&stConfig, ZCL_FRAME_CLIENT_SERVER_DIR, TRUE, zclSampleThermostatSeqNum++ );
}
As i receive Packet I store in the zclSampleThermostat_DstAddr Structure and i send to the same device . Is there any configurations need to be done