From 41ba43e9deff9cb55c1941c9fe1716834b479ce0 Mon Sep 17 00:00:00 2001 From: Malika Date: Sat, 23 Mar 2024 11:09:35 +0100 Subject: [PATCH 1/2] Update ReadMe with instructions on project setup --- README.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.rst b/README.rst index 3aa98d9..45d1732 100644 --- a/README.rst +++ b/README.rst @@ -47,3 +47,31 @@ Where: * **Frame data** - n byte, data of the frame, can be empty. Sometimes first 2 bytes of data are used as a subcommand. Max size 246 * **Checksum** - 1 byte, the least significant byte of the sum of all bytes of the frame except separator bytes, CRC, and checksum itself. * **CRC** - 2 bytes, CRC 16 of all bytes of the frame except separator bytes and CRC itself (Modbus CRC algorithm used). CRC is available only if the frame flags byte indicates it. + +Setup / usage +-------------------- + +Prerequisites +----------- +* Windows (no support for compilation on other OSes as of now) +* CMake https://cmake.org/download/ +* Visual Studio Code or another way to compile C++ + +Running the application +----------- + +1. Use CMake to generate the necessary files +``` +mkdir build && cd build +cmake .. +cd .. +``` + +2. Build +``` +cmake --build build --config Debug --target all +``` + +3. Run +? + From 250c3f34cf5b1c37c78a93f607464280829808d7 Mon Sep 17 00:00:00 2001 From: Malika Date: Sat, 23 Mar 2024 11:11:56 +0100 Subject: [PATCH 2/2] Activate C++11 to fix warnings when compiling --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a84314..87834ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.19) +# Activate C++ 11 +set (CMAKE_CXX_STANDARD 11) + file(READ ${CMAKE_CURRENT_SOURCE_DIR}/library.json LIB_PROPERTIES) string(JSON LIB_NAME GET ${LIB_PROPERTIES} "name") string(JSON LIB_VERSION GET ${LIB_PROPERTIES} "version")