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
4d2956ff
Commit
4d2956ff
authored
7 years ago
by
Arun Muthusamy
Browse files
Options
Downloads
Patches
Plain Diff
update wrapper with different hilink api calls based on hilink software version
parent
d0a7df23
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libmobile.c
+115
-38
115 additions, 38 deletions
libmobile.c
with
115 additions
and
38 deletions
libmobile.c
+
115
−
38
View file @
4d2956ff
...
...
@@ -2,14 +2,19 @@
static
char
*
zte
=
"usb0"
;
static
char
*
hilink
=
"eth5"
;
static
char
*
software_version
=
"22.200.05.00.1080"
;
// check other libraries to maintain similar structure, libwifi, libethernet, libdsl
struct
json_object
*
mobile_set_pin
(
struct
dongle
dev
,
char
*
current_pin
,
char
*
new_pin
)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_set_pin_zte
(
dev
.
ip
,
current_pin
,
new_pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_set_pin_hilink
(
current_pin
,
new_pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_set_pin_hilink_huawei
(
current_pin
,
new_pin
);
else
return
mobile_set_pin_hilink_tre
(
current_pin
,
new_pin
);
}
return
NULL
;
}
...
...
@@ -18,8 +23,12 @@ struct json_object *mobile_disable_pin(struct dongle dev, char *pin)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_disable_pin_zte
(
dev
.
ip
,
pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_disable_pin_hilink
(
pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_disable_pin_hilink_huawei
(
pin
);
else
return
mobile_disable_pin_hilink_tre
(
pin
);
}
return
NULL
;
}
...
...
@@ -28,8 +37,12 @@ struct json_object *mobile_verify_pin(struct dongle dev, char *pin)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_verify_pin_zte
(
dev
.
ip
,
pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_set_pin_hilink
(
pin
,
pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_set_pin_hilinki_huawei
(
pin
,
pin
);
else
return
mobile_set_pin_hilink_tre
(
pin
,
pin
);
}
return
NULL
;
}
...
...
@@ -38,8 +51,12 @@ struct json_object *mobile_enable_pin(struct dongle dev, char *pin)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_enable_pin_zte
(
dev
.
ip
,
pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_enable_pin_hilink
(
pin
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_enable_pin_hilink_huawei
(
pin
);
else
return
mobile_enable_pin_hilink_tre
(
pin
);
}
return
NULL
;
}
...
...
@@ -48,8 +65,12 @@ struct json_object *mobile_get_remaining_tries(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_get_remaining_tries_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_get_remaining_tries_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_get_remaining_tries_hilink_huawei
();
else
return
mobile_get_remaining_tries_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -58,8 +79,12 @@ struct json_object *mobile_unlock_sim(struct dongle dev, char *pin, char *puk)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_unlock_sim_zte
(
dev
.
ip
,
pin
,
puk
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_unlock_sim_hilink
(
pin
,
puk
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_unlock_sim_hilink_huawei
(
pin
,
puk
);
else
return
mobile_unlock_sim_hilink_tre
(
pin
,
puk
);
}
return
NULL
;
}
...
...
@@ -68,8 +93,12 @@ struct json_object *mobile_get_apn_profiles(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_get_apn_profiles_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_get_apn_profiles_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_get_apn_profiles_hilink_huawei
();
else
return
mobile_get_apn_profiles_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -78,8 +107,12 @@ struct json_object *mobile_delete_apn_profile(struct dongle dev, char *name)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_delete_apn_profile_zte
(
dev
.
ip
,
name
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_delete_apn_profile_hilink
(
0
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_delete_apn_profile_hilink_huawei
(
0
);
else
return
mobile_delete_apn_profile_hilink_zte
(
0
);
}
return
NULL
;
}
...
...
@@ -88,8 +121,12 @@ struct json_object *mobile_set_apn_profile(struct dongle dev, char *name)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_set_apn_profile_zte
(
dev
.
ip
,
name
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_set_apn_profile_hilink
(
name
,
name
,
name
,
name
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_set_apn_profile_hilink_huawei
(
name
,
name
,
name
,
name
);
else
return
mobile_set_apn_profile_hilink_tre
(
name
,
name
,
name
,
name
);
}
return
NULL
;
}
...
...
@@ -98,8 +135,12 @@ struct json_object *mobile_create_apn_profile(struct dongle dev, char *profile_n
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_create_apn_profile_zte
(
dev
.
ip
,
profile_name
,
wan_apn
,
pdp_type
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_create_apn_profile_hilink
(
profile_name
,
profile_name
,
profile_name
,
profile_name
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_create_apn_profile_hilink_huawei
(
profile_name
,
profile_name
,
profile_name
,
profile_name
);
else
return
mobile_create_apn_profile_hilink_tre
(
profile_name
,
profile_name
,
profile_name
,
profile_name
);
}
return
NULL
;
}
...
...
@@ -108,8 +149,12 @@ struct json_object *mobile_get_current_apn(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_get_current_apn_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_get_current_apn_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_get_current_apn_hilink_huawei
();
else
return
mobile_get_current_apn_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -118,8 +163,12 @@ struct json_object *mobile_get_rssi(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_get_rssi_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_get_signal_strength_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_get_signal_strength_hilink_huawei
();
else
return
mobile_get_signal_strength_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -128,8 +177,12 @@ struct json_object *mobile_connect_network(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_connect_network_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_connect_network_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_connect_network_hilink_huawei
();
else
return
mobile_connect_network_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -138,8 +191,12 @@ struct json_object *mobile_disconnect_network(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_disconnect_network_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_disconnect_network_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_disconnect_network_hilink_huawei
();
else
return
mobile_disconnect_network_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -148,8 +205,12 @@ struct json_object *mobile_get_modem_state(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_get_modem_state_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_get_provider_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_get_provider_hilink_huawei
();
else
return
mobile_get_provider_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -158,8 +219,12 @@ struct json_object *mobile_enable_roaming(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_enable_roaming_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_enable_roaming_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_enable_roaming_hilink_huawei
();
else
return
mobile_enable_roaming_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -168,8 +233,12 @@ struct json_object *mobile_disable_roaming(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_disable_roaming_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_disable_roaming_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_disable_roaming_hilink_huawei
();
else
return
mobile_disable_roaming_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -178,8 +247,12 @@ struct json_object *mobile_get_roam_status(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_get_roam_status_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_get_roam_status_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_get_roam_status_hilink_huawei
();
else
return
mobile_get_roam_status_hilink_tre
();
}
return
NULL
;
}
...
...
@@ -188,8 +261,12 @@ struct json_object *mobile_get_pin_status(struct dongle dev)
{
if
(
strcmp
(
dev
.
if_name
,
zte
)
==
0
)
return
mobile_get_pin_status_zte
(
dev
.
ip
);
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
return
mobile_get_pin_status_hilink
();
else
if
(
strcmp
(
dev
.
if_name
,
hilink
)
==
0
)
{
if
(
strcmp
(
dev
.
software_version
,
software_version
)
==
0
)
return
mobile_get_pin_status_hilink_huawei
();
else
return
mobile_get_pin_status_hilink_tre
();
}
return
NULL
;
}
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