Skip to content

Commit d510c3c

Browse files
committed
Release v4.0
2 parents 5e6eb2d + bec259d commit d510c3c

File tree

600 files changed

+166
-144994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

600 files changed

+166
-144994
lines changed

CMakeLists.txt

+16-46
Original file line numberDiff line numberDiff line change
@@ -157,55 +157,25 @@ set (ICON_INSTALL_DIR ${DATA_INSTALL_DIR}/icon)
157157
set (CONFIG_INSTALL_REL_DIR ${CMAKE_INSTALL_DATADIR}/${INSTALL_NAME})
158158
set (CONFIG_INSTALL_DIR ${CONFIG_INSTALL_REL_DIR})
159159

160-
file (READ "${PROJECT_SOURCE_DIR}/comms/include/comms/version.h" version_file)
161-
string (REGEX MATCH "COMMS_MAJOR_VERSION ([0-9]*)U*" _ ${version_file})
162-
set (major_ver ${CMAKE_MATCH_1})
163-
string (REGEX MATCH "COMMS_MINOR_VERSION ([0-9]*)U*" _ ${version_file})
164-
set (minor_ver ${CMAKE_MATCH_1})
165-
string (REGEX MATCH "COMMS_PATCH_VERSION ([0-9]*)U*" _ ${version_file})
166-
set (patch_ver ${CMAKE_MATCH_1})
167-
set (COMMS_VERSION "${major_ver}.${minor_ver}.${patch_ver}")
168-
169-
170-
include(CMakePackageConfigHelpers)
171-
write_basic_package_version_file(
172-
${CMAKE_BINARY_DIR}/LibCommsConfigVersion.cmake
173-
VERSION ${COMMS_VERSION}
174-
COMPATIBILITY AnyNewerVersion)
175-
176-
write_basic_package_version_file(
177-
${CMAKE_BINARY_DIR}/CommsChampionConfigVersion.cmake
178-
VERSION ${COMMS_VERSION}
179-
COMPATIBILITY AnyNewerVersion)
180-
181-
set (LIB_COMMS_CMAKE_FILES
182-
${PROJECT_SOURCE_DIR}/cmake/CC_Compile.cmake
183-
${PROJECT_SOURCE_DIR}/cmake/CC_External.cmake
184-
${PROJECT_SOURCE_DIR}/cmake/CC_CxxtestFuncs.cmake
185-
${PROJECT_SOURCE_DIR}/cmake/CC_DefineExternalProjectTargets.cmake
186-
${PROJECT_SOURCE_DIR}/cmake/CC_DocCleanupScript.cmake
187-
${PROJECT_SOURCE_DIR}/cmake/CC_Prefetch.cmake
188-
${PROJECT_SOURCE_DIR}/cmake/CC_RunWithValgrindScript.cmake
189-
${PROJECT_SOURCE_DIR}/cmake/LibCommsConfig.cmake
190-
${PROJECT_SOURCE_DIR}/cmake/DefineExternalProjectTargets.cmake
191-
${CMAKE_BINARY_DIR}/LibCommsConfigVersion.cmake
192-
)
193-
194-
set (COMMS_CHAMPION_CMAKE_FILES
195-
${PROJECT_SOURCE_DIR}/cmake/CC_DeployQt5Script.cmake
196-
${PROJECT_SOURCE_DIR}/cmake/CC_GenWinAppStartBat.cmake
197-
${PROJECT_SOURCE_DIR}/cmake/CommsChampionConfig.cmake
198-
)
160+
set (CC_COMMS_EXTERNAL_PROJ_SRC_DIR "${CC_EXTERNALS_DIR}/comms")
161+
set (CC_COMMS_EXTERNAL_PROJ_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/comms_ext/build")
162+
set (CC_COMMS_EXTERNAL_PROJ_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/comms_ext/install")
163+
164+
if (CC_INSTALL_COMMS_LIB)
165+
set (CC_COMMS_EXTERNAL_PROJ_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
166+
endif ()
199167

200168
add_subdirectory (comms)
201169
add_subdirectory (comms_champion)
202170

203-
add_subdirectory (demo)
204171

205-
if (WIN32 AND CC_QT_DIR)
206-
add_custom_target ("deploy_qt"
207-
COMMAND ${CMAKE_COMMAND} -DCC_QT_DIR=${CC_QT_DIR}
208-
-DCC_BIN_DIR=${BIN_INSTALL_DIR} -DCC_PLUGIN_DIR=${PLUGIN_INSTALL_DIR}
209-
-P ${PROJECT_SOURCE_DIR}/cmake/CC_DeployQt5Script.cmake
172+
if (CC_INSTALL_TOOLS_LIBRARY)
173+
set (COMMS_CHAMPION_CMAKE_FILES
174+
${PROJECT_SOURCE_DIR}/cmake/CommsChampionConfig.cmake
175+
)
176+
177+
install (
178+
FILES ${COMMS_CHAMPION_CMAKE_FILES}
179+
DESTINATION ${LIB_INSTALL_DIR}/CommsChampion/cmake/
210180
)
211-
endif ()
181+
endif()

README.md

+19-167
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
![Image: CommsChampion Icon](comms_champion/app/cc_view/src/image/app_icon.png)
1+
# IMPORTANT NOTICE
2+
Since release v4.0 this project is deprecated. For convenience it has been split into
3+
two separate ones:
4+
5+
- [COMMS Library](https://github.com/commschamp/comms)
6+
- [CommsChampion Tools](https://github.com/commschamp/cc_tools_qt)
7+
8+
Please use them instead.
9+
10+
This project is now a simple wrapper arount the ones listed above. It
11+
still can be used for backward compatibility, but it is not recommended.
12+
13+
----
214

315
This project is a core (and a member) of
416
[CommsChampion Ecosystem](https://commschamp.github.io),
@@ -15,174 +27,14 @@ definitions. The tools can be used to visualise, analyse, and debug binary
1527
communication protocols, which were developed using [COMMS Library](#comms-library).
1628

1729
# COMMS Library
18-
**COMMS** is the **C++(11)** headers only, platform independent library,
19-
which makes the implementation of a communication
20-
protocol to be an easy and relatively quick process. It provides all the necessary
21-
types and classes to make the definition of the custom messages, as well as
22-
wrapping transport data fields, to be simple declarative statements of type and
23-
class definitions. These statements will specify **WHAT** needs to be implemented.
24-
The **COMMS** library internals handle the **HOW** part.
25-
26-
The internals of the **COMMS** library is mostly template classes which use
27-
multiple meta-programming techniques. As the result, only the functionality,
28-
required by the protocol being developed, gets compiled in, providing the best code size and
29-
speed performance possible. The down side is that compilation process may
30-
take a significant amount of time and consume a lot of memory.
31-
32-
The **COMMS** library allows having **single implementation** of the binary
33-
protocol messages, which can be re-compiled and used for any possible application:
34-
bare-metal with constrained resources, Linux based embedded systems, even
35-
independent GUI analysis tools.
36-
37-
The **COMMS** library was specifically developed to be used in **embedded** systems
38-
including **bare-metal** ones. It doesn't use exceptions and/or RTTI. It also
39-
minimises usage of dynamic memory allocation and provides an ability to exclude
40-
it altogether if required, which may be needed when developing **bare-metal**
41-
embedded systems.
42-
43-
Core ideas and architecture of the **COMMS** library is described in
44-
[Guide to Implementing Communication Protocols in C++](https://commschamp.github.io/comms_protocols_cpp/) free e-book.
45-
However, at this stage the library internals are much more advanced and sophisticated, than
46-
examples in the e-book, please don't treat the latter as a guide to library's internals.
47-
48-
Full [doxygen](www.doxygen.org) generated documentation with the full tutorial inside can be
49-
read [online](https://commschamp.github.io/comms_doc/) and/or
50-
downloaded as **doc_comms_vX.zip** archive from
51-
[release artefacts](https://github.com/commschamp/comms_champion/releases).
52-
53-
For quick usage examples please refer to [EXAMPLES.md](EXAMPLES.md).
30+
**IMPORTANT**: The COMMS library has been relocated to a
31+
separate [repository](https://github.com/commschamp/comms). Please open
32+
it to read the description.
5433

5534
# CommsChampion Tools
56-
This project also contains a set of tool applications (in addition to the
57-
[COMMS Library](#comms-library)), which can be used to
58-
develop, monitor and debug custom binary communication protocols, that where
59-
developed using the [COMMS Library](#comms-library).
60-
All the applications are plug-in based, i.e. plug-ins are used to define
61-
I/O socket, data filters, and the custom protocol itself. The tools
62-
use [Qt5](http://www.qt.io/) framework for GUI interfaces as well as loading
63-
and managing plug-ins.
64-
65-
The current list of available applications is below. Please refer to the
66-
[wiki page](https://github.com/commschamp/comms_champion/wiki/How-to-Use-CommsChampion-Tools)
67-
for tutorial on how to use them.
68-
69-
- **cc_view** is the main generic GUI application for visualisation and analysis of the
70-
communication protocols.
71-
72-
- **cc_dump** is a command line utility, that recognises all the received
73-
custom binary protocol messages and dumps them all in CSV format to standard output.
74-
It can also record the incoming message into the file, which can be opened
75-
later for visual analysis using **cc_view** GUI application.
76-
The tool has an ability to receive a file with definition of outgoing messages,
77-
created using **cc_view** GUI application, and send them one by one
78-
in parallel to dumping/recording the incoming messages.
79-
80-
The [CommsChampion Tools](#commschampion-tools) package provides the following
81-
plugins that can be used with any application:
82-
83-
- **null_socket** - NULL socket, that doesn't produce any incoming data and
84-
discards any outgoing data.
85-
- **echo_socket** - Echo socket, all the data being sent is immediately reported
86-
as an incoming data.
87-
- **serial_socket** - Low level socket that sends and receives data over serial
88-
(RS-232) I/O link.
89-
- **tcp_client_socket** - Client TCP/IP socket, that connects to remote
90-
server, sends and receives data over TCP/IP network link.
91-
- **tcp_server_socket** - Server TCP/IP socket, waits for and accepts all
92-
connections from TCP/IP clients, sends and receives data to/from them.
93-
- **tcp_proxy_socket** - Proxy server TCP/IP socket, combines Server and Client
94-
side of TCP/IP connection, can be used to monitor traffic of the messages between
95-
remote a client and a server.
96-
- **udp_socket** - Generic (client/server) UDP/IP socket.
97-
- **raw_data_protocol** - Protocol definition that defines only a single message
98-
type with one field of unlimited length data. It can be used to review the
99-
raw data being received from I/O socket.
100-
101-
### Developing Custom Socket/Filter/Protocol Plugin
102-
The full tutorial as well as API documentation can be downloaded as
103-
**doc_commschampion_vX.zip** archive from
104-
from [release artefacts](https://github.com/commschamp/comms_champion/releases).
105-
106-
# Demos and Examples
107-
Over the years the
108-
[COMMS Library](#comms-library) grew with features and accumulated
109-
multiple nuances to be remembered when defining a new protocol. In order to
110-
simplify protocol definition work, a separate toolset, called
111-
[commsdsl](https://github.com/commschamp/commsdsl) (hosted as separate repository),
112-
has been developed. It allows much easier and simpler definition of the protocol,
113-
using schema files written in XML based domain specific language, called
114-
[CommsDSL](https://github.com/commschamp/CommsDSL-Specification). The toolset
115-
will generate a C++11 code that defines the protocol using appropriate
116-
[COMMS Library](#comms-library) classes and functions, as well as generate extra code
117-
required to implement a protocol definition plugin for
118-
[CommsChampion Tools](#commschampion-tools). Many binary protocols
119-
may have nuances that are difficult to express in existing schema language.
120-
In order to still allow usage of the schema files for the protocol definition, the
121-
toolset allows injection of extra custom code to modify or extend the generated
122-
one. The generated code itself is also highly compile time customisable. It
123-
allows selection of custom data structures for data storage as well as polymorphic
124-
interfaces relevant to the application being developed.
125-
126-
As the result, manual implementation of binary communication protocols **from
127-
scratch** using
128-
[COMMS Library](#comms-library) is not recommended and should be avoided. Please use
129-
**commsdsl2comms** code generator from
130-
[commsdsl](https://github.com/commschamp/commsdsl) project, which also
131-
lists multiple available protocols (with usage examples) that can be used
132-
as reference.
133-
134-
# Licence
135-
The [COMMS Library](#comms-library) is licensed under
136-
the [MPL-2.0](http://mozilla.org/MPL/2.0/) license.
137-
138-
The [CommsChampion Tools](#commschampion-tools) use open-source
139-
[Qt5](http://www.qt.io/) libraries, hence licenced under the
140-
[GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html).
141-
142-
143-
# Supported Compilers
144-
The [COMMS Library](#comms-library) requires proper C++11 support which
145-
is provided by the following compilers:
146-
- **GCC**: >=4.8
147-
- **Clang**: >=3.9
148-
- **MSVC**: >= 2015
149-
150-
# How to Build
151-
Detailed instructions on how to build and install all the components can be
152-
found in [doc/BUILD.md](doc/BUILD.md) file.
153-
154-
# How to Use COMMS Library
155-
The COMMS library [doxygen documentation](https://commschamp.github.io/comms_doc/)
156-
contains detailed tutorial and examples how to use the provided
157-
classes and functions.
158-
159-
The [cc_tutorial](https://github.com/commschamp/cc_tutorial/) repository
160-
contains a full tutorial how to use the library in conjunction with
161-
[commsdsl2comms](https://github.com/commschamp/commsdsl) code generator.
162-
163-
# Other documentation
164-
Please check the [doc](doc) folder for the available additional documentation.
165-
166-
# How to Run CommsChampion Tools applications
167-
On Windows platforms try to run the *.exe binary (**cc_view.exe**
168-
or **cc_dump.exe**), which resides in
169-
**${CMAKE_ISNTALL_PREFIX}/bin** directory. If the execution fails due to missing **Qt5** dlls,
170-
either set your **%PATH%** variable accordingly or try to execute generated **.bat**
171-
files (**cc_view.bat** or **cc_dump.bat**) residing in the same directory. Another
172-
option is to build **deploy_qt** target to deploy Qt5 libraries into installation directory, which will allow execution of any **.exe** file without any extra manipulations.
173-
174-
On Linux platforms use the appropriate shell script
175-
(**cc_view.sh** or **cc_dump.sh**), which also resides in
176-
**${CMAKE_ISNTALL_PREFIX}/bin** directory.
177-
178-
Please note that available plugins must reside in the **${CMAKE_ISNTALL_PREFIX}/lib/CommsChampion/plugin** directory.
179-
180-
The tools support multiple command line options, please use "-h" or "--help" for
181-
the full list.
182-
183-
>$> ./install/bin/cc_view.sh -h
184-
185-
>$> ./install/bin/cc_dump.sh -h
35+
**IMPORTANT**: The tools have been relocated to a
36+
separate [repository](https://github.com/commschamp/cc_tools_qt). Please open
37+
it to read the description.
18638

18739
# Branching Model
18840
This repository will follow the

cmake/CommsChampionConfig.cmake

+12-47
Original file line numberDiff line numberDiff line change
@@ -18,59 +18,24 @@
1818
get_filename_component(_ONE_UP_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH)
1919
get_filename_component(_TWO_UP_DIR "${_ONE_UP_DIR}" PATH)
2020
set (LIBCOMMS_CMAKE_DIR "${_TWO_UP_DIR}/LibComms/cmake")
21+
set (CC_TOOLS_QT_CMAKE_DIR "${_TWO_UP_DIR}/cc_tools_qt/cmake")
2122

2223
if ((NOT TARGET cc::comms) AND (EXISTS ${LIBCOMMS_CMAKE_DIR}/LibCommsConfig.cmake))
2324
include (${LIBCOMMS_CMAKE_DIR}/LibCommsConfig.cmake)
2425
endif ()
2526

26-
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/comms_championExport.cmake)
27-
include (${CMAKE_CURRENT_LIST_DIR}/comms_championExport.cmake)
27+
if ((NOT TARGET cc::cc_tools_qt) AND (EXISTS ${CC_TOOLS_QT_CMAKE_DIR}/cc_tools_qtConfig.cmake))
28+
include (${CC_TOOLS_QT_CMAKE_DIR}/cc_tools_qtConfig.cmake)
2829
endif ()
2930

30-
if (NOT TARGET cc::comms_champion)
31-
return ()
31+
if ((NOT TARGET cc::comms_champion) AND (TARGET cc::cc_tools_qt))
32+
add_library(cc::comms_champion ALIAS cc::cc_tools_qt)
3233
endif ()
3334

34-
# Load information for each installed configuration.
35-
file(GLOB config_files "${CMAKE_CURRENT_LIST_DIR}/CommsChampionConfig-*.cmake")
36-
foreach(f ${config_files})
37-
include(${f})
38-
endforeach()
39-
40-
get_filename_component (CC_INSTALL_LIB_PROJ_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
41-
get_filename_component (CC_INSTALL_LIB_DIR ${CC_INSTALL_LIB_PROJ_DIR} DIRECTORY)
42-
get_filename_component (CC_ROOT_DIR ${CC_INSTALL_LIB_DIR} DIRECTORY)
43-
44-
find_path(CC_INCLUDE_DIR NAMES comms_champion/Message.h PATHS "${CC_ROOT_DIR}" PATH_SUFFIXES include)
45-
find_library(CC_PLUGIN_LIBRARY NAMES "comms_champion" PATHS "${CC_ROOT_DIR}" PATH_SUFFIXES lib)
46-
47-
if (MSVC)
48-
find_file(CC_NULL_SOCK_LIBRARY NAMES "null_socket.dll" PATHS "${CC_ROOT_DIR}/lib/CommsChampion" PATH_SUFFIXES plugin)
49-
else ()
50-
find_library(CC_NULL_SOCK_LIBRARY NAMES "null_socket" PATHS "${CC_ROOT_DIR}/lib/CommsChampion" PATH_SUFFIXES plugin)
51-
endif ()
52-
53-
if (CC_PLUGIN_LIBRARY)
54-
get_filename_component (CC_PLUGIN_LIBRARY_DIR ${CC_PLUGIN_LIBRARY} DIRECTORY)
55-
endif ()
56-
57-
if (CC_NULL_SOCK_LIBRARY)
58-
get_filename_component (CC_PLUGIN_DIR ${CC_NULL_SOCK_LIBRARY} DIRECTORY)
59-
endif ()
60-
61-
set (CC_CMAKE_DIR ${CMAKE_CURRENT_LIST_DIR})
62-
63-
find_package(PackageHandleStandardArgs REQUIRED)
64-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
65-
CommsChampion
66-
REQUIRED_VARS
67-
CC_ROOT_DIR CC_INCLUDE_DIR CC_PLUGIN_LIBRARY_DIR CC_PLUGIN_LIBRARY CC_CMAKE_DIR)
68-
69-
set (CC_COMMS_CHAMPION_FOUND ${CommsChampion_FOUND})
70-
71-
if (CC_COMMS_CHAMPION_FOUND)
72-
set (CC_INCLUDE_DIRS ${CC_INCLUDE_DIR})
73-
set (CC_PLUGIN_LIBRARIES ${CC_PLUGIN_LIBRARY})
74-
set (CC_PLUGIN_LIBRARY_DIRS ${CC_PLUGIN_LIBRARY_DIR})
75-
endif ()
76-
35+
set (CC_COMMS_CHAMPION_FOUND ${CC_TOOLS_QT_FOUND})
36+
set (CC_INCLUDE_DIRS ${CC_TOOLS_QT_INCLUDE_DIRS})
37+
set (CC_ROOT_DIR ${CC_TOOLS_QT_ROOT_DIR})
38+
set (CC_PLUGIN_LIBRARIES ${CC_TOOLS_QT_PLUGIN_LIBRARIES})
39+
set (CC_PLUGIN_LIBRARY_DIRS ${CC_TOOLS_QT_PLUGIN_LIBRARY_DIRS})
40+
set (CC_PLUGIN_DIR ${CC_TOOLS_QT_PLUGIN_DIR})
41+
set (CC_CMAKE_DIR ${CC_COMMS_CMAKE_DIR})

0 commit comments

Comments
 (0)