uqmi: Change returned value to QMI_CMD_REQUEST for 'sync' command.
[project/uqmi.git] / commands-dms.c
index 563b6d9..8cc7bc5 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * uqmi -- tiny QMI support implementation
+ *
+ * Copyright (C) 2014-2015 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ */
 #include "qmi-message.h"
 
 static struct {
@@ -331,6 +351,22 @@ cmd_dms_get_msisdn_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct
        return QMI_CMD_REQUEST;
 }
 
+static void cmd_dms_get_imei_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg)
+{
+       struct qmi_dms_get_ids_response res;
+
+       qmi_parse_dms_get_ids_response(msg, &res);
+       if (res.data.imei)
+               blobmsg_add_string(&status, NULL, res.data.imei);
+}
+
+static enum qmi_cmd_result
+cmd_dms_get_imei_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+       qmi_set_dms_get_ids_request(msg);
+       return QMI_CMD_REQUEST;
+}
+
 #define cmd_dms_reset_cb no_cb
 static enum qmi_cmd_result
 cmd_dms_reset_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
@@ -372,3 +408,11 @@ cmd_dms_set_operating_mode_prepare(struct qmi_dev *qmi, struct qmi_request *req,
 
        return uqmi_add_error("Invalid argument");
 }
+
+#define cmd_dms_set_fcc_authentication_cb no_cb
+static enum qmi_cmd_result
+cmd_dms_set_fcc_authentication_prepare(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg, char *arg)
+{
+       qmi_set_dms_set_fcc_authentication_request(msg);
+       return QMI_CMD_REQUEST;
+}