Other Parts Discussed in Thread: Z-STACK
Hi all,
I am using AF_Datarequest() for sending data from transmitter to receiver. How shall i receive this data in receiver .Do i have to implement a callback for it.
Thanks
Amit
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Other Parts Discussed in Thread: Z-STACK
Hi all,
I am using AF_Datarequest() for sending data from transmitter to receiver. How shall i receive this data in receiver .Do i have to implement a callback for it.
Thanks
Amit
You have to add the line "osal_msg_send( zclYourApplicaiton_TaskID, msgPtr );
" in zcl_event_loop() to receive AF_INCOMING_MSG_CMD.
if ( *msgPtr == AF_INCOMING_MSG_CMD )
{
zcl_ProcessMessageMSG( (afIncomingMSGPacket_t *)msgPtr );
osal_msg_send( zclYourApplicaiton_TaskID, msgPtr );
}
Check if you receive AF_INCOMING_MSG_CMD in your zclYourApplication_event_loop() first.
Try to add the following red line in zcl_event_loop().
if ( *msgPtr == AF_INCOMING_MSG_CMD )
{
zcl_ProcessMessageMSG( (afIncomingMSGPacket_t *)msgPtr );
osal_msg_send( zclYourApplicaiton_TaskID, msgPtr );
}
And you should receive AF_INCOMING_MSG_CMD.
What do you send by AF_DataRequest? I suggest you to set a breakpoint in afBuildMSGIncoming() and see if it is hit when you send message by AF_DataRequest.
do U kown how the Z-stack/OSAL working?
U will build user task,and user task can process some message.
the message AF_INCOMING_MSG_CMD is to read the receiving data for receiver,and AF_DATA_CONFIRM_CMD is to confirm sending by sender.