Files
Spherebot-Host-GUI/Spherebot_UI/rxthread.cpp
Alex aec078c865 rxthread
outsourced the receiving to a seperate thread. This allows us to use
much lower baudrates but still have a responsive UI. Set Baudrate to
57600 baud
2014-12-23 19:01:23 +01:00

28 lines
435 B
C++

#include "rxthread.h"
rxThread::rxThread(spherebot *uibot)
{
bot = uibot;
}
rxThread::~rxThread()
{
}
void rxThread::receiveData()
{
if(bot->port->canReadLine())
{
line = bot->port->readLine(1024);
line.chop(1);
qDebug()<<"receiving: " << line << endl;/////////////////////////////
emit lineReceived(line);
}
}
void rxThread::run()
{
qDebug()<<"start Receiver";
line = "";
}