From: David Bauer Date: Thu, 13 Feb 2025 01:19:27 +0000 (+0100) Subject: wds: implement profile deletion X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=5c844c0243a628632e3e2fd1dd326113fe2c44e4;p=project%2Fuqmi.git wds: implement profile deletion Implement deletion of a specific configuration on the modem. Signed-off-by: David Bauer --- diff --git a/uqmi/commands-wds.c b/uqmi/commands-wds.c index b7d3f09..afb57aa 100644 --- a/uqmi/commands-wds.c +++ b/uqmi/commands-wds.c @@ -648,3 +648,30 @@ cmd_wds_get_default_profile_cb(struct qmi_dev *qmi, struct qmi_request *req, str blobmsg_close_table(&status, p); } + +#define cmd_wds_delete_profile_cb no_cb + +static enum qmi_cmd_result +cmd_wds_delete_profile_prepare(struct qmi_dev *qmi, struct qmi_request *req, + struct qmi_msg *msg, char *arg) +{ + struct qmi_wds_delete_profile_request delete_req = { + QMI_INIT_SEQUENCE(profile_identifier, + .profile_type = QMI_WDS_PROFILE_TYPE_3GPP, + .profile_index = 1, + ) + }; + struct uqmi_wds_profile_identifier profile; + + if (uqmi_wds_profile_identifier_parse(arg, &profile) < 0) { + fprintf(stderr, "Invalid argument\n"); + return QMI_CMD_EXIT; + } + + qmi_set_ptr(&delete_req, profile_identifier.profile_type, profile.type); + qmi_set_ptr(&delete_req, profile_identifier.profile_index, profile.index); + + qmi_set_wds_delete_profile_request(msg, &delete_req); + + return QMI_CMD_REQUEST; +} diff --git a/uqmi/commands-wds.h b/uqmi/commands-wds.h index 26e98b3..18d4c39 100644 --- a/uqmi/commands-wds.h +++ b/uqmi/commands-wds.h @@ -37,6 +37,7 @@ __uqmi_command(wds_get_default_profile, get-default-profile, required, QMI_SERVICE_WDS), \ __uqmi_command(wds_create_profile, create-profile, required, QMI_SERVICE_WDS), \ __uqmi_command(wds_modify_profile, modify-profile, required, QMI_SERVICE_WDS), \ + __uqmi_command(wds_delete_profile, delete-profile, required, QMI_SERVICE_WDS), \ __uqmi_command(wds_set_pdp_type, pdp-type, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_no_roaming, no-roaming, required, CMD_TYPE_OPTION), \ __uqmi_command(wds_get_current_settings, get-current-settings, no, QMI_SERVICE_WDS), \ @@ -75,6 +76,7 @@ " --password : Use network password\n" \ " --auth-type pap|chap|both|none: Use network authentication type\n" \ " --no-roaming false|true To allow roaming, set to false\n" \ + " --delete-profile ,#: Delete profile number (3gpp, 3gpp2)\n" \ " --get-current-settings: Get current connection settings\n" \ " --bind-mux : Bind data session to QMAP multiplex (use with options below)\n" \ " --endpoint-type : Set endpoint interface type (hsusb, pcie)\n" \