Microchip® Advanced Software Framework

mac.h File Reference

Provides MAC API to access MAC Layer functionality.

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

#include <stdint.h>
#include <stdbool.h>
#include "stack_config.h"
#include "tal_generic.h"
#include "return_val.h"
#include "mac_api.h"
#include "qmm.h"
#include "mac_build_config.h"

Macros

#define FCF_ADDR_MASK   (3)
 
#define FCF_GET_DEST_ADDR_MODE(x)   (((x) >> FCF_DEST_ADDR_OFFSET) & FCF_ADDR_MASK)
 
#define FCF_GET_SOURCE_ADDR_MODE(x)   (((x) >> FCF_SOURCE_ADDR_OFFSET) & FCF_ADDR_MASK)
 
#define MAX_ALLOWED_PAN_DESCRIPTORS
 Maximum allowed PANDescriptors that is calculated using the large buffer size. More...
 
#define MAX_PANDESCRIPTORS   (MAX_ALLOWED_PAN_DESCRIPTORS > 5 ? 5 : MAX_ALLOWED_PAN_DESCRIPTORS)
 Active/passive scan: implementation-defined maximum number of PANDescriptors that can be stored. More...
 

Functions

uint8_t mac_extract_mhr_addr_info (uint8_t *frame_ptr)
 
retval_t mac_init (void)
 Initializes the MAC sublayer. More...
 
bool mac_task (void)
 Runs the MAC scheduler. More...
 
void mcps_data_conf (uint8_t *m)
 Wrapper function for messages of type mcps_data_conf_t. More...
 
void mcps_data_ind (uint8_t *m)
 Wrapper function for messages of type mcps_data_ind_t. More...
 
void mcps_data_request (uint8_t *msg)
 Builds the data frame for transmission. More...
 
void mcps_purge_conf (uint8_t *m)
 Wrapper function for messages of type mcps_purge_conf_t. More...
 
void mcps_purge_request (uint8_t *msg)
 Processes a MCPS-PURGE.request primitive. More...
 
void mlme_associate_conf (uint8_t *m)
 Wrapper function for messages of type mlme_associate_conf_t. More...
 
void mlme_associate_ind (uint8_t *m)
 Wrapper function for messages of type mlme_associate_ind_t. More...
 
void mlme_associate_request (uint8_t *m)
 Handles the MLME associate request command from the NWK layer. More...
 
void mlme_associate_response (uint8_t *m)
 Entry point from the stack for MLME associate response. More...
 
void mlme_beacon_notify_ind (uint8_t *m)
 Wrapper function for messages of type mlme_beacon_notify_ind_t. More...
 
void mlme_comm_status_ind (uint8_t *m)
 Wrapper function for messages of type mlme_comm_status_ind_t. More...
 
void mlme_disassociate_conf (uint8_t *m)
 Wrapper function for messages of type mlme_disassociate_conf_t. More...
 
void mlme_disassociate_ind (uint8_t *m)
 Wrapper function for messages of type mlme_disassociate_ind_t. More...
 
void mlme_disassociate_request (uint8_t *m)
 Handles the MLME disassociate request command from the NWK layer. More...
 
retval_t mlme_get (uint8_t attribute, pib_value_t *attribute_value)
 
void mlme_get_conf (uint8_t *m)
 Wrapper function for messages of type mlme_get_conf_t. More...
 
void mlme_get_request (uint8_t *m)
 Handles an MLME-GET.request. More...
 
void mlme_orphan_ind (uint8_t *m)
 Wrapper function for messages of type mlme_orphan_ind_t. More...
 
void mlme_orphan_response (uint8_t *m)
 Implements the MLME-ORPHAN.response. More...
 
void mlme_poll_conf (uint8_t *m)
 Wrapper function for messages of type mlme_poll_conf_t. More...
 
void mlme_poll_request (uint8_t *m)
 Implements MLME-POLL.request. More...
 
void mlme_reset_conf (uint8_t *m)
 Wrapper function for messages of type mlme_reset_conf_t. More...
 
void mlme_reset_request (uint8_t *m)
 Resets the MAC layer. More...
 
void mlme_rx_enable_conf (uint8_t *m)
 Wrapper function for messages of type mlme_rx_enable_conf_t. More...
 
void mlme_rx_enable_request (uint8_t *m)
 Implement the MLME-RX-ENABLE.request primitive. More...
 
void mlme_scan_conf (uint8_t *m)
 Wrapper function for messages of type mlme_scan_conf_t. More...
 
void mlme_scan_request (uint8_t *m)
 The MLME-SCAN.request primitive makes a request for a node to start a scan procedure. More...
 
retval_t mlme_set (uint8_t attribute, pib_value_t *attribute_value, bool set_trx_to_sleep)
 
void mlme_start_conf (uint8_t *m)
 Wrapper function for messages of type mlme_start_conf_t. More...
 
void mlme_start_request (uint8_t *m)
 The MLME-START.request primitive makes a request for the device to start using a new superframe configuration. More...
 
void mlme_sync_loss_ind (uint8_t *m)
 Wrapper function for messages of type mlme_sync_loss_ind_t. More...
 
void mlme_sync_request (uint8_t *m)
 Implements the MLME-SYNC request. More...
 

Variables

queue_t mac_nhle_q
 Queue used by MAC for communication to next higher layer. More...
 
queue_t nhle_mac_q
 

#define FCF_ADDR_MASK   (3)
#define FCF_GET_DEST_ADDR_MODE (   x)    (((x) >> FCF_DEST_ADDR_OFFSET) & FCF_ADDR_MASK)
#define FCF_GET_SOURCE_ADDR_MODE (   x)    (((x) >> FCF_SOURCE_ADDR_OFFSET) & FCF_ADDR_MASK)
#define MAX_ALLOWED_PAN_DESCRIPTORS
Value:
#define LARGE_BUFFER_SIZE
The following macros hold the size of a large buffer.
Definition: stack_config.h:129
This is the MLME-SCAN.confirm message structure.
Definition: mac_msg_types.h:630
PAN descriptor information structure.
Definition: mac_api.h:129

Maximum allowed PANDescriptors that is calculated using the large buffer size.

#define MAX_PANDESCRIPTORS   (MAX_ALLOWED_PAN_DESCRIPTORS > 5 ? 5 : MAX_ALLOWED_PAN_DESCRIPTORS)

Active/passive scan: implementation-defined maximum number of PANDescriptors that can be stored.

uint8_t mac_extract_mhr_addr_info ( uint8_t *  frame_ptr)
retval_t mlme_get ( uint8_t  attribute,
pib_value_t attribute_value 
)
retval_t mlme_set ( uint8_t  attribute,
pib_value_t attribute_value,
bool  set_trx_to_sleep 
)

queue_t mac_nhle_q

Queue used by MAC for communication to next higher layer.

queue_t nhle_mac_q