Primitives
MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0
3-22
Freescale Semiconductor
•
If the result of the call of the function is different than gErrorNoError_c, the application should
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 TxDataBuffer[gMaxSmacSDULe sizeof(txPacket_t)];
txPacket_t *TxPacket;
smacErrors_t smacError;
...
TxPacket = (txPacket_t*)TxDataBuffer;
TxPacket->u8DataLength = payloadLength;
//Copy the data to send into the smacPdu of the packet
FLib_MemCpy(TxPacket->smacPdu.smacPdu, bufferToSend, payloadLength);
smacError = MCPSDataRequest(TxPacket);
...
Implementation
This MCPSDataRequest primitive creates a message for the PHY task and fills it in respect to the user
configurations prior to this call and to the information contained in the packet.
3.2
MLMETXDisableRequest
This function places the radio into stand-by and the PHY and SMAC state machines into idle, if current
operation is TX. It does not explicitly check if SMAC is in a transmitting state, but it clears the SMAC
buffer containing the packet to be sent, which makes it ideal for using when application wants to switch
from TX to idle.
Prototype
void MLMETXDisableRequest(void);
Arguments
None.
Returns
None: The function will forcibly set the transceiver to standy by and the PHY and SMAC state machines
to idle, so not return value is needed.
Usage
Call
MLMETXDisableRequest().
Implementation
This primitive creates a message for PHY, sets message type as set transceiver state request, with value of
force transceiver off. After passing the message to PHY, SMAC checks if a TX is in progress and clears
the buffer containing the packet.