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
Michael Black
OpenXG-RAN
Commits
503a6b1a
Commit
503a6b1a
authored
Feb 15, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework UE activation scripts
new adb script
parent
5d786098
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
6 deletions
+64
-6
ci-scripts/ci_ctl_adb.sh
ci-scripts/ci_ctl_adb.sh
+55
-0
ci-scripts/ci_ctl_qtel.py
ci-scripts/ci_ctl_qtel.py
+9
-6
No files found.
ci-scripts/ci_ctl_adb.sh
0 → 100755
View file @
503a6b1a
#!/bin/bash
usage
()
{
echo
"usage:
$0
<command> <id>"
echo
"available commands: initialize, attach, detach, terminate, check"
}
if
[
$#
-ne
2
]
;
then
usage
exit
1
fi
cmd
=
$1
id
=
$2
flightmode_off
()
{
set
+x
adb
-s
$id
shell
"/data/local/tmp/on"
}
flightmode_on
()
{
set
+x
adb
-s
$id
shell
"/data/local/tmp/off"
}
initialize
()
{
set
+x
adb
-s
$id
shell
"svc data enable"
# make sure data services are enabled
flightmode_on
}
terminate
()
{
echo
"terminate: does nothing"
}
check
()
{
declare
-A
service
=(
[
"0"
]=
"IN_SERVICE"
[
"1"
]=
"OUT_OF_SERVICE"
[
"2"
]=
"EMERGENCY_ONLY"
[
"3"
]=
"RADIO_POWERED_OFF"
)
declare
-A
data
=(
[
"0"
]=
"DISCONNECTED"
[
"1"
]=
"CONNECTING"
[
"2"
]=
"CONNECTED"
[
"3"
]=
"SUSPENDED"
)
serv_idx
=
$(
adb
-s
$id
shell
"dumpsys telephony.registry"
|
sed
-n
's/.*mServiceState=\([0-3]\).*/\1/p'
)
data_idx
=
$(
adb
-s
$id
shell
"dumpsys telephony.registry"
|
sed
-n
's/.*mDataConnectionState=\([0-3]\).*/\1/p'
)
data_reason
=
$(
adb
-s
$id
shell
"dumpsys telephony.registry"
|
sed
-n
's/.*mDataConnectionReason=\([0-9a-zA-Z_]\+\).*/\1/p'
)
#echo "Status Check UE $id"
echo
"Service State:
${
service
[
$serv_idx
]
}
"
echo
"Data State:
${
data
[
$data_idx
]
}
"
echo
"Data Reason:
${
data_reason
}
"
}
case
"
${
cmd
}
"
in
initialize
)
initialize
;;
attach
)
flightmode_off
;;
detach
)
flightmode_on
;;
terminate
)
terminate
;;
check
)
check
;;
*
)
echo
"Invalid command
$cmd
"
;
usage
;
exit
1
;;
esac
ci-scripts/ci_ctl_qtel.py
View file @
503a6b1a
...
...
@@ -32,7 +32,7 @@
import
sys
import
time
import
serial
import
subprocess
as
sp
class
qtel_ctl
:
#---------------
...
...
@@ -75,12 +75,15 @@ class qtel_ctl:
self
.
__set_modem_state
(
self
.
modem
,
'0'
)
if
__name__
==
"__main__"
:
#argv[1] : usb port
#argv[2] : qtel command (see function pointers dict "wup", "detach" etc ...)
command
=
sys
.
argv
[
2
]
Module
=
qtel_ctl
(
sys
.
argv
[
1
])
if
len
(
sys
.
argv
)
>=
3
:
command
=
sys
.
argv
[
2
]
print
(
command
)
Module
=
qtel_ctl
(
sys
.
argv
[
1
])
#calling the function to be applied
Module
.
cmd_dict
[
command
]()
Module
.
cmd_dict
[
command
]()
print
(
Module
.
cmd_dict
[
command
])
else
:
print
(
"To many arguments"
)
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