Skip to content

RDKEMW-14684 Implement Radio Data Model Parameters for RDKE - #380

Open
nhanasi wants to merge 9 commits into
developfrom
topic/RDKEMW-14888
Open

RDKEMW-14684 Implement Radio Data Model Parameters for RDKE#380
nhanasi wants to merge 9 commits into
developfrom
topic/RDKEMW-14888

Conversation

@nhanasi

@nhanasi nhanasi commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Implement Radio Data Model Parameters for RDKE

Copilot AI review requested due to automatic review settings March 4, 2026 18:29
@nhanasi
nhanasi requested a review from a team as a code owner March 4, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements additional WiFi Radio data model parameters intended for RDKE/WALDB by exposing Device.WiFi.Radio.{i}.OperatingChannelBandwidth and Device.WiFi.Radio.{i}.Stats fields through the hostIf WiFi request handler and the generic WALDB data model.

Changes:

  • Added WALDB generic data model entries for OperatingChannelBandwidth, Stats.PacketsReceived, and Stats.Noise.
  • Updated WiFi Radio/Radio_Stats hostIf implementations to compile without RDKV_NM and provide values for the new parameters.
  • Extended WiFiReqHandler::handleGetMsg() (non-TR69 path) to route the new Device.WiFi.Radio.* parameters to the appropriate getters.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/unittest/stubs/dsVideoDeviceTypes.h Adds an extra leading blank line in the stub header.
src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.h Makes NoiseFloor signed and removes RDKV_NM gating around props fetch declarations.
src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.cpp Refactors RDKV_NM usage and adds non-RDKV_NM fallback behavior for stats props.
src/hostif/profiles/wifi/Device_WiFi_Radio.h Removes RDKV_NM gating around radio props fetch declarations.
src/hostif/profiles/wifi/Device_WiFi_Radio.cpp Refactors RDKV_NM usage and adds non-RDKV_NM fallback behavior for radio props.
src/hostif/parodusClient/waldb/data-model/data-model-generic.xml Adds the new Radio / Radio.Stats parameters to the generic WALDB data model.
src/hostif/handlers/src/hostIf_WiFi_ReqHandler.cpp Adds non-TR69 routing for the new Radio parameters.
Comments suppressed due to low confidence (1)

src/hostif/profiles/wifi/Device_WiFi_Radio_Stats.cpp:232

  • PacketsReceived is modeled as an unsigned long (and WALDB XML declares it as unsignedLong), but this getter writes it via put_int and sets paramtype to hostIf_UnsignedIntType with paramLen=4. This can truncate values and can also cause a type mismatch for the new RDKE data model parameter; use hostIf_UnsignedLongType and write the value with the appropriate helper/size (consistent with other stats getters in the codebase, e.g. WiFi EndPoint stats).
int hostIf_WiFi_Radio_Stats::get_Device_WiFi_Radio_Stats_PacketsReceived(HOSTIF_MsgData_t *stMsgData,int radioIndex )
{
    RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Entering..\n", __FUNCTION__, __FILE__);
    checkWifiRadioPropsFetch(radioIndex);
    put_int(stMsgData->paramValue, PacketsReceived);
    stMsgData->paramtype = hostIf_UnsignedIntType;
    stMsgData->paramLen=4;
    RDK_LOG(RDK_LOG_TRACE1,LOG_TR69HOSTIF,"[%s:%s] Exiting..\n", __FUNCTION__, __FILE__);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 159 to 164
int hostIf_WiFi_Radio::get_Device_WiFi_Radio_Props_Fields(int radioIndex)
{
#ifdef RDKV_NM
IARM_Result_t retVal = IARM_RESULT_SUCCESS;
IARM_BUS_WiFi_DiagsPropParam_t param = {0};
int ret;

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside get_Device_WiFi_Radio_Props_Fields() (in the #ifdef RDKV_NM section), several snprintf() calls pass the source string as the format argument (format-string vulnerability) and at least one call uses a size (BUFF_LENGTH_1024) that is larger than the destination buffer (OperatingChannelBandwidth is char[BUFF_MIN_16]), risking memory corruption. Please switch these to safe string copies (e.g., strcpy_s/strncpy) or snprintf(dest, sizeof(dest), "%s", src) with the correct destination size for every field.

Copilot uses AI. Check for mistakes.
@@ -1,3 +1,4 @@

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A leading blank line was added before the file header comment. This breaks the common convention of having the copyright header at the very top of the file; please remove the extra blank line.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines +212 to +219
#else
hostIf_WiFi_Radio *pDev = hostIf_WiFi_Radio::getInstance(dev_id);
if(pDev)
{
snprintf(OperatingChannelBandwidth,BUFF_MIN_16,"80MHz");
radioFirstExTime = time (NULL);
return OK;
}

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In non-RDKV_NM builds this function populates OperatingChannelBandwidth with a hard-coded value ("80MHz") and returns OK. Since this path is used by the new RDKE/WALDB data model parameters, it will report incorrect values at runtime; please fetch the real value via the non-RDKV_NM mechanism used elsewhere (Thunder/NetworkManager JSON-RPC), or return NOK / "Not Implemented" instead of a constant.

Copilot uses AI. Check for mistakes.
Comment on lines +154 to +162
#else
hostIf_WiFi_Radio_Stats *pDev = hostIf_WiFi_Radio_Stats::getInstance(dev_id);
if(pDev)
{
PacketsReceived = 65568;
NoiseFloor = -100;
radioFirstExTime = time (NULL);
return OK;
}

Copilot AI Mar 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In non-RDKV_NM builds this code returns hard-coded values for PacketsReceived and NoiseFloor and returns OK. This will make the new RDKE/WALDB parameters report bogus data; please fetch real stats using the non-RDKV_NM approach already used in other WiFi profile codepaths (Thunder/NetworkManager JSON-RPC), or fail the request (NOK / invalid parameter) rather than returning constants.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants