Implements the building of beacon frames and initiates transmission via CSMA-CA after reception of a beacon request frame in a nonbeacon-enabled PAN.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <compiler.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include "return_val.h"
#include "pal.h"
#include "bmm.h"
#include "qmm.h"
#include "tal.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 | ADVNC_BCN_PREP_TIME (50) |
#define | BEACON_MAX_PEND_ADDR_CNT (7) |
#define | BEACON_PAYLOAD_LEN (4) |
#define | MAC_MIN_WAKEUP_US (200) |
Functions | |
static uint8_t | add_pending_extended_address_cb (void *buf_ptr, void *handle) |
static uint8_t | add_pending_short_address_cb (void *buf_ptr, void *handle) |
static uint8_t | mac_buffer_add_pending (uint8_t *buf_ptr) |
void | mac_build_and_tx_beacon (bool beacon_enabled) |
Builds and transmits the beacon frame. More... | |
void | mac_process_beacon_request (buffer_t *msg) |
Processes a beacon request. More... | |
void | mac_start_beacon_timer (void) |
Starts the beacon timer. More... | |
static void | mac_t_beacon_cb (void *callback_parameter) |
static void | mac_t_prepare_beacon_cb (void *callback_parameter) |
static void | mac_t_superframe_cb (void *callback_parameter) |
void | mac_tx_pending_bc_data (void) |
Variables | |
static uint8_t | beacon_buffer [LARGE_BUFFER_SIZE] |
static uint8_t * | beacon_ptr |
static uint8_t | pending_address_count |
static uint8_t | vpan_no |
#define ADVNC_BCN_PREP_TIME (50) |
Referenced by mac_t_beacon_cb().
#define BEACON_MAX_PEND_ADDR_CNT (7) |
Referenced by add_pending_extended_address_cb(), and add_pending_short_address_cb().
#define BEACON_PAYLOAD_LEN (4) |
Referenced by mac_build_and_tx_beacon().
#define MAC_MIN_WAKEUP_US (200) |
|
static |
References BEACON_MAX_PEND_ADDR_CNT, beacon_ptr, FCF_2_DEST_ADDR_OFFSET, FCF_ADDR_MASK, FCF_LONG_ADDR, frame_info_tag::mpdu, pending_address_count, PL_POS_DST_ADDR_START, and PL_POS_FCF_2.
Referenced by mac_buffer_add_pending().
|
static |
References BEACON_MAX_PEND_ADDR_CNT, beacon_ptr, FCF_2_DEST_ADDR_OFFSET, FCF_ADDR_MASK, FCF_SHORT_ADDR, frame_info_tag::mpdu, pending_address_count, PL_POS_DST_ADDR_START, and PL_POS_FCF_2.
Referenced by mac_buffer_add_pending().
|
static |
References add_pending_extended_address_cb(), add_pending_short_address_cb(), beacon_ptr, search_t::criteria_func, indirect_data_q, pending_address_count, and qmm_queue_read().
Referenced by mac_build_and_tx_beacon().
|
static |
References ADVNC_BCN_PREP_TIME, beacon_buffer, broadcast_q, FAILURE, FINAL_CAP_SLOT_DEFAULT, FUNC_PTR, MAC_ACTIVE_CAP, mac_final_cap_slot, MAC_SCAN_IDLE, mac_scan_state, MAC_SUCCESS, mac_superframe_state, mac_t_gts_cb(), mac_t_prepare_beacon_cb(), mac_t_superframe_cb(), mac_tx_pending_bc_data(), macBeaconTxTime, NON_BEACON_NWK, pal_add_time_us(), pal_sub_time_us(), pal_timer_start(), pal_timer_stop(), set_tal_pib_internal(), queue_tag::size, T_Beacon, T_Beacon_Preparation, T_CAP, T_Superframe, TAL_CONVERT_SYMBOLS_TO_US, TAL_CONVERT_US_TO_SYMBOLS, TAL_GET_BEACON_INTERVAL_TIME, TAL_GET_SUPERFRAME_DURATION_TIME, tal_pib, tal_tx_beacon(), TIMEOUT_ABSOLUTE, and TIMEOUT_RELATIVE.
Referenced by mac_start_beacon_timer().
|
static |
References mac_build_and_tx_beacon(), and mac_trx_wakeup().
Referenced by mac_t_beacon_cb().
|
static |
References MAC_INACTIVE, mac_sleep_trans(), and mac_superframe_state.
Referenced by mac_t_beacon_cb().
|
static |
Referenced by mac_build_and_tx_beacon(), and mac_t_beacon_cb().
|
static |
Referenced by add_pending_extended_address_cb(), add_pending_short_address_cb(), and mac_buffer_add_pending().
|
static |
Referenced by add_pending_extended_address_cb(), add_pending_short_address_cb(), and mac_buffer_add_pending().
|
static |
Referenced by mac_build_and_tx_beacon().