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

Add Network enable/disable call

parent 70df2551
No related branches found
No related tags found
No related merge requests found
...@@ -950,3 +950,43 @@ fail_converter: ...@@ -950,3 +950,43 @@ fail_converter:
fail_result: fail_result:
return NULL; return NULL;
} }
struct json_object *network_action(int action)
{
char *api_url = "http://192.168.8.1/api/dialup/dial";
char post_query[128];
struct write_result *result;
struct json_object *result_json;
snprintf(post_query, 128, "<request><Action>%d</Action></request>", action);
result = post_request(sess_tok_url, api_url, post_query);
if (!result)
goto fail_result;
result_json = xml_to_json_converter(result);
if(!result_json)
goto fail_converter;
if (result)
free(result);
return result_json;
fail_converter:
free(result);
fail_result:
return NULL;
}
struct json_object *mobile_connect_network_hilink()
{
return network_action(ENABLE);
}
struct json_object *mobile_disconnect_network_hilink()
{
return network_action(DISABLE);
}
...@@ -100,6 +100,10 @@ struct json_object *mobile_pin_set_hilink(char *current_pin, char *new_pin); ...@@ -100,6 +100,10 @@ struct json_object *mobile_pin_set_hilink(char *current_pin, char *new_pin);
struct json_object *mobile_set_language_hilink(char *language_name); struct json_object *mobile_set_language_hilink(char *language_name);
struct json_object *mobile_connect_network_hilink();
struct json_object *mobile_disconnect_network_hilink();
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment