Smacfillheader; Smac_Setivkey - NXP Semiconductors MKW01 Reference Manual

Simple media access controller (smac)
Table of Contents

Advertisement

Primitives
3.21

SMACFillHeader

This function has no interaction with the PHY layer. It's purpose is to aid the application in configuring
the addressing for packet to be sent. The function will fill the packet header with the updated addressing
and hard-coded configuration values and will add the destination address passed as parameter.
Arguments
smacHeader_t* pSmacHeader : Pointer to the SMAC header that needs to be filled with addressing and
uint16_t destAddr
Returns
None.
Usage
Call the function if it's the first time the application uses the txPacket_t variable, or if the destination
address must be changed.
uint8_t TxDataBuffer[gMaxSmacSDULength_c + sizeof(txPacket_t)];
txPacket_t *TxPacket;
smacErrors_t smacError;
...
TxPacket = (txPacket_t*)TxDataBuffer;
SMACFillHeader(&(TxPacket->smacHeader), gBroadcastAddress_c);
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 function fills the smacHeader with default, hard-coded frame control and sequence number values.
Also, it adds the addressing information (configured by calling MLMESetShortSrcAddress and
MLMESetPanID) and the destination address passed as parameter.
3.22

SMAC_SetIVKey

This function sets the initial vector and encryption key for the encryption process if gSmacUseSecurity_c
is defined.
Arguments
uint8_t* KEY
Pointer to a 16 byte buffer containing the key.
uint8_t* IV
Pointer to a 16 byte buffer containing the initial vector.
MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0
3-34
configuration information.
: The 16 bit destination address.
Freescale Semiconductor

Advertisement

Table of Contents
loading

Table of Contents