Skip to content

Commit ae24828

Browse files
Merge branch 'main' into release
Release 1.0.3
2 parents 28b2c84 + effe739 commit ae24828

File tree

12 files changed

+118
-27
lines changed

12 files changed

+118
-27
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# general
22
build*
3-
docs/
3+
docs/*
4+
5+
!docs/index.md
6+
!docs/_config.yml
47

58
# editor files
69

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.13.4 FATAL_ERROR)
44
# ======================================================================================================================
55

66
# project
7-
project(stdin_to_modbus_shm LANGUAGES CXX VERSION 1.0.2)
7+
project(stdin_to_modbus_shm LANGUAGES CXX VERSION 1.0.3)
88

99
# settings
1010
set(Target "stdin_to_modbus_shm") # Executable name (without file extension!)

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# STDIN to Modbus Shared Memory
2+
3+
This application reads values from stdin and writes them to the shared memory created by one of the shared memory
4+
modbus clients (TCP/RTU).

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
target_sources(${Target} PRIVATE main.cpp)
55
target_sources(${Target} PRIVATE SHM.cpp)
6+
target_sources(${Target} PRIVATE license.cpp)
67

78

89
# ---------------------------------------- header files (*.jpp, *.h, ...) ----------------------------------------------
@@ -11,6 +12,7 @@ target_sources(${Target} PRIVATE SHM.cpp)
1112
target_sources(${Target} PRIVATE SHM.hpp)
1213
target_sources(${Target} PRIVATE input_parse.hpp)
1314
target_sources(${Target} PRIVATE split_string.hpp)
15+
target_sources(${Target} PRIVATE license.hpp)
1416

1517

1618
# ---------------------------------------- subdirectories --------------------------------------------------------------

src/SHM.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2021-2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
16
#include "SHM.hpp"
27

38
#include <fcntl.h>

src/SHM.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2021-2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
16
#pragma once
27

38
#include <string>
@@ -8,7 +13,7 @@ class SHM {
813
std::string name;
914
int fd = -1;
1015
std::size_t size = 0;
11-
void * addr = nullptr;
16+
void *addr = nullptr;
1217

1318
public:
1419
explicit SHM(std::string name);

src/input_parse.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2021-2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
16
#pragma once
27

38
#include "split_string.hpp"
@@ -36,7 +41,7 @@ static void parse_input(const std::string &input, input_data_t &target, int base
3641

3742
// get register type
3843
input_data_t::register_type_t type;
39-
auto & type_str = split_input.at(0);
44+
auto &type_str = split_input.at(0);
4045
for (auto &c : type_str)
4146
c = static_cast<char>(std::tolower(c));
4247
if (type_str == "do") {

src/license.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (C) 2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
6+
#include "license.hpp"
7+
8+
void print_licenses(std::ostream &o) {
9+
o << "This Application (" << PROJECT_NAME << ' ' << PROJECT_VERSION "): " << std::endl;
10+
o << std::endl;
11+
o << " MIT License" << std::endl;
12+
o << std::endl;
13+
o << " Copyright (c) 2021-2022 Nikolas Koesling" << std::endl;
14+
o << std::endl;
15+
o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
16+
o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
17+
o << " in the Software without restriction, including without limitation the rights" << std::endl;
18+
o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
19+
o << " copies of the Software, and to permit persons to whom the Software is" << std::endl;
20+
o << " furnished to do so, subject to the following conditions:" << std::endl;
21+
o << std::endl;
22+
o << " The above copyright notice and this permission notice shall be included in all" << std::endl;
23+
o << " copies or substantial portions of the Software." << std::endl;
24+
o << std::endl;
25+
o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
26+
o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
27+
o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
28+
o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
29+
o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
30+
o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl;
31+
o << " SOFTWARE." << std::endl;
32+
o << std::endl;
33+
o << std::endl;
34+
o << "cxxopts Library (https://github.com/jarro2783/cxxopts)" << std::endl;
35+
o << std::endl;
36+
o << " MIT License" << std::endl;
37+
o << std::endl;
38+
o << " Copyright (c) 2014 Jarryd Beck" << std::endl;
39+
o << std::endl;
40+
o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
41+
o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
42+
o << " in the Software without restriction, including without limitation the rights" << std::endl;
43+
o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
44+
o << " copies of the Software, and to permit persons to whom the Software is" << std::endl;
45+
o << " furnished to do so, subject to the following conditions:" << std::endl;
46+
o << std::endl;
47+
o << " The above copyright notice and this permission notice shall be included in" << std::endl;
48+
o << " all copies or substantial portions of the Software." << std::endl;
49+
o << std::endl;
50+
o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
51+
o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
52+
o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
53+
o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
54+
o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
55+
o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN" << std::endl;
56+
o << " THE SOFTWARE." << std::endl;
57+
}

src/license.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (C) 2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
6+
#pragma once
7+
8+
#include <ostream>
9+
10+
/**
11+
* \brief print licences
12+
* @param o output stream used to print licenses
13+
*/
14+
void print_licenses(std::ostream &o);

0 commit comments

Comments
 (0)