Skip to content

RDKBWIFI-454: Added station RSSI (unassociated STA statistics) implementation#1157

Open
vlad-safonov wants to merge 13 commits into
rdkcentral:developfrom
vlad-safonov:RDKBWIFI-454-adding-station-RSSI
Open

RDKBWIFI-454: Added station RSSI (unassociated STA statistics) implementation#1157
vlad-safonov wants to merge 13 commits into
rdkcentral:developfrom
vlad-safonov:RDKBWIFI-454-adding-station-RSSI

Conversation

@vlad-safonov

@vlad-safonov vlad-safonov commented May 29, 2026

Copy link
Copy Markdown
Contributor

Reason for change: added implementation of new RBUS method "Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_GetNaSta". Aslo added support unassoc STA datamodel in the Easymesh translator

Dependent PR: rdk-wifi-hal/#721, rdkb-halif-wifi/#109

Test procedure: Execute rbus request: Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_GetNaSta
with Json string, e.g.

  "Version": "1.0",
  "SubDocName": "UnassocStaQuery",
  "UnassocStaQueryList": [
    {
      "opclass": 115,
      "channels_length": 2,
      "channels": [
        {
          "channel": 36,
          "sta_list_length": 2,
          "sta_macs": ["AA:BB:CC:DD:EE:01", "AA:BB:CC:DD:EE:02"]
        },
        {
          "channel": 40,
          "sta_list_length": 1,
          "sta_macs": ["AA:BB:CC:DD:EE:03"]
        }
      ]
    },
    {
      "opclass": 128,
      "channels_length": 1,
      "channels": [
        {
          "channel": 40,
          "sta_list_length": 1,
          "sta_macs": ["AA:BB:CC:DD:EE:04"]
        }
      ]
    }
  ]
}

and subscribe for rbus event Device.WiFi.EM.NaStaResponse:, expect to get response, like this

{
  "UnassociatedSTALinkMetricsResponse": {
    "num_sta": 2,
    "sta_list": [
      {
        "sta_mac": "AA:BB:CC:DD:EE:FF",
        "channel": 6,
        "op_class": 81,
        "rcpi": 120
      },
      {
        "sta_mac": "11:22:33:44:55:66",
        "channel": 36,
        "op_class": 115,
        "rcpi": 95
      }
    ],
  }
}

Note: Channel parameter:
The primary channel is expected in "UnassocStaQuery" JSON. "op_class" and primary channel are used internally to calculate center frequency and bandwidth.

RCPI:

MAX_RSSI = MAX(RSSI[ant0]...RSSI[ant4]);
RCPI = (MAX_RSSI + 110) * 2;
RCPI = CLAP(RCPI, 0, 220);

Priority: P2
Risks: Low

@vlad-safonov vlad-safonov requested a review from a team as a code owner May 29, 2026 13:40
@vlad-safonov vlad-safonov marked this pull request as draft May 29, 2026 13:40
@github-actions github-actions Bot added the community contribution Contributions from community. label May 29, 2026
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: 57708ce
Report detail: https://gist.github.com/rdkcmf-jenkins/b578d829cf751f171fddb51314ed8651'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 2 files pending identification.

  • Protex Server Path: /home/blackduck/github/OneWifi/1157/rdkb/components/opensource/ccsp/OneWifi

  • Commit: 57708ce

Report detail: gist'

@vlad-safonov vlad-safonov force-pushed the RDKBWIFI-454-adding-station-RSSI branch from 173a212 to ac79d94 Compare May 29, 2026 13:50
@vlad-safonov vlad-safonov marked this pull request as ready for review May 29, 2026 14:28
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: ac79d94
Report detail: https://gist.github.com/rdkcmf-jenkins/b807dcb2ebfc2eb703bf1e649dc89436'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/OneWifi/1157/rdkb/components/opensource/ccsp/OneWifi

  • Commit: ac79d94

Report detail: gist'

@vlad-safonov

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@vlad-safonov vlad-safonov changed the title Added station RSSI (unassociated STA statistics) implementation RDKBWIFI-454: Added station RSSI (unassociated STA statistics) implementation May 29, 2026
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: c6613ee
Report detail: https://gist.github.com/rdkcmf-jenkins/91b9e37f107cdb5612c5af07dd0ad959'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/OneWifi/1157/rdkb/components/opensource/ccsp/OneWifi

  • Commit: c6613ee

Report detail: gist'

@vlad-safonov vlad-safonov marked this pull request as draft June 1, 2026 09:57
@vlad-safonov vlad-safonov force-pushed the RDKBWIFI-454-adding-station-RSSI branch 3 times, most recently from ec58522 to ca4a5a3 Compare June 1, 2026 13:11
@vlad-safonov vlad-safonov marked this pull request as ready for review June 1, 2026 13:12
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Copyright scan failure
Commit: ca4a5a3
Report detail: https://gist.github.com/rdkcmf-jenkins/a921424702e64f2fad7225396af30281'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/OneWifi/1157/rdkb/components/opensource/ccsp/OneWifi

  • Commit: ca4a5a3

