From a19e42ad9806256a88df1194cdf5c1d28a2095f1 Mon Sep 17 00:00:00 2001 From: Balalakshmi Arunachalam Rajendran <bala.arunachalam@iopsys.eu> Date: Wed, 21 May 2025 17:07:32 +0200 Subject: [PATCH] Add ubus method for reseting multiap stack --- src/agent_ubus.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/agent_ubus.c b/src/agent_ubus.c index 14bcfca93..e973cb9ad 100644 --- a/src/agent_ubus.c +++ b/src/agent_ubus.c @@ -1177,6 +1177,20 @@ static int agent_wpspbc(struct ubus_context *ctx, struct ubus_object *obj, return wifiagent_initiate_wpspbc(ctx, obj, req); } +static int agent_reset(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + trace("%s: ---> Executing reset command... \n", __func__); + int ret; + + ret = agent_exec_platform_scripts("reset &"); + if (ret != 0) { + trace("%s: reset command failed with code %d\n", __func__, ret); + return UBUS_STATUS_UNKNOWN_ERROR; + } + return UBUS_STATUS_OK; +} #if 0 static int agent_config_ap(struct ubus_context *ctx, struct ubus_object *obj, @@ -1445,6 +1459,7 @@ int agent_publish_object(struct agent *a, const char *objname) UBUS_METHOD("assoc_notify", assoc_notify, assoc_notify_params), UBUS_METHOD_NOARG("WPSPBC", agent_wpspbc), + UBUS_METHOD_NOARG("reset", agent_reset), #ifdef AGENT_SYNC_DYNAMIC_CNTLR_CONFIG UBUS_METHOD_NOARG("sync", sync_dyn_controller_config), #endif -- GitLab