Smacheader_T - NXP Semiconductors MKW01 Reference Manual

Simple media access controller (smac)
Table of Contents

Advertisement

Usage
This data type is used by an application in the following manner:
1. Declare a buffer to store a packet to be received OTA. Freescale recommends the size of this buffer
to be at least as long as the biggest packet to be received by the application.
2. Declare a pointer of the type rxPacket_t.
3. Initialize the pointer to point to the buffer declared at the first step.
4. Initialize the u8MaxDataLength member of the packet structure. The SMAC will filter all the
received packets having a payload size bigger than u8MaxDataLength.
5. Use the pointer as the argument when calling MLMERXEnableRequest:
uint8_t RxDataBuffer[gMaxSmacSDULength_c + sizeof(rxPacket_t)];
rxPacket_t *RxPacket;
RxPacket = (rxPacket_t*)RxDataBuffer;
RxPacket->u8MaxDataLength = gMaxSmacSDULength_c;
RxEnableResult = MLMERXEnableRequest(RxPacket, 0);
You can use a variable of the type smacErrors_t to store the result of executing
MLMERXEnableRequest function.
2.2.3

smacHeader_t

This structure defines the variable used for MKW01 SMAC header:
typedef PACKED_STRUCT rxPacket_tag{
uint16_t
frameControl;
uint8_t
seqNo;
uint16_t
panId;
uint16_t
destAddr;
uint16_t
srcAddr;
}rxPacket_t;
Members
frameControl
Frame control configuration. The value is set each time SMACFillHeader is called
and should not be changed.
seqNo
The Sequence number is updated each time a data request is performed.
panId
The value of the source and destination PAN address. It is recommended to be
changed through the associated function.
destAddr
The short destination address.
srcAddr
The short source address.
Usage
Freescale recommends that the user does not access this structure directly but through the associated
functions.
MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0
Freescale Semiconductor
Software Architecture
2-11

Advertisement

Table of Contents
loading

Table of Contents