Skip to content
Snippets Groups Projects
Commit 79b11a57 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

some more features added to wrapper

parent a4ca0ed7
Branches
No related tags found
No related merge requests found
...@@ -303,7 +303,7 @@ int unlock_sim(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -303,7 +303,7 @@ int unlock_sim(struct ubus_context *ctx, struct ubus_object *obj,
if (rv < 0) if (rv < 0)
goto fail_input; goto fail_input;
printf("survived puk format\n"); printf("survived puk format\n");
response = mobile_unlock_sim(global_dev->ip, pin, puk); response = mobile_unlock_sim(global_dev, pin, puk);
if (!response) if (!response)
goto fail_unknown; goto fail_unknown;
printf("did not survive the library\n"); printf("did not survive the library\n");
...@@ -421,7 +421,7 @@ int create_apn_profile(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -421,7 +421,7 @@ int create_apn_profile(struct ubus_context *ctx, struct ubus_object *obj,
goto fail_argument; goto fail_argument;
} }
response = mobile_create_apn_profile_zte(global_dev->ip, profile_name, wan_apn, pdp_type); response = mobile_create_apn_profile(global_dev, profile_name, wan_apn, pdp_type);
if (!response) if (!response)
goto fail_unknown; goto fail_unknown;
...@@ -438,7 +438,7 @@ int show_current_apn(struct ubus_context *ctx, struct ubus_object *obj, ...@@ -438,7 +438,7 @@ int show_current_apn(struct ubus_context *ctx, struct ubus_object *obj,
{ {
struct json_object *response; struct json_object *response;
response = mobile_get_current_apn_zte(global_dev->ip); response = mobile_get_current_apn(global_dev);
if (!response) if (!response)
goto fail_unknown; goto fail_unknown;
...@@ -449,16 +449,13 @@ fail_unknown: ...@@ -449,16 +449,13 @@ fail_unknown:
} }
//dongle_network.. //dongle_network..
char *dongle_ip;
int get_signal_strength(struct ubus_context *ctx, struct ubus_object *obj, int get_signal_strength(struct ubus_context *ctx, struct ubus_object *obj,
struct ubus_request_data *req, const char *method, struct ubus_request_data *req, const char *method,
struct blob_attr *msg) struct blob_attr *msg)
{ {
struct json_object *response; struct json_object *response;
response = mobile_get_rssi_zte(global_dev->ip); response = mobile_get_rssi(global_dev);
if (!response) if (!response)
goto fail_unknown; goto fail_unknown;
......
...@@ -65,7 +65,7 @@ struct json_object *mobile_get_notification_hilink(); ...@@ -65,7 +65,7 @@ struct json_object *mobile_get_notification_hilink();
struct json_object *mobile_get_sms_count_hilink(); struct json_object *mobile_get_sms_count_hilink();
struct json_object *mobile_get_language_hilink(); struct json_object *mobile_get_language_hilink();
struct json_object *mobile_create_apn_profile(char *name, char *apn_name, char *username, char *password); struct json_object *mobile_create_apn_profile_hilink(char *name, char *apn_name, char *username, char *password);
struct json_object *mobile_set_apn_profile_default_hilink(char *name, char *apn_name, char *username, char *password); struct json_object *mobile_set_apn_profile_default_hilink(char *name, char *apn_name, char *username, char *password);
......
...@@ -88,4 +88,34 @@ struct json_object *mobile_set_apn_profile(struct device *dev, char *name) ...@@ -88,4 +88,34 @@ struct json_object *mobile_set_apn_profile(struct device *dev, char *name)
//return mobile_set_apn_profile_hilink(dev->ip, name); //return mobile_set_apn_profile_hilink(dev->ip, name);
return NULL; return NULL;
}
struct json_object *mobile_create_apn_profile(struct device *dev, char *profile_name, char *wan_apn, char *pdp_type)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_create_apn_profile_zte(dev->ip, profile_name, wan_apn, pdp_type);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
//return mobile_create_apn_profile_hilink(dev->ip, profile_name, wan_apn, pdp_type);
return NULL;
}
struct json_object *mobile_get_current_apn(struct device *dev)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_get_current_apn_zte(dev->ip);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
//return mobile_get_current_apn_hilink(dev->ip);
return NULL;
}
struct json_object *mobile_get_rssi(struct device *dev)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_get_rssi_zte(dev->ip);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
//return mobile_get_rssi_hilink(dev->ip);
return NULL;
} }
\ No newline at end of file
...@@ -27,7 +27,11 @@ struct json_object *mobile_disable_pin(struct device *dev, char *pin); ...@@ -27,7 +27,11 @@ struct json_object *mobile_disable_pin(struct device *dev, char *pin);
struct json_object *mobile_verify_pin(struct device *dev, char *pin); struct json_object *mobile_verify_pin(struct device *dev, char *pin);
struct json_object *mobile_enable_pin(struct device *dev, char *pin); struct json_object *mobile_enable_pin(struct device *dev, char *pin);
struct json_object *mobile_get_remaining_tries(struct device *dev); struct json_object *mobile_get_remaining_tries(struct device *dev);
struct json_object *mobile_unlock_sim(struct device *dev, char *pin, char *puk);
struct json_object *mobile_get_apn_profiles(struct device *dev); struct json_object *mobile_get_apn_profiles(struct device *dev);
struct json_object *mobile_delete_apn_profile(struct device *dev, char *name); struct json_object *mobile_delete_apn_profile(struct device *dev, char *name);
struct json_object *mobile_set_apn_profile(struct device *dev, char *name); struct json_object *mobile_set_apn_profile(struct device *dev, char *name);
struct json_object *mobile_create_apn_profile(struct device *dev, char *profile_name, char *wan_apn, char *pdp_type);
struct json_object *mobile_get_current_apn(struct device *dev);
struct json_object *mobile_mobile_get_rssi(struct device *dev);
#endif #endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment