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
8b45740b
Commit
8b45740b
authored
7 years ago
by
Jakob Olsson
Browse files
Options
Downloads
Patches
Plain Diff
add some debug print
parent
29685e57
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dongle_infrastructure.c
+13
-10
13 additions, 10 deletions
dongle_infrastructure.c
with
13 additions
and
10 deletions
dongle_infrastructure.c
+
13
−
10
View file @
8b45740b
...
@@ -119,6 +119,8 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
...
@@ -119,6 +119,8 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
int
rv
;
int
rv
;
struct
json_object
*
response
;
struct
json_object
*
response
;
memset
(
&
bb
,
0
,
sizeof
(
bb
));
blob_buf_init
(
&
bb
,
0
);
blobmsg_parse
(
pin_policy
,
__PIN_MAX
,
tb
,
blob_data
(
msg
),
blob_len
(
msg
));
blobmsg_parse
(
pin_policy
,
__PIN_MAX
,
tb
,
blob_data
(
msg
),
blob_len
(
msg
));
if
(
!
tb
[
PIN
])
{
if
(
!
tb
[
PIN
])
{
...
@@ -133,6 +135,7 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
...
@@ -133,6 +135,7 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
}
}
if
(
!
pin_status
(
&
bb
,
global_ip_addr
))
{
if
(
!
pin_status
(
&
bb
,
global_ip_addr
))
{
ubus_send_reply
(
ctx
,
req
,
bb
.
head
);
debug_print
(
"pin already disabled!
\n
"
);
debug_print
(
"pin already disabled!
\n
"
);
goto
disabled
;
goto
disabled
;
}
}
...
@@ -149,14 +152,16 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
...
@@ -149,14 +152,16 @@ int disable_pin(struct ubus_context *ctx, struct ubus_object *obj,
goto
fail_input_response
;
goto
fail_input_response
;
}
}
disabled:
return
0
;
return
print_to_ubus
(
response
,
ctx
,
req
)
;
fail_input_response:
fail_input_response:
json_object_put
(
response
);
json_object_put
(
response
);
fail_input:
fail_input:
return
UBUS_STATUS_INVALID_ARGUMENT
;
return
UBUS_STATUS_INVALID_ARGUMENT
;
fail_data:
fail_data:
return
UBUS_STATUS_UNKNOWN_ERROR
;
return
UBUS_STATUS_UNKNOWN_ERROR
;
disabled:
return
0
;
}
}
int
enable_pin
(
struct
ubus_context
*
ctx
,
struct
ubus_object
*
obj
,
int
enable_pin
(
struct
ubus_context
*
ctx
,
struct
ubus_object
*
obj
,
...
@@ -169,6 +174,8 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
...
@@ -169,6 +174,8 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
int
rv
;
int
rv
;
struct
json_object
*
response
;
struct
json_object
*
response
;
memset
(
&
bb
,
0
,
sizeof
(
bb
));
blob_buf_init
(
&
bb
,
0
);
blobmsg_parse
(
pin_policy
,
__PIN_MAX
,
tb
,
blob_data
(
msg
),
blob_len
(
msg
));
blobmsg_parse
(
pin_policy
,
__PIN_MAX
,
tb
,
blob_data
(
msg
),
blob_len
(
msg
));
if
(
!
tb
[
PIN
])
{
if
(
!
tb
[
PIN
])
{
...
@@ -185,29 +192,23 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
...
@@ -185,29 +192,23 @@ int enable_pin(struct ubus_context *ctx, struct ubus_object *obj,
if
(
pin_status
(
&
bb
,
global_ip_addr
))
{
if
(
pin_status
(
&
bb
,
global_ip_addr
))
{
debug_print
(
"pin already enabled"
);
debug_print
(
"pin already enabled"
);
ubus_send_reply
(
ctx
,
req
,
bb
.
head
);
goto
enabled
;
goto
enabled
;
}
}
response
=
mobile_enable_pin_zte
(
global_ip_addr
,
pin
);
if
(
!
response
)
{
debug_print
(
"no response from get_pin_status!
\n
"
);
goto
fail_data
;
}
rv
=
check_response
(
response
);
rv
=
check_response
(
response
);
if
(
rv
<
0
)
{
if
(
rv
<
0
)
{
debug_print
(
"incorrect pin!
\n
"
);
debug_print
(
"incorrect pin!
\n
"
);
goto
fail_input_response
;
goto
fail_input_response
;
}
}
return
print_to_ubus
(
response
,
ctx
,
req
);
enabled:
enabled:
return
0
;
return
0
;
fail_input_response:
fail_input_response:
json_object_put
(
response
);
json_object_put
(
response
);
fail_input:
fail_input:
return
UBUS_STATUS_INVALID_ARGUMENT
;
return
UBUS_STATUS_INVALID_ARGUMENT
;
fail_data:
return
UBUS_STATUS_UNKNOWN_ERROR
;
}
}
int
verify_pin
(
struct
ubus_context
*
ctx
,
struct
ubus_object
*
obj
,
int
verify_pin
(
struct
ubus_context
*
ctx
,
struct
ubus_object
*
obj
,
...
@@ -220,6 +221,8 @@ int verify_pin(struct ubus_context *ctx, struct ubus_object *obj,
...
@@ -220,6 +221,8 @@ int verify_pin(struct ubus_context *ctx, struct ubus_object *obj,
int
rv
;
int
rv
;
struct
json_object
*
response
;
struct
json_object
*
response
;
memset
(
&
bb
,
0
,
sizeof
(
bb
));
blob_buf_init
(
&
bb
,
0
);
blobmsg_parse
(
pin_policy
,
__PIN_MAX
,
tb
,
blob_data
(
msg
),
blob_len
(
msg
));
blobmsg_parse
(
pin_policy
,
__PIN_MAX
,
tb
,
blob_data
(
msg
),
blob_len
(
msg
));
if
(
!
tb
[
PIN
])
{
if
(
!
tb
[
PIN
])
{
...
...
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