diff --git a/src/agent_ubus.c b/src/agent_ubus.c index 14bcfca931e2e38012fb7bc822386b70c8573ca8..e973cb9ad465340b086d3764f05844ff183ff9ea 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