Skip to content
Snippets Groups Projects
libmobile_wrapper.c 723 B
Newer Older
  • Learn to ignore specific revisions
  • #include <stdio.h>
    
    typedef struct write_result *(*func_ptr)(char *, char *);
    
    //Example...
    struct write_result *mobile_pin_set_zte(char *current_pin, char *new_pin)
    {
    	return pin_action("03", current_pin, 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_pin_set(char *dongle, char *current_pin, char *new_pin)
    {
    	func_ptr mobile_pin_set_impl = NULL;
    
    	if (strcmp(dongle, "zte") == 0)
    		mobile_pin_set_impl = mobile_pin_set_zte;
    
    	if (strcmp(dongle, "hilink") == 0)
    		mobile_pin_set_impl = mobile_pin_set_hilink;
    
    	if (mobile_pin_set_impl)
    		mobile_pin_set_impl(current_pin, new_pin);
    }