Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

In Progress

Scope

Objective is to add a Test Parameter in OneWiFi.

Steps to be followed:                                                                  

  • Identify the component and object to add new parameter.
  • In component XML file, add parameter with this set, get functions.
  • Define the set, get operations of parameters in OneWifi component.


Add a New Parameter

Code Snippet

Image Modified


Get Parameter API

The handle is taken from TR181-WiFi-USGv2.XML file and Get Parameter API will fetch the respective parameter value from OneWiFi DB.

Example:

Code Block
File: cosa_wifi_dml.c


API: WiFi_GetParamBoolValue

Code Block
languagecpp

if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_TestParameter", TRUE))
    {
        *pBool = pcfg->test_parameter;
        return TRUE;
    }

In the above example, the value for the test parameter is fetched from wifi_global_param_t structure that is to a WiFiDB. Get the respective parameters value from WiFiDB.


Code Snippet

Image Added


Image Added

Flow of Get Operation

Image Added

Set Parameter API

The handle for setting a parameter value is taken from TR181-WiFi-USGv2.XML file and SetParameter API will push the changes. This API either pushes the changes to a queue () or will store values till HAL layer (on driver level)

Example:

Code Block

File: cosa_wifi_dml.c
API: WiFi_SetParamBoolValue

if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_TestParameter", TRUE))
{
if(global_wifi_config->global_parameters.test_parameter == bValue)
{
return TRUE;
}
wifi_util_dbg_print(WIFI_DMCLI,"%s:%d:test_parameter=%d Value = %d  \n",__func__, __LINE__,global_wifi_config->global_parameters.test_parameter,bValue);
global_wifi_config->global_parameters.test_parameter = bValue;
push_global_config_dml_cache_to_one_wifidb();
push_test_parameter_ctrl_queue(bValue);
return TRUE;
}

Code Snippet

Image Added

Image Added

Whenever an update is made to the Test Parameter, it must be pushed to the global config dml cache to one wifidb, along with its value. From cosa_wifi_dml.c file the control then goes to dml_onewifi_apis.c file.

Image Added

push_global_config_dml_cache_to_one_wifidb API is the generic API for all parameters, which pushes the value to queue.

Image Added

Here push_test_parameter_ctrl_queue API is defined specifically for Test Parameter and the value could directly pushed to queue with the above API.