diff --git a/dongle.c b/dongle.c index cee23182254bdad622fca6715296ec7d8148a4fd..2bc9ef9808c27bc86ff112e75a928f35b6e66051 100644 --- a/dongle.c +++ b/dongle.c @@ -19,7 +19,7 @@ int debug; struct device *global_dev; struct uloop_timeout timeout = { - .cb = devices_status + .cb = poll_devices }; static struct option long_options[] = { @@ -72,7 +72,7 @@ fail: return -1; } -int devices_status(struct uloop_timeout *t) +int poll_devices(struct uloop_timeout *t) { get_devices(); tag_missing_devices(); diff --git a/dongle.h b/dongle.h index 69c42a2c66be5af10d3dd1b2aebbc93cc8cab94a..4f102189cf723f73129419bb8b4ae44a103549cb 100644 --- a/dongle.h +++ b/dongle.h @@ -24,7 +24,7 @@ struct device { void uloop_add_get_devices(struct uloop_timeout *t); int get_devices_from_path(char *input_path); int get_devices(void); -int devices_status(struct uloop_timeout *t); +int poll_devices(struct uloop_timeout *t); int tag_missing_devices(void); int add_device(struct device *new_dev); int delete_all_devices(void); diff --git a/func_test.c b/func_test.c new file mode 100644 index 0000000000000000000000000000000000000000..e8900f4b2c83d34a68076b889c563e0c9a396a38 --- /dev/null +++ b/func_test.c @@ -0,0 +1,19 @@ +#include <stdio.h> +#include "libmobile_hilink.h" +#include "libmobile_zte.h" + +typedef struct json_object *(*func_ptr)(char *, char *); +func_ptr active_mobile_set_pin; + +struct json_object *mobile_set_pin(char *dongle, char *current_pin, char *new_pin) +{ + if (mobile_set_pin_impl) + mobile_set_pin_impl(current_pin, new_pin); + + if (strcmp(dongle, "zte") == 0) + mobile_set_pin_impl = mobile_set_pin_zte; + + if (strcmp(dongle, "hilink") == 0) + mobile_set_pin_impl = mobile_set_pin_hilink; + +}