Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Programmable RF Attenuator
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Programmable RF Attenuator
Commits
fbccef41
Commit
fbccef41
authored
Nov 05, 2021
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cli: open by serial, or default to first board
parent
3847d66f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
oautest
software/lib/oautest
+7
-8
No files found.
software/lib/oautest
View file @
fbccef41
...
...
@@ -31,21 +31,20 @@ class OauTest(cmd.Cmd):
self
.
nchannels
=
None
def
do_open
(
self
,
arg
):
"""open
lun
"""
"""open
device by serial number
"""
try
:
lun
=
int
(
arg
)
if
arg
else
0
serial
=
arg
if
arg
else
c_void_p
(
0
)
except
ValueError
as
e
:
print
(
'usage: open
lun
'
)
print
(
'usage: open
[serial]
'
)
return
fd
=
self
.
api
.
oau_att_open
(
lun
)
fd
=
self
.
api
.
oau_att_open
(
serial
)
if
fd
<
0
:
print
(
'cannot open
lun {}'
.
format
(
lun
))
print
(
'cannot open
device {}'
.
format
(
serial
))
return
self
.
lun
=
lun
self
.
fd
=
fd
self
.
nchannels
=
self
.
read_nchannels
()
print
(
'current device:
lun
{}, fd {}, {} channels'
.
format
(
lun
,
fd
,
self
.
nchannels
))
print
(
'current device:
serial
{}, fd {}, {} channels'
.
format
(
serial
,
fd
,
self
.
nchannels
))
def
do_close
(
self
,
arg
):
"""close connection to current device."""
...
...
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