Primitives
MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0
3-36
Freescale Semiconductor
default:
break;
}
MEM_BufferFree(pMsg);
return gErrorNoError_c;
}
smacErrors_t smacToAppMcpsSap(smacToAppDataMessage_t* pMsg, instanceId_t instance)
{
switch(pMsg->msgType)
{
case gMcpsDataInd_c:
...
break;
case gMcpsDataCnf_c:
...
break;
default:
break;
}
MEM_BufferFree(pMsg);
return gErrorNoError_c;
}
void InitApp
{
...
Smac_RegisterSapHandlers(
(SMAC_APP_MCPS_SapHandler_t)smacToAppMcpsSap,
(SMAC_APP_MLME_SapHandler_t)smacToAppMlmeSap,
0)
...
}
Implementation
This function associates the SMAC internal function handlers with the ones registered by the application.
Whenever an asynchronous response needs to be passed from SMAC to application, the internal handlers
are called, which in turn call the ones defined by the application.