Contiki 2.6

RF230 Frame handling

Data Structures

union  fcf_t
 Defines the bitfields of the frame control field (FCF). More...
struct  scf_t
 802.15.4 security control bitfield. More...
struct  aux_hdr_t
 802.15.4 Aux security header More...
union  ADDR_SIZE_SPEC_t
 A union of short and long address types. More...
struct  PAN_ID_ADDR_SPEC_t
 Structure containing a PAN ID and an address. More...
struct  ADDR_FIELD_SPEC_t
 Structure containing both source and destination addresses. More...
union  addr_t
 Union of both short and long addresses. More...
struct  frame_result_t
 Strucure used to return that status of the frame create process. More...
struct  frame_create_params_t
 Parameters used by the frame_tx_create() function. More...

Files

file  frame.c
 

802.15.4 frame creation and parsing functions


file  frame.h
 

802.15.4 frame creation and parsing functions


Defines

#define FIXEDFRAMEOVERHEAD   (5)
 Some constants for frame length calculations.

Functions

void frame_tx_create (frame_create_params_t *p, frame_result_t *frame_result)
 Creates a frame for transmission over the air.
void rx_frame_parse (hal_rx_frame_t *rx_frame, parsed_frame_t *pf)
 Parses an input frame.

Define Documentation

#define FIXEDFRAMEOVERHEAD   (5)

Some constants for frame length calculations.

The IEEE 802.15.4 frame has a number of constant/fixed fields that can be counted to make frame construction and max payload calculations easier.

These include: 1. FCF - 2 bytes - Fixed 2. Sequence number - 1 byte - Fixed 3. Addressing fields - 4 - 20 bytes - Variable 4. Aux security header - 0 - 14 bytes - Variable 5. CRC - 2 bytes - Fixed

Definition at line 124 of file frame.h.


Function Documentation

void frame_tx_create ( frame_create_params_t p,
frame_result_t frame_result 
)

Creates a frame for transmission over the air.

This function is meant to be called by a higher level function, that interfaces to a MAC.

Parameters:
pPointer to frame_create_params_t struct, which specifies the frame to send.
frame_resultPointer to frame_result_t struct, which will receive the results of this function, a pointer to the frame created, and the length of the frame.
Returns:
Nothing directly, though the frame_result structure will be filled in with a pointer to the frame and the frame length.

Definition at line 120 of file frame.c.

References addr_t::addr16, addr_t::addr64, frame_create_params_t::aux_hdr, frame_create_params_t::dest_addr, frame_create_params_t::dest_pid, fcf_t::destAddrMode, frame_create_params_t::fcf, frame_result_t::frame, scf_t::key_id_mode, frame_result_t::length, fcf_t::panIdCompression, frame_create_params_t::payload, frame_create_params_t::payload_len, aux_hdr_t::security_control, fcf_t::securityEnabled, frame_create_params_t::seq, frame_create_params_t::src_addr, frame_create_params_t::src_pid, fcf_t::srcAddrMode, and fcf_t::word_val.

Referenced by sicslowmac_dataRequest().

void rx_frame_parse ( hal_rx_frame_t rx_frame,
parsed_frame_t *  pf 
)

Parses an input frame.

Scans the input frame to find each section, and stores the resulting addresses of each section in a parsed_frame_t structure.

Parameters:
rx_frameThe input data from the radio chip.
pfThe parsed_frame_t struct that stores a pointer to each section of the frame payload.

Definition at line 256 of file frame.c.

References hal_rx_frame_t::crc, hal_rx_frame_t::data, fcf_t::destAddrMode, fcf_t::frameType, hal_rx_frame_t::length, hal_rx_frame_t::lqi, mac_put_event(), NULL, fcf_t::panIdCompression, process_poll(), process_post(), and fcf_t::srcAddrMode.