Report detail: gist'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/OneWifi/1157/rdkb/components/opensource/ccsp/OneWifi

  • Commit: ca4a5a3

Report detail: gist'

@mhughesacn

Copy link
Copy Markdown

Hi @vlad-safonov : Please add a credit for MaxLinear to the end of the NOTICE file at the top level in this component:

Copyright 2026 MaxLinear, Inc
Licensed under the Apache License, Version 2.0

and I will clear off the checks.
Thank you - MartinH, RDK CMF Compliance Team

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## Blackduck scan failure details

Summary: 0 violations, 0 files pending approval, 3 files pending identification.

  • Protex Server Path: /home/blackduck/github/OneWifi/1157/rdkb/components/opensource/ccsp/OneWifi

  • Commit: 9cb0642

Report detail: gist'

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

b'## WARNING: A Blackduck scan failure has been waived

A prior failure has been upvoted

  • Upvote reason: Thank you

  • Commit: 9cb0642
    '

Comment thread source/webconfig/Makefile.am

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

This PR adds support for unassociated station (NaSta) RSSI statistics by introducing a new WebConfig subdoc (UnassocStaQuery), wiring it into the controller apply path, and exposing a new RBUS method Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_GetNaSta that publishes results asynchronously via Device.WiFi.EM.NaStaResponse.

Changes:

  • Add UnassocStaQuery WebConfig subdoc with request decode + response encode.
  • Add controller apply logic to call wifi_getNASta() and publish an async RBUS response event.
  • Add an RBUS test utility (wifi_rbus) plus MXL-specific scaffolding for wifi_api2.

Reviewed changes

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

Show a summary per file
File Description
source/webconfig/wifi_webconfig.c Registers the new webconfig_subdoc_type_nasta_query subdoc.
source/webconfig/wifi_webconfig_nasta.c Implements NaSta query decode and response encode logic.
source/webconfig/Makefile.am Adds wifi_webconfig_nasta.c to libwifi_webconfig sources.
source/test/wifi_rbus.c New RBUS CLI tool to invoke X_RDKCENTRAL-COM_GetNaSta and print async response.
source/test/Makefile.am Builds and links the new wifi_rbus test utility.
source/core/wifi_ctrl_wifiapi_handlers.c Adds MXL-gated inclusion of extra wifi_api2 entries (currently problematic).
source/core/wifi_ctrl_webconfig.c Adds webconfig_nasta_apply() to execute HAL calls and publish response event.
source/core/wifi_ctrl_rbus_handlers.c Adds RBUS method handler get_NaSta and registers method/event elements.
source/core/wifi_ctrl_queue_handlers.c Routes new queue subtype wifi_event_webconfig_set_data_nasta through webconfig decode/apply.
source/core/mxl_wifi_ctrl_wifiapi_handlers.h Declares MXL wifi_api2 list macro and handler prototype (currently mismatched).
source/core/mxl_wifi_ctrl_wifiapi_handlers.c Adds MXL handler implementation for wifi_getNASta (scaffolding).
source/core/Makefile.am Conditionally builds MXL handler implementation when MXL_WIFI is enabled.
include/wifi_webconfig.h Adds new subdoc/object types and decoded data fields for NaSta.
include/wifi_events.h Adds new event subtype wifi_event_webconfig_set_data_nasta.
include/wifi_base.h Adds NaSta RBUS method/event names and query/response structures and limits.
configure.ac Adds AM_CONDITIONAL([MXL_WIFI], ...).
NOTICE Adds MaxLinear 2026 notice entry.

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

Comment thread source/test/wifi_rbus.c Outdated
Comment thread source/test/wifi_rbus.c Outdated
Comment thread source/test/wifi_rbus.c Outdated
Comment thread source/core/wifi_ctrl_rbus_handlers.c Outdated
Comment thread source/core/mxl_wifi_ctrl_wifiapi_handlers.h Outdated
Comment thread source/core/wifi_ctrl_webconfig.c Outdated
Comment thread source/core/wifi_ctrl_rbus_handlers.c Outdated
@vlad-safonov vlad-safonov force-pushed the RDKBWIFI-454-adding-station-RSSI branch 2 times, most recently from 5c0537b to abf59e3 Compare June 3, 2026 13:51

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

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Comment on lines +220 to +225
/* Extract VapIndex (injected by RBUS handler) */
cJSON *vap_idx_obj = cJSON_GetObjectItem(json, "VapIndex");
if (vap_idx_obj && cJSON_IsNumber(vap_idx_obj)) {
query->vap_index = (unsigned int)cJSON_GetNumberValue(vap_idx_obj);
}

