qSniff/source/sniffthread.cpp

24 lines
323 B
C++
Raw Normal View History

2017-10-17 20:08:05 +00:00
#include "sniffthread.h"
2017-10-18 20:31:39 +00:00
#include "sniffer.h"
2017-10-17 20:08:05 +00:00
#include <sstream>
void SniffThread::run()
{
2017-10-18 20:31:39 +00:00
Sniffer sniffer(6);
2017-10-17 20:08:05 +00:00
while (true)
{
2017-10-18 20:31:39 +00:00
unsigned int data = sniffer.receive();
if (data != 0)
2017-10-17 20:08:05 +00:00
{
2017-10-18 20:31:39 +00:00
std::stringstream dataStream;
dataStream << data;
2017-10-17 20:08:05 +00:00
2017-10-18 20:31:39 +00:00
emit dataReceived(dataStream.str().c_str());
2017-10-17 20:08:05 +00:00
}
delay(100);
}
}