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
spbro
OpenXG-RAN
Commits
7878f8af
Commit
7878f8af
authored
Apr 05, 2021
by
Remi Hardy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding some inline doc/comments to ci_ctl_qtel.py
parent
31726d68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
ci-scripts/ci_ctl_qtel.py
ci-scripts/ci_ctl_qtel.py
+13
-5
No files found.
ci-scripts/ci_ctl_qtel.py
View file @
7878f8af
...
...
@@ -32,10 +32,13 @@ import serial
class
qtel_ctl
:
#---------------
#private methods
#---------------
def
__init__
(
self
,
usb_port_at
):
self
.
QUECTEL_USB_PORT_AT
=
usb_port_at
#'/dev/ttyUSB2'
self
.
QUECTEL_USB_PORT_AT
=
usb_port_at
#
ex :
'/dev/ttyUSB2'
self
.
modem
=
serial
.
Serial
(
self
.
QUECTEL_USB_PORT_AT
,
timeout
=
1
)
self
.
cmd_dict
=
{
"wup"
:
self
.
wup
,
"detach"
:
self
.
detach
}
self
.
cmd_dict
=
{
"wup"
:
self
.
wup
,
"detach"
:
self
.
detach
}
#dictionary of function pointers
def
__set_modem_state
(
self
,
ser
,
state
):
self
.
__send_command
(
ser
,
"AT+CFUN={}
\r
"
.
format
(
state
))
...
...
@@ -45,19 +48,24 @@ class qtel_ctl:
ser
.
flushInput
()
ser
.
write
(
com
.
encode
())
def
wup
(
self
):
#--------------
#public methods
#--------------
def
wup
(
self
):
#sending AT+CFUN=0, then AT+CFUN=1
self
.
__set_modem_state
(
self
.
modem
,
0
)
time
.
sleep
(
3
)
self
.
__set_modem_state
(
self
.
modem
,
1
)
def
detach
(
self
):
def
detach
(
self
):
#sending AT+CFUN=0
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
])
#calling the function to be applied
Module
.
cmd_dict
[
command
]()
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