From ad579f02d4b9adc23e11a94d0ee278d9fc7bdb2b Mon Sep 17 00:00:00 2001
From: Jakob Olsson <jakobols@kth.se>
Date: Fri, 8 Jun 2018 11:19:04 +0200
Subject: [PATCH] add verify_pin function to _zte library

---
 libmobile_zte.c |  5 +++++
 libmobile_zte.h | 15 +++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/libmobile_zte.c b/libmobile_zte.c
index 58bc5d2..42719e7 100644
--- a/libmobile_zte.c
+++ b/libmobile_zte.c
@@ -539,6 +539,11 @@ struct json_object *mobile_enable_pin_zte(char *ip_addr, char *pin)
 	return prepare_request(ip_addr, query, POST);
 }
 
+struct json_object *mobile_verify_pin_zte(char *ip_addr, char *pin)
+{
+	return mobile_set_pin_zte(ip_addr, pin, pin);
+}
+
 struct json_object *mobile_set_pin_zte(char *ip_addr, char *current_pin, char *new_pin)
 {
 	char query[1024] = {0};
diff --git a/libmobile_zte.h b/libmobile_zte.h
index 5bfcf27..da88ced 100644
--- a/libmobile_zte.h
+++ b/libmobile_zte.h
@@ -235,6 +235,21 @@ struct json_object *mobile_set_apn_profile_zte(char *ip_addr, char *name);
  */
 struct json_object *mobile_enable_pin_zte(char *ip_addr, char *pin);
 
+/**
+ * Function: mobile_verify_pin
+ *
+ * Verifies whether input pin is the active one.
+ *
+ * Parameter:
+ *		ip_addr - host addr of mobile dongle
+ *		pin - pin to verify
+ *
+ * Returns:
+ *		A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"}
+ *		NULL on failure.
+ */
+struct json_object *mobile_verify_pin_zte(char *ip_addr, char *pin);
+
 /**
  * Function: mobile_set_pin
  *
-- 
GitLab