Hi,
The issue is not resolved yet.
For further information:
I found that there is two kind of data messages that goes through the NLDE queue:
- the data frames (gNwkNldeDataInd_c)
- the ACK answers (gNwkNldeDataCnf_c) to a NLDE_DataRequest() or NLME_StartRequest or NLME_UnpairRequest() commands.
The data frames are processed with the App_HandleNldeMessage() function.
If it is an ACK answer, the App_HandleNldeEvent() dequeue the message that it is processed later by the App_DataState() or App_StartState() or App_UnpairState() functions. When the appStateMachine.state is idle, we could be waiting for an ACK answer. If you don't dequeue the message, you will never receive the ACK.
The bug: while we are sending requests to the zigbee stack we put the appStateMachine.state out of idle. During that time, all received data packets will be lost. This time could be long because we change the appStateMachine.state when we launch the TS_SendEvent().
We have tried one solution but doesn't work:
We are using the latest version of the Beekit library: BeeStack Consumer codebase version 1.7.2
We've only changed the Target code for the test.
We have changed App_HandleNldeEvent() to:
static void* App_HandleNldeEvent(void)
{
void *pMsgIn;
/* Try to get the first message in the Nlde message queue */
pMsgIn = MSG_DeQueue(&mNldeAppInputQueue);
if(pMsgIn)
{
/* Handle the message in Idle state */
App_HandleNldeMessage((nwkNldeToAppMsg_t*)pMsgIn);
}
return pMsgIn;
}
And App_HandleNldeMessage() to:
static void App_HandleNldeMessage(nwkNldeToAppMsg_t* pMsgIn) {
switch(pMsgIn->msgType)
{
/* Data indication received */
case gNwkNldeDataInd_c:
App_HandleDataInd(&pMsgIn->msgData.nwkNldeDataInd);
MSG_Free(pMsgIn);
pMsgIn = NULL;
break;
default:
break;
}
}
If the NLDE message is a data frame (gNwkNldeDataInd_c), we process it and free pMsgIN, even if appStateMachine.state is not idle (I think that should work).
If the NLDE message is an ACK (gNwkNldeDataCnf_c), we dequeue it an pass it to the other functions.
That works for about 10 seconds and then the App_MainTask() is not called anymore.
We don't understand by.
If we made the change in the Controller, it works without problem.
Regards