diff --git a/src/plugins/serialoutput/SerialOutput.cc b/src/plugins/serialoutput/SerialOutput.cc index 9fff8146..c5d1028e 100644 --- a/src/plugins/serialoutput/SerialOutput.cc +++ b/src/plugins/serialoutput/SerialOutput.cc @@ -1,5 +1,3 @@ -#include - #include "SerialOutput.hpp" using namespace std; @@ -8,16 +6,10 @@ using namespace fail; bool SerialOutput::run() { IOPortListener ev_ioport(m_port, m_out); - BaseListener *ev; while (true) { simulator.addListener(&ev_ioport); - ev = simulator.resume(); - simulator.removeListener(&ev_ioport); - if (ev == &ev_ioport) { - m_output += ev_ioport.getData(); - } else { - break; - } + simulator.resume(); + m_output += ev_ioport.getData(); } return true; } diff --git a/src/plugins/serialoutput/SerialOutput.hpp b/src/plugins/serialoutput/SerialOutput.hpp index 6af327a8..efe3af5e 100644 --- a/src/plugins/serialoutput/SerialOutput.hpp +++ b/src/plugins/serialoutput/SerialOutput.hpp @@ -30,10 +30,10 @@ public: * * @param port the port the listener is listening on * @param out Defines the direction of the listener. - * \arg \c true Output on the given port is captured. + * \arg \c true Output on the given port is captured. This is default. * \arg \c false Input on the given port is captured. */ - SerialOutput(unsigned port, bool out) : m_out(out), m_port(port) { } + SerialOutput(unsigned port, bool out = true) : m_out(out), m_port(port) { } bool run(); /** * Resets the output variable which contains the traffic of