Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+65
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "tetra_if_impl.h"
|
||||
|
||||
#include "mainthread.h"
|
||||
|
||||
#include <CoPrtCnv/CoPrtCnvRadioTelegram.hpp>
|
||||
#include <QtNetwork/QTcpSocket>
|
||||
#include <time.h>
|
||||
|
||||
namespace DifferentialGPS
|
||||
{
|
||||
TetraImpl::TetraImpl()
|
||||
: TetraIF("TetraIF")
|
||||
, m_main(nullptr)
|
||||
{}
|
||||
|
||||
TetraImpl::~TetraImpl()
|
||||
{}
|
||||
|
||||
void TetraImpl::startThread(int threadIndex, MainThread *main)
|
||||
{
|
||||
m_main = main;
|
||||
startThreadInternal(threadIndex);
|
||||
}
|
||||
|
||||
bool TetraImpl::onNewDataAvailableInternal()
|
||||
{
|
||||
QByteArray payload;
|
||||
if (!m_main->getNewData(payload))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "No data to send";
|
||||
return false;
|
||||
}
|
||||
|
||||
// GEF_BESTAETIGUNG -> Dummy, gets overridden by setPayloadDataComplete()
|
||||
N_CoPrtCnv::CoPrtCnvRadioTelegram tele(GEF_BESTAETIGUNG, payload.size(), m_broadcastIssi);
|
||||
tele.setPayloadDataComplete(payload);
|
||||
tele.setSrcISSI(m_srcIssi);
|
||||
tele.setDestISSI(m_broadcastIssi);
|
||||
tele.setZaehler(m_counter++);
|
||||
m_socket->write(tele.data());
|
||||
m_socket->flush();
|
||||
|
||||
/*
|
||||
uint8_t* p = tele.getData();
|
||||
QString outText("Data: \n ");
|
||||
for (int i=0; i<tele.getSize(); ++i)
|
||||
{
|
||||
outText.append(QString::number(p[i], 16).rightJustified(2,QChar('0')));
|
||||
outText.append(" ");
|
||||
if(i%8 == 7 )
|
||||
outText.append("\n");
|
||||
}
|
||||
DEBUG_LOG(m_logger) << outText;
|
||||
*/
|
||||
|
||||
DEBUG_LOG(m_logger) << "Sent " << tele.getSize() << " to Tetra";
|
||||
return true;
|
||||
}
|
||||
} // namespace DifferentialGPS
|
||||
Reference in new issue
Block a user