Files
Spherebot-Host-GUI/Spherebot_UI/rxthread.cpp
2018-05-13 16:14:16 +02:00

35 lines
631 B
C++

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