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
db8ccf0d
Commit
db8ccf0d
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Plain Diff
Merge branch 'zte-mf823' of public.inteno.se:mobile-api into zte-mf823
parents
2484e379
b48f5be7
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
common.c
+3
-3
3 additions, 3 deletions
common.c
dongle_infrastructure.c
+22
-3
22 additions, 3 deletions
dongle_infrastructure.c
libmobile_hilink.c
+6
-6
6 additions, 6 deletions
libmobile_hilink.c
libmobile_wrapper.c
+8
-8
8 additions, 8 deletions
libmobile_wrapper.c
with
39 additions
and
20 deletions
common.c
+
3
−
3
View file @
db8ccf0d
...
...
@@ -59,9 +59,9 @@ void xml_to_json(xmlNode *anode, json_object *jobj)
json_object
*
cur_jstr
=
NULL
;
for
(
cur_node
=
anode
;
cur_node
;
cur_node
=
cur_node
->
next
)
{
debug_print
(
"child address: %p
\n
"
,
cur_node
);
debug_print
(
"next addres: %p
\n
"
,
cur_node
->
next
);
debug_print
(
"root child content: %s
\n
"
,
(
uint8_t
*
)
xmlNodeGetContent
(
cur_node
));
//
debug_print("child address: %p\n", cur_node);
//
debug_print("next addres: %p\n", cur_node->next);
//
debug_print("root child content: %s\n", (uint8_t *)xmlNodeGetContent(cur_node));
if
(
cur_node
->
type
==
XML_ELEMENT_NODE
)
{
if
(
xmlChildElementCount
(
cur_node
)
==
0
)
{
...
...
This diff is collapsed.
Click to expand it.
dongle_infrastructure.c
+
22
−
3
View file @
db8ccf0d
...
...
@@ -67,6 +67,12 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj,
new_pin
=
(
char
*
)
blobmsg_data
(
tb
[
NEW_PIN
]);
current_pin
=
(
char
*
)
blobmsg_data
(
tb
[
CURRENT_PIN
]);
response
=
mobile_set_pin
(
global_dev
,
current_pin
,
new_pin
);
if
(
!
response
)
{
debug_print
(
"error setting pin!
\n
"
);
goto
fail_data
;
}
/*
rv = validate_pin_format(new_pin);
if (rv > 0) {
debug_print("invalid pin format\n");
...
...
@@ -95,7 +101,7 @@ int set_pin(struct ubus_context *ctx, struct ubus_object *obj,
debug_print("incorrect pin!\n");
goto fail_input_json;
}
*/
return
print_to_ubus
(
response
,
ctx
,
req
);
fail_input_json:
json_object_put
(
response
);
...
...
@@ -127,6 +133,12 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
}
pin
=
(
char
*
)
blobmsg_data
(
tb
[
PIN
]);
response
=
mobile_disable_pin
(
global_dev
,
pin
);
if
(
!
response
)
{
debug_print
(
"error disabling pin!
\n
"
);
goto
fail_data
;
}
/*
rv = validate_pin_format(pin);
if (rv < 0) {
debug_print("invalid pin format!\n");
...
...
@@ -151,7 +163,7 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
goto fail_input_response;
}
*/
return
print_to_ubus
(
response
,
ctx
,
req
);
fail_input_response:
json_object_put
(
response
);
...
...
@@ -183,7 +195,13 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
}
pin
=
(
char
*
)
blobmsg_data
(
tb
[
PIN
]);
rv
=
validate_pin_format
(
pin
);
response
=
mobile_enable_pin
(
global_dev
,
pin
);
if
(
!
response
)
{
debug_print
(
"error disabling pin!
\n
"
);
goto
fail_data
;
}
/* rv = validate_pin_format(pin);
if (rv < 0) {
debug_print("invalid pin format!\n");
goto fail_input;
...
...
@@ -206,6 +224,7 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
debug_print("incorrect pin!\n");
goto fail_input_response;
}
*/
return
print_to_ubus
(
response
,
ctx
,
req
);
enabled:
...
...
This diff is collapsed.
Click to expand it.
libmobile_hilink.c
+
6
−
6
View file @
db8ccf0d
...
...
@@ -642,7 +642,7 @@ struct json_object *mobile_delete_apn_profile_hilink(int profile_name_location)
struct
write_result
*
result
;
struct
json_object
*
result_json
;
sprintf
(
post_query
,
"<request><Delete>%d</Delete><SetDefault>1</SetDefault><Modify>0</Modify></request>"
,
profile_name_location
);
s
n
printf
(
post_query
,
512
,
"<request><Delete>%d</Delete><SetDefault>1</SetDefault><Modify>0</Modify></request>"
,
profile_name_location
);
result
=
post_request
(
sess_tok_url
,
api_url
,
post_query
);
if
(
!
result
)
...
...
@@ -671,7 +671,7 @@ struct json_object *mobile_sms_read_hilink(int sms_location)
struct
write_result
*
result
;
struct
json_object
*
result_json
;
sprintf
(
post_query
,
"<request><Index>%d</Index></request>"
,
sms_location
);
s
n
printf
(
post_query
,
256
,
"<request><Index>%d</Index></request>"
,
sms_location
);
result
=
post_request
(
sess_tok_url
,
api_url
,
post_query
);
if
(
!
result
)
...
...
@@ -700,7 +700,7 @@ struct json_object *mobile_sms_delete_hilink(int sms_location)
struct
write_result
*
result
;
struct
json_object
*
result_json
;
sprintf
(
post_query
,
"<request><Index>%d</Index></request>"
,
sms_location
);
s
n
printf
(
post_query
,
256
,
"<request><Index>%d</Index></request>"
,
sms_location
);
result
=
post_request
(
sess_tok_url
,
api_url
,
post_query
);
if
(
!
result
)
...
...
@@ -838,7 +838,7 @@ struct json_object *mobile_set_connection_type_hilink(int connection_type)
struct
write_result
*
result
;
struct
json_object
*
result_json
;
sprintf
(
post_query
,
"<request><NetworkMode>%d</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></request>"
,
connection_type
);
s
n
printf
(
post_query
,
256
,
"<request><NetworkMode>%d</NetworkMode><NetworkBand>3FFFFFFF</NetworkBand><LTEBand>7FFFFFFFFFFFFFFF</LTEBand></request>"
,
connection_type
);
result
=
post_request
(
sess_tok_url
,
api_url
,
post_query
);
if
(
!
result
)
...
...
@@ -867,7 +867,7 @@ struct json_object *data_roaming(int action)
struct
write_result
*
result
;
struct
json_object
*
result_json
;
sprintf
(
post_query
,
"<request><RoamAutoConnectEnable>%d</RoamAutoConnectEnable><MaxIdelTime>600</MaxIdelTime><ConnectMode>0</ConnectMode><MTU>1500</MTU><auto_dial_switch>1</auto_dial_switch><pdp_always_on>0</pdp_always_on></request>"
,
action
);
s
n
printf
(
post_query
,
256
,
"<request><RoamAutoConnectEnable>%d</RoamAutoConnectEnable><MaxIdelTime>600</MaxIdelTime><ConnectMode>0</ConnectMode><MTU>1500</MTU><auto_dial_switch>1</auto_dial_switch><pdp_always_on>0</pdp_always_on></request>"
,
action
);
result
=
post_request
(
sess_tok_url
,
api_url
,
post_query
);
if
(
!
result
)
...
...
@@ -908,7 +908,7 @@ struct json_object *pin_action(char *type, char *current_pin, char *new_pin, cha
struct
write_result
*
result
;
struct
json_object
*
result_json
;
sprintf
(
post_query
,
"<request><OperateType>%s</OperateType><CurrentPin>%s</CurrentPin><NewPin>%s</NewPin><PukCode>%s</PukCode></request>"
,
type
,
current_pin
,
new_pin
,
puk
);
sprintf
(
post_query
,
256
,
"<request><OperateType>%s</OperateType><CurrentPin>%s</CurrentPin><NewPin>%s</NewPin><PukCode>%s</PukCode></request>"
,
type
,
current_pin
,
new_pin
,
puk
);
result
=
post_request
(
sess_tok_url
,
api_url
,
post_query
);
if
(
!
result
)
...
...
This diff is collapsed.
Click to expand it.
libmobile_wrapper.c
+
8
−
8
View file @
db8ccf0d
...
...
@@ -5,7 +5,7 @@ struct json_object *mobile_set_pin(struct device *dev, char *current_pin, char *
if
(
strcmp
(
dev
->
usb
.
if_name
,
"usb0"
)
==
0
)
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
(
"12345678"
,
"12345678"
);
return
mobile_set_pin_hilink
(
current_pin
,
new_pin
);
return
NULL
;
}
...
...
@@ -15,7 +15,7 @@ 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
->
ip
,
pin
);
else
if
(
strcmp
(
dev
->
usb
.
if_name
,
"eth5"
)
==
0
)
return
mobile_disable_pin_hilink
(
"12345678"
);
return
mobile_disable_pin_hilink
(
pin
);
return
NULL
;
}
...
...
@@ -25,7 +25,7 @@ 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
->
ip
,
pin
);
else
if
(
strcmp
(
dev
->
usb
.
if_name
,
"eth5"
)
==
0
)
return
mobile_set_pin_hilink
(
"12345678"
,
"12345678"
);
return
mobile_set_pin_hilink
(
pin
,
pin
);
return
NULL
;
}
...
...
@@ -35,7 +35,7 @@ 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
->
ip
,
pin
);
else
if
(
strcmp
(
dev
->
usb
.
if_name
,
"eth5"
)
==
0
)
return
mobile_enable_pin_hilink
(
"12345678"
);
return
mobile_enable_pin_hilink
(
pin
);
return
NULL
;
}
...
...
@@ -75,7 +75,7 @@ struct json_object *mobile_delete_apn_profile(struct device *dev, char *name)
if
(
strcmp
(
dev
->
usb
.
if_name
,
"usb0"
)
==
0
)
return
mobile_delete_apn_profile_zte
(
dev
->
ip
,
name
);
else
if
(
strcmp
(
dev
->
usb
.
if_name
,
"eth5"
)
==
0
)
return
mobile_delete_apn_profile_hilink
(
1
);
return
mobile_delete_apn_profile_hilink
(
0
);
return
NULL
;
}
...
...
@@ -85,7 +85,7 @@ struct json_object *mobile_set_apn_profile(struct device *dev, char *name)
if
(
strcmp
(
dev
->
usb
.
if_name
,
"usb0"
)
==
0
)
return
mobile_set_apn_profile_zte
(
dev
->
ip
,
name
);
else
if
(
strcmp
(
dev
->
usb
.
if_name
,
"eth5"
)
==
0
)
return
mobile_set_apn_profile_hilink
(
"arun"
,
"arun"
,
"arun"
,
"arun"
);
return
mobile_set_apn_profile_hilink
(
name
,
name
,
name
,
name
);
return
NULL
;
}
...
...
@@ -95,7 +95,7 @@ struct json_object *mobile_create_apn_profile(struct device *dev, char *profile_
if
(
strcmp
(
dev
->
usb
.
if_name
,
"usb0"
)
==
0
)
return
mobile_create_apn_profile_zte
(
dev
->
ip
,
profile_name
,
wan_apn
,
pdp_type
);
else
if
(
strcmp
(
dev
->
usb
.
if_name
,
"eth5"
)
==
0
)
return
mobile_create_apn_profile_hilink
(
"test"
,
"test"
,
"test"
,
"test"
);
return
mobile_create_apn_profile_hilink
(
profile_name
,
profile_name
,
profile_name
,
profile_name
);
return
NULL
;
}
...
...
@@ -188,4 +188,4 @@ struct json_object *mobile_get_pin_status(struct device *dev)
return
mobile_get_pin_status_hilink
();
return
NULL
;
}
\ 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