SerialOutput-plugin update

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1458 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hellwig
2012-07-19 13:10:52 +00:00
parent c06565aa4e
commit 41ef24747b
2 changed files with 4 additions and 12 deletions

View File

@ -1,5 +1,3 @@
#include <iostream>
#include "SerialOutput.hpp" #include "SerialOutput.hpp"
using namespace std; using namespace std;
@ -8,16 +6,10 @@ using namespace fail;
bool SerialOutput::run() bool SerialOutput::run()
{ {
IOPortListener ev_ioport(m_port, m_out); IOPortListener ev_ioport(m_port, m_out);
BaseListener *ev;
while (true) { while (true) {
simulator.addListener(&ev_ioport); simulator.addListener(&ev_ioport);
ev = simulator.resume(); simulator.resume();
simulator.removeListener(&ev_ioport); m_output += ev_ioport.getData();
if (ev == &ev_ioport) {
m_output += ev_ioport.getData();
} else {
break;
}
} }
return true; return true;
} }

View File

@ -30,10 +30,10 @@ public:
* *
* @param port the port the listener is listening on * @param port the port the listener is listening on
* @param out Defines the direction of the listener. * @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. * \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(); bool run();
/** /**
* Resets the output variable which contains the traffic of * Resets the output variable which contains the traffic of