Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

The MAC Core Layer (MCL) abstracts and implements IEEE 802.15.4-2006 compliant behavior for non-beacon enabled and beacon-enabled network support.

Macros

#define MAKE_MAC_BUSY()
 This macro sets the MAC to busy. More...
 
#define MAKE_MAC_NOT_BUSY()
 This macro sets the MAC to not busy. More...
 

Functions

void dispatch_event (uint8_t *event)
 Obtains the message type from the buffer and calls the respective handler. More...
 
void mac_gen_mcps_data_conf (buffer_t *buf_ptr, uint8_t status, uint8_t handle)
 
void mac_idle_trans (void)
 Resets the MAC helper variables and transition to idle state. More...
 
void mac_process_data_frame (buffer_t *buf_ptr)
 Processes data frames. More...
 
void mac_process_tal_data_ind (uint8_t *msg)
 Depending on received frame the appropriate function is called. More...
 
void mac_sleep_trans (void)
 Puts the radio to sleep if this is allowed. More...
 
void mac_trx_init_sleep (void)
 MAC function to put the radio to sleep mode. More...
 
void mac_trx_wakeup (void)
 MAC function to wake-up the radio from sleep state. More...
 
retval_t set_tal_pib_internal (uint8_t attribute, pib_value_t *attribute_value)
 Wakes-up the radio and sets the corresponding TAL PIB attribute. More...
 

#define MAKE_MAC_BUSY ( )
Value:
do { \
mac_busy = true; \
} \
while (0)
bool mac_busy
MAC busy state, indicates whether MAC can process any request from NHLE.
Definition: mac.c:192

This macro sets the MAC to busy.

Referenced by mac_process_tal_tx_status(), and mcps_data_request().

#define MAKE_MAC_NOT_BUSY ( )
Value:
do { \
mac_busy = false; \
} \
while (0)
bool mac_busy
MAC busy state, indicates whether MAC can process any request from NHLE.
Definition: mac.c:192

This macro sets the MAC to not busy.

Referenced by tal_tx_frame_done_cb().

void dispatch_event ( uint8_t *  event)

Obtains the message type from the buffer and calls the respective handler.

This function decodes all events/messages and calls the appropriate handler.

Parameters
eventPointer to the buffer header whose body part holds the message type and message elemnets

References Assert, bmm_buffer_free(), BMM_BUFFER_POINTER, CMD_ID_OCTET, LAST_MESSAGE, and PGM_READ_WORD.

Referenced by mac_task().

void mac_gen_mcps_data_conf ( buffer_t buf_ptr,
uint8_t  status,
uint8_t  handle 
)
void mac_idle_trans ( void  )

Resets the MAC helper variables and transition to idle state.

This function sets the MAC to idle state and resets MAC helper variables

References Assert, mac_sleep_trans(), mac_soft_reset(), MAC_SUCCESS, mac_trx_wakeup(), macPANId, macPANId_def, macShortAddress, macShortAddress_def, and set_tal_pib_internal().

Referenced by mac_process_tal_data_ind(), mac_process_tal_tx_status(), and process_data_ind_not_transient().

void mac_trx_init_sleep ( void  )
retval_t set_tal_pib_internal ( uint8_t  attribute,
pib_value_t attribute_value 
)

Wakes-up the radio and sets the corresponding TAL PIB attribute.

Parameters
attributePIB attribute to be set
attribute_valueAttribute value to be set
Returns
Status of the attempt to set the TAL PIB attribute

References mac_radio_sleep_state, mac_sleep_trans(), mac_trx_wakeup(), RADIO_SLEEPING, and tal_pib_set().

Referenced by mac_coord_realignment_command_tx_success(), mac_idle_trans(), mlme_start_request(), and process_data_ind_not_transient().