Skip to content

Commit

Permalink
Release v0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Apr 28, 2024
2 parents 688a126 + 112bed7 commit 7b36e36
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ environment:
COMMS_TAG: v5.2.3
CC_TOOLS_QT_TAG: v5.2.1
CC_MQTT5_GENERATED_TAG: v2.7
CC_MQTT5_LIBS_TAG: v0.4
CC_MQTT5_LIBS_TAG: v0.5
matrix:
- CPP_STD: 17
QT_MAJOR: 5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/actions_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
COMMS_TAG: v5.2.3
CC_TOOLS_QT_TAG: v5.2.1
CC_MQTT5_GENERATED_TAG: v2.7
CC_MQTT5_LIBS_TAG: v0.4
CC_MQTT5_LIBS_TAG: v0.5

jobs:

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project ("cc_tools_plugin_mqtt5_client_filter")

# Available options
option (OPT_WARN_AS_ERR "Treat warning as error" ON)
option (OPT_USE_CCACHE "Use ccache on UNIX systems if it's available" ON)
option (OPT_USE_CCACHE "Use ccache on UNIX systems if it's available" OFF)

# Extra configuration variables
# OPT_QT_MAJOR_VERSION - Major Qt version. Defaults to 5
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# MQTT5 Client Filter Plugin for the CommsChampion Tools
# MQTT v5 Client Filter Plugin for the CommsChampion Tools
This project is a member of the [CommsChampion Ecosystem](https://commschamp.github.io/) and implements
**MQTT5 Filter** plugin for the [CommsChampion Tools](https://github.com/commschamp/cc_tools_qt). It
**MQTT v5 Client Filter** plugin for the [CommsChampion Tools](https://github.com/commschamp/cc_tools_qt). It
allows observation and debugging of the custom protocol messages exchanged using
[MQTT5](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html) as the intermediate transport protocol in the common
[MQTT v5](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html) as the intermediate transport protocol in the common
environment of the [CommsChampion Tools](https://github.com/commschamp/cc_tools_qt).
Please read the [wiki page](https://github.com/commschamp/cc.mqtt5_client_filter.cc_tools_plugin/wiki) for the instructions on
how to configure and use the plugin.
Expand All @@ -14,8 +14,8 @@ This project uses [CMake](https://cmake.org/) as its build system. Please open t
This project has the following direct and transitive external dependencies:

- [COMMS Library](https://github.com/commschamp/comms) (**direct** dependency) - Primary library for any protocol definition, some inner cmake scripts are re-used in the build.
- [cc.mqtt5.generated](https://github.com/commschamp/cc.mqtt5.generated) (**transitive** dependency) - Definition of the MQTT5 protocol (depends on the [COMMS Library](https://github.com/commschamp/comms)).
- [cc.mqtt5.libs](https://github.com/commschamp/cc.mqtt5.generated) (**direct** dependency) - MQTT5 client library (depends on the
- [cc.mqtt5.generated](https://github.com/commschamp/cc.mqtt5.generated) (**transitive** dependency) - Definition of the MQTT v5 protocol (depends on the [COMMS Library](https://github.com/commschamp/comms)).
- [cc.mqtt5.libs](https://github.com/commschamp/cc.mqtt5.generated) (**direct** dependency) - MQTT v5 client library (depends on the
[COMMS Library](https://github.com/commschamp/comms) and the [cc.mqtt5.generated](https://github.com/commschamp/cc.mqtt5.generated)).
- [CommsChampion Tools](https://github.com/commschamp/cc.mqtt5.generated) (**direct** dependency) - CommsChampion Tools and its library required for the plugin development.
- [Qt](https://www.qt.io/) (**direct** dependency) - Qt5/6 libraries.
Expand Down
3 changes: 2 additions & 1 deletion script/full_debug_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ 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 COMMON_USE_CCACHE=ON
export EXTERNALS_DIR=${ROOT_DIR}/externals
if [ -z "${COMMON_QT_VER}" ]; then
export COMMON_QT_VER=5
Expand All @@ -20,7 +21,7 @@ ${SCRIPT_DIR}/prepare_externals.sh

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

procs=$(nproc)
if [ -n "${procs}" ]; then
Expand Down
30 changes: 22 additions & 8 deletions script/prepare_externals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
# COMMON_INSTALL_DIR - (Optional) Common directory to perform installations
# COMMON_BUILD_TYPE - (Optional) CMake build type
# COMMON_CXX_STANDARD - (Optional) CMake C++ standard
# COMMON_CMAKE_GENERATOR - (Optional) CMake generator
# COMMON_CMAKE_PLATFORM - (Optional) CMake platform
# COMMON_QT_VER - (Optional) common Qt major version
# COMMON_USE_CCACHE - (Optional) control of whether to use ccache

#####################################

Expand Down Expand Up @@ -128,7 +131,9 @@ function build_comms() {

echo "Building ${proj_name}..."
mkdir -p ${COMMS_BUILD_DIR}
cmake -S ${COMMS_SRC_DIR} -B ${COMMS_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${COMMS_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD}
cmake -S ${COMMS_SRC_DIR} -B ${COMMS_BUILD_DIR} \
${COMMON_CMAKE_GENERATOR:+"-G ${COMMON_CMAKE_GENERATOR}"} ${COMMON_CMAKE_PLATFORM:+"-A ${COMMON_CMAKE_PLATFORM}"} \
-DCMAKE_INSTALL_PREFIX=${COMMS_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD}
cmake --build ${COMMS_BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param}
}

Expand All @@ -149,7 +154,12 @@ function build_cc_tools_qt() {

echo "Building ${proj_name} ..."
mkdir -p ${CC_TOOLS_QT_BUILD_DIR}
cmake -S ${CC_TOOLS_QT_SRC_DIR} -B ${CC_TOOLS_QT_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${CC_TOOLS_QT_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DCC_TOOLS_QT_BUILD_APPS=OFF -DCMAKE_PREFIX_PATH=${COMMS_INSTALL_DIR} -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD} -DCC_TOOLS_QT_MAJOR_QT_VERSION=${COMMON_QT_VER}
cmake -S ${CC_TOOLS_QT_SRC_DIR} -B ${CC_TOOLS_QT_BUILD_DIR} \
${COMMON_CMAKE_GENERATOR:+"-G ${COMMON_CMAKE_GENERATOR}"} ${COMMON_CMAKE_PLATFORM:+"-A ${COMMON_CMAKE_PLATFORM}"} \
-DCMAKE_INSTALL_PREFIX=${CC_TOOLS_QT_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} \
${COMMON_USE_CCACHE:+"-DCC_TOOLS_QT_USE_CCACHE=${COMMON_USE_CCACHE}"} \
-DCC_TOOLS_QT_BUILD_APPS=OFF -DCMAKE_PREFIX_PATH=${COMMS_INSTALL_DIR} \
-DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD} -DCC_TOOLS_QT_MAJOR_QT_VERSION=${COMMON_QT_VER}
cmake --build ${CC_TOOLS_QT_BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param}
}

Expand All @@ -170,7 +180,10 @@ function build_cc_mqtt5_generated() {

echo "Building ${proj_name} ..."
mkdir -p ${CC_MQTT5_GENERATED_BUILD_DIR}
cmake -S ${CC_MQTT5_GENERATED_SRC_DIR} -B ${CC_MQTT5_GENERATED_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${CC_MQTT5_GENERATED_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DCMAKE_PREFIX_PATH=${COMMS_INSTALL_DIR} -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD} -DOPT_REQUIRE_COMMS_LIB=OFF
cmake -S ${CC_MQTT5_GENERATED_SRC_DIR} -B ${CC_MQTT5_GENERATED_BUILD_DIR} \
${COMMON_CMAKE_GENERATOR:+"-G ${COMMON_CMAKE_GENERATOR}"} ${COMMON_CMAKE_PLATFORM:+"-A ${COMMON_CMAKE_PLATFORM}"} \
-DCMAKE_INSTALL_PREFIX=${CC_MQTT5_GENERATED_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} \
-DCMAKE_PREFIX_PATH=${COMMS_INSTALL_DIR} -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD} -DOPT_REQUIRE_COMMS_LIB=OFF
cmake --build ${CC_MQTT5_GENERATED_BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param}
}

Expand All @@ -191,7 +204,12 @@ function build_cc_mqtt5_libs() {

echo "Building ${proj_name} ..."
mkdir -p ${CC_MQTT5_LIBS_BUILD_DIR}
cmake -S ${CC_MQTT5_LIBS_SRC_DIR} -B ${CC_MQTT5_LIBS_BUILD_DIR} -DCMAKE_INSTALL_PREFIX=${CC_MQTT5_LIBS_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} -DCMAKE_PREFIX_PATH=${COMMS_INSTALL_DIR}\;${CC_MQTT5_GENERATED_INSTALL_DIR} -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD} -DCC_MQTT5_CLIENT_LIB_FORCE_PIC=ON -DCC_MQTT5_CLIENT_APPS=OFF
cmake -S ${CC_MQTT5_LIBS_SRC_DIR} -B ${CC_MQTT5_LIBS_BUILD_DIR} \
${COMMON_CMAKE_GENERATOR:+"-G ${COMMON_CMAKE_GENERATOR}"} ${COMMON_CMAKE_PLATFORM:+"-A ${COMMON_CMAKE_PLATFORM}"} \
-DCMAKE_INSTALL_PREFIX=${CC_MQTT5_LIBS_INSTALL_DIR} -DCMAKE_BUILD_TYPE=${COMMON_BUILD_TYPE} \
-DCMAKE_PREFIX_PATH=${COMMS_INSTALL_DIR}\;${CC_MQTT5_GENERATED_INSTALL_DIR} -DCMAKE_CXX_STANDARD=${COMMON_CXX_STANDARD} \
${COMMON_USE_CCACHE:+"-DCC_MQTT5_USE_CCACHE=${COMMON_USE_CCACHE}"} \
-DCC_MQTT5_CLIENT_LIB_FORCE_PIC=ON -DCC_MQTT5_CLIENT_APPS=OFF
cmake --build ${CC_MQTT5_LIBS_BUILD_DIR} --config ${COMMON_BUILD_TYPE} --target install ${procs_param}
}

Expand All @@ -201,7 +219,3 @@ build_comms
build_cc_tools_qt
build_cc_mqtt5_generated
build_cc_mqtt5_libs




5 changes: 4 additions & 1 deletion src/Mqtt5ClientFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,10 @@ void Mqtt5ClientFilter::sendDataCb(void* data, const unsigned char* buf, unsigne
asThis(data)->sendDataInternal(buf, bufLen);
}

void Mqtt5ClientFilter::brokerDisconnectedCb(void* data, [[maybe_unused]] const CC_Mqtt5DisconnectInfo* info)
void Mqtt5ClientFilter::brokerDisconnectedCb(
void* data,
[[maybe_unused]] CC_Mqtt5BrokerDisconnectReason reason,
[[maybe_unused]] const CC_Mqtt5DisconnectInfo* info)
{
asThis(data)->brokerDisconnectedInternal();
}
Expand Down
4 changes: 2 additions & 2 deletions src/Mqtt5ClientFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <memory>
#include <string>

static_assert(CC_MQTT5_CLIENT_MAKE_VERSION(0, 4, 0) <= CC_MQTT5_CLIENT_VERSION, "The version of the cc_mqtt5_client library is too old");
static_assert(CC_MQTT5_CLIENT_MAKE_VERSION(0, 5, 0) <= CC_MQTT5_CLIENT_VERSION, "The version of the cc_mqtt5_client library is too old");
static_assert(CC_TOOLS_QT_MAKE_VERSION(5, 2, 1) <= CC_TOOLS_QT_VERSION, "The version of the cc_tools_qt library is too old");

namespace cc_plugin_mqtt5_client_filter
Expand Down Expand Up @@ -136,7 +136,7 @@ private slots:


static void sendDataCb(void* data, const unsigned char* buf, unsigned bufLen);
static void brokerDisconnectedCb(void* data, const CC_Mqtt5DisconnectInfo* info);
static void brokerDisconnectedCb(void* data, CC_Mqtt5BrokerDisconnectReason reason, const CC_Mqtt5DisconnectInfo* info);
static void messageReceivedCb(void* data, const CC_Mqtt5MessageInfo* info);
static void nextTickProgramCb(void* data, unsigned ms);
static unsigned cancelTickProgramCb(void* data);
Expand Down

0 comments on commit 7b36e36

Please sign in to comment.