I have MT_AF_FUNC, MT_AF_CB_FUNC enabled. I don't see any MT_AF_INCOMING_MSG of any kind, ever. Some inspection in the source code revealed that the code to generate these messages is never executed:
// If ZDO or SAPI have registered for this endpoint, dont intercept it here
if (AFCB_CHECK(CB_ID_AF_DATA_IND, *(epDesc->task_id)))
{
MT_AfIncomingMsg( (void *)MSGpkt );
// Release the memory.
osal_msg_deallocate( (void *)MSGpkt );
}
else
#endif
{
// Send message through task message.
osal_msg_send( *(epDesc->task_id), (uint8 *)MSGpkt );
}
}
lthe if-statement is always false because the task ID is never equal to that of MT. Messages always have task ID's of either the ZCL or ZDApp. Which is logical in my opinion.
Does the MT_INCOMING_MSG command work at all?
Edit:
#if defined ( MT_AF_CB_FUNC )
// If ZDO or SAPI have registered for this endpoint, dont intercept it here
// if (AFCB_CHECK(CB_ID_AF_DATA_IND, *(epDesc->task_id)))
// {
MT_AfIncomingMsg( (void *)MSGpkt );
// Release the memory.
// osal_msg_deallocate( (void *)MSGpkt );
// }
// else
#endif
{
// Send message through task message.
osal_msg_send( *(epDesc->task_id), (uint8 *)MSGpkt );
}
}
Edit the source in AF.c (afBuildMSGIncoming) as above and all messages are send to MT as well as the app. It works, but it doesn't really feel 'right'. Can anyone suggest a better solution?