From ddfe15c1947a2ce99347c58282df78943523b8c4 Mon Sep 17 00:00:00 2001
From: Arun Muthusamy <arun.muthusamy@inteno.se>
Date: Mon, 11 Jun 2018 12:42:32 +0200
Subject: [PATCH] comment out logic code on post calls

---
 common.c                |  6 +++---
 dongle_infrastructure.c | 25 ++++++++++++++++++++++---
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/common.c b/common.c
index 1d44ec3..3aacf1b 100644
--- a/common.c
+++ b/common.c
@@ -59,9 +59,9 @@ void xml_to_json(xmlNode *anode, json_object *jobj)
 	json_object *cur_jstr = NULL;
 
 	for (cur_node = anode; cur_node; cur_node = cur_node->next) {
-		debug_print("child address: %p\n", cur_node);
-		debug_print("next addres: %p\n", cur_node->next);
-		debug_print("root child content: %s\n", (uint8_t *)xmlNodeGetContent(cur_node));
+		//debug_print("child address: %p\n", cur_node);
+		//debug_print("next addres: %p\n", cur_node->next);
+		//debug_print("root child content: %s\n", (uint8_t *)xmlNodeGetContent(cur_node));
 
 		if (cur_node->type == XML_ELEMENT_NODE) {
 			if (xmlChildElementCount(cur_node) == 0) {
diff --git a/dongle_infrastructure.c b/dongle_infrastructure.c
index cfffd0b..295ee02 100644
--- a/dongle_infrastructure.c
+++ b/dongle_infrastructure.c
@@ -67,6 +67,12 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj,
 	new_pin = (char *)blobmsg_data(tb[NEW_PIN]);
 	current_pin = (char *)blobmsg_data(tb[CURRENT_PIN]);
 
+	response = mobile_set_pin(global_dev, current_pin, new_pin);
+	if (!response) {
+		debug_print("error setting pin!\n");
+		goto fail_data;
+	}
+/*
 	rv = validate_pin_format(new_pin);
 	if (rv > 0) {
 		debug_print("invalid pin format\n");
@@ -95,7 +101,7 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj,
 		debug_print("incorrect pin!\n");
 		goto fail_input_json;
 	}
-
+*/
 	return print_to_ubus(response, ctx, req);
 fail_input_json:
 	json_object_put(response);
@@ -127,6 +133,12 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
 	}
 	pin = (char *)blobmsg_data(tb[PIN]);
 
+	response = mobile_disable_pin(global_dev, pin);
+	if (!response) {
+		debug_print("error disabling pin!\n");
+		goto fail_data;
+	}
+/*
 	rv = validate_pin_format(pin);
 	if (rv < 0) {
 		debug_print("invalid pin format!\n");
@@ -151,7 +163,7 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
 		goto fail_input_response;
 	}
 
-
+*/
 	return print_to_ubus(response, ctx, req);
 fail_input_response:
 	json_object_put(response);
@@ -183,7 +195,13 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
 	}
 
 	pin = (char *)blobmsg_data(tb[PIN]);
-	rv = validate_pin_format(pin);
+	response = mobile_enable_pin(global_dev, pin);
+	if (!response) {
+		debug_print("error disabling pin!\n");
+		goto fail_data;
+	}
+
+/*	rv = validate_pin_format(pin);
 	if (rv < 0) {
 		debug_print("invalid pin format!\n");
 		goto fail_input;
@@ -206,6 +224,7 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
 		debug_print("incorrect pin!\n");
 		goto fail_input_response;
 	}
+*/
 
 	return print_to_ubus(response, ctx, req);
 enabled:
-- 
GitLab