mirror of
https://github.com/thunderbug1/Spherebot-Host-GUI.git
synced 2026-02-24 13:21:17 +01:00
35 lines
631 B
C++
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 = "";
|
|
}
|