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
4161e365
Commit
4161e365
authored
Sep 13, 2021
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add get_sync_state command to cli
parent
101d4e63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
ertm-cli
libertm/ertm-cli
+32
-0
No files found.
libertm/ertm-cli
View file @
4161e365
...
...
@@ -101,6 +101,14 @@ class ertm_lib_version(Structure):
(
"git_user"
,
c_char_p
),
(
"git_url"
,
c_char_p
),
]
class
ertm_sync_states
(
Structure
):
_fields_
=
[
(
"sync_state"
,
c_int
),
(
"label"
,
c_char_p
),
(
"description"
,
c_char_p
),
]
class
ertm_status
(
Structure
):
_fields_
=
[
(
"connection"
,
ertm_connection
),
...
...
@@ -358,6 +366,29 @@ class ErtmTest(cmd.Cmd):
print
(
"{:s}{:02d}: {:s} ({:d})"
.
format
(
conn
.
upper
(),
channel
,
"on"
if
st
else
"off"
,
st
))
def
do_get_sync_state
(
self
,
args
):
"display channel sync state"
try
:
conn
,
channel
=
args
.
split
()
connector
=
self
.
connector_idx
[
conn
.
lower
()]
channel
=
int
(
channel
)
except
(
ValueError
,
KeyError
)
as
e
:
print
(
'usage: get_sync_state/gss {clka|clkb|lo|ref} channel'
)
return
sync_state
=
c_uint
(
0
)
err
=
self
.
lib
.
ertm_get_sync_state
(
self
.
handle
,
connector
,
channel
,
byref
(
sync_state
))
if
err
:
msg
=
self
.
errmsg
(
err
)
print
(
'error {} in get_sync_state: {}'
.
format
(
err
,
msg
))
return
st
=
sync_state
.
value
label
=
c_char_p
(
0
);
description
=
c_char_p
(
0
);
self
.
lib
.
ertm_sync_state_translate
(
st
,
byref
(
label
),
byref
(
description
))
print
(
"{:s}{:02d}: {:d}: {:s}
\t\t
({:s})"
.
format
(
conn
.
upper
(),
channel
,
st
,
str
(
label
.
value
,
encoding
=
'utf8'
),
str
(
description
.
value
,
encoding
=
'utf8'
)))
def
do_get_level_adjust
(
self
,
args
):
"display amplification level of connector."
try
:
...
...
@@ -546,6 +577,7 @@ class ErtmTest(cmd.Cmd):
do_gla
=
do_get_level_adjust
do_ec
=
do_enable_channel
do_dc
=
do_disable_channel
do_gss
=
do_get_sync_state
do_wrd
=
do_wrc_diags
do_temp
=
do_temperatures
do_volt
=
do_voltages
...
...
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