Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
openairinterface5G
Commits
f13b40c6
Commit
f13b40c6
authored
9 years ago
by
Rohit Gupta
Browse files
Options
Downloads
Patches
Plain Diff
fixed some bugs for UE configuration
parent
65ee1824
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!6
Enhancement 57 uhd interfacing
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
+11
-7
11 additions, 7 deletions
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
with
11 additions
and
7 deletions
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
+
11
−
7
View file @
f13b40c6
...
...
@@ -12,20 +12,22 @@ import os
# configure the serial connections (the parameters differs on the device you are connecting to)
#First we find an open port to work with
serial_port
=
''
ser
=
''
def
find_open_port
(
serial_port
):
ser
=
serial
.
Serial
()
def
find_open_port
():
global
serial_port
,
ser
max_ports
=
100
if
os
.
path
.
exists
(
serial_port
)
==
True
:
return
serial_port
for
port
in
range
(
1
,
100
):
for
port
in
range
(
2
,
100
):
serial_port
=
'
/dev/ttyUSB
'
+
str
(
port
)
ser
=
serial
.
Serial
(
port
=
serial_port
)
if
os
.
path
.
exists
(
serial_port
)
==
True
:
print
'
New Serial Port :
'
+
serial_port
break
return
serial_port
serial_port
=
find_open_port
(
''
)
ser
=
serial
.
Serial
(
port
=
serial_port
)
return
find_open_port
()
print
'
Using Serial port :
'
+
serial_port
#serial_port = '/dev/ttyUSB2'
...
...
@@ -71,12 +73,14 @@ class pppThread (threading.Thread):
def
send_command
(
cmd
,
response
,
timeout
):
count
=
0
sleep_duration
=
1
print
'
In function: send_command: cmd
'
+
cmd
+
'
> response: <
'
+
response
+
'
>
\n
'
global
serial_port
,
ser
while
count
<=
timeout
:
try
:
#Sometimes the port does not exist coz of reset in modem.
#In that case, we need to search for this port again
if
os
.
path
.
exists
(
serial_port
)
==
False
:
serial_port
=
find_open_port
(
serial_port
)
find_open_port
()
ser
.
write
(
cmd
+
'
\r\n
'
)
out
=
''
time
.
sleep
(
sleep_duration
)
...
...
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