From bf869ffda2b4be7ff909bc1394defbf534ff3fb6 Mon Sep 17 00:00:00 2001 From: Jakob Olsson <jakobols@kth.se> Date: Fri, 8 Jun 2018 08:22:48 +0200 Subject: [PATCH] WIP debugging application, name changes --- common.c | 7 +- dongle.c | 4 +- dongle_infrastructure.c | 227 ++++++++-------------------------------- dongle_infrastructure.h | 1 - libmobile_hilink.c | 56 +++++----- libmobile_hilink.h | 52 ++++----- libmobile_zte.c | 46 ++++---- libmobile_zte.h | 36 +++---- 8 files changed, 148 insertions(+), 281 deletions(-) diff --git a/common.c b/common.c index 9a77177..c49c445 100644 --- a/common.c +++ b/common.c @@ -150,6 +150,7 @@ int isdigits(const char *pin) if (isdigit(*pin++) == 0) return false; } + return true; } @@ -190,8 +191,9 @@ int pin_status(struct blob_buf *bb, char *ip_addr) { struct json_object *response, *rv_json; int rv; - - response = mobile_get_pin_status(ip_addr); + printf("lets retrieve pin status\n"); + response = mobile_get_pin_status_zte(ip_addr); + printf("lets retrieve pin status1\n"); if (!response) { debug_print("no response from get_pin_status!\n"); goto fail_response; @@ -204,6 +206,7 @@ int pin_status(struct blob_buf *bb, char *ip_addr) } rv = json_object_get_int(rv_json); + printf("pin status %s\n", rv); if (rv == 0) blobmsg_add_string(bb, "Failure", "Pin disabled"); else diff --git a/dongle.c b/dongle.c index 3a3f7b5..430322e 100644 --- a/dongle.c +++ b/dongle.c @@ -43,14 +43,16 @@ int parse_args(int argc, char **argv) { char ch; - while ((ch = getopt_long(argc, argv, "d:", long_options, NULL)) != -1) { + while ((ch = getopt_long(argc, argv, ":d:", long_options, NULL)) != -1) { switch (ch) { case 'd': + printf("debug\n"); debug = atoi(optarg); if (debug > 1 || debug < 0) { printf("%s: option '-%c' is invalid.\n", argv[0], optopt); //cant exactly do debug print in here... goto fail; } + printf("debug mode %d\n", debug); goto done; case ':': fprintf(stderr, "%s: option '-%c' requires an argument\n", argv[0], optopt); diff --git a/dongle_infrastructure.c b/dongle_infrastructure.c index b0d747b..9b15b67 100644 --- a/dongle_infrastructure.c +++ b/dongle_infrastructure.c @@ -53,23 +53,21 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj, { struct blob_attr *tb[__SET_PIN_MAX]; struct blob_buf bb; - char *new_pin, *current_pin, *ip_addr; + char *new_pin, *current_pin; int rv; struct json_object *response; + printf("hello\n"); blobmsg_parse(set_pin_policy, __SET_PIN_MAX, tb, blob_data(msg), blob_len(msg)); - - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - + printf("hello2\n"); if (!tb[NEW_PIN] && !tb[CURRENT_PIN]) { - debug_print("Please enter both a new pin and old pin!\n"); + printf("Please enter both a new pin and old pin!\n"); goto fail_input; } + printf("hello3\n"); new_pin = (char *)blobmsg_data(tb[NEW_PIN]); current_pin = (char *)blobmsg_data(tb[CURRENT_PIN]); - + printf("new pin %s, current_pin %s\n", new_pin, current_pin); rv = validate_pin_format(new_pin); if (rv > 0) { debug_print("invalid pin format\n"); @@ -81,14 +79,14 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj, debug_print("invalid pin format\n"); goto fail_input; } - - if (!pin_status(&bb, ip_addr)) { - debug_print("pin disabled!"); + printf("or did we get stuck during pin_status\n"); + if (!pin_status(&bb, global_ip_addr)) { + printf("pin disabled!"); ubus_send_reply(ctx, req, bb.head); goto disabled; } - - response = mobile_set_pin(ip_addr, current_pin, new_pin); + printf("did we reach query\n"); + response = mobile_set_pin_zte(global_ip_addr, current_pin, new_pin); if (!response) { debug_print("error setting pin!\n"); goto fail_data; @@ -100,20 +98,15 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj, goto fail_input_json; } - free(ip_addr); return print_to_ubus(response, ctx, req); fail_input_json: json_object_put(response); fail_input: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_data: - free(ip_addr); return UBUS_STATUS_NO_DATA; -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; disabled: - free(ip_addr); return 0; } @@ -123,16 +116,12 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj, { struct blob_attr *tb[__PIN_MAX]; struct blob_buf bb; - char *pin, *ip_addr; + char *pin; int rv; struct json_object *response; blobmsg_parse(pin_policy, __PIN_MAX, tb, blob_data(msg), blob_len(msg)); - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - if (!tb[PIN]) { debug_print("Please enter a pin!\n"); goto fail_input; @@ -144,12 +133,12 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj, goto fail_input; } - if (!pin_status(&bb, ip_addr)) { + if (!pin_status(&bb, global_ip_addr)) { debug_print("pin already disabled!\n"); goto disabled; } - response = mobile_disable_pin(ip_addr, pin); + response = mobile_disable_pin_zte(global_ip_addr, pin); if (!response) { debug_print("error disabling pin!\n"); goto fail_data; @@ -162,18 +151,13 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj, } disabled: - free(ip_addr); return 0; fail_input_response: json_object_put(response); fail_input: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_data: - free(ip_addr); return UBUS_STATUS_NO_DATA; -fail_strdup: - free(ip_addr); return UBUS_STATUS_UNKNOWN_ERROR; } @@ -183,16 +167,12 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj, { struct blob_attr *tb[__PIN_MAX]; struct blob_buf bb; - char *pin, *ip_addr; + char *pin; int rv; struct json_object *response; blobmsg_parse(pin_policy, __PIN_MAX, tb, blob_data(msg), blob_len(msg)); - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - if (!tb[PIN]) { debug_print("Please enter both a new pin and old pin!\n"); goto fail_input; @@ -205,12 +185,12 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj, goto fail_input; } - if (pin_status(&bb, ip_addr)) { + if (pin_status(&bb, global_ip_addr)) { debug_print("pin already enabled"); goto enabled; } - response = mobile_enable_pin(ip_addr, pin); + response = mobile_enable_pin_zte(global_ip_addr, pin); if (!response) { debug_print("no response from get_pin_status!\n"); goto fail_data; @@ -223,17 +203,13 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj, } enabled: - free(ip_addr); return 0; fail_input_response: json_object_put(response); fail_input: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_data: - free(ip_addr); return UBUS_STATUS_NO_DATA; -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -243,16 +219,12 @@ int verify_pin(struct ubus_context *ctx, struct ubus_object *obj, { struct blob_attr *tb[__PIN_MAX]; struct blob_buf bb; - char *pin, *ip_addr; + char *pin; int rv; struct json_object *response; blobmsg_parse(pin_policy, __PIN_MAX, tb, blob_data(msg), blob_len(msg)); - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - if (!tb[PIN]) { debug_print("Please enter a pin\n!"); goto fail_input; @@ -265,24 +237,20 @@ int verify_pin(struct ubus_context *ctx, struct ubus_object *obj, goto fail_input; } - if (!pin_status(&bb, ip_addr)) { + if (!pin_status(&bb, global_ip_addr)) { debug_print("pin disabled"); ubus_send_reply(ctx, req, bb.head); goto disabled; } - response = mobile_set_pin(ip_addr, pin, pin); + response = mobile_set_pin_zte(global_ip_addr, pin, pin); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_input: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; disabled: return 0; @@ -292,22 +260,14 @@ int remaining_tries(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - - response = mobile_get_remaining_tries(ip_addr); + response = mobile_get_remaining_tries_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -316,43 +276,35 @@ int unlock_sim(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct blob_attr *tb[__UNLOCK_MAX]; - char *pin, *puk, *ip_addr; - struct json_object *response;//, *rv_json; + char *pin, *puk; + struct json_object *response; int rv; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - - blobmsg_parse(pin_policy, __PIN_MAX, tb, blob_data(msg), blob_len(msg)); + blobmsg_parse(pin_policy, __UNLOCK_MAX, tb, blob_data(msg), blob_len(msg)); if (!tb[PUK] || !tb[UNLOCK_PIN]) { - debug_print("Please enter both a pin and a puk code!\n"); + printf("Please enter both a pin and a puk code!\n"); goto fail_input; } puk = (char *)blobmsg_data(tb[PUK]); pin = (char *)blobmsg_data(tb[UNLOCK_PIN]); - + printf("puk %s, pin %s\n", puk, pin); rv = validate_pin_format(pin); if (rv < 0) goto fail_input; - + printf("survived pin format\n"); rv = validate_puk_format(puk); if (rv < 0) goto fail_input; - - response = mobile_unlock_sim(ip_addr, puk, pin); + printf("survived puk format\n"); + response = mobile_unlock_sim_zte(global_ip_addr, puk, pin); if (!response) goto fail_unknown; - - free(ip_addr); + printf("did not survive the library\n"); return print_to_ubus(response, ctx, req); fail_input: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -360,22 +312,14 @@ int list_apn_profiles(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - - response = mobile_get_apn_profiles(ip_addr); + response = mobile_get_apn_profiles_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -384,15 +328,11 @@ int delete_apn_profile(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct blob_attr *tb[__APN_MAX]; - char *name, *ip_addr; //what is max available name length in dongle? + char *name; //what is max available name length in dongle? struct json_object *response; blobmsg_parse(apn_policy, __APN_MAX, tb, blob_data(msg), blob_len(msg)); - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - if (!tb[APN_NAME]) goto fail_argument; @@ -405,18 +345,14 @@ int delete_apn_profile(struct ubus_context *ctx, struct ubus_object *obj, goto fail_argument; } - response = mobile_delete_apn(ip_addr, name); + response = mobile_delete_apn_zte(global_ip_addr, name); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_argument: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -425,15 +361,11 @@ int set_apn_profile(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct blob_attr *tb[__APN_MAX]; - char *name, *ip_addr; + char *name; struct json_object *response; blobmsg_parse(apn_policy, __APN_MAX, tb, blob_data(msg), blob_len(msg)); - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - if (!tb[APN_NAME]) goto fail_argument; @@ -446,18 +378,14 @@ int set_apn_profile(struct ubus_context *ctx, struct ubus_object *obj, goto fail_argument; } - response = mobile_set_apn_profile(ip_addr, name); + response = mobile_set_apn_profile_zte(global_ip_addr, name); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_argument: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -466,15 +394,11 @@ int create_apn_profile(struct ubus_context *ctx, struct ubus_object *obj, struct blob_attr *msg) { struct blob_attr *tb[__CREATE_MAX]; - char *profile_name, *wan_apn, *pdp_type, *ip_addr; //what is max available name length in dongle? + char *profile_name, *wan_apn, *pdp_type; //what is max available name length in dongle? struct json_object *response; blobmsg_parse(create_apn_policy, __CREATE_MAX, tb, blob_data(msg), blob_len(msg)); - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - if (!tb[PROFILE_NAME] || !tb[WAN_APN] || !tb[PDP_TYPE]) { debug_print("Need to provide all arguments!\n"); goto fail_argument; @@ -491,18 +415,14 @@ int create_apn_profile(struct ubus_context *ctx, struct ubus_object *obj, goto fail_argument; } - response = mobile_create_apn_profile(ip_addr, profile_name, wan_apn, pdp_type); + response = mobile_create_apn_profile_zte(global_ip_addr, profile_name, wan_apn, pdp_type); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_argument: - free(ip_addr); return UBUS_STATUS_INVALID_ARGUMENT; fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -510,23 +430,15 @@ int show_current_apn(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - - response = mobile_get_current_apn(ip_addr); + response = mobile_get_current_apn_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -538,22 +450,15 @@ int get_signal_strength(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - response = mobile_get_rssi(ip_addr); + response = mobile_get_rssi_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -561,22 +466,15 @@ int connect_network(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - response = mobile_connect_network(ip_addr); + response = mobile_connect_network_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -584,22 +482,15 @@ int disconnect(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - response = mobile_disconnect_network(ip_addr); + response = mobile_disconnect_network_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -607,23 +498,16 @@ int modem_state(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - response = mobile_get_modem_state(ip_addr); + response = mobile_get_modem_state_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -631,23 +515,16 @@ int enable_roaming(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - response = mobile_enable_roaming(ip_addr); + response = mobile_enable_roaming_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -655,23 +532,16 @@ int disable_roaming(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - response = mobile_disable_roaming(ip_addr); + response = mobile_disable_roaming_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } @@ -679,23 +549,16 @@ int roam_status(struct ubus_context *ctx, struct ubus_object *obj, struct ubus_request_data *req, const char *method, struct blob_attr *msg) { - char *ip_addr; struct json_object *response; - ip_addr = strdup("192.168.0.1"); - if (!ip_addr) - goto fail_strdup; - response = mobile_get_roam_status(ip_addr); + response = mobile_get_roam_status_zte(global_ip_addr); if (!response) goto fail_unknown; - free(ip_addr); return print_to_ubus(response, ctx, req); fail_unknown: - free(ip_addr); -fail_strdup: return UBUS_STATUS_UNKNOWN_ERROR; } diff --git a/dongle_infrastructure.h b/dongle_infrastructure.h index 22b32cd..77b09fc 100644 --- a/dongle_infrastructure.h +++ b/dongle_infrastructure.h @@ -45,7 +45,6 @@ enum { __DEV_MAX }; - int devices_status(struct uloop_timeout *t); struct ubus_object *dongle_create_dynamic_object(struct device *dev_instance); int publish_ubus_object(struct ubus_context *ctx, struct ubus_object *obj); diff --git a/libmobile_hilink.c b/libmobile_hilink.c index c29480b..8e8e237 100644 --- a/libmobile_hilink.c +++ b/libmobile_hilink.c @@ -281,7 +281,7 @@ leave: } -struct write_result *mobile_get_device_info() +struct write_result *mobile_get_device_info_hilink() { char *api_url = "http://192.168.8.1/api/device/information"; @@ -289,7 +289,7 @@ struct write_result *mobile_get_device_info() } -struct write_result *mobile_get_monitoring_status() +struct write_result *mobile_get_monitoring_status_hilink() { char *api_url = "http://192.168.8.1/api/monitoring/status"; @@ -297,7 +297,7 @@ struct write_result *mobile_get_monitoring_status() } -struct write_result *mobile_get_trafficstatistics() +struct write_result *mobile_get_trafficstatistics_hilink() { char *api_url = "http://192.168.8.1/api/monitoring/traffic-statistics"; @@ -305,7 +305,7 @@ struct write_result *mobile_get_trafficstatistics() } -struct write_result *mobile_get_provider() +struct write_result *mobile_get_provider_hilink() { char *api_url = "http://192.168.8.1/api/net/current-plmn"; @@ -313,7 +313,7 @@ struct write_result *mobile_get_provider() } -struct write_result *mobile_get_pin_status() +struct write_result *mobile_get_pin_status_hilink() { char *api_url = "http://192.168.8.1/api/pin/status"; @@ -321,7 +321,7 @@ struct write_result *mobile_get_pin_status() } -struct write_result *mobile_get_connection_status() +struct write_result *mobile_get_connection_status_hilink() { char *api_url = "http://192.168.8.1/api/dialup/connection"; @@ -329,7 +329,7 @@ struct write_result *mobile_get_connection_status() } -struct write_result *mobile_get_apn_profiles() +struct write_result *mobile_get_apn_profiles_hilink() { char *api_url = "http://192.168.8.1/api/dialup/profiles"; @@ -337,7 +337,7 @@ struct write_result *mobile_get_apn_profiles() } -struct write_result *mobile_get_notification() +struct write_result *mobile_get_notification_hilink() { char *api_url = "http://192.168.8.1/api/monitoring/check-notifications"; @@ -345,7 +345,7 @@ struct write_result *mobile_get_notification() } -struct write_result *mobile_get_sms_count() +struct write_result *mobile_get_sms_count_hilink() { char *api_url = "http://192.168.8.1/api/sms/sms-count"; @@ -353,7 +353,7 @@ struct write_result *mobile_get_sms_count() } -struct write_result *mobile_get_language() +struct write_result *mobile_get_language_hilink() { char *api_url = "http://192.168.8.1/api/language/current-language"; @@ -361,7 +361,7 @@ struct write_result *mobile_get_language() } /* post calls */ -struct write_result *mobile_create_apn_profile(char *name, char *apn_name, char *username, char *password) +struct write_result *mobile_create_apn_profile_hilink(char *name, char *apn_name, char *username, char *password) { char *api_url = "http://192.168.8.1/api/dialup/profiles"; char post_query[1024]; @@ -372,7 +372,7 @@ struct write_result *mobile_create_apn_profile(char *name, char *apn_name, char } -struct write_result *mobile_set_apn_profile_default(char *name, char *apn_name, char *username, char *password) +struct write_result *mobile_set_apn_profile_default_hilink(char *name, char *apn_name, char *username, char *password) { char *api_url = "http://192.168.8.1/api/dialup/profiles"; char post_query[1024]; @@ -383,7 +383,7 @@ struct write_result *mobile_set_apn_profile_default(char *name, char *apn_name, } -struct write_result *mobile_delete_apn_profile(int profile_name_location) +struct write_result *mobile_delete_apn_profile_hilink(int profile_name_location) { char *api_url = "http://192.168.8.1/api/dialup/profiles"; char post_query[512]; @@ -394,7 +394,7 @@ struct write_result *mobile_delete_apn_profile(int profile_name_location) } -struct write_result *mobile_sms_read(int sms_location) +struct write_result *mobile_sms_read_hilink(int sms_location) { char *api_url = "http://192.168.8.1/api/sms/set-read"; char post_query[256]; @@ -405,7 +405,7 @@ struct write_result *mobile_sms_read(int sms_location) } -struct write_result *mobile_sms_delete(int sms_location) +struct write_result *mobile_sms_delete_hilink(int sms_location) { char *api_url = "http://192.168.8.1/api/sms/delete-sms"; char post_query[256]; @@ -416,7 +416,7 @@ struct write_result *mobile_sms_delete(int sms_location) } -struct write_result *mobile_reset_traffic() +struct write_result *mobile_reset_traffic_hilink() { char *api_url = "http://192.168.8.1/api/monitoring/clear-traffic"; char *post_query = "<request><ClearTraffic>1</ClearTraffic></request>"; @@ -425,7 +425,7 @@ struct write_result *mobile_reset_traffic() } /* mobile_LTE_register has to be called to enbale or disable LTE */ -struct write_result *mobile_LTE_register() +struct write_result *mobile_LTE_register_hilink() { char *api_url = "http://192.168.8.1/api/net/register"; char *post_query = "<request><Mode>0</Mode><Plmn></Plmn><Rat></Rat></request>"; @@ -434,7 +434,7 @@ struct write_result *mobile_LTE_register() } -struct write_result *mobile_LTE_enable() +struct write_result *mobile_LTE_enable_hilink() { char *api_url = "http://192.168.8.1/api/net/net-mode"; char *post_query = "<request><NetworkMode>00</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></request>"; @@ -443,7 +443,7 @@ struct write_result *mobile_LTE_enable() } -struct write_result *mobile_LTE_disable() +struct write_result *mobile_LTE_disable_hilink() { char *api_url = "http://192.168.8.1/api/net/net-mode"; char *post_query = "<NetworkMode>0201</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></request>"; @@ -453,7 +453,7 @@ struct write_result *mobile_LTE_disable() /* 00 - default- 4g, 01 - 2g, 02 - 3g */ -struct write_result *mobile_set_connection_type(int connection_type) +struct write_result *mobile_set_connection_type_hilink(int connection_type) { char *api_url = "http://192.168.8.1/api/dialup/connection"; char post_query[256]; @@ -464,7 +464,7 @@ struct write_result *mobile_set_connection_type(int connection_type) } -struct write_result *data_roaming(int action) +struct write_result *data_roaming_hilink(int action) { char *api_url = "http://192.168.8.1/api/dialup/connection"; char post_query[256]; @@ -475,19 +475,19 @@ struct write_result *data_roaming(int action) } -struct write_result *mobile_data_roaming_enable() +struct write_result *mobile_data_roaming_enable_hilink() { return data_roaming(ENABLE); } -struct write_result *mobile_data_roaming_disable() +struct write_result *mobile_data_roaming_disable_hilink() { return data_roaming(DISABLE); } /* 00 -> enter pin, 01 -> activate pin, 02 ->disable pin, 03 -> change pin, 04 -> enter puk */ -struct write_result *pin_action(char *type, char *current_pin, char *new_pin, char *puk) +struct write_result *pin_action_hilink(char *type, char *current_pin, char *new_pin, char *puk) { char *api_url = "http://192.168.8.1/api/pin/operate"; char post_query[256]; @@ -498,25 +498,25 @@ struct write_result *pin_action(char *type, char *current_pin, char *new_pin, ch } -struct write_result *mobile_pin_enable(char *current_pin) +struct write_result *mobile_pin_enable_hilink(char *current_pin) { return pin_action("01", current_pin, "", ""); } -struct write_result *mobile_pin_disable(char *current_pin) +struct write_result *mobile_pin_disable_hilink(char *current_pin) { return pin_action("02", current_pin, "", ""); } -struct write_result *mobile_pin_set(char *current_pin, char *new_pin) +struct write_result *mobile_pin_set_hilink(char *current_pin, char *new_pin) { return pin_action("03", current_pin, new_pin, ""); } -struct write_result *mobile_set_language(char *language_name) +struct write_result *mobile_set_language_hilink(char *language_name) { char *api_url = "http://192.168.8.1/api/language/current-language"; char post_query[128]; diff --git a/libmobile_hilink.h b/libmobile_hilink.h index 71321a6..b065fb6 100644 --- a/libmobile_hilink.h +++ b/libmobile_hilink.h @@ -29,76 +29,76 @@ struct write_result { //DeviceName, SerialNumber, Imei, Imsi, Iccid, Msisdn, HardwareVersion, SoftwareVersion, //WebUIVersion, MacAddress1, MacAddress2, ProductFamily, Classify, supportmode, workmode -struct write_result *mobile_get_device_info(); +struct write_result *mobile_get_device_info_hilink(); //ConnectionStatus, WifiConnectionStatus, SignalStrength, SignalIcon, CurrentNetworkType, CurrentServiceDomain, RoamingStatus, BatteryStatus //BatteryLevel, BatteryPercent, simlockStatus, WanIPAddress, WanIPv6Address, PrimaryDns, SecondaryDns, PrimaryIPv6Dns, SecondaryIPv6Dns, //CurrentWifiUser, TotalWifiUser, currenttotalwifiuser, ServiceStatus, SimStatus, WifiStatus, CurrentNetworkTypeEx, maxsignal, wifiindooronly, wififrequence, //classify, flymode, cellroam -struct write_result *mobile_get_monitoring_status(); +struct write_result *mobile_get_monitoring_status_hilink(); //CurrentConnectTime, currentUpload, CurrentDownload, CurrentDownloadRate, CurrentUploadRate, TotalUpload, TotalDownload, TotalConnectTime, showtraffic -struct write_result *mobile_get_trafficstatistics(); +struct write_result *mobile_get_trafficstatistics_hilink(); //State, FullName, ShortName, Numeric, Rat -struct write_result *mobile_get_provider(); +struct write_result *mobile_get_provider_hilink(); ///SimState, PinOptState, SimPinTimes -struct write_result *mobile_get_pin_status(); +struct write_result *mobile_get_pin_status_hilink(); //RoamAutoConnectEnable, MaxIdelTime, ConnectMode, MTU, auto_dial_switch, pdp_always_on -struct write_result *mobile_get_connection_status(); +struct write_result *mobile_get_connection_status_hilink(); -struct write_result *mobile_get_apn_profiles(); +struct write_result *mobile_get_apn_profiles_hilink(); //UnreadMessage, SmsStorageFull, OnlineUpdateStatus -struct write_result *mobile_get_notification(); +struct write_result *mobile_get_notification_hilink(); //LocalUnread, LocalInbox, LocalOutbox, LocalDraft, LocalDeleted, SimUnread, SimInbox, SimOutbox //SimDraft, LocalMax, SimMax, SimUsed, NewMsg -struct write_result *mobile_get_sms_count(); +struct write_result *mobile_get_sms_count_hilink(); -struct write_result *mobile_get_language(); +struct write_result *mobile_get_language_hilink(); -struct write_result *mobile_create_apn_profile(char *name, char *apn_name, char *username, char *password); +struct write_result *mobile_create_apn_profile_hilink(char *name, char *apn_name, char *username, char *password); -struct write_result *mobile_set_apn_profile_default(char *name, char *apn_name, char *username, char *password); +struct write_result *mobile_set_apn_profile_default_hilink(char *name, char *apn_name, char *username, char *password); -struct write_result *mobile_delete_apn_profile(int profile_name_location); +struct write_result *mobile_delete_apn_profile_hilink(int profile_name_location); -struct write_result *mobile_sms_read(int sms_location); +struct write_result *mobile_sms_read_hilink(int sms_location); -struct write_result *mobile_sms_delete(int sms_location); +struct write_result *mobile_sms_delete_hilink(int sms_location); -struct write_result *mobile_reset_traffic(); +struct write_result *mobile_reset_traffic_hilink(); /* mobile_LTE_register has to be called to enbale or disable LTE */ -struct write_result *mobile_LTE_register(); +struct write_result *mobile_LTE_register_hilink(); -struct write_result *mobile_LTE_enable(); +struct write_result *mobile_LTE_enable_hilink(); -struct write_result *mobile_LTE_disable(); +struct write_result *mobile_LTE_disable_hilink(); /* 00 - default- 4g, 01 - 2g, 02 - 3g */ -struct write_result *mobile_set_connection_type(int connection_type); +struct write_result *mobile_set_connection_type_hilink(int connection_type); -struct write_result *mobile_data_roaming_enable(); +struct write_result *mobile_data_roaming_enable_hilink(); -struct write_result *mobile_data_roaming_disable(); +struct write_result *mobile_data_roaming_disable_hilink(); /* 00 -> enter pin, 01 -> activate pin, 02 ->disable pin, 03 -> change pin, 04 -> enter puk */ -struct write_result *mobile_pin_enable(char *current_pin); +struct write_result *mobile_pin_enable_hilink(char *current_pin); -struct write_result *mobile_pin_disable(char *current_pin); +struct write_result *mobile_pin_disable_hilink(char *current_pin); -struct write_result *mobile_pin_set(char *current_pin, char *new_pin); +struct write_result *mobile_pin_set_hilink(char *current_pin, char *new_pin); -struct write_result *mobile_set_language(char *language_name); +struct write_result *mobile_set_language_hilink(char *language_name); #endif diff --git a/libmobile_zte.c b/libmobile_zte.c index 1ee559b..58bc5d2 100644 --- a/libmobile_zte.c +++ b/libmobile_zte.c @@ -76,7 +76,7 @@ static size_t write_func(void *buffer, size_t size, size_t nmemb, void *data) * Finds the index of a given profile name from all available profiles. * * Parameters: - * apn_profiles - json_object pointer to apn_profiles (gotten from a previous call to <mobile_get_apn_profiles>) + * apn_profiles - json_object pointer to apn_profiles (gotten from a previous call to <mobile_get_apn_profiles_zte>) * name - Name of the APN index for which will be searched. * * Returns: @@ -117,7 +117,7 @@ fail: */ static int get_apn_profiles_len(char *ip_addr) { - struct json_object *apn_profiles = mobile_get_apn_profiles(ip_addr); + struct json_object *apn_profiles = mobile_get_apn_profiles_zte(ip_addr); int len = 0; if (!apn_profiles) { @@ -377,19 +377,19 @@ finished: } -struct json_object *mobile_connect_network(char *ip_addr) +struct json_object *mobile_connect_network_zte(char *ip_addr) { return prepare_request(ip_addr, "isTest=false¬Callback=true&goformId=CONNECT_NETWORK", POST); } -struct json_object *mobile_disconnect_network(char *ip_addr) +struct json_object *mobile_disconnect_network_zte(char *ip_addr) { return prepare_request(ip_addr, "isTest=false¬Callback=true&goformId=DISCONNECT_NETWORK", POST); } -struct json_object *mobile_delete_apn(char *ip_addr, char *name) +struct json_object *mobile_delete_apn_zte(char *ip_addr, char *name) { - struct json_object *apn_profiles = mobile_get_apn_profiles(ip_addr); + struct json_object *apn_profiles = mobile_get_apn_profiles_zte(ip_addr); char query[1024] = {0}; int idx; @@ -413,22 +413,22 @@ fail: return NULL; } -struct json_object *mobile_enable_roaming(char *ip_addr) +struct json_object *mobile_enable_roaming_zte(char *ip_addr) { return prepare_request(ip_addr, "isTest=false&goformId=SET_CONNECTION_MODE&roam_setting_option=on", POST); } -struct json_object *mobile_disable_roaming(char *ip_addr) +struct json_object *mobile_disable_roaming_zte(char *ip_addr) { return prepare_request(ip_addr, "isTest=false&goformId=SET_CONNECTION_MODE&roam_setting_option=off", POST); } -struct json_object *mobile_get_roam_status(char *ip_addr) +struct json_object *mobile_get_roam_status_zte(char *ip_addr) { return prepare_request(ip_addr, "roam_setting_option", GET); } -struct json_object *mobile_get_current_apn(char *ip_addr) +struct json_object *mobile_get_current_apn_zte(char *ip_addr) { struct json_object *idx_json, *apn_profiles, *current_profile; int idx, counter = 0; @@ -444,7 +444,7 @@ struct json_object *mobile_get_current_apn(char *ip_addr) //debug_print("Something is very wrong!\n"); goto fail_idx; } - apn_profiles = mobile_get_apn_profiles(ip_addr); + apn_profiles = mobile_get_apn_profiles_zte(ip_addr); json_object_object_foreach(apn_profiles, key, val) { counter++; @@ -462,27 +462,27 @@ fail: return NULL; } -struct json_object *mobile_get_remaining_tries(char *ip_addr) +struct json_object *mobile_get_remaining_tries_zte(char *ip_addr) { return prepare_request(ip_addr, "pinnumber", GET); } -struct json_object *mobile_get_pin_status(char *ip_addr) +struct json_object *mobile_get_pin_status_zte(char *ip_addr) { return prepare_request(ip_addr, "pin_status", GET); } -struct json_object *mobile_get_rssi(char *ip_addr) +struct json_object *mobile_get_rssi_zte(char *ip_addr) { return prepare_request(ip_addr, "lte_rssi", GET); } -struct json_object *mobile_get_modem_state(char *ip_addr) +struct json_object *mobile_get_modem_state_zte(char *ip_addr) { return prepare_request(ip_addr, "&sms_received_flag_flag=0&sts_received_flag_flag=0&cmd=modem_main_state%2Cpin_status%2Cloginfo%2Cnew_version_state%2Ccurrent_upgrade_state%2Cis_mandatory%2Csms_received_flag%2Csts_received_flag%2Csignalbar%2Cnetwork_type%2Cnetwork_provider%2Cppp_status%2CEX_SSID1%2Cex_wifi_status%2CEX_wifi_profile%2Cm_ssid_enable%2Csms_unread_num%2CRadioOff%2Csimcard_roam%2Clan_ipaddr%2Cstation_mac%2Cbattery_charging%2Cbattery_vol_percent%2Cbattery_pers%2Cspn_display_flag%2Cplmn_display_flag%2Cspn_name_data%2Cspn_b1_flag%2Cspn_b2_flag%2Crealtime_tx_bytes%2Crealtime_rx_bytes%2Crealtime_time%2Crealtime_tx_thrpt%2Crealtime_rx_thrpt%2Cmonthly_rx_bytes%2Cmonthly_tx_bytes%2Cmonthly_time%2Cdate_month%2Cdata_volume_limit_switch%2Cdata_volume_limit_size%2Cdata_volume_alert_percent%2Cdata_volume_limit_unit%2Croam_setting_option%2Cupg_roam_switch%2Chplmn", GET); } -struct json_object *mobile_get_apn_profiles(char *ip_addr) +struct json_object *mobile_get_apn_profiles_zte(char *ip_addr) { struct json_object *apn_profiles = prepare_request(ip_addr, "APN_config0,APN_config1,APN_config2,APN_config3,APN_config4,APN_config5,APN_config6,APN_config7,APN_config8,APN_config9,APN_config10,APN_config11,APN_config12,APN_config13,APN_config14,APN_config15,APN_config16,APN_config17,APN_config18,APN_config19", GET); @@ -495,7 +495,7 @@ fail: return NULL; } -struct json_object *mobile_create_apn_profile(char *ip_addr, char *profile_name, char *wan_apn, char *pdp_type) +struct json_object *mobile_create_apn_profile_zte(char *ip_addr, char *profile_name, char *wan_apn, char *pdp_type) { char query[1024] = {0}; @@ -504,9 +504,9 @@ struct json_object *mobile_create_apn_profile(char *ip_addr, char *profile_name, return prepare_request(ip_addr, query, POST); } -struct json_object *mobile_set_apn_profile(char *ip_addr, char *name) +struct json_object *mobile_set_apn_profile_zte(char *ip_addr, char *name) { - struct json_object *apn_profiles = mobile_get_apn_profiles(ip_addr); + struct json_object *apn_profiles = mobile_get_apn_profiles_zte(ip_addr); int idx; char query[1024] = {0}; @@ -530,7 +530,7 @@ fail: return NULL; } -struct json_object *mobile_enable_pin(char *ip_addr, char *pin) +struct json_object *mobile_enable_pin_zte(char *ip_addr, char *pin) { char query[1024] = {0}; @@ -539,7 +539,7 @@ struct json_object *mobile_enable_pin(char *ip_addr, char *pin) return prepare_request(ip_addr, query, POST); } -struct json_object *mobile_set_pin(char *ip_addr, char *current_pin, char *new_pin) +struct json_object *mobile_set_pin_zte(char *ip_addr, char *current_pin, char *new_pin) { char query[1024] = {0}; @@ -548,7 +548,7 @@ struct json_object *mobile_set_pin(char *ip_addr, char *current_pin, char *new_p return prepare_request(ip_addr, query, POST); } -struct json_object *mobile_disable_pin(char *ip_addr, char *pin) +struct json_object *mobile_disable_pin_zte(char *ip_addr, char *pin) { char query[1024] = {0}; @@ -557,7 +557,7 @@ struct json_object *mobile_disable_pin(char *ip_addr, char *pin) return prepare_request(ip_addr, query, POST); } -struct json_object *mobile_unlock_sim(char *ip_addr, char *pin, char *puk) +struct json_object *mobile_unlock_sim_zte(char *ip_addr, char *pin, char *puk) { char query[1024] = {0}; diff --git a/libmobile_zte.h b/libmobile_zte.h index e69434e..5bfcf27 100644 --- a/libmobile_zte.h +++ b/libmobile_zte.h @@ -54,7 +54,7 @@ * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_unlock_sim(char *ip_addr, char *pin, char *puk); +struct json_object *mobile_unlock_sim_zte(char *ip_addr, char *pin, char *puk); /** * Function: mobile_connect_network @@ -65,7 +65,7 @@ struct json_object *mobile_unlock_sim(char *ip_addr, char *pin, char *puk); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_connect_network(char *ip_addr); +struct json_object *mobile_connect_network_zte(char *ip_addr); /** * Function: mobile_disconnect_network @@ -76,7 +76,7 @@ struct json_object *mobile_connect_network(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_disconnect_network(char *ip_addr); +struct json_object *mobile_disconnect_network_zte(char *ip_addr); /** * Function: mobile_delete_apn @@ -90,7 +90,7 @@ struct json_object *mobile_disconnect_network(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_delete_apn(char *ip_addr, char *name); +struct json_object *mobile_delete_apn_zte(char *ip_addr, char *name); /** * Function: mobile_enable_roaming @@ -101,7 +101,7 @@ struct json_object *mobile_delete_apn(char *ip_addr, char *name); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_enable_roaming(char *ip_addr); +struct json_object *mobile_enable_roaming_zte(char *ip_addr); /** * Function: mobile_disable_roaming @@ -112,7 +112,7 @@ struct json_object *mobile_enable_roaming(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_disable_roaming(char *ip_addr); +struct json_object *mobile_disable_roaming_zte(char *ip_addr); /** * Function: mobile_disable_roaming @@ -123,7 +123,7 @@ struct json_object *mobile_disable_roaming(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"roam_setting_option": "on"/"off" } * NULL on failure. */ -struct json_object *mobile_get_roam_status(char *ip_addr); +struct json_object *mobile_get_roam_status_zte(char *ip_addr); /** * Function: mobile_get_current_apn @@ -134,7 +134,7 @@ struct json_object *mobile_get_roam_status(char *ip_addr); * A pointer to a json_object containing the JSON profile on success. * NULL on failure. */ -struct json_object *mobile_get_current_apn(char *ip_addr); +struct json_object *mobile_get_current_apn_zte(char *ip_addr); /** * Function: mobile_get_remaining_tries @@ -145,7 +145,7 @@ struct json_object *mobile_get_current_apn(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"pinnumber": {1..3} } on success. * NULL on failure. */ -struct json_object *mobile_get_remaining_tries(char *ip_addr); +struct json_object *mobile_get_remaining_tries_zte(char *ip_addr); /** * Function: mobile_get_pin_status @@ -156,7 +156,7 @@ struct json_object *mobile_get_remaining_tries(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"pinnumber": {0..1} } on success. * NULL on failure. */ -struct json_object *mobile_get_pin_status(char *ip_addr); +struct json_object *mobile_get_pin_status_zte(char *ip_addr); /** * Function: mobile_get_rssi @@ -167,7 +167,7 @@ struct json_object *mobile_get_pin_status(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"rssi": {} } on success. * NULL on failure. */ -struct json_object *mobile_get_rssi(char *ip_addr); +struct json_object *mobile_get_rssi_zte(char *ip_addr); /** * Function: mobile_get_modem_state @@ -178,7 +178,7 @@ struct json_object *mobile_get_rssi(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_get_modem_state(char *ip_addr); +struct json_object *mobile_get_modem_state_zte(char *ip_addr); /** * Function: mobile_get_apn_profiles @@ -189,7 +189,7 @@ struct json_object *mobile_get_modem_state(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_get_apn_profiles(char *ip_addr); +struct json_object *mobile_get_apn_profiles_zte(char *ip_addr); /** * Function: mobile_create_apn_profile @@ -205,7 +205,7 @@ struct json_object *mobile_get_apn_profiles(char *ip_addr); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_create_apn_profile(char *ip_addr, char *profile_name, char *wan_apn, char *pdp_type); +struct json_object *mobile_create_apn_profile_zte(char *ip_addr, char *profile_name, char *wan_apn, char *pdp_type); /** * Function: mobile_set_apn_profile @@ -219,7 +219,7 @@ struct json_object *mobile_create_apn_profile(char *ip_addr, char *profile_name, * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_set_apn_profile(char *ip_addr, char *name); +struct json_object *mobile_set_apn_profile_zte(char *ip_addr, char *name); /** * Function: mobile_enable_pin @@ -233,7 +233,7 @@ struct json_object *mobile_set_apn_profile(char *ip_addr, char *name); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_enable_pin(char *ip_addr, char *pin); +struct json_object *mobile_enable_pin_zte(char *ip_addr, char *pin); /** * Function: mobile_set_pin @@ -248,7 +248,7 @@ struct json_object *mobile_enable_pin(char *ip_addr, char *pin); * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_set_pin(char *ip_addr, char *current_pin, char *new_pin); +struct json_object *mobile_set_pin_zte(char *ip_addr, char *current_pin, char *new_pin); /** * Function: mobile_disable_pin @@ -262,5 +262,5 @@ struct json_object *mobile_set_pin(char *ip_addr, char *current_pin, char *new_p * A pointer to a json_object containing the JSON response from the server. {"result": "success"/"failure"} * NULL on failure. */ -struct json_object *mobile_disable_pin(char *ip_addr, char *pin); +struct json_object *mobile_disable_pin_zte(char *ip_addr, char *pin); #endif -- GitLab