Tool/software: Code Composer Studio
Hi TI Support Team,
I am trying to create a program that will let me run zigbee and subghz activities on a non-concurrent basis.
I was looking for the function that will let me pause the Zigbee (or abort any zigbee activities) and I found this code from the pauseCallback of the DMM example zigbee and ble.
Zstackapi_pauseResumeDeviceReq
zstack_pauseResumeDeviceReq_t zstack_pauseResumeDeviceReq;
zstack_pauseResumeDeviceReq.pause = true;
return Zstackapi_pauseResumeDeviceReq(appServiceTaskId,
&zstack_pauseResumeDeviceReq);
But then everytime I manually trigger these line of codes, it causes the system to hang.
I tried to track on where did it go wrong inside the
Zstackapi_pauseResumeDeviceReq()
and I found out that this line of code (see below code at line 40) is not changing its value to true that is causing the whole function to be trapped inside a while loop
static zstack_ZStatusValues sendReqDefaultRsp(uint8_t appServiceTaskId,
zstack_CmdIDs cmdID, void *pReq,
int msgSize)
{
zstack_ZStatusValues status = zstack_ZStatusValues_ZMemError;
uint8_t msgStatus;
//Make sure allocate space enought for the msg, even
//if the message does not have payload
if(msgSize < sizeof(zstackmsg_genericReq_t))
{
msgSize = sizeof(zstackmsg_genericReq_t);
}
zstackmsg_genericReq_t *pMsg =
(zstackmsg_genericReq_t *)OsalPort_msgAllocate(msgSize);
// Make sure the allocation was successful
if(pMsg != NULL)
{
// Fill in the message header
pMsg->hdr.event = cmdID;
pMsg->hdr.status = 0;
pMsg->hdr.srcServiceTask = appServiceTaskId;
// Update the messges's request field
pMsg->pReq = pReq;
// Send the message
msgStatus = OsalPort_msgSend( stackServiceTaskId, (uint8_t*) pMsg );
// Was the message sent successfully
if(msgStatus == OsalPort_SUCCESS)
{
bool gotRsp = false;
// Return status
zstackmsg_genericReq_t *pCmdStatus = NULL;
while(!gotRsp)
{
// Wait for the response message
OsalPort_blockOnEvent(Task_self());
pCmdStatus = (zstackmsg_genericReq_t*)OsalPort_msgFindDequeue(appServiceTaskId, pMsg->hdr.event);
if(pCmdStatus)
{
gotRsp = true;
}
}
// setup return of
status = (zstack_ZStatusValues)pCmdStatus->hdr.status;
}
// pCmdStatus is the same as pMsg
OsalPort_msgDeallocate( (uint8_t*)pMsg);
}
// function status
return(status);
}
Is there any use case example for the command
Zstackapi_pauseResumeDeviceReq
I am hoping that your team could help me with this matter.
Thank you,
Jonathan