Contiki 3.x
|
Files | |
file | frame.c |
802.15.4 frame creation and parsing functions | |
file | frame.h |
802.15.4 frame creation and parsing functions | |
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... | |
Macros | |
#define | FIXEDFRAMEOVERHEAD (5) |
Some constants for frame length calculations. More... | |
Functions | |
void | frame_tx_create (frame_create_params_t *p, frame_result_t *frame_result) |
Creates a frame for transmission over the air. More... | |
void | rx_frame_parse (hal_rx_frame_t *rx_frame, parsed_frame_t *pf) |
Parses an input frame. More... | |
#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:
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.
p | Pointer to frame_create_params_t struct, which specifies the frame to send. |
frame_result | Pointer 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. |
Definition at line 119 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.
rx_frame | The input data from the radio chip. |
pf | The parsed_frame_t struct that stores a pointer to each section of the frame payload. |
Definition at line 255 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.