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
bfc40d99
Commit
bfc40d99
authored
Mar 29, 2021
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli: add 'usb' command to change port
parent
a63e2a49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
ertm-cli
libertm/ertm-cli
+15
-0
No files found.
libertm/ertm-cli
View file @
bfc40d99
...
...
@@ -162,6 +162,21 @@ class ErtmTest(cmd.Cmd):
print
(
'could not open USB device'
)
exit
()
def
do_usb
(
self
,
args
):
if
not
args
:
usb
=
self
.
handle
[
0
]
.
connection
.
serial_connection
print
(
str
(
usb
,
encoding
=
'utf-8'
))
return
try
:
usb
=
bytes
(
args
,
encoding
=
'utf-8'
)
handle
=
self
.
lib
.
ertm_init
(
c_char_p
(
usb
))
if
not
handle
:
print
(
'could not open USB device'
)
else
:
self
.
handle
=
handle
except
TypeError
as
e
:
print
(
'bad encoding in devname {}'
.
format
(
args
))
def
do_lib_version
(
self
,
args
):
"show library version info."
self
.
lib
.
ertm_lib_version
.
restype
=
POINTER
(
ertm_lib_version
)
...
...
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