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

update wrapper to utilize device

parent 188b8d27
No related branches found
No related tags found
No related merge requests found
#include "libmobile_hilink.h"
#include "libmobile_zte.h"
#include "libmobile_wrapper.h"
struct json_object *mobile_set_pin(struct device *dev, char *current_pin, char *new_pin)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_set_pin_zte(dev->usb.ip, current_pin, new_pin);
return mobile_set_pin_zte(dev->ip, current_pin, new_pin);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
return mobile_set_pin_hilink();
//return mobile_set_pin_hilink();
return NULL;
}
......@@ -14,9 +13,9 @@ struct json_object *mobile_set_pin(struct device *dev, char *current_pin, char *
struct json_object *mobile_disable_pin(struct device *dev, char *pin)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_disable_pin_zte(dev->usb.ip, pin);
return mobile_disable_pin_zte(dev->ip, pin);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
return mobile_disable_pin_hilink(dev->usb.ip, pin);
//return mobile_disable_pin_hilink(dev->ip, pin);
return NULL;
}
......@@ -24,9 +23,9 @@ struct json_object *mobile_disable_pin(struct device *dev, char *pin)
struct json_object *mobile_verify_pin(struct device *dev, char *pin)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_verify_pin_zte(dev->usb.ip, pin);
return mobile_verify_pin_zte(dev->ip, pin);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
return mobile_verify_pin_hilink(dev->usb.ip, pin);
//return mobile_verify_pin_hilink(dev->ip, pin);
return NULL;
}
......@@ -34,9 +33,9 @@ struct json_object *mobile_verify_pin(struct device *dev, char *pin)
struct json_object *mobile_enable_pin(struct device *dev, char *pin)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_enable_pin_zte(dev->usb.ip, pin);
return mobile_enable_pin_zte(dev->ip, pin);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
return mobile_enable_pin_hilink(dev->usb.ip, pin);
//return mobile_enable_pin_hilink(dev->ip, pin);
return NULL;
}
......@@ -44,9 +43,9 @@ struct json_object *mobile_enable_pin(struct device *dev, char *pin)
struct json_object *mobile_get_remaining_tries(struct device *dev)
{
if (strcmp(dev->usb.if_name, "usb0") == 0)
return mobile_get_remaining_tries_zte(dev->usb.ip);
return mobile_get_remaining_tries_zte(dev->ip);
else if (strcmp(dev->usb.if_name, "eth5") == 0)
return mobile_get_remaining_tries_hilink(dev->usb.ip);
//return mobile_get_remaining_tries_hilink(dev->ip);
return NULL;
}
#ifndef LIBWRAPPER_H
#define LIBWRAPPER_H
#include <libubox/list.h>
#include "libmobile_hilink.h"
#include "libmobile_zte.h"
/* ORIGINALLY FROM DONGLE.H - WHERE DOES IT BELONG? */
struct USB {
char *product;
......@@ -16,4 +20,11 @@ struct device {
char *ip;
int missing; //counter
bool present;
};
\ No newline at end of file
};
struct json_object *mobile_set_pin(struct device *dev, char *current_pin, char *new_pin);
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_enable_pin(struct device *dev, char *pin);
struct json_object *mobile_get_remaining_tries(struct device *dev);
#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