Microchip® Advanced Software Framework

mac.c File Reference

This module runs the MAC scheduler.

Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.

#include <compiler.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "return_val.h"
#include "pal.h"
#include "bmm.h"
#include "qmm.h"
#include "tal.h"
#include "tal_internal.h"
#include "ieee_const.h"
#include "mac_msg_const.h"
#include "mac_api.h"
#include "mac_msg_types.h"
#include "mac_data_structures.h"
#include "stack_config.h"
#include "mac_internal.h"
#include "mac.h"
#include "mac_build_config.h"

Macros

#define MAC_GUARD_TIME_US   1000
 
#define READY_TO_SLEEP   1
 

Functions

uint32_t mac_ready_to_sleep (void)
 Checks if the mac stack is ready to sleep. More...
 
bool mac_task (void)
 Runs the MAC scheduler. More...
 

Variables

queue_t broadcast_q
 Queue used by MAC layer in beacon-enabled network to put in broadcast data. More...
 
queue_t indirect_data_q
 Queue used by MAC layer to put in indirect data. More...
 
bool mac_bc_data_indicated
 Flag stating that the last received beacon frame from the parent indicated pending broadcast data to be received. More...
 
uint8_t mac_beacon_payload [aMaxBeaconPayloadLength]
 Holds the contents of the beacon payload. More...
 
bool mac_busy
 MAC busy state, indicates whether MAC can process any request from NHLE. More...
 
uint8_t * mac_conf_buf_ptr
 Holds the mlme request buffer pointer, used to give the respective confirmation in scan, poll and association. More...
 
uint8_t mac_final_cap_slot
 Final Cap Slot of current Superframe. More...
 
uint8_t mac_last_dsn
 
uint64_t mac_last_src_addr
 
parse_t mac_parse_data
 Global parse data. More...
 
mac_pib_t mac_pib
 
mac_poll_state_t mac_poll_state
 Current state of MAC poll state machine, e.g. More...
 
mac_radio_sleep_state_t mac_radio_sleep_state
 Radio sleep state. More...
 
bool mac_rx_enabled
 
uint8_t * mac_scan_cmd_buf_ptr
 Holds the buffer pointer which is used to send scan command. More...
 
uint8_t mac_scan_orig_channel
 Stores the original channel before start of scanning. More...
 
uint8_t mac_scan_orig_page
 Stores the original channel page before start of scanning. More...
 
uint16_t mac_scan_orig_panid
 Stores the original PAN-Id before start of scanning. More...
 
mac_scan_state_t mac_scan_state
 Current state of scanning process. More...
 
mac_state_t mac_state
 Current state of the MAC state machine. More...
 
mac_superframe_state_t mac_superframe_state = MAC_NOBEACON
 
mac_sync_state_t mac_sync_state
 Current state of syncronization with parent (either coordinator or PAN coordinator). More...
 
queue_t nhle_mac_q
 NHLE to MAC queue in which NHLE pushes all the requests to the MAC layer. More...
 
queue_t tal_mac_q
 Queue used by MAC for its internal operation. More...
 
volatile bool timer_trigger
 

#define MAC_GUARD_TIME_US   1000

Referenced by mac_ready_to_sleep().

#define READY_TO_SLEEP   1

Referenced by mac_ready_to_sleep().