Microchip® Advanced Software Framework

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

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

Functions

static int _serial_if_plme_pack_plme_callback (uint8_t *puc_plme_command, int l_len)
 Packets a PLME Callback to avoid misaligments. More...
 
static int _serial_if_plme_unpack_get_req (void)
 This function extracts the PLME SAP Get.Request. More...
 
static int _serial_if_plme_unpack_set_req (void)
 This function extracts the PLME SAP Set.Request. More...
 
static int _serial_if_plme_unpack_testmode_req (void)
 This function extracts the PLME SAP Testmode.Request. More...
 
uint8_t serial_if_plme_api_parser (uint8_t *puc_rx_msg, uint16_t us_len)
 Received message. More...
 
int8_t serial_if_plme_process (void)
 Function to encapsulate PLME Tx Control Process. More...
 

Variables

static uint8_t commandPlmeToPack [PRIME_PLME_DATA_SIZE]
 
static uint8_t NewPlmeCallBackCmd [PRIME_PLME_DATA_SIZE]
 
static uint8_t * puc_rx
 

static int _serial_if_plme_pack_plme_callback ( uint8_t *  puc_plme_command,
int  l_len 
)
static

Packets a PLME Callback to avoid misaligments.

Parameters
puc_plme_commandPointer to the PLME command
l_lenCommand length
Return values
lengthof the buffer packet

References PRIME_PLME_GET_CONFIRM, PRIME_PLME_RESET_CONFIRM, PRIME_PLME_RESUME_CONFIRM, PRIME_PLME_SET_CONFIRM, PRIME_PLME_SLEEP_CONFIRM, and PRIME_PLME_TESTMODE_CONFIRM.

Referenced by serial_if_plme_process().

static int _serial_if_plme_unpack_get_req ( void  )
static

This function extracts the PLME SAP Get.Request.

Note
This function extracts the PLME 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_PLME_GET_request(), and puc_rx.

Referenced by serial_if_plme_api_parser().

static int _serial_if_plme_unpack_set_req ( void  )
static

This function extracts the PLME SAP Set.Request.

Note
This function extracts the PLME 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 prime_PLME_SET_BUF_request(), prime_PLME_SET_request(), and puc_rx.

Referenced by serial_if_plme_api_parser().

static int _serial_if_plme_unpack_testmode_req ( void  )
static

This function extracts the PLME SAP Testmode.Request.

Note
This function extracts the PLME SAP Testmode.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_PLME_TESTMODE_request(), and puc_rx.

Referenced by serial_if_plme_api_parser().

uint8_t serial_if_plme_api_parser ( uint8_t *  puc_rx_msg,
uint16_t  us_len 
)

Received message.

Note
Process Dialogue with peer
  • Proces Profiles
  • Wait for received message
  • Process incoming message
  • Send response if necessary
Parameters
puc_rx_msgPointer to the data attached to the connection request
us_lenData length of the data attached to the request
Return values
1primitive stored
0primitive could not be stored

References _serial_if_plme_unpack_get_req(), _serial_if_plme_unpack_set_req(), _serial_if_plme_unpack_testmode_req(), CMD_PRIME_PROTOCOL, PRIME_PLME_GET_REQUEST, PRIME_PLME_RESET_REQUEST, prime_PLME_RESET_request(), PRIME_PLME_RESUME_REQUEST, prime_PLME_RESUME_request(), PRIME_PLME_SET_REQUEST, PRIME_PLME_SLEEP_REQUEST, prime_PLME_SLEEP_request(), PRIME_PLME_TESTMODE_REQUEST, and UNUSED.

Referenced by _process_msg().

int8_t serial_if_plme_process ( void  )

Function to encapsulate PLME Tx Control Process.

  @param
 @return

This function will be called using a pointer

References _serial_if_plme_pack_plme_callback(), prime_PLME_callback(), PROTOCOL_PLME_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 commandPlmeToPack[PRIME_PLME_DATA_SIZE]
static
uint8_t NewPlmeCallBackCmd[PRIME_PLME_DATA_SIZE]
static