Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list
Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF
Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
- Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
- Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)
Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified
Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
133 lines
4.0 KiB
C++
133 lines
4.0 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* main for TetraRadio
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
|
*/
|
|
|
|
#include <nglapplication/nglcoreapplication.h>
|
|
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
|
#include <QNetworkProxy>
|
|
#include <memory>
|
|
#include "main_handler.h"
|
|
#include "logger.h"
|
|
#include "settings.h"
|
|
|
|
#include <LtsUtilsCore/sfm_bytemessage_converter.h>
|
|
#include "wls_sfm_message.h"
|
|
#include "wls_sfm_message_converter.h"
|
|
|
|
class CmdLineParser : public LtsCommandLineParser::LtsCommandLineParser
|
|
{
|
|
public:
|
|
CmdLineParser()
|
|
: LtsCommandLineParser()
|
|
{
|
|
addOption({ QStringList() << QLatin1String("c") << QLatin1String("checkData"),
|
|
QLatin1String("Testdata"),
|
|
QLatin1String("data to check as hex (e.g. '02044c221f8091660bb300001a31313131313131313131313131313131313131313131313131312503'"),
|
|
QString()
|
|
});
|
|
}
|
|
|
|
bool isCheckData() const { return isSet(QLatin1String("c")); }
|
|
QByteArray dataToCheck() const { return value(QLatin1String("c")).toUtf8(); }
|
|
};
|
|
|
|
namespace WirelessLocationSystem
|
|
{
|
|
bool sendBinarySfmData(const QByteArray &ba, int sendCounter)
|
|
{
|
|
int chunkLen = 0;
|
|
int chunkCount = 1;
|
|
|
|
if (!WlsParticipant::calcChunkCountAndLen(ba, chunkCount, chunkLen))
|
|
{
|
|
fprintf(stderr, "Chunk count is not ok - data size: %d\n", ba.size());
|
|
return false;
|
|
}
|
|
|
|
int fragmentNumber = 1;
|
|
int iPos = 0;
|
|
while (iPos < ba.size())
|
|
{
|
|
const SfmMsgTetra_tx tx(sendCounter,
|
|
chunkCount,
|
|
fragmentNumber,
|
|
ba.mid(iPos, chunkLen));
|
|
const auto payload(SfmMessageConverter::generateTxMessage(tx));
|
|
const unsigned int fragmentParts = ((payload.size() + WlsHandler::s_maxLenTransparentData - 1) / WlsHandler::s_maxLenTransparentData);
|
|
if (fragmentParts != 1)
|
|
fprintf(stderr, "Calculation mismatch - only expected one part, got %d\n", fragmentParts);
|
|
|
|
SfmMsgTetra_rx rx;
|
|
rx.setPayload(tx.getPayload());
|
|
fprintf(stdout, "Output: len: %d(%d), %s, sendCounter: %d(0x%02x), is fragmented: %d, fragment: %d/%d\n",
|
|
payload.size(), tx.getPayload().size(), payload.data(),
|
|
rx.sendCounter(), rx.sendCounter(), rx.isFragmented(), rx.fragmentNumber(), rx.fragmentCount());
|
|
|
|
++sendCounter;
|
|
++fragmentNumber;
|
|
iPos += chunkLen;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
static int checkData(const QByteArray &data)
|
|
{
|
|
const QByteArray ba(QByteArray::fromHex(data));
|
|
try
|
|
{
|
|
const auto msg = LtsUtils::byteStreamToSfmMessage(ba);
|
|
fprintf(stdout, "Message payload: len: %d, %s\n", msg.payload().size(), msg.payload().toHex().data());
|
|
if (msg.id() == int(SfmMessage::MsgId::TetraMessage))
|
|
{
|
|
WirelessLocationSystem::SfmMsgTetra_rx rx;
|
|
rx.setPayload(msg.payload());
|
|
fprintf(stdout, "SfmMsgTetra payload: len: %d, %s, ", rx.payload().size(), rx.payload().toHex().data());
|
|
fprintf(stdout, "sendCounter: %d(0x%02x), is fragmented: %d, fragment: %d/%d\n",
|
|
rx.sendCounter(), rx.sendCounter(), rx.isFragmented(), rx.fragmentNumber(), rx.fragmentCount());
|
|
sendBinarySfmData(rx.payload(), 0x02); // 0x02 -> a value which has to be substituted
|
|
}
|
|
}
|
|
catch (const std::exception &e)
|
|
{
|
|
fprintf(stderr, "Could not decode message: %s\n", e.what());
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
} // namespace WirelessLocationSystem
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
NGLCoreApplication app(argc, argv);
|
|
QNetworkProxy::setApplicationProxy(QNetworkProxy());
|
|
|
|
int iRet = -1;
|
|
CmdLineParser options;
|
|
if (!options.init())
|
|
return iRet;
|
|
app.createLogger("WLS", 0);
|
|
|
|
if (options.isCheckData())
|
|
return WirelessLocationSystem::checkData(options.dataToCheck());
|
|
|
|
WirelessLocationSystem::Settings::setIniFile(options.iniFile());
|
|
|
|
{
|
|
std::unique_ptr<WirelessLocationSystem::MainHandler> mainHandler(new WirelessLocationSystem::MainHandler);
|
|
if (mainHandler->init(options.domainId()))
|
|
{
|
|
STARTUP_LOG(app.baseLogger());
|
|
iRet = app.exec();
|
|
SHUTDOWN_LOG(app.baseLogger());
|
|
}
|
|
}
|
|
|
|
return iRet;
|
|
}
|