You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

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



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:

File: cosa_wifi_dml.c
API: WiFi_GetParamBoolValue
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



Flow of Get Operation

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:

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



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.



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



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.





  • No labels