System Configuration Stack

Overview

  • The RAPIDSEA System Configuration Stack enables developers to rapidly incorporate device configuration format and update parameters.

  • System configuration parameters are required in embedded devices and are also referred to as system settings. Based on those system settings, the device can enable and control the relevant hardware and software processes. The configuration can be done through any interface, depending on the device interface selected and availability.

Supported features

  • System configuration parameter mapping

  • System configuration update

  • Multiple interface selection and support

  • Configuration update indication from remote device

  • Configuration update status to remote device

  • Lower memory footprint

  • Configuration statistics

  • Configuration storage and backup support by EEPROM/ External memory.

Architecture

  • System configuration enables connectivity with remote device using through a dedicated interface selection and communication protocol . The below diagram depicts the stack with its underlying physical connection along with higher level modules.

  • The below diagram captures the high level block diagram of the RAPIDSEA System configuration module and how it interfaces with other modules.

RAPIDSEA System Configuration Architecture

Application Interface

The below table captures the function that are to be called from the application logic.

API Functions

Function

Description

rs_sys_conf_init

To initialize the system configuration stack

rs_sys_conf_register_callback

To register the callback function to be called on events

rs_sys_conf_data_begin

To handle the system configuration begin packet process

rs_sys_conf_data

To validate the system configuration data

rs_sys_conf_data_end

To handle the process of the system configuration end packet

rs_sys_conf_set_status

To update system configuration status

rs_sys_conf_get_status

To gets the System configuration status

rs_sys_conf_callback

Callback function format

System Configuration Header Details

Documentation from the relevant header as follows:

System configuration Specific APIs.

Defines macros and functions specific to System configuration functionality

Author

Embien RAPIDSEA Team

Copyright

Embien Technologies India Pvt. Ltd.

Defines

RS_SYS_CONF_NEW_CONF_RECEIVED

New system configuration received.

RS_SYS_CONF_JSON_VALIDATION_ERROR

System configuration json validation error.

RS_SYS_CONF_PARAMETER_ERROR

System configuration parameter error.

RS_SYS_CONF_VALID

System configuration valid status.

RS_SYS_CONF_INVALID

System configuration invalid status.

RS_SYS_CONF_FORMAT_JSON

System configuration format.

Typedefs

typedef void (*rs_sys_conf_callback)(rs_handle_t handle, rs_ret_val_t result)

Callback function format.

This callback function is called on system configuration event basics

Param handle:

[in] - Handle to the system configuration

Param result:

[in] - Result of the system configuration process

Return:

None

typedef struct tag_rs_sys_config rs_sys_config_instance_t

Structure for system configuration information.

Functions

rs_handle_t rs_sys_conf_init(rs_sys_config_instance_t *ptr_instance, uint8_t sys_conf_type, void *ptr_json_attr, void *ptr_sys_config, uint32_t u32_sys_conf_size)

Initialize the system configuration instance to process the system configuration data.

This function configures the system configuration JSON format and system configuration structure pointer to further process it.

Parameters:
  • ptr_instance[in] - Pointer to the system configuration instance

  • sys_conf_type[in] - Type to initialize the system configuration format.

  • ptr_json_attr[in] - Pointer to set the JSON attributes

  • ptr_sys_config[in] - Pointer of user system configuration structure.

  • u32_sys_conf_size[in] - system configuration size

Returns:

handle to system configuration initialization on success or error code on failure

rs_ret_val_t rs_sys_conf_register_callback(rs_handle_t handle, rs_sys_conf_callback ptr_func)

Registers the given callback function for event of system configuration process.

This function registers the given callback function for event of system configuration

Parameters:
  • handle[in] - Handle to the system configuration

  • ptr_func[in] - Callback function to call the system configuration callback.

Returns:

0 on success or error code on failure

rs_ret_val_t rs_sys_conf_data_begin(rs_handle_t handle)

System configuration begin packet process.

This function clears the system configuration attributes and variables and wait for the begin request.

Parameters:

handle[in] - Handle to the system configuration

Returns:

0 on success or error code on failure

rs_ret_val_t rs_sys_conf_data(rs_handle_t handle, void *ptr_buffer, uint32_t u32_sys_conf_size)

Validate the system configuration data.

This function process the system configuration data, validate with configured JSON format and trigger the callback with status

Parameters:
  • handle[in] - Handle to the system configuration

  • ptr_buffer[in] - Pointer of system configuration buffer

  • u32_sys_conf_size[in] - system configuration size

Returns:

0 on success or error code on failure

rs_ret_val_t rs_sys_conf_data_end(rs_handle_t handle)

System configuration End packet process.

This function waits for the end packet and process it.

Parameters:

handle[in] - Handle to the system configuration

Returns:

0 on success or error code on failure

rs_ret_val_t rs_sys_conf_set_status(rs_handle_t handle, uint8_t u8_status)

System configuration status update.

This function sets the system configuration status.

Parameters:
  • handle[in] - Handle to the system configuration

  • u8_status[in] - Set the status VALID/INVALID

Returns:

0 on success or error code on failure

rs_ret_val_t rs_sys_conf_get_status(rs_handle_t handle)

Gets the System configuration status.

This function return the last system configuration status.

Parameters:

handle[in] - Handle to the system configuration

Returns:

0 on VALID or non zero on INVALID

struct tag_rs_sys_config
#include <rs_sys_conf.h>

Structure for system configuration information.

Public Members

uint8_t sys_conf_type

System configuration type.

uint8_t *ptr_json_format_attr

Pointer to JSON format attribute.

uint8_t *ptr_sys_config

System configuration pointer buffer.

uint32_t u32_max_config_buff_size

System Configuration size.

rs_sys_conf_callback ptr_cb

Pointer to the callback function.

uint8_t u8_sys_configuration_status

System configuration status.