RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Info |
---|
In Progress |
Objective is to add a Test Parameter in OneWiFi.
Steps to be followed:
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:
Code Block |
---|
File: cosa_wifi_dml.c |
API: WiFi_GetParamBoolValue |
Code Block | ||
---|---|---|
| ||
if (AnscEqualString(ParamName, "X_RDKCENTRAL-COM_TestParameter", TRUE)) { *pBool = pcfg->test_parameter; return TRUE; } |
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:
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
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.