diff mbox series

dpp: Emit a DPP PB_STATUS event when push button starts

Message ID 20240229035349.1839961-1-evan.benn@morsemicro.com
State Changes Requested
Headers show
Series dpp: Emit a DPP PB_STATUS event when push button starts | expand

Commit Message

Evan Benn Feb. 29, 2024, 3:53 a.m. UTC
To implement an action script that listens for DPP push button events
and for example blinks a LED it is useful to know when push button has
started. Emit an event when push button starts.
---
 src/ap/dpp_hostapd.c            | 1 +
 wpa_supplicant/dpp_supplicant.c | 2 ++
 2 files changed, 3 insertions(+)

Comments

Jouni Malinen March 3, 2024, 5:30 p.m. UTC | #1
On Thu, Feb 29, 2024 at 02:53:49PM +1100, Evan Benn wrote:
> To implement an action script that listens for DPP push button events
> and for example blinks a LED it is useful to know when push button has
> started. Emit an event when push button starts.
> ---

Please read the top level CONTRIBUTIONS file. The commit message needs
to include the Signed-off-by: line as described there before I can apply
the changes.
diff mbox series

Patch

diff --git a/src/ap/dpp_hostapd.c b/src/ap/dpp_hostapd.c
index 3f89bc20c509..d1bffa81152b 100644
--- a/src/ap/dpp_hostapd.c
+++ b/src/ap/dpp_hostapd.c
@@ -3941,6 +3941,7 @@  int hostapd_dpp_push_button(struct hostapd_data *hapd, const char *cmd)
 	eloop_register_timeout(100, 0, hostapd_dpp_push_button_expire,
 			       hapd, NULL);
 
+	wpa_msg(hapd->msg_ctx, MSG_INFO, DPP_EVENT_PB_STATUS "started");
 	return 0;
 }
 
diff --git a/wpa_supplicant/dpp_supplicant.c b/wpa_supplicant/dpp_supplicant.c
index d3a96ac0c2ab..350ed614e797 100644
--- a/wpa_supplicant/dpp_supplicant.c
+++ b/wpa_supplicant/dpp_supplicant.c
@@ -5589,6 +5589,7 @@  static int wpas_dpp_push_button_configurator(struct wpa_supplicant *wpa_s,
 	eloop_register_timeout(100, 0, wpas_dpp_push_button_expire,
 			       wpa_s, NULL);
 
+	wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_PB_STATUS "started");
 	return 0;
 }
 
@@ -5650,6 +5651,7 @@  int wpas_dpp_push_button(struct wpa_supplicant *wpa_s, const char *cmd)
 	wpa_s->scan_req = MANUAL_SCAN_REQ;
 	wpa_s->scan_res_handler = wpas_dpp_pb_scan_res_handler;
 	wpa_supplicant_req_scan(wpa_s, 0, 0);
+	wpa_msg(wpa_s, MSG_INFO, DPP_EVENT_PB_STATUS "started");
 	return 0;
 }