Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
bcb30277
Commit
bcb30277
authored
Oct 27, 2016
by
Alessandro Rubini
Committed by
Grzegorz Daniluk
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell/cmd_ptp: report current status too
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
75b10836
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
cmd_ptp.c
shell/cmd_ptp.c
+14
-0
No files found.
shell/cmd_ptp.c
View file @
bcb30277
...
@@ -26,11 +26,25 @@ struct subcmd {
...
@@ -26,11 +26,25 @@ struct subcmd {
{
"slave"
,
wrc_ptp_set_mode
,
WRC_MODE_SLAVE
},
{
"slave"
,
wrc_ptp_set_mode
,
WRC_MODE_SLAVE
},
};
};
static
char
*
is_run
[]
=
{
"stopped"
,
"running"
};
static
char
*
is_mech
[]
=
{[
PP_E2E_MECH
]
=
"e2e"
,
[
PP_P2P_MECH
]
=
"p2p"
};
static
char
*
is_mode
[]
=
{[
WRC_MODE_GM
]
=
"gm"
,
[
WRC_MODE_MASTER
]
=
"master"
,
[
WRC_MODE_SLAVE
]
=
"slave"
};
static
int
cmd_ptp
(
const
char
*
args
[])
static
int
cmd_ptp
(
const
char
*
args
[])
{
{
int
i
;
int
i
;
struct
subcmd
*
c
;
struct
subcmd
*
c
;
if
(
!
args
[
0
])
{
pp_printf
(
"%s; %s %s
\n
"
,
is_run
[
wrc_ptp_run
(
-
1
)],
is_mech
[
wrc_ptp_sync_mech
(
-
1
)],
is_mode
[
wrc_ptp_get_mode
()]);
return
0
;
}
for
(
i
=
0
,
c
=
subcmd
;
i
<
ARRAY_SIZE
(
subcmd
);
i
++
,
c
++
)
for
(
i
=
0
,
c
=
subcmd
;
i
<
ARRAY_SIZE
(
subcmd
);
i
++
,
c
++
)
if
(
!
strcasecmp
(
args
[
0
],
c
->
name
))
if
(
!
strcasecmp
(
args
[
0
],
c
->
name
))
return
c
->
fun
(
c
->
arg
);
return
c
->
fun
(
c
->
arg
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment