Reinserts original comments
This commit is contained in:
112 files changed
+7113
-5131
No files matched your search
@@ -1,5 +1,9 @@
|
||||
|
||||
|
||||
/**
|
||||
* Tetra-Interface für Lasttest
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#include "tetra_if.h"
|
||||
#include <utility>
|
||||
|
||||
@@ -48,7 +52,7 @@ void TetraIF::start()
|
||||
|
||||
void TetraIF::listenMode(const QStringList &args)
|
||||
{
|
||||
|
||||
// take input and write them to and output directory
|
||||
if (args.count() > 1)
|
||||
usage();
|
||||
m_outputDir = QCoreApplication::applicationDirPath();
|
||||
@@ -177,7 +181,7 @@ void TetraIF::onReadyRead()
|
||||
do
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Got " << m_socket->bytesAvailable() << " bytes from socket";
|
||||
|
||||
// read the 4-byte frame-header for find out the length of whole telegram
|
||||
N_CoPrtCnv::CoPrtCnvRadioTelegram::PrtCnvRadioGwHeader header;
|
||||
if (m_socket->bytesAvailable() < int(sizeof(header)))
|
||||
return;
|
||||
@@ -234,24 +238,24 @@ void TetraIF::handleReceivedTelegram(const QByteArray &data)
|
||||
|
||||
switch (type)
|
||||
{
|
||||
|
||||
// response to register indication
|
||||
case N_CoPrtCnv::CoPrtCnvRadioTelegram::e_RegisterRsp:
|
||||
handleRegisterRsp(data.at(5));
|
||||
handleRegisterRsp(data.at(5)); // registration status
|
||||
break;
|
||||
|
||||
|
||||
// payload telegram
|
||||
case N_CoPrtCnv::CoPrtCnvRadioTelegram::e_DataIndReq:
|
||||
handleDataIndReq(data);
|
||||
break;
|
||||
|
||||
|
||||
// ack-telegram - not handled here
|
||||
case N_CoPrtCnv::CoPrtCnvRadioTelegram::e_ReportIndReq:
|
||||
|
||||
// handleReportIndReq(data);
|
||||
break;
|
||||
|
||||
|
||||
// air-interface-load-telegram - not handled here
|
||||
case N_CoPrtCnv::CoPrtCnvRadioTelegram::e_AirInterfaceLoadReq:
|
||||
|
||||
// handleAirInterfaceLoadReq(data);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -297,7 +301,7 @@ void TetraIF::handleRegisterRsp(const uint8_t a_registrationStatus)
|
||||
|
||||
void TetraIF::dumpData(const QByteArray &data)
|
||||
{
|
||||
|
||||
// im Listen-Mode -> Ausgabe in Directory
|
||||
if (m_outputDir.isEmpty())
|
||||
return;
|
||||
const qint64 msecs = QDateTime::currentMSecsSinceEpoch();
|
||||
@@ -332,7 +336,7 @@ void TetraIF::dumpData(const QByteArray &data)
|
||||
<< " for writing - error: "
|
||||
<< f.errorString();
|
||||
}
|
||||
|
||||
// 27 Bytes Header entfernen
|
||||
f.write(&data.data()[27], data.size() - 27);
|
||||
f.close();
|
||||
}
|
||||
@@ -341,7 +345,7 @@ void TetraIF::dumpData(const QByteArray &data)
|
||||
void TetraIF::onSendData()
|
||||
{
|
||||
++m_secondFragment;
|
||||
|
||||
// we're called every 10ms
|
||||
if (m_secondFragment == 100)
|
||||
{
|
||||
m_secondFragment = 0;
|
||||
@@ -358,7 +362,7 @@ void TetraIF::onSendData()
|
||||
{
|
||||
for (unsigned short dest_issi : std::as_const(m_issiList))
|
||||
{
|
||||
|
||||
// GEF_BESTAETIGUNG -> Dummy, gets overridden by setPayloadDataComplete()
|
||||
m_data[0] = s_randomChar++;
|
||||
N_CoPrtCnv::CoPrtCnvRadioTelegram tele(GEF_BESTAETIGUNG, m_data.size(), dest_issi);
|
||||
tele.setPayloadDataComplete(m_data);
|
||||
@@ -383,7 +387,7 @@ void TetraIF::onSendData()
|
||||
void TetraIF::parseISSIs(const QStringList &issiList)
|
||||
{
|
||||
m_issiList.clear();
|
||||
|
||||
// broadcast
|
||||
if (issiList.count() == 0)
|
||||
{
|
||||
m_issiList += 0;
|
||||
@@ -430,7 +434,7 @@ void TetraIF::handleDataIndReq(const QByteArray &data)
|
||||
break;
|
||||
}
|
||||
|
||||
delete radioTelegram;
|
||||
delete radioTelegram; // this deletes also a_data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,7 +442,7 @@ void TetraIF::handleLoginTelegram(N_CoPrtCnv::CoPrtCnvRadioTelegram *a_loginTele
|
||||
{
|
||||
uint16_t identity = a_loginTelegram->getIdentity();
|
||||
uint32_t issi = a_loginTelegram->getSrcISSI();
|
||||
|
||||
// is it a login request?
|
||||
if (N_CoPrtCnv::CoPrtCnvRadioTelegram::e_LoginRequest == (a_loginTelegram->getPayloadDataUInt8(2) & N_CoPrtCnv::CoPrtCnvRadioTelegram::e_LoginStatusMask))
|
||||
{
|
||||
bool sent = sendLoginResponse(issi);
|
||||
@@ -456,33 +460,33 @@ bool TetraIF::sendLoginResponse(const uint32_t a_ISSI)
|
||||
++m_SendCounter;
|
||||
N_CoPrtCnv::CoPrtCnvRadioTelegram *a_telegram = new N_CoPrtCnv::CoPrtCnvRadioTelegram(GEF_BESTAETIGUNG, 20, a_ISSI);
|
||||
a_telegram->setZaehler(m_SendCounter);
|
||||
|
||||
// set our ISSI
|
||||
a_telegram->setDestISSI(a_ISSI);
|
||||
a_telegram->setSrcISSI(2);
|
||||
gef_telegramm_id_et telId = a_telegram->isNormalTelegram() ? a_telegram->getTelID() : GEF_BESTAETIGUNG;
|
||||
|
||||
|
||||
// send telegram to radio
|
||||
INFO_LOG(m_logger) << "Send telegram to radio: telId=" << telId << " wcounter=" << a_telegram->zaehler() << " size= 28";
|
||||
|
||||
|
||||
|
||||
// Protokoll-Byte wird hier mit als Datenbyte missbraucht...
|
||||
a_telegram->setProtocolIdentifier(N_CoPrtCnv::CoPrtCnvRadioTelegram::e_TDSMessageWithoutSDS_TL);
|
||||
a_telegram->setPayloadData(0x01);
|
||||
a_telegram->setPayloadData(0x04);
|
||||
|
||||
a_telegram->getData()[22] = 0x0d;
|
||||
// Bitanzahl anpassen
|
||||
a_telegram->getData()[22] = 0x0d; // Warum 13 (bzw. 21) ??
|
||||
|
||||
char *data = a_telegram->getData();
|
||||
|
||||
|
||||
data[02] = 0x18;
|
||||
|
||||
// Header - complete Payload in Bytes
|
||||
data[02] = 0x18; // 24 Bytes
|
||||
// Len in Bits
|
||||
data[22] = 0x0d;
|
||||
data[23] = 0x00;
|
||||
|
||||
// Len in Bytes
|
||||
data[24] = 0x02;
|
||||
data[25] = 0x00;
|
||||
|
||||
// Data
|
||||
data[13] = 0x00;
|
||||
data[26] = 0x01;
|
||||
data[27] = 0x40;
|
||||
|
||||
Reference in new issue
Block a user