Skip to content
Snippets Groups Projects
Commit ddfe15c1 authored by Arun Muthusamy's avatar Arun Muthusamy
Browse files

comment out logic code on post calls

parent a9e5b553
No related branches found
No related tags found
No related merge requests found
...@@ -59,9 +59,9 @@ void xml_to_json(xmlNode *anode, json_object *jobj) ...@@ -59,9 +59,9 @@ void xml_to_json(xmlNode *anode, json_object *jobj)
json_object *cur_jstr = NULL; json_object *cur_jstr = NULL;
for (cur_node = anode; cur_node; cur_node = cur_node->next) { for (cur_node = anode; cur_node; cur_node = cur_node->next) {
debug_print("child address: %p\n", cur_node); //debug_print("child address: %p\n", cur_node);
debug_print("next addres: %p\n", cur_node->next); //debug_print("next addres: %p\n", cur_node->next);
debug_print("root child content: %s\n", (uint8_t *)xmlNodeGetContent(cur_node)); //debug_print("root child content: %s\n", (uint8_t *)xmlNodeGetContent(cur_node));
if (cur_node->type == XML_ELEMENT_NODE) { if (cur_node->type == XML_ELEMENT_NODE) {
if (xmlChildElementCount(cur_node) == 0) { if (xmlChildElementCount(cur_node) == 0) {
......
...@@ -67,6 +67,12 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -67,6 +67,12 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj,
new_pin = (char *)blobmsg_data(tb[NEW_PIN]); new_pin = (char *)blobmsg_data(tb[NEW_PIN]);
current_pin = (char *)blobmsg_data(tb[CURRENT_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); rv = validate_pin_format(new_pin);
if (rv > 0) { if (rv > 0) {
debug_print("invalid pin format\n"); debug_print("invalid pin format\n");
...@@ -95,7 +101,7 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -95,7 +101,7 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj,
debug_print("incorrect pin!\n"); debug_print("incorrect pin!\n");
goto fail_input_json; goto fail_input_json;
} }
*/
return print_to_ubus(response, ctx, req); return print_to_ubus(response, ctx, req);
fail_input_json: fail_input_json:
json_object_put(response); json_object_put(response);
...@@ -127,6 +133,12 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -127,6 +133,12 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
} }
pin = (char *)blobmsg_data(tb[PIN]); 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); rv = validate_pin_format(pin);
if (rv < 0) { if (rv < 0) {
debug_print("invalid pin format!\n"); debug_print("invalid pin format!\n");
...@@ -151,7 +163,7 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -151,7 +163,7 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
goto fail_input_response; goto fail_input_response;
} }
*/
return print_to_ubus(response, ctx, req); return print_to_ubus(response, ctx, req);
fail_input_response: fail_input_response:
json_object_put(response); json_object_put(response);
...@@ -183,7 +195,13 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -183,7 +195,13 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
} }
pin = (char *)blobmsg_data(tb[PIN]); 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) { if (rv < 0) {
debug_print("invalid pin format!\n"); debug_print("invalid pin format!\n");
goto fail_input; goto fail_input;
...@@ -206,6 +224,7 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -206,6 +224,7 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
debug_print("incorrect pin!\n"); debug_print("incorrect pin!\n");
goto fail_input_response; goto fail_input_response;
} }
*/
return print_to_ubus(response, ctx, req); return print_to_ubus(response, ctx, req);
enabled: enabled:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment