Microchip® Advanced Software Framework

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

This module provides configuration and utils for the serialization of PRIME MLME.

Enumerations

enum  ADDRESS_IND {
  NOADDRESS,
  EUI48,
  SNA_REQ
}
 

Functions

static int _serial_if_mlme_pack_active_conn (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_active_conn_ex (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_available_switch_table (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_direct_conn (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_direct_switch_table (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_ex_snr_table (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_list_phy_comm (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_mcast_entries (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_mlme_callback (uint8_t *puc_mlme_command, int l_len)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_node_432_table (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_reg_devices (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misalignments. More...
 
static int _serial_if_mlme_pack_switch_table (uint8_t *puc_buf_des, uint8_t *px_buf_org)
 Packets a MLME Callback to avoid misaligments. More...
 
static int _serial_if_mlme_unpack_demote_req_base (void)
 This function extracts the MLME SAP Demote.Request. More...
 
static int _serial_if_mlme_unpack_get_req (void)
 This function extracts the MLME SAP Get.Request. More...
 
static int _serial_if_mlme_unpack_list_get_req (void)
 This function extracts the MLME SAP List.Get.Request. More...
 
static int _serial_if_mlme_unpack_promote_req_base (void)
 This function extracts the MLME SAP Promote.Request. More...
 
static int _serial_if_mlme_unpack_register_req (void)
 This function extracts the MLME SAP Register.Request. More...
 
static int _serial_if_mlme_unpack_set_req (void)
 This function extracts the MLME SAP Set.Request. More...
 
static int _serial_if_mlme_unpack_unregister_req_base (void)
 This function extracts the MLME SAP Unregister.Request. More...
 
uint8_t serial_if_mlme_api_parser (uint8_t *puc_rx_msg, uint16_t us_len)
 Received message. More...
 
int8_t serial_if_mlme_process (void)
 Function to encapsulate MLME Tx Control Process. More...
 

Variables

static uint8_t commandMlmeToPack [MLME_DATA_SIZE]
 
static uint8_t NewMlmeCallBackCmd [MLME_DATA_SIZE]
 
static uint8_t * puc_rx
 

Enumerator
NOADDRESS 
EUI48 
SNA_REQ 

static int _serial_if_mlme_pack_active_conn ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_active_conn_ex ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_available_switch_table ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_direct_conn ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_direct_switch_table ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_ex_snr_table ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_list_phy_comm ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_mcast_entries ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_node_432_table ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH, and SERIAL_NUMBER_432_MAC.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_reg_devices ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misalignments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

References PRIME_MAC_LENGTH.

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_pack_switch_table ( uint8_t *  puc_buf_des,
uint8_t *  px_buf_org 
)
static

Packets a MLME Callback to avoid misaligments.

Parameters
puc_buf_desPointer to the destination buffer
px_buf_orgPointer to the source buffer
Return values
lengthof the buffer packet

Referenced by _serial_if_mlme_pack_mlme_callback().

static int _serial_if_mlme_unpack_demote_req_base ( void  )
static

This function extracts the MLME SAP Demote.Request.

Note
This function extracts the MLME SAP Demote.Request from the received packet and stores the data in the circular buffer if possible.
Return values
0primitive stored
-1primitive could not be stored

References PRIME_MAC_LENGTH, prime_MLME_DEMOTE_request_base(), and puc_rx.

Referenced by serial_if_mlme_api_parser().

static int _serial_if_mlme_unpack_get_req ( void  )
static

This function extracts the MLME SAP Get.Request.

Note
This function extracts the MLME SAP Get.Request from the received packet and stores the data in the circular buffer if possible.
Return values
0primitive stored
-1primitive could not be stored

References prime_MLME_GET_request(), and puc_rx.

Referenced by serial_if_mlme_api_parser().

static int _serial_if_mlme_unpack_list_get_req ( void  )
static

This function extracts the MLME SAP List.Get.Request.

Note
This function extracts the MLME SAP List.Get.Request from the received packet and stores the data in the circular buffer if possible.
Return values
0primitive stored
-1primitive could not be stored

References prime_MLME_LIST_GET_request(), and puc_rx.

Referenced by serial_if_mlme_api_parser().

static int _serial_if_mlme_unpack_promote_req_base ( void  )
static

This function extracts the MLME SAP Promote.Request.

Note
This function extracts the MLME SAP Promote.Request from the received packet and stores the data in the circular buffer if possible.
Return values
0primitive stored
-1primitive could not be stored

References PRIME_MAC_LENGTH, prime_MLME_PROMOTE_request_base(), and puc_rx.

Referenced by serial_if_mlme_api_parser().

static int _serial_if_mlme_unpack_register_req ( void  )
static

This function extracts the MLME SAP Register.Request.

Note
This function extracts the MLME SAP Register.Request from the received packet and stores the data in the circular buffer if possible.
Return values
0primitive stored
-1primitive could not be stored

References EUI48, NOADDRESS, PRIME_MAC_LENGTH, prime_MLME_REGISTER_request(), puc_rx, and SNA_REQ.

Referenced by serial_if_mlme_api_parser().

static int _serial_if_mlme_unpack_set_req ( void  )
static

This function extracts the MLME SAP Set.Request.

Note
This function extracts the MLME SAP Set.Request from the received packet and stores the data in the circular buffer if possible.
Return values
0primitive stored
-1primitive could not be stored

References PIB_CERTIFICATION_SEND_MSG, PIB_MAC_ACTION_APPEMU_DATA_BURST, PIB_MAC_ACTION_BROADCAST_BURST, PIB_MAC_ACTION_CONN_CLOSE_BN, PIB_MAC_ACTION_DEMOTE, PIB_MAC_ACTION_MGMT_CON, PIB_MAC_ACTION_MGMT_MUL, PIB_MAC_ACTION_PRM, PIB_MAC_ACTION_PROMOTE, PIB_MAC_ACTION_REJECT, PIB_MAC_ACTION_SEGMENTED_432, PIB_MAC_ACTION_UNREGISTER_BN, PIB_MAC_BOARD_SERIAL_NUMBER, PIB_MAC_EUI48, PRIME_MAC_LENGTH, prime_MLME_SET_BUF_request(), prime_MLME_SET_request(), and puc_rx.

Referenced by serial_if_mlme_api_parser().

static int _serial_if_mlme_unpack_unregister_req_base ( void  )
static

This function extracts the MLME SAP Unregister.Request.

Note
This function extracts the MLME SAP Unregister.Request from the received packet and stores the data in the circular buffer if possible.
Return values
0primitive stored
-1primitive could not be stored

References PRIME_MAC_LENGTH, prime_MLME_UNREGISTER_request_base(), and puc_rx.

Referenced by serial_if_mlme_api_parser().

int8_t serial_if_mlme_process ( void  )

Function to encapsulate MLME Tx Control Process.

Note
This function will be called using a pointer
Return values
0if the request has been sent
-1if the request has not been sent

References _serial_if_mlme_pack_mlme_callback(), prime_MLME_callback(), PROTOCOL_MLME_PRIME, x_usi_serial_cmd_params_t::ptr_buf, x_usi_serial_cmd_params_t::uc_protocol_type, x_usi_serial_cmd_params_t::us_len, and usi_send_cmd().

uint8_t commandMlmeToPack[MLME_DATA_SIZE]
static
uint8_t NewMlmeCallBackCmd[MLME_DATA_SIZE]
static