diff --git a/common.c b/common.c index 1d44ec3708b22422ec3c90e40d2c2b3df8e4f297..3aacf1b5017d494cd55b38d15e07b9b708ed5242 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 cfffd0b727e4acf6cbaa47b6c0ed1105b17b3678..295ee0252dfcdb3eab7c0da52337a75ffa4f7620 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: