Skip to content

Commit

Permalink
Release v4.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Dec 12, 2023
2 parents aaa3c67 + 85ede29 commit a6b9cc3
Show file tree
Hide file tree
Showing 12 changed files with 142 additions and 46 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Overview
This project also contains a set of tool applications , which can be used to
This project contains a set of tool applications , which can be used to
develop, monitor and debug custom binary communication protocols, that were
developed using the [COMMS Library](https://github.com/commschamp/comms).
All the applications are plug-in based, i.e. plug-ins are used to define
Expand Down Expand Up @@ -73,7 +73,7 @@ specific Qt major version by using **CC_TOOLS_QT_MAJOR_QT_VERSION** cmake variab
cmake -DCC_TOOLS_QT_MAJOR_QT_VERSION=6 ...
```

It is highly recommended to open main[CMakeLists.txt](CMakeLists.txt) file and review the available
It is highly recommended to open main [CMakeLists.txt](CMakeLists.txt) file and review the available
configuration options and variables.

# Developing Custom Socket/Filter/Protocol Plugin
Expand Down
2 changes: 1 addition & 1 deletion lib/include/cc_tools_qt/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define CC_TOOLS_QT_MINOR_VERSION 2U

/// @brief Patch level of the library
#define CC_TOOLS_QT_PATCH_VERSION 3U
#define CC_TOOLS_QT_PATCH_VERSION 4U

/// @brief Macro to create numeric version as single unsigned number
#define CC_TOOLS_QT_MAKE_VERSION(major_, minor_, patch_) \
Expand Down
2 changes: 1 addition & 1 deletion lib/src/MsgMgrImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ void MsgMgrImpl::socketDataReceived(DataInfoPtr dataInfoPtr)
}

QList<DataInfoPtr> data;
data.append(std::move(dataInfoPtr));
data.append(dataInfoPtr);
for (auto filt : m_filters) {
assert(filt);

Expand Down
11 changes: 9 additions & 2 deletions plugin/serial_socket/SerialSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "comms/CompileControl.h"

CC_DISABLE_WARNINGS()
#include <QtCore/QtGlobal>
#include <QtSerialPort/QSerialPortInfo>
CC_ENABLE_WARNINGS()

Expand Down Expand Up @@ -49,13 +50,19 @@ SerialSocket::SerialSocket()
m_name = firstDev->systemLocation();
}

#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
connect(
&m_serial, &QSerialPort::errorOccurred,
this, &SerialSocket::errorOccurred);
#else // #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
connect(
&m_serial, SIGNAL(error(QSerialPort::SerialPortError)),
this, SLOT(errorOccurred(QSerialPort::SerialPortError)));
#endif // #if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)

connect(
&m_serial, SIGNAL(readyRead()),
this, SLOT(performRead()));
&m_serial, &QSerialPort::readyRead,
this, &SerialSocket::performRead);
}

SerialSocket::~SerialSocket() noexcept = default;
Expand Down
15 changes: 9 additions & 6 deletions plugin/ssl_socket/client/SslSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,17 @@ const QString ToPropName("ssl.to");
SslSocket::SslSocket()
{
connect(
&m_socket, SIGNAL(disconnected()),
this, SLOT(socketDisconnected()));
&m_socket, &QSslSocket::disconnected,
this, &SslSocket::socketDisconnected);

connect(
&m_socket, SIGNAL(readyRead()),
this, SLOT(readFromSocket()));
&m_socket, &QSslSocket::readyRead,
this, &SslSocket::readFromSocket);

connect(
&m_socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
&m_socket, &QSslSocket::errorOccurred,
this, &SslSocket::socketErrorOccurred);

connect(
&m_socket, SIGNAL(sslErrors(const QList<QSslError>&)),
this, SLOT(sslErrorsOccurred(const QList<QSslError>&)));
Expand Down
16 changes: 12 additions & 4 deletions plugin/tcp_socket/client/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "comms/CompileControl.h"

CC_DISABLE_WARNINGS()
#include <QtCore/QtGlobal>
#include <QtNetwork/QHostAddress>
CC_ENABLE_WARNINGS()

Expand Down Expand Up @@ -49,14 +50,21 @@ const QString ToPropName("tcp.to");
Socket::Socket()
{
connect(
&m_socket, SIGNAL(disconnected()),
this, SLOT(socketDisconnected()));
&m_socket, &QTcpSocket::disconnected,
this, &Socket::socketDisconnected);
connect(
&m_socket, SIGNAL(readyRead()),
this, SLOT(readFromSocket()));
&m_socket, &QTcpSocket::readyRead,
this, &Socket::readFromSocket);

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
&m_socket, &QTcpSocket::errorOccurred,
this, &Socket::socketErrorOccurred);
#else // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
&m_socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
#endif
}

Socket::~Socket() noexcept
Expand Down
39 changes: 27 additions & 12 deletions plugin/tcp_socket/proxy/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "comms/CompileControl.h"

CC_DISABLE_WARNINGS()
#include <QtCore/QtGlobal>
#include <QtNetwork/QHostAddress>
CC_ENABLE_WARNINGS()

Expand Down Expand Up @@ -48,12 +49,12 @@ const QString ToPropName("tcp.to");
Socket::Socket()
{
QObject::connect(
&m_server, SIGNAL(newConnection()),
this, SLOT(newConnection()));
&m_server, &QTcpServer::newConnection,
this, &Socket::newConnection);

QObject::connect(
&m_server, SIGNAL(acceptError(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
&m_server, &QTcpServer::acceptError,
this, &Socket::socketErrorOccurred);
}

Socket::~Socket() noexcept
Expand Down Expand Up @@ -146,25 +147,39 @@ void Socket::newConnection()
{
auto *newConnSocket = m_server.nextPendingConnection();
connect(
newConnSocket, SIGNAL(disconnected()),
this, SLOT(clientConnectionTerminated()));
newConnSocket, &QTcpSocket::disconnected,
this, &Socket::clientConnectionTerminated);

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
newConnSocket, &QTcpSocket::errorOccurred,
this, &Socket::socketErrorOccurred);
#else // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
newConnSocket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
#endif // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)

ConnectionSocketPtr connectionSocket(new QTcpSocket);
connect(
connectionSocket.get(), SIGNAL(connected()),
this, SLOT(connectionSocketConnected()));
connectionSocket.get(), &QTcpSocket::connected,
this, &Socket::connectionSocketConnected);
connect(
connectionSocket.get(), SIGNAL(disconnected()),
this, SLOT(connectionSocketDisconnected()));
connectionSocket.get(), &QTcpSocket::disconnected,
this, &Socket::connectionSocketDisconnected);
connect(
connectionSocket.get(), &QTcpSocket::readyRead,
this, &Socket::readFromConnectionSocket);

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
connectionSocket.get(), SIGNAL(readyRead()),
this, SLOT(readFromConnectionSocket()));
connectionSocket.get(), &QTcpSocket::errorOccurred,
this, &Socket::socketErrorOccurred);
#else // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
connectionSocket.get(), SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
#endif

if (m_remoteHost.isEmpty()) {
m_remoteHost = QHostAddress(QHostAddress::LocalHost).toString();
Expand Down
28 changes: 18 additions & 10 deletions plugin/tcp_socket/server/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "comms/CompileControl.h"

CC_DISABLE_WARNINGS()
#include <QtCore/QtGlobal>
#include <QtNetwork/QHostAddress>
CC_ENABLE_WARNINGS()

Expand Down Expand Up @@ -48,12 +49,12 @@ const QString ToPropName("tcp.to");
Socket::Socket()
{
QObject::connect(
&m_server, SIGNAL(acceptError(QAbstractSocket::SocketError)),
this, SLOT(acceptErrorOccurred(QAbstractSocket::SocketError)));
&m_server, &QTcpServer::acceptError,
this, &Socket::acceptErrorOccurred);

QObject::connect(
&m_server, SIGNAL(newConnection()),
this, SLOT(newConnection()));
&m_server, &QTcpServer::newConnection,
this, &Socket::newConnection);
}

Socket::~Socket() noexcept
Expand Down Expand Up @@ -128,17 +129,24 @@ void Socket::newConnection()
auto *newConnSocket = m_server.nextPendingConnection();
m_sockets.push_back(newConnSocket);
connect(
newConnSocket, SIGNAL(disconnected()),
newConnSocket, SLOT(deleteLater()));
newConnSocket, &QTcpSocket::disconnected,
newConnSocket, &Socket::deleteLater);
connect(
newConnSocket, SIGNAL(disconnected()),
this, SLOT(connectionTerminated()));
newConnSocket, &QTcpSocket::disconnected,
this, &Socket::connectionTerminated);
connect(
newConnSocket, SIGNAL(readyRead()),
this, SLOT(readFromSocket()));
newConnSocket, &QTcpSocket::readyRead,
this, &Socket::readFromSocket);

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
newConnSocket, &QTcpSocket::errorOccurred,
this, &Socket::socketErrorOccurred);
#else // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
newConnSocket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
#endif // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
}

void Socket::connectionTerminated()
Expand Down
28 changes: 20 additions & 8 deletions plugin/udp_socket/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "comms/CompileControl.h"

CC_DISABLE_WARNINGS()
#include <QtCore/QtGlobal>
#include <QtNetwork/QHostAddress>
CC_ENABLE_WARNINGS()

Expand Down Expand Up @@ -54,20 +55,31 @@ Socket::Socket()
m_broadcastPropName(DefaultBroadcastPropName)
{
connect(
&m_socket, SIGNAL(disconnected()),
this, SLOT(socketDisconnected()));
&m_socket, &QUdpSocket::disconnected,
this, &Socket::socketDisconnected);
connect(
&m_socket, SIGNAL(readyRead()),
this, SLOT(readFromSocket()));
&m_socket, &QUdpSocket::readyRead,
this, &Socket::readFromSocket);
connect(
&m_socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
&m_broadcastSocket, &QUdpSocket::readyRead,
this, &Socket::readFromBroadcastSocket);

#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
&m_broadcastSocket, SIGNAL(readyRead()),
this, SLOT(readFromBroadcastSocket()));
&m_socket, &QUdpSocket::errorOccurred,
this, &Socket::socketErrorOccurred);

connect(
&m_broadcastSocket, &QUdpSocket::errorOccurred,
this, &Socket::socketErrorOccurred);
#else // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
connect(
&m_socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
connect(
&m_broadcastSocket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketErrorOccurred(QAbstractSocket::SocketError)));
#endif // #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
}

Socket::~Socket() noexcept
Expand Down
27 changes: 27 additions & 0 deletions script/full_debug_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

if [ -z "${CC}" -o -z "$CXX" ]; then
echo "ERROR: Compilers are not provided"
exit 1
fi

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR=$( dirname ${SCRIPT_DIR} )
export BUILD_DIR="${ROOT_DIR}/build.full.${CC}"
export COMMON_INSTALL_DIR=${BUILD_DIR}/install
export COMMON_BUILD_TYPE=Debug
export EXTERNALS_DIR=${ROOT_DIR}/externals
mkdir -p ${BUILD_DIR}

${SCRIPT_DIR}/prepare_externals.sh

cd ${BUILD_DIR}
cmake .. -DCMAKE_INSTALL_PREFIX=${COMMON_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} \
-DCC_TOOLS_QT_BUILD_DEMO_PROTOCOL=ON "$@"

procs=$(nproc)
if [ -n "${procs}" ]; then
procs_param="--parallel ${procs}"
fi

cmake --build ${BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param}
8 changes: 8 additions & 0 deletions script/full_debug_build_clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

export CC=clang
export CXX=clang++

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
${SCRIPT_DIR}/full_debug_build.sh

8 changes: 8 additions & 0 deletions script/full_debug_build_gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

export CC=gcc
export CXX=g++

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
${SCRIPT_DIR}/full_debug_build.sh

0 comments on commit a6b9cc3

Please sign in to comment.