Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
f-interop-contributors
agent
Commits
68728043
Commit
68728043
authored
Sep 04, 2017
by
Federico Sismondi
Browse files
log catched exceptions
parent
4649ce6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/serial_listener.py
View file @
68728043
...
...
@@ -3,12 +3,8 @@
import
json
import
serial
import
logging
import
threading
import
time
import
signal
import
sys
from
kombu
import
Exchange
from
collections
import
OrderedDict
from
utils
import
arrow_down
,
arrow_up
,
finterop_banner
...
...
@@ -25,9 +21,6 @@ logging.basicConfig(level=logging.DEBUG)
log
=
logging
.
getLogger
(
__name__
)
class
SerialListener
(
object
):
def
__init__
(
self
,
agent_name
,
rmq_connection
,
rmq_exchange
=
"amq.topic"
,
serial_port
=
'/dev/ttyUSB0'
,
serial_boudrate
=
'460800'
):
...
...
@@ -153,5 +146,6 @@ class SerialListener(object):
if
numbytes
>
0
:
output
=
self
.
ser
.
read
(
numbytes
)
# read output
self
.
recv_chars
(
output
)
except
:
except
Exception
as
e
:
log
.
error
(
'Error found while processing received data stream in serial: %s'
%
str
(
e
))
sys
.
exit
(
1
)
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