Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrf fromtree] net: mgmt: Update app of TWT teardown status #1437

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/zephyr/net/wifi.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ enum wifi_twt_fail_reason {
WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS,
};

/** Wi-Fi Target Wake Time (TWT) teradown status. */
enum wifi_twt_teardown_status {
/** TWT teardown success */
WIFI_TWT_TEARDOWN_SUCCESS = 0,
/** TWT teardown failure */
WIFI_TWT_TEARDOWN_FAILED,
};

/** @cond INTERNAL_HIDDEN */
static const char * const wifi_twt_err_code_tbl[] = {
[WIFI_TWT_FAIL_UNSPECIFIED] = "Unspecified",
Expand Down
2 changes: 2 additions & 0 deletions include/zephyr/net/wifi_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ struct wifi_twt_params {
enum wifi_twt_setup_cmd setup_cmd;
/** TWT setup response status, see enum wifi_twt_setup_resp_status */
enum wifi_twt_setup_resp_status resp_status;
/** TWT teardown cmd status, see enum wifi_twt_teardown_status */
enum wifi_twt_teardown_status teardown_status;
/** Dialog token, used to map requests to responses */
uint8_t dialog_token;
/** Flow ID, used to map setup with teardown */
Expand Down
9 changes: 7 additions & 2 deletions subsys/net/l2/wifi/wifi_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,13 @@ static void handle_wifi_twt_event(struct net_mgmt_event_callback *cb)
(const struct wifi_twt_params *)cb->info;

if (resp->operation == WIFI_TWT_TEARDOWN) {
print(context.sh, SHELL_NORMAL, "TWT teardown received for flow ID %d\n",
resp->flow_id);
if (resp->teardown_status == WIFI_TWT_TEARDOWN_SUCCESS) {
print(context.sh, SHELL_NORMAL, "TWT teardown succeeded for flow ID %d\n",
resp->flow_id);
} else {
print(context.sh, SHELL_NORMAL, "TWT teardown failed for flow ID %d\n",
resp->flow_id);
}
return;
}

Expand Down