#include <compiler.h>
#include <string.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 "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_config.h"
#include "mac_build_config.h"
Macros | |
#define | BEAC_REQ_ORPH_NOT_PAYLOAD_LEN (1) |
#define | BEACON_NETWORK_MAX_BO (14) |
#define | MAC_CALCULATE_SYMBOL_TIME_SCANDURATION(SD) (aBaseSuperframeDuration * ((1UL << (SD)) + 1)) |
Scan duration formula: \(aBaseSuperframeDuration (2^SD + 1)\) where \(0 <= SD <= 14\). More... | |
Functions | |
static void | mac_awake_scan (buffer_t *buff_ptr) |
void | mac_process_orphan_realign (buffer_t *buf_ptr) |
Processing a coordinator realignment command frame during Orphan scan. More... | |
void | mac_scan_send_complete (retval_t status) |
Continue scanning after the completion of frame transmission. More... | |
static void | mac_t_scan_duration_cb (void *callback_parameter) |
void | mlme_scan_request (uint8_t *m) |
The MLME-SCAN.request primitive makes a request for a node to start a scan procedure. More... | |
static void | scan_clean_up (buffer_t *buf) |
static void | scan_proceed (uint8_t scanning_type, buffer_t *buf) |
static void | scan_set_complete (retval_t set_status) |
Continue scanning after setting of PIB attributes. More... | |
static bool | send_scan_cmd (bool beacon_req) |
Send a beacon request or orphan notification command frame. More... | |
void | tal_ed_end_cb (uint8_t energy_level) |
ED scan callback function. More... | |
Variables | |
static uint32_t | scan_channels |
static uint8_t | scan_curr_channel |
static uint8_t | scan_curr_page |
static uint8_t | scan_duration |
static uint8_t | scan_type |
#define BEAC_REQ_ORPH_NOT_PAYLOAD_LEN (1) |
Referenced by send_scan_cmd().
#define BEACON_NETWORK_MAX_BO (14) |
Referenced by mlme_scan_request().
#define MAC_CALCULATE_SYMBOL_TIME_SCANDURATION | ( | SD | ) | (aBaseSuperframeDuration * ((1UL << (SD)) + 1)) |
Scan duration formula: \(aBaseSuperframeDuration (2^SD + 1)\) where \(0 <= SD <= 14\).
Referenced by mac_scan_send_complete(), and scan_set_complete().
|
static |
References Assert, bmm_buffer_alloc(), bmm_buffer_free(), BMM_BUFFER_POINTER, BROADCAST, mlme_scan_conf_tag::ChannelPage, mlme_scan_conf_tag::cmdcode, scan_result_list_t::ed_value, LARGE_BUFFER_SIZE, mac_conf_buf_ptr, MAC_INVALID_PARAMETER, mac_nhle_q, mac_scan_cmd_buf_ptr, MAC_SCAN_ED, mac_scan_orig_panid, mac_scan_state, mac_sleep_trans(), MAC_SUCCESS, macPANId, MIN_CHANNEL, MLME_SCAN_CONFIRM, MLME_SCAN_TYPE_ACTIVE, MLME_SCAN_TYPE_ED, MLME_SCAN_TYPE_ORPHAN, MLME_SCAN_TYPE_PASSIVE, qmm_queue_append(), mlme_scan_conf_tag::ResultListSize, scan_channels, scan_curr_channel, scan_curr_page, scan_proceed(), mlme_scan_conf_tag::scan_result_list, scan_type, mlme_scan_conf_tag::ScanType, set_tal_pib_internal(), mlme_scan_conf_tag::status, tal_pib, and mlme_scan_conf_tag::UnscannedChannels.
Referenced by mlme_scan_request().
|
static |
References BMM_BUFFER_POINTER, mac_conf_buf_ptr, MAC_SCAN_ACTIVE, MAC_SCAN_ORPHAN, MAC_SCAN_PASSIVE, mac_scan_state, scan_curr_channel, scan_proceed(), scan_type, and mlme_scan_conf_tag::UnscannedChannels.
Referenced by mac_scan_send_complete(), and scan_set_complete().
|
static |
References Assert, mac_nhle_q, MAC_SCAN_IDLE, mac_scan_orig_channel, mac_scan_orig_page, mac_scan_state, mac_sleep_trans(), MAC_SUCCESS, phyCurrentChannel, phyCurrentPage, qmm_queue_append(), scan_curr_channel, scan_curr_page, and set_tal_pib_internal().
Referenced by scan_proceed().
|
static |
References Assert, bmm_buffer_free(), BMM_BUFFER_POINTER, mac_pib_tag::mac_AutoRequest, mac_conf_buf_ptr, MAC_LIMIT_REACHED, mac_nhle_q, MAC_NO_BEACON, mac_pib, MAC_SCAN_ACTIVE, mac_scan_cmd_buf_ptr, MAC_SCAN_IDLE, mac_scan_orig_panid, MAC_SCAN_ORPHAN, MAC_SCAN_PASSIVE, mac_scan_state, mac_sleep_trans(), MAC_SUCCESS, macPANId, MAX_CHANNEL, MAX_PANDESCRIPTORS, MLME_SCAN_TYPE_ACTIVE, MLME_SCAN_TYPE_ED, MLME_SCAN_TYPE_ORPHAN, MLME_SCAN_TYPE_PASSIVE, phyCurrentChannel, phyCurrentPage, qmm_queue_append(), mlme_scan_conf_tag::ResultListSize, scan_clean_up(), scan_curr_channel, scan_curr_page, scan_set_complete(), set_tal_pib_internal(), mlme_scan_conf_tag::status, and mlme_scan_conf_tag::UnscannedChannels.
Referenced by mac_awake_scan(), mac_scan_send_complete(), mac_t_scan_duration_cb(), scan_set_complete(), and tal_ed_end_cb().
|
static |
Continue scanning after setting of PIB attributes.
This functions continues scanning once the corresponding PIB attribute change has been completed depending on the status.
set_status | Status of the Request to change the PIB attribute |
References Assert, FUNC_PTR, MAC_CALCULATE_SYMBOL_TIME_SCANDURATION, mac_conf_buf_ptr, MAC_SCAN_ACTIVE, MAC_SCAN_ED, MAC_SCAN_ORPHAN, MAC_SCAN_PASSIVE, mac_scan_state, MAC_SUCCESS, mac_t_scan_duration_cb(), MAKE_MAC_BUSY, MLME_SCAN_TYPE_PASSIVE, pal_timer_start(), PHY_RX_ON, scan_curr_channel, scan_duration, scan_proceed(), send_scan_cmd(), T_Scan_Duration, TAL_CONVERT_SYMBOLS_TO_US, tal_ed_start(), tal_rx_enable(), and TIMEOUT_RELATIVE.
Referenced by mac_process_orphan_realign(), and scan_proceed().
Send a beacon request or orphan notification command frame.
This function sends a beacon request or orphan notification command frame. An MPDU containing either a beacon request or an orphan notification command frame is constructed and sent.
beacon_req | True if a beacon request command frame shall be sent, otherwise (false) an orphan notification command frame will be sent. |
References BEAC_REQ_ORPH_NOT_PAYLOAD_LEN, BEACONREQUEST, BMM_BUFFER_POINTER, BROADCAST, frame_info_tag::buffer_header, convert_16_bit_to_byte_array(), convert_64_bit_to_byte_array(), convert_spec_16_bit_to_byte_array(), CSMA_UNSLOTTED, FCF_FRAMETYPE_MAC_CMD, FCF_LONG_ADDR, FCF_NO_ADDR, FCF_PAN_ID_COMPRESSION, FCF_SET_DEST_ADDR_MODE, FCF_SET_FRAMETYPE, FCF_SET_SOURCE_ADDR_MODE, FCF_SHORT_ADDR, LARGE_BUFFER_SIZE, mac_pib_tag::mac_DSN, mac_pib, mac_scan_cmd_buf_ptr, MAC_SUCCESS, MAKE_MAC_BUSY, frame_info_tag::mpdu, frame_info_tag::msg_type, NO_CSMA_NO_IFS, ORPHANNOTIFICATION, tal_pib, and tal_tx_frame().
Referenced by scan_set_complete().
void tal_ed_end_cb | ( | uint8_t | energy_level | ) |
ED scan callback function.
User call back function for finished ED Scan.
This function is a callback function from the TAL after ED scan is performed on a specified channel.
energy_level | Maximum energy on the channel |
References BMM_BUFFER_POINTER, scan_result_list_t::ed_value, mac_conf_buf_ptr, MAKE_MAC_NOT_BUSY, MLME_SCAN_TYPE_ED, mlme_scan_conf_tag::ResultListSize, scan_curr_channel, scan_proceed(), mlme_scan_conf_tag::scan_result_list, and mlme_scan_conf_tag::UnscannedChannels.
Referenced by ed_scan_done().
|
static |
Referenced by mac_awake_scan(), and mlme_scan_request().
|
static |
|
static |
Referenced by mac_awake_scan(), mlme_scan_request(), scan_clean_up(), and scan_proceed().
|
static |
Referenced by mac_scan_send_complete(), mlme_scan_request(), and scan_set_complete().
|
static |
Referenced by mac_awake_scan(), mac_scan_send_complete(), mac_t_scan_duration_cb(), and mlme_scan_request().