Skip to content

RDKBWIFI-359: BTM Query support#1115

Open
prashant-singh1 wants to merge 1 commit into
rdkcentral:developfrom
prashant-singh1:btm_query
Open

RDKBWIFI-359: BTM Query support#1115
prashant-singh1 wants to merge 1 commit into
rdkcentral:developfrom
prashant-singh1:btm_query

Conversation

@prashant-singh1
Copy link
Copy Markdown
Contributor

BTM Query Handling Enhancements in OneWiFi
The required changes to handle BTM (BSS Transition Management) queries in OneWiFi have been implemented.
When a BTM query is received without a neighbor list, the system now:

  • Triggers a neighbor scan
  • Collects the candidate list belonging to our AP/network
  • Includes this candidate list in the BTM request response

Observations & Planned Improvements
The following observations were identified and will be addressed in separate tickets:

Neighbor Scan Duration

Current scan duration is approximately 5 seconds, which is longer than expected. As discussed with Narendra:

  • A periodic neighbor scanning mechanism will be implemented. The scan results will be cached and reused for BTM requests to reduce latency.
  • The neighbor scan is currently functional only on the 2.4 GHz band. Scans for other bands are failing and is a known issue. This will be fixed as part of a separate task.

@prashant-singh1 prashant-singh1 requested a review from a team as a code owner May 7, 2026 07:17
@github-actions github-actions Bot added the community contribution Contributions from community. label May 7, 2026
@Nikita-Hakai Nikita-Hakai requested a review from Copilot May 7, 2026 14:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 BTM (BSS Transition Management) Query handling so that when a STA sends a BTM Query without a neighbor list, OneWiFi triggers a neighbor scan, filters candidates to local SSIDs, and responds with a BTM Request containing a candidate list.

Changes:

  • Add new HAL event subtypes for WNM action frames and for sending BTM requests.
  • Detect WNM action frames from received ACTION frames and route them to the EM app for BTM Query handling.
  • Build/sort BTM candidates from neighbor scan results and send BTM Requests via the HAL.

Reviewed changes

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

Show a summary per file
File Description
source/core/wifi_events.c Adds string mappings for new event subtypes.
source/core/wifi_ctrl.c Classifies ACTION frames as WNM vs public/DPP for event routing.
source/core/wifi_ctrl_queue_handlers.c Adds BTM Request construction/sending and wires new event handling.
source/apps/em/wifi_em.h Introduces WNM/802.11 constants and SSID list limits used by BTM logic.
source/apps/em/wifi_em.c Implements BTM Query parsing, neighbor scan trigger, and candidate filtering.
include/wifi_events.h Adds new event subtype enum values.
include/wifi_base.h Adds em_btm_req_ctrl_msg_t and extends scan results with freq.
Comments suppressed due to low confidence (1)

source/core/wifi_ctrl_queue_handlers.c:4510

  • wifi_event_hal_wnm_action_frame is generated in mgmt_wifi_frame_recv(), but handle_hal_indication() has no case for it, so every WNM action frame will hit the default branch and log an error even though the event is forwarded to apps later. Add an explicit case wifi_event_hal_wnm_action_frame: (either to dispatch appropriately or to no-op) to avoid noisy/incorrect error logs.
    case wifi_event_hal_wps_results:
        process_wps_results_event(data);
        break;

    case wifi_event_hal_send_btm_req:
        process_btm_request_send_event(data, len);
        break;

    default:

        wifi_util_error_print(WIFI_CTRL, "[%s]:WIFI hal handler not supported this event %s\r\n",
            __FUNCTION__, wifi_event_subtype_to_string(subtype));
        break;

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

Comment thread source/core/wifi_ctrl.c
Comment thread source/core/wifi_ctrl_queue_handlers.c
Comment thread source/core/wifi_ctrl_queue_handlers.c Outdated
Comment thread source/apps/em/wifi_em.c
Comment thread source/apps/em/wifi_em.c Outdated
Comment thread source/apps/em/wifi_em.c Outdated
Comment thread source/apps/em/wifi_em.c Outdated
Comment thread source/apps/em/wifi_em.c
Signed-off-by: prashant-singh1 <prashant.singh8521@gmail.com>
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.

2 participants