Hello all,
i am using cc2538 and zstack HA 1.20 and i am using sample Temp sensor and sample Thermostat projects for testing...... i want to send data by AF_DataRequest API in my project but i am getting few problems. ->
1) in my temp sensor side i am sending msg continuously after every 5sec but i am not able to recive that msg at thermostat side.
2)i am able to see my msg on temp sensor side lcd screen but not able to see any msg on thermostat side..
below is my code which i wrote ->
Temp sensor :=>
#define SAMPLETEMPERATURESENSOR_AF_MSG_SEND_EVT 0x0020
// Send Message Timeout
#define SAMPLETEMPERATURESENSOR_SEND_MSG_TIMEOUT 5000
Under <>_event_loop () :=>
case ZDO_STATE_CHANGE:
..............
..............
// Start sending "the" message in a regular interval.
osal_start_timerEx ( zclSampleTemperatureSensor_TaskID, SAMPLETEMPERATURESENSOR_AF_MSG_SEND_EVT,
SAMPLETEMPERATURESENSOR_SEND_MSG_TIMEOUT );
if ( events & SAMPLETEMPERATURESENSOR_AF_MSG_SEND_EVT )
{
// Send "the" message
zclSampleTemperatureSensor_SendTheAFMessage();
// Setup to send message again
osal_start_timerEx( zclSampleTemperatureSensor_TaskID,
SAMPLETEMPERATURESENSOR_AF_MSG_SEND_EVT,
SAMPLETEMPERATURESENSOR_SEND_MSG_TIMEOUT );
// return unprocessed events
return (events ^ SAMPLETEMPERATURESENSOR_AF_MSG_SEND_EVT);
}
and =>
static void zclSampleTemperatureSensor_SendTheAFMessage( void )
{
char theMessageData[] = "Maneesh singh";
if ( AF_DataRequest( &zclSampleTemperatureSensor_DstAddr, &sampleTemperatureSensor_TestEp,
ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT,
(byte)osal_strlen( theMessageData ) + 1,
(byte *)&theMessageData,
&zclSampleTemperatureSensor_TransID,
AF_DISCV_ROUTE, AF_DEFAULT_RADIUS ) == afStatus_SUCCESS )
{
HalLcdWriteString ( theMessageData, HAL_LCD_LINE_2 );
// Successfully requested to be sent.
}
else
{
// Error occurred in request to send.
}
}
Thermostat side :=>
under <>_event_loop()
case AF_INCOMING_MSG_CMD:
zclSampleThermostat_MessageMSGCB( MSGpkt );
break;
static void zclSampleThermostat_MessageMSGCB( afIncomingMSGPacket_t *pkt )
{
switch ( pkt->clusterId )
{
case ZCL_CLUSTER_ID_HVAC_THERMOSTAT:
UARTprintf("AF_msg_received_is => %s\n",(pkt->cmd.Data) );
break;
}
}
is there anyone who can help me to solve this problem..
any idea what i am doing wrong ?
plz tell me how can send and receive data with AF_dataRequest API..
Anyone plz reply...
Thanks & Regards,
Maneesh singh