Comment on lines +4310 to +4311
cJSON_AddNumberToObject(json, "VapIndex", vap_idx - 1);
enriched_str = cJSON_PrintUnformatted(json);
Comment thread source/core/wifi_ctrl_rbus_handlers.c Outdated
Comment thread include/wifi_events.h
Comment on lines +4756 to +4757
webconfig_decode(config, data, raw);
webconfig_data_free(data);
Copilot AI review requested due to automatic review settings June 18, 2026 13:16

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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Comment on lines +4330 to +4337
if (outParams != NULL) {
char *ack = strdup("{\"Status\":\"Accepted\"}");
if (ack != NULL) {
outParams->value.data_type = bus_data_type_string;
outParams->value.raw_data.bytes = ack;
outParams->value.raw_data_len = strlen(ack);
}
}
wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to parse JSON input\r\n", __func__, __LINE__);
return bus_error_invalid_input;
}
cJSON_AddNumberToObject(json, "VapIndex", vap_idx - 1);
Comment thread build/linux/bpi/makefile
@vlad-safonov vlad-safonov force-pushed the RDKBWIFI-454-adding-station-RSSI branch from b73d7a6 to 15a907d Compare June 18, 2026 14:52
Comment thread include/wifi_base.h
#define HOTSPOT_CLIENT_DHCP_FAILURE_DISCONNECTED "Device.X_COMCAST-COM_GRE.Hotspot.RejectAssociatedClient"
#define WIFI_STUCK_DETECT_FILE_NAME "/nvram/wifi_stuck_detect"
#define WIFI_ACCESSPOINT_GET_NASTA "Device.WiFi.AccessPoint.{i}.X_RDKCENTRAL-COM_GetNaSta"
#define WIFI_NASTA_RESPONSE_EVENT "Device.WiFi.EM.NaStaResponse"

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.

For Device.WiFi.EM.XXXX specific data, can we maintain in wifi_em files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we will review and address all comments

{ WIFI_ACCESSPOINT_GET_NASTA, bus_element_type_method,
{ NULL, NULL, NULL, NULL, NULL, get_NaSta }, slow_speed, ZERO_TABLE,
{ bus_data_type_string, true, 0, 0, 0, NULL } },
{ WIFI_NASTA_RESPONSE_EVENT, bus_element_type_event,

@Nikita-Hakai Nikita-Hakai Jun 19, 2026

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.

This event seems specific to Easymesh only right? If so, can this be managed in wifi_em.c including the publish part?

Copilot AI review requested due to automatic review settings June 19, 2026 14:09
@vlad-safonov vlad-safonov force-pushed the RDKBWIFI-454-adding-station-RSSI branch from 15a907d to efafdd2 Compare June 19, 2026 14:09

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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comment on lines +4330 to +4337
if (outParams != NULL) {
char *ack = strdup("{\"Status\":\"Accepted\"}");
if (ack != NULL) {
outParams->value.data_type = bus_data_type_string;
outParams->value.raw_data.bytes = ack;
outParams->value.raw_data_len = strlen(ack);
}
}
Comment thread source/core/wifi_ctrl_rbus_handlers.c
@vlad-safonov vlad-safonov force-pushed the RDKBWIFI-454-adding-station-RSSI branch from 3fac0de to 06ec7b7 Compare June 19, 2026 15:21
Copilot AI review requested due to automatic review settings June 19, 2026 15:40

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

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

wifi_util_error_print(WIFI_CTRL, "%s:%d Failed to parse JSON input\r\n", __func__, __LINE__);
return bus_error_invalid_input;
}
cJSON_AddNumberToObject(json, "VapIndex", vap_idx - 1);
config->subdocs[webconfig_subdoc_type_ignite].translate_to_subdoc = translate_to_ignite_subdoc;
config->subdocs[webconfig_subdoc_type_ignite].translate_from_subdoc = translate_from_ignite_subdoc;

//webconfig_subdoc_type_nasta_query
}

cJSON *oc_val = cJSON_GetObjectItem(opclass_obj, "opclass");
if (!oc_val || !cJSON_IsNumber(oc_val)) {
}

cJSON *ch_val = cJSON_GetObjectItem(chan_obj, "channel");
if (!ch_val || !cJSON_IsNumber(ch_val)) {
outParams->value.data_type = bus_data_type_string;
outParams->value.raw_data.bytes = ack;
outParams->value.raw_data_len = strlen(ack) + 1;
}
if (ack != NULL) {
outParams->value.data_type = bus_data_type_string;
outParams->value.raw_data.bytes = ack;
outParams->value.raw_data_len = strlen(ack) + 1;
Comment on lines +214 to +218
/* Extract VapIndex (injected by RBUS handler) */
cJSON *vap_idx_obj = cJSON_GetObjectItem(json, "VapIndex");
if (vap_idx_obj && cJSON_IsNumber(vap_idx_obj)) {
query->vap_index = (unsigned int)cJSON_GetNumberValue(vap_idx_obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community contribution Contributions from community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants