Software Architecture
MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0
2-18
Freescale Semiconductor
All taken into consideration, the two types of messages used by the SMAC to application SAPs have the
following form:
typedef struct smacToAppMlmeMessage_tag
{
smacMessageDefs_t msgType;
uint8_t appInstanceId;
union
{
smacCcaCnf_t ccaCnf;
smacEdCnf_t edCnf;
}msgData;
} smacToAppMlmeMessage_t;
typedef struct smacToAppDataMessage_tag
{
smacMessageDefs_t msgType;
uint8_t appInstanceId;
union
{
smacDataCnf_t dataCnf;
smacDataInd_t dataInd;
}msgData;
} smacToAppDataMessage_t;
The SMAC to application SAP handlers are function pointers of a special type. When application specifies
the functions to handle asynchronous responses, the SAP handlers aquire the value of those functions.
Below are the definitions of the handlers.
typedef smacErrors_t ( * SMAC_APP_MCPS_SapHandler_t)(smacToAppDataMessage_t * pMsg,
instanceId_t instanceId);
4
gMlmeEdCnf_c
smacEdCnf_t
status
This is a smacErrors_t element. If PHY
succesfully performs the ED it’s value will
be gErrorsNoError_c
energyLevel
The value of the energy level register.
energyLeveldB
The value of the energy level converted to
dBm.
scannedChannel
The channel number of the scanned
channel.
5
gMlmeTimeoutIn
d_c
none
-
6
gMlme_Unexpect
edRadioResetIn
d_c
none
-
Table 2-1. Message Types and Associated Data Structures
Index
Message Type
Associated Data
Structures
Description