Contiki-NG
Loading...
Searching...
No Matches
802.15.4 frame creation and parsing

Files

file  frame802154.h
 802.15.4 frame creation and parsing functions
 

Data Structures

struct  frame802154_fcf_t
 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. More...
 
struct  frame802154_scf_t
 802.15.4 security control bitfield. More...
 
struct  frame802154_aux_hdr_t
 802.15.4 Aux security header More...
 
struct  frame802154_t
 Parameters used by the frame802154_create() function. More...
 

Variables

static uint16_t mac_pan_id = IEEE802154_PANID
 The 16-bit identifier of the PAN on which the device is operating.
 

FCF element values definitions

These are some definitions of values used in the FCF.

See the 802.15.4 spec for details.

int frame802154_hdrlen (frame802154_t *p)
 Calculates the length of the frame header.
 
int frame802154_create (frame802154_t *p, uint8_t *buf)
 Creates a frame for transmission over the air.
 
int frame802154_parse (uint8_t *data, int len, frame802154_t *pf)
 Parses an input frame.
 
#define FRAME802154_NOADDR   (0x00)
 Only valid for ACK or Beacon frames.
 

Detailed Description

Function Documentation

◆ frame802154_create()

int frame802154_create ( frame802154_t * p,
uint8_t * buf )

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 frame802154_t struct, which specifies the frame to send.
bufPointer to the buffer to use for the frame.
Returns
The length of the frame header

Definition at line 387 of file frame802154.c.

References frame802154_t::aux_hdr, frame802154_t::dest_addr, frame802154_t::dest_pid, frame802154_t::fcf, frame802154_aux_hdr_t::frame_counter, frame802154_scf_t::frame_counter_size, frame802154_scf_t::frame_counter_suppression, frame802154_scf_t::key_id_mode, frame802154_aux_hdr_t::key_index, frame802154_aux_hdr_t::key_source, frame802154_aux_hdr_t::security_control, frame802154_scf_t::security_level, frame802154_t::seq, frame802154_t::src_addr, and frame802154_t::src_pid.

Referenced by tsch_packet_create_eack().

◆ frame802154_hdrlen()

int frame802154_hdrlen ( frame802154_t * p)

Calculates the length of the frame header.

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

Parameters
pPointer to frame802154_t_t struct, which specifies the frame to send.
Returns
The length of the frame header.

Definition at line 353 of file frame802154.c.

Referenced by tsch_packet_create_eack().

◆ frame802154_parse()

Variable Documentation

◆ mac_pan_id

uint16_t mac_pan_id = IEEE802154_PANID
static

The 16-bit identifier of the PAN on which the device is operating.

If this value is 0xffff, the device is not associated.

Definition at line 76 of file frame802154.c.