
Primitives
MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0
3-24
Freescale Semiconductor
3.4
MLMERXEnableRequest
Places the radio into receive mode on the channel pre-selected by MLMESetChannelRequest ().
Prototype
smacErrors_t MLMERXEnableRequest(rxPacket_t *gsRxPacket, uint32_t u32Timeout);
Arguments
rxPacket_t *gsRxPacket: Pointer to the structure where the reception results will be stored.
uint32_t u32Timeout: 32-bit timeout value in symbol duration. One symbol duration is equivalent to a 16
us duration.
Returns
gErrorNoError_c
Everything is ok and the reception will be performed
gErrorOutOfRange_c
One of the members in the rxPacket_t structure is out of range (not
valid buffer size or data buffer pointer is NULL).
gErrorBusy_c
The radio is performing another action and could not attend this
request.
gErrorNoValidCondition_c
The MKW01 SMAC has not been initialized.
gErrorNoResourcesAvailable_c The PHY cannot process a MKW01 SMAC request, so the
MKW01 SMAC cannot process it.
Usage
•
SMAC must be initialized before calling this function.
•
Declare a variable of the type smacErrors_t to save the result of the function execution.
•
Prepare the rxPacket_t parameter as explained in
Section 2.2.2, “rxPacket_t
” declaration and
usage.
•
Call MLMERXEnableRequest function.
•
If the result of the call of the function is different to gErrorNoError_c, the application may handle
the error returned. For instance, if the result is gErrorBusy_c the application should wait for the
radio to finish a previous operation.
uint8_t RxDataBuffer[gMaxSmacSDULe sizeof(rxPacket_t)];
rxPacket_t *RxPacket;
smacErrors_t smacError;
RxPacket = (rxPacket_t*)RxDataBuffer;
RxPacket->u8MaxDataLength =
gMaxSmacSDULength_c;
smacError = MLMERXEnableRequest(RxPacket, 0);
...
NOTE
•
The return of anything different than gErrorNoError_c implies that the
receiver did not go into receive mode.