Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ebpfCAT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
karaboDevices
ebpfCAT
Commits
771e2ede
Commit
771e2ede
authored
9 months ago
by
Martin Teichmann
Browse files
Options
Downloads
Patches
Plain Diff
wait for initialization of serial terminal
parent
6e26a03a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ebpfcat/serial.py
+8
-4
8 additions, 4 deletions
ebpfcat/serial.py
with
8 additions
and
4 deletions
ebpfcat/serial.py
+
8
−
4
View file @
771e2ede
...
...
@@ -15,7 +15,7 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from
asyncio
import
ensure_future
,
Event
,
Queue
,
StreamReader
,
gather
from
asyncio
import
ensure_future
,
Event
,
Future
,
Queue
,
StreamReader
,
gather
from
.ebpfcat
import
Device
,
TerminalVar
...
...
@@ -45,12 +45,14 @@ class Serial(Device):
def
write
(
self
,
data
):
self
.
buffer
.
put_nowait
(
data
)
def
connect
(
self
):
self
.
task
=
ensure_future
(
self
.
run
())
async
def
connect
(
self
):
connected
=
Future
()
self
.
task
=
ensure_future
(
self
.
run
(
connected
))
self
.
reader
=
StreamReader
()
await
connected
return
self
.
reader
,
self
async
def
run
(
self
):
async
def
run
(
self
,
connected
):
while
not
self
.
init_accept
:
self
.
init_request
=
True
await
self
.
data_arrived
.
wait
()
...
...
@@ -58,6 +60,8 @@ class Serial(Device):
while
self
.
init_accept
:
await
self
.
data_arrived
.
wait
()
connected
.
set_result
(
None
)
await
gather
(
self
.
receive
(),
self
.
transmit
())
async
def
receive
(
self
):
...
...
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