Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhouShuya
OpenXG-RAN
Commits
f13b40c6
Commit
f13b40c6
authored
Nov 11, 2015
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed some bugs for UE configuration
parent
65ee1824
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
+11
-7
No files found.
cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
View file @
f13b40c6
...
@@ -12,20 +12,22 @@ import os
...
@@ -12,20 +12,22 @@ import os
# configure the serial connections (the parameters differs on the device you are connecting to)
# configure the serial connections (the parameters differs on the device you are connecting to)
#First we find an open port to work with
#First we find an open port to work with
serial_port
=
''
serial_port
=
''
ser
=
''
ser
=
serial
.
Serial
()
def
find_open_port
(
serial_port
):
def
find_open_port
():
global
serial_port
,
ser
max_ports
=
100
max_ports
=
100
if
os
.
path
.
exists
(
serial_port
)
==
True
:
if
os
.
path
.
exists
(
serial_port
)
==
True
:
return
serial_port
return
serial_port
for
port
in
range
(
1
,
100
):
for
port
in
range
(
2
,
100
):
serial_port
=
'/dev/ttyUSB'
+
str
(
port
)
serial_port
=
'/dev/ttyUSB'
+
str
(
port
)
ser
=
serial
.
Serial
(
port
=
serial_port
)
if
os
.
path
.
exists
(
serial_port
)
==
True
:
if
os
.
path
.
exists
(
serial_port
)
==
True
:
print
'New Serial Port : '
+
serial_port
print
'New Serial Port : '
+
serial_port
break
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
print
'Using Serial port : '
+
serial_port
#serial_port = '/dev/ttyUSB2'
#serial_port = '/dev/ttyUSB2'
...
@@ -71,12 +73,14 @@ class pppThread (threading.Thread):
...
@@ -71,12 +73,14 @@ class pppThread (threading.Thread):
def
send_command
(
cmd
,
response
,
timeout
):
def
send_command
(
cmd
,
response
,
timeout
):
count
=
0
count
=
0
sleep_duration
=
1
sleep_duration
=
1
print
'In function: send_command: cmd '
+
cmd
+
'> response: <'
+
response
+
'>
\n
'
global
serial_port
,
ser
while
count
<=
timeout
:
while
count
<=
timeout
:
try
:
try
:
#Sometimes the port does not exist coz of reset in modem.
#Sometimes the port does not exist coz of reset in modem.
#In that case, we need to search for this port again
#In that case, we need to search for this port again
if
os
.
path
.
exists
(
serial_port
)
==
False
:
if
os
.
path
.
exists
(
serial_port
)
==
False
:
serial_port
=
find_open_port
(
serial_port
)
find_open_port
(
)
ser
.
write
(
cmd
+
'
\r\n
'
)
ser
.
write
(
cmd
+
'
\r\n
'
)
out
=
''
out
=
''
time
.
sleep
(
sleep_duration
)
time
.
sleep
(
sleep_duration
)
...
...
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