Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mdmngr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IOPSYS
mdmngr
Commits
28d21461
Commit
28d21461
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
update wrapper to utilize device
parent
188b8d27
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libmobile_wrapper.c
+11
-12
11 additions, 12 deletions
libmobile_wrapper.c
libmobile_wrapper.h
+12
-1
12 additions, 1 deletion
libmobile_wrapper.h
with
23 additions
and
13 deletions
libmobile_wrapper.c
+
11
−
12
View file @
28d21461
#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
;
}
This diff is collapsed.
Click to expand it.
libmobile_wrapper.h
+
12
−
1
View file @
28d21461
#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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment