Commit 497f1abf7e026dc87dcbdcad4e95c33d99719921

Authored by Peter M. Groen
2 parents 51becbde cd1a2748

Merge branch 'development' into 'master'

Development merge to master

See merge request !3
Showing 84 changed files with 2025 additions and 994 deletions
.gitignore 0 → 100644
  1 +build/
  2 +build/*
  3 +CMakeLists.txt.user*
  4 +cmake/
  5 +versioning/
  6 +/.gitmodules
CMakeLists.txt
1 cmake_minimum_required(VERSION 3.0) 1 cmake_minimum_required(VERSION 3.0)
2 -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 2 +project(osdev_mqtt)
  3 +# ==============================================================================
  4 +# Check to see if we're a submodule or top-repo.
  5 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  6 + message( STATUS "Looks like we're a single module" )
  7 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
  8 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
  9 + message( STATUS "Looks like we're a submodule" )
  10 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
  11 +else()
  12 + message( FATAL_ERROR "No cmake directory found. Did you run the submodules script?" )
  13 +endif()
3 14
  15 +# ==============================================================================
4 # Check to see if there is versioning information available 16 # Check to see if there is versioning information available
5 -if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/osdev_versioning/cmake)  
6 - LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/osdev_versioning/cmake)  
7 - include(osdevversion) 17 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/versioning)
  18 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/versioning/cmake)
  19 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../versioning)
  20 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../versioning/cmake)
  21 +else()
  22 + message( FATAL_ERROR "No ${CURRENT_SOURCE_DIR}/osdev_versioning directory found. Did you run the submodules script?" )
8 endif() 23 endif()
9 24
  25 +# ==============================================================================
  26 +# = Include build information
  27 +include(osdevversion)
10 include(projectheader) 28 include(projectheader)
  29 +
11 project_header(osdev_mqtt) 30 project_header(osdev_mqtt)
12 31
13 add_subdirectory(src) 32 add_subdirectory(src)
14 -add_subdirectory(tests/pub)  
15 -add_subdirectory(tests/sub)  
16 - 33 +add_subdirectory(examples/pub)
  34 +add_subdirectory(examples/sub)
17 35
18 -# include(packaging)  
19 -# package_component() 36 +include(packaging)
  37 +package_component()
README.md 0 → 100644
  1 +# MQTT-CPP
  2 +Modern, asynchronous and fast C++ client for paho-mqtt ( paho-c ).
  3 +
  4 +**Features:**
  5 +* Simple and clean A-synchronous API. ( Connect, publish, subscribe ).
  6 +* Multi-threaded. Use multiple topics in multiple threads..
  7 +* Callbacks can be lambdas, class methods, bind expressions, or any [std::function]
  8 +* Fully autonomous reconnecting
  9 +
  10 +# Dependencies
  11 +This library has dependencies on libpaho-mqtt3a.so and Boost ( RegEx and Core ).
  12 +Changes are there is a version for your platform ( Debian, Fedora, CentOS ).
  13 +Just check your package manager for the correct package-name.
  14 +
  15 +# Tutorial
  16 +* Clone this repository :
  17 + ```
  18 + git clone http://gitlab.osdev.nl/open_source/mqtt-cpp.git
  19 + ```
  20 + * Change to the repo and run the submodules script :
  21 + ```
  22 + $ cd mqtt-cpp
  23 + $ scripts/setup_submodules -i
  24 + ```
  25 + This will add the cmake directory and versioning.
  26 + * Create a build directory and start the build.
  27 + ```
  28 + $ mkdir build
  29 + $ cd build
  30 + $ cmake ../
  31 + $ gmake
  32 + ```
  33 +And you're all set. In build/bin there are two examples, test_mqtt_pu and test_mqtt_sub. Have a broker running,
  34 +like mosquitto or flashmq capable of accepting anonymous connections. Start the "sub" part and couple of moments
  35 +later the "pub" part. If all went well, you should see two screens in sync running.
  36 +
  37 + ```
  38 + Open terminal 1
  39 + $ bin/test_mqtt_sub
  40 +
  41 + Open terminal 2
  42 + $ bin/test_mqtt_pub
  43 + ```
  44 +Screen 2 is sending, Screen 1 is receiving.
  45 +
  46 +# Using the library.
  47 +Using mqtt-cpp is pretty straight forward. No real magic is happening. Beware of the fact that the library uses the namespace :
  48 +```
  49 + osdev::components::mqtt
  50 +```
  51 +
  52 +## Publishing..
  53 +To create a publisher, a simple member needs to be created.
  54 +Header :
  55 +```
  56 + #pragma once
  57 +
  58 + // std
  59 + #include <memory>
  60 + #include <string>
  61 +
  62 + // osdev::components::mqtt
  63 + #include "mqttclient.h"
  64 + #include "compat-c++14.h"
  65 +
  66 + class Publisher
  67 + {
  68 + public:
  69 + Publisher(const std::string &client_id);
  70 +
  71 + virtual ~Publisher() {}
  72 +
  73 + void connect( const std::string &hostname, int portnumber = 1883, const std::string &username = std::string(), const std::string &password = std::string() );
  74 +
  75 + void publish( const std::string &message_topic, const std::string &message_payload );
  76 +
  77 + private:
  78 + osdev::components::mqtt::MqttClient m_mqtt_client;
  79 + };
  80 +```
  81 +
  82 +Implementation
  83 +```
  84 +
  85 + // osdev::components::mqtt
  86 + // #include "token.h"
  87 +
  88 + // mqtt_tests
  89 + #include "publisher.h"
  90 +
  91 + Publisher::Publisher(const std::string &client_id)
  92 + : m_mqtt_client( client_id )
  93 + {
  94 +
  95 + }
  96 +
  97 + void Publisher::connect( const std::string &hostname, int portnumber, const std::string &username, const std::string &password )
  98 + {
  99 + m_mqtt_client.connect( hostname, portnumber, osdev::components::mqtt::Credentials( username, password ) );
  100 + std::cout << "Client state : " << m_mqtt_client.state() << std::endl;
  101 + }
  102 +
  103 + void Publisher::publish( const std::string &message_topic, const std::string &message_payload )
  104 + {
  105 + osdev::components::mqtt::MqttMessage message( message_topic, true, false, message_payload );
  106 + std::cout << "[Publisher::publish] - Publising message : " << message_payload << " to topic : " << message_topic << std::endl;
  107 + osdev::components::mqtt::Token t_result = m_mqtt_client.publish( message, 0 );
  108 + }
  109 +```
  110 +
  111 +## Subscribing
  112 +TO create a subscriber, a bit more work is involved. A subscription is dependant on a callback in which the data is handled to your liking. It is necessary to inherit from MqttSubscriberBase and override the "receive_data" method.
  113 +
  114 +subscriber.h
  115 +```
  116 +#pragma once
  117 +
  118 +// std
  119 +#include <string>
  120 +
  121 +// mqtt-cpp
  122 +#include "mqttsubscriberbase.h"
  123 +
  124 +class Subscriber : public MqttSubscriberBase
  125 +{
  126 +public:
  127 + Subscriber( const std::string &client_id );
  128 +
  129 + virtual ~Subscriber() {}
  130 +
  131 +protected:
  132 + void receive_data( const std::string &message_topic, const std::string &message_payload );
  133 +
  134 +};
  135 +```
  136 +
  137 +In the receive_data, the logic will be implemented to handle, decode and store the payload.
  138 +```
  139 +#include "subscriber.h"
  140 +
  141 +#include <iostream>
  142 +
  143 +Subscriber::Subscriber( const std::string &client_id )
  144 + : MqttSubscriberBase( client_id )
  145 +{
  146 +
  147 +}
  148 +
  149 +void Subscriber::receive_data( const std::string &message_topic, const std::string &message_payload )
  150 +{
  151 + std::cout << "[Subscriber::receive_data] - Received message : " << message_payload << " from topic : " << message_topic << std::endl;
  152 +}
  153 +```
  154 +
  155 +Now it will be very easy to send and receive messages from a broker without the hassle of administration.
tests/pub/CMakeLists.txt renamed to examples/pub/CMakeLists.txt
@@ -5,7 +5,7 @@ include(projectheader) @@ -5,7 +5,7 @@ include(projectheader)
5 project_header(test_mqtt_pub) 5 project_header(test_mqtt_pub)
6 6
7 include_directories( SYSTEM 7 include_directories( SYSTEM
8 - ${CMAKE_CURRENT_SOURCE_DIR}/../../src 8 + ${CMAKE_CURRENT_SOURCE_DIR}/../../include
9 ) 9 )
10 10
11 include(compiler) 11 include(compiler)
@@ -21,7 +21,7 @@ add_executable( ${PROJECT_NAME} @@ -21,7 +21,7 @@ add_executable( ${PROJECT_NAME}
21 21
22 target_link_libraries( 22 target_link_libraries(
23 ${PROJECT_NAME} 23 ${PROJECT_NAME}
24 - mqtt 24 + mqtt-cpp
25 ) 25 )
26 26
27 set_target_properties( ${PROJECT_NAME} PROPERTIES 27 set_target_properties( ${PROJECT_NAME} PROPERTIES
tests/pub/main.cpp renamed to examples/pub/main.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 22
20 // std 23 // std
21 #include <iostream> 24 #include <iostream>
@@ -80,14 +83,18 @@ int main( int argc, char* argv[] ) @@ -80,14 +83,18 @@ int main( int argc, char* argv[] )
80 // Assume we are connected now, start publishing. 83 // Assume we are connected now, start publishing.
81 while( 1 ) 84 while( 1 )
82 { 85 {
83 - std::string payload = "<Timestamp value=\"" + std::to_string( getEpochUSecs() ) + "\" /><MessageNumber value=\"" + std::to_string( messageNumber ) + "\" />" ;  
84 - pPublisher->publish( std::string( "test/publisher/TestPublisher" ), payload );  
85 -  
86 - sleepcp( 1, T_SECONDS );  
87 - if( messageNumber > 2000000000 )  
88 - messageNumber = -1;  
89 -  
90 - messageNumber++; 86 + for( unsigned int nCount = 0; nCount < 10; nCount++ )
  87 + {
  88 + std::string payload = "<Timestamp value=\"" + std::to_string( getEpochUSecs() ) + "\" /><MessageNumber value=\"" + std::to_string( messageNumber ) + "\" />" ;
  89 + pPublisher->publish( std::string( "test/publisher/TestPublisher_" + std::to_string( nCount ) ), payload );
  90 +
  91 + if( messageNumber > 2000000000 )
  92 + {
  93 + messageNumber = -1;
  94 + }
  95 + messageNumber++;
  96 + }
  97 + sleepcp( 1, T_MICRO );
91 } 98 }
92 } 99 }
93 else 100 else
tests/pub/publisher.cpp renamed to examples/pub/publisher.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */  
19 -  
20 -// osdev::components::mqtt  
21 -#include "token.h" 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
22 22
23 // mqtt_tests 23 // mqtt_tests
24 #include "publisher.h" 24 #include "publisher.h"
examples/pub/publisher.h 0 → 100644
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
  22 +#pragma once
  23 +
  24 +// std
  25 +#include <memory>
  26 +#include <string>
  27 +
  28 +// osdev::components::mqtt
  29 +#include "mqttclient.h"
  30 +#include "compat-c++14.h"
  31 +
  32 +class Publisher
  33 +{
  34 +public:
  35 + Publisher();
  36 +
  37 + virtual ~Publisher() {}
  38 +
  39 + void connect( const std::string &hostname, int portnumber = 1883, const std::string &username = std::string(), const std::string &password = std::string() );
  40 +
  41 + void publish( const std::string &message_topic, const std::string &message_payload );
  42 +
  43 +private:
  44 + osdev::components::mqtt::MqttClient m_mqtt_client;
  45 +};
tests/sub/CMakeLists.txt renamed to examples/sub/CMakeLists.txt
@@ -5,7 +5,7 @@ include(projectheader) @@ -5,7 +5,7 @@ include(projectheader)
5 project_header(test_mqtt_sub) 5 project_header(test_mqtt_sub)
6 6
7 include_directories( SYSTEM 7 include_directories( SYSTEM
8 - ${CMAKE_CURRENT_SOURCE_DIR}/../../src 8 + ${CMAKE_CURRENT_SOURCE_DIR}/../../include
9 ) 9 )
10 10
11 include(compiler) 11 include(compiler)
@@ -21,7 +21,7 @@ add_executable( ${PROJECT_NAME} @@ -21,7 +21,7 @@ add_executable( ${PROJECT_NAME}
21 21
22 target_link_libraries( 22 target_link_libraries(
23 ${PROJECT_NAME} 23 ${PROJECT_NAME}
24 - mqtt 24 + mqtt-cpp
25 ) 25 )
26 26
27 set_target_properties( ${PROJECT_NAME} PROPERTIES 27 set_target_properties( ${PROJECT_NAME} PROPERTIES
tests/sub/main.cpp renamed to examples/sub/main.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 22
20 // std 23 // std
21 #include <iostream> 24 #include <iostream>
@@ -68,19 +71,19 @@ int main( int argc, char* argv[] ) @@ -68,19 +71,19 @@ int main( int argc, char* argv[] )
68 71
69 std::cout << "Creating the subscriber : "; 72 std::cout << "Creating the subscriber : ";
70 // Create the subscriber 73 // Create the subscriber
71 - Subscriber *pSubscriber = new Subscriber(); 74 + Subscriber *pSubscriber = new Subscriber( "Test_Subscriber" );
72 if( pSubscriber != nullptr ) 75 if( pSubscriber != nullptr )
73 { 76 {
74 std::cout << "[OK]" << std::endl; 77 std::cout << "[OK]" << std::endl;
75 std::cout << "Connecting to the test-broker : " << std::endl; 78 std::cout << "Connecting to the test-broker : " << std::endl;
76 pSubscriber->connect( "localhost", 1883, "", "" ); 79 pSubscriber->connect( "localhost", 1883, "", "" );
77 std::cout << "Subscribing to the test-topic....." << std::endl; 80 std::cout << "Subscribing to the test-topic....." << std::endl;
78 - pSubscriber->subscribe( "test/publisher/TestPublisher" ); 81 + pSubscriber->subscribe( "test/publisher/#" );
79 82
80 // Start a loop to give the subscriber the possibility to do its work. 83 // Start a loop to give the subscriber the possibility to do its work.
81 while( 1 ) 84 while( 1 )
82 { 85 {
83 - sleepcp( 1, T_SECONDS ); // Sleep 1 Sec to give the scheduler the change to interfene. 86 + sleepcp( 1, T_MICRO ); // Sleep 1 Sec to give the scheduler the change to interfene.
84 } 87 }
85 } 88 }
86 else 89 else
examples/sub/subscriber.cpp 0 → 100644
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
  22 +#include "subscriber.h"
  23 +
  24 +#include <iostream>
  25 +
  26 +Subscriber::Subscriber( const std::string &client_id )
  27 + : MqttSubscriberBase( client_id )
  28 +{
  29 +
  30 +}
  31 +
  32 +void Subscriber::receive_data( const std::string &message_topic, const std::string &message_payload )
  33 +{
  34 + std::cout << "[Subscriber::receive_data] - Received message : " << message_payload << " from topic : " << message_topic << std::endl;
  35 +}
examples/sub/subscriber.h 0 → 100644
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
  22 +#pragma once
  23 +
  24 +// std
  25 +#include <string>
  26 +
  27 +// mqtt-cpp
  28 +#include "mqttsubscriberbase.h"
  29 +
  30 +class Subscriber : public MqttSubscriberBase
  31 +{
  32 +public:
  33 + Subscriber( const std::string &client_id );
  34 +
  35 + virtual ~Subscriber() {}
  36 +
  37 +protected:
  38 + void receive_data( const std::string &message_topic, const std::string &message_payload );
  39 +
  40 +};
src/bimap.h renamed to include/bimap.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */  
19 - 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
20 #ifndef OSDEV_COMPONENTS_MQTT_BIMAP_H 22 #ifndef OSDEV_COMPONENTS_MQTT_BIMAP_H
21 #define OSDEV_COMPONENTS_MQTT_BIMAP_H 23 #define OSDEV_COMPONENTS_MQTT_BIMAP_H
22 24
src/clientpaho.h renamed to include/clientpaho.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_CLIENTPAHO_H 22 #ifndef OSDEV_COMPONENTS_MQTT_CLIENTPAHO_H
2 #define OSDEV_COMPONENTS_MQTT_CLIENTPAHO_H 23 #define OSDEV_COMPONENTS_MQTT_CLIENTPAHO_H
3 24
src/commondefs.h renamed to include/commondefs.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_COMMONDEFS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_COMMONDEFS_H
2 #define OSDEV_COMPONENTS_MQTT_COMMONDEFS_H 23 #define OSDEV_COMPONENTS_MQTT_COMMONDEFS_H
3 24
src/compat-c++14.h renamed to include/compat-c++14.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_COMPATCXX14 22 #ifndef OSDEV_COMPONENTS_COMPATCXX14
20 #define OSDEV_COMPONENTS_COMPATCXX14 23 #define OSDEV_COMPONENTS_COMPATCXX14
21 24
src/compat-chrono.h renamed to include/compat-chrono.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include <chrono> 22 #include <chrono>
20 #include <type_traits> 23 #include <type_traits>
21 24
@@ -45,7 +48,11 @@ To ceil(const std::chrono::duration&lt;Rep, Period&gt;&amp; d) @@ -45,7 +48,11 @@ To ceil(const std::chrono::duration&lt;Rep, Period&gt;&amp; d)
45 { 48 {
46 To t = std::chrono::duration_cast<To>(d); 49 To t = std::chrono::duration_cast<To>(d);
47 if (t < d) 50 if (t < d)
  51 + {
48 return t + To{ 1 }; 52 return t + To{ 1 };
  53 + }
  54 +
  55 + // or else...
49 return t; 56 return t;
50 } 57 }
51 58
src/compiletimedigits.h renamed to include/compiletimedigits.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_COMPILETIMEDIGITS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_COMPILETIMEDIGITS_H
20 #define OSDEV_COMPONENTS_MQTT_COMPILETIMEDIGITS_H 23 #define OSDEV_COMPONENTS_MQTT_COMPILETIMEDIGITS_H
21 24
src/compiletimestring.h renamed to include/compiletimestring.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_COMPILETIMESTRING_H 22 #ifndef OSDEV_COMPONENTS_MQTT_COMPILETIMESTRING_H
20 #define OSDEV_COMPONENTS_MQTT_COMPILETIMESTRING_H 23 #define OSDEV_COMPONENTS_MQTT_COMPILETIMESTRING_H
21 24
src/connectionstatus.h renamed to include/connectionstatus.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_CONNECTIONSTATUS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_CONNECTIONSTATUS_H
2 #define OSDEV_COMPONENTS_MQTT_CONNECTIONSTATUS_H 23 #define OSDEV_COMPONENTS_MQTT_CONNECTIONSTATUS_H
3 24
src/credentials.h renamed to include/credentials.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_CREDENTIALS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_CREDENTIALS_H
2 #define OSDEV_COMPONENTS_MQTT_CREDENTIALS_H 23 #define OSDEV_COMPONENTS_MQTT_CREDENTIALS_H
3 24
src/date.h renamed to include/date.h
src/errorcode.h renamed to include/errorcode.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_ERRORCODE_H 22 #ifndef OSDEV_COMPONENTS_MQTT_ERRORCODE_H
2 #define OSDEV_COMPONENTS_MQTT_ERRORCODE_H 23 #define OSDEV_COMPONENTS_MQTT_ERRORCODE_H
3 24
src/histogram.h renamed to include/histogram.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAM_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAM_H
20 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAM_H 23 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAM_H
21 24
src/histogramprovider.h renamed to include/histogramprovider.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAMPROVIDER_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAMPROVIDER_H
20 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAMPROVIDER_H 23 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_HISTOGRAMPROVIDER_H
21 24
src/ihistogram.h renamed to include/ihistogram.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_IHISTOGRAM_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_IHISTOGRAM_H
2 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_IHISTOGRAM_H 23 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_IHISTOGRAM_H
3 24
src/imqttclient.h renamed to include/imqttclient.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_IMQTTCLIENT_H 22 #ifndef OSDEV_COMPONENTS_MQTT_IMQTTCLIENT_H
20 #define OSDEV_COMPONENTS_MQTT_IMQTTCLIENT_H 23 #define OSDEV_COMPONENTS_MQTT_IMQTTCLIENT_H
21 24
src/imqttclientimpl.h renamed to include/imqttclientimpl.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_IMQTTCLIENTIMPL_H 22 #ifndef OSDEV_COMPONENTS_MQTT_IMQTTCLIENTIMPL_H
20 #define OSDEV_COMPONENTS_MQTT_IMQTTCLIENTIMPL_H 23 #define OSDEV_COMPONENTS_MQTT_IMQTTCLIENTIMPL_H
21 24
src/istatecallback.h renamed to include/istatecallback.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_ISTATECALLBACK_H 22 #ifndef OSDEV_COMPONENTS_MQTT_ISTATECALLBACK_H
2 #define OSDEV_COMPONENTS_MQTT_ISTATECALLBACK_H 23 #define OSDEV_COMPONENTS_MQTT_ISTATECALLBACK_H
3 24
src/lockguard.h renamed to include/lockguard.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_LOCKGUARD_H 22 #ifndef OSDEV_COMPONENTS_MQTT_LOCKGUARD_H
20 #define OSDEV_COMPONENTS_MQTT_LOCKGUARD_H 23 #define OSDEV_COMPONENTS_MQTT_LOCKGUARD_H
21 24
src/macrodefs.h renamed to include/macrodefs.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_MACRODEFS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MACRODEFS_H
20 #define OSDEV_COMPONENTS_MQTT_MACRODEFS_H 23 #define OSDEV_COMPONENTS_MQTT_MACRODEFS_H
21 24
src/measure.h renamed to include/measure.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_MEASURE_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_MEASURE_H
20 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_MEASURE_H 23 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_MEASURE_H
21 24
src/metaprogrammingdefs.h renamed to include/metaprogrammingdefs.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_METAPROGRAMMINGDEFS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_METAPROGRAMMINGDEFS_H
20 #define OSDEV_COMPONENTS_MQTT_METAPROGRAMMINGDEFS_H 23 #define OSDEV_COMPONENTS_MQTT_METAPROGRAMMINGDEFS_H
21 24
src/mqttclient.h renamed to include/mqttclient.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MQTTCLIENT_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MQTTCLIENT_H
2 #define OSDEV_COMPONENTS_MQTT_MQTTCLIENT_H 23 #define OSDEV_COMPONENTS_MQTT_MQTTCLIENT_H
3 24
src/mqttfailure.h renamed to include/mqttfailure.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MQTTFAILURE_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MQTTFAILURE_H
2 #define OSDEV_COMPONENTS_MQTT_MQTTFAILURE_H 23 #define OSDEV_COMPONENTS_MQTT_MQTTFAILURE_H
3 24
src/mqttidgenerator.h renamed to include/mqttidgenerator.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MLOGICIDGENERATOR_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MLOGICIDGENERATOR_H
2 #define OSDEV_COMPONENTS_MQTT_MLOGICIDGENERATOR_H 23 #define OSDEV_COMPONENTS_MQTT_MLOGICIDGENERATOR_H
3 24
src/mqttmessage.h renamed to include/mqttmessage.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MQTTMESSAGE_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MQTTMESSAGE_H
2 #define OSDEV_COMPONENTS_MQTT_MQTTMESSAGE_H 23 #define OSDEV_COMPONENTS_MQTT_MQTTMESSAGE_H
3 24
tests/CMakeLists.txt renamed to include/mqttpublisherbase.h
src/mqttstream.h renamed to include/mqttstream.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_MQTTSTREAM_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MQTTSTREAM_H
20 #define OSDEV_COMPONENTS_MQTT_MQTTSTREAM_H 23 #define OSDEV_COMPONENTS_MQTT_MQTTSTREAM_H
21 24
include/mqttsubscriberbase.h 0 → 100644
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
  22 +#pragma once
  23 +
  24 +// std
  25 +#include <memory>
  26 +#include <string>
  27 +
  28 +// osdev::components::mqtt
  29 +#include "mqttclient.h"
  30 +
  31 +
  32 +class MqttSubscriberBase
  33 +{
  34 +public:
  35 + /*!
  36 + * \brief SubscriberBase
  37 + */
  38 + MqttSubscriberBase( const std::string &client_id );
  39 +
  40 + /*!
  41 + * \brief ~SubscriberBase
  42 + */
  43 + virtual ~MqttSubscriberBase() {}
  44 +
  45 + /*!
  46 + * \brief getClientId
  47 + * \return
  48 + */
  49 + std::string getClientId() const;
  50 +
  51 + /*!
  52 + * \brief connect
  53 + * \param hostname
  54 + * \param portnumber
  55 + * \param username
  56 + * \param password
  57 + */
  58 + void connect( const std::string &hostname, int portnumber, const std::string &username, const std::string &password );
  59 +
  60 + /*!
  61 + * \brief subscribe
  62 + * \param message_topic
  63 + */
  64 + void subscribe( const std::string &message_topic );
  65 +
  66 + /*!
  67 + * \brief disconnect
  68 + */
  69 + void disconnect();
  70 +
  71 +protected:
  72 + /*!
  73 + * \brief receive_data
  74 + * \param message_topic
  75 + * \param message_payload
  76 + */
  77 + virtual void receive_data( const std::string &message_topic, const std::string &message_payload ) = 0;
  78 +
  79 +private:
  80 + osdev::components::mqtt::MqttClient m_mqtt_client;
  81 +
  82 +};
src/mqttsuccess.h renamed to include/mqttsuccess.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MQTTSUCCESS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MQTTSUCCESS_H
2 #define OSDEV_COMPONENTS_MQTT_MQTTSUCCESS_H 23 #define OSDEV_COMPONENTS_MQTT_MQTTSUCCESS_H
3 24
src/mqtttypeconverter.h renamed to include/mqtttypeconverter.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MLOGICTYPECONVERTER_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MLOGICTYPECONVERTER_H
2 #define OSDEV_COMPONENTS_MQTT_MLOGICTYPECONVERTER_H 23 #define OSDEV_COMPONENTS_MQTT_MLOGICTYPECONVERTER_H
3 24
src/mqttutil.h renamed to include/mqttutil.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MQTTUTIL_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MQTTUTIL_H
2 #define OSDEV_COMPONENTS_MQTT_MQTTUTIL_H 23 #define OSDEV_COMPONENTS_MQTT_MQTTUTIL_H
3 24
src/scopeguard.h renamed to include/scopeguard.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_SCOPEGUARD_H 22 #ifndef OSDEV_COMPONENTS_MQTT_SCOPEGUARD_H
2 #define OSDEV_COMPONENTS_MQTT_SCOPEGUARD_H 23 #define OSDEV_COMPONENTS_MQTT_SCOPEGUARD_H
3 24
src/serverstate.h renamed to include/serverstate.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_SERVERSTATE_H 22 #ifndef OSDEV_COMPONENTS_MQTT_SERVERSTATE_H
2 #define OSDEV_COMPONENTS_MQTT_SERVERSTATE_H 23 #define OSDEV_COMPONENTS_MQTT_SERVERSTATE_H
3 24
src/sharedreaderlock.h renamed to include/sharedreaderlock.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_SHAREDREADERLOCK_H 22 #ifndef OSDEV_COMPONENTS_MQTT_SHAREDREADERLOCK_H
2 #define OSDEV_COMPONENTS_MQTT_SHAREDREADERLOCK_H 23 #define OSDEV_COMPONENTS_MQTT_SHAREDREADERLOCK_H
3 24
src/stringify.h renamed to include/stringify.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDSEV_COMPONENTS_MQTT_STRINGIFY_H 22 #ifndef OSDSEV_COMPONENTS_MQTT_STRINGIFY_H
20 #define OSDSEV_COMPONENTS_MQTT_STRINGIFY_H 23 #define OSDSEV_COMPONENTS_MQTT_STRINGIFY_H
21 24
src/stringutils.h renamed to include/stringutils.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_STRINGUTILS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_STRINGUTILS_H
20 #define OSDEV_COMPONENTS_MQTT_STRINGUTILS_H 23 #define OSDEV_COMPONENTS_MQTT_STRINGUTILS_H
21 24
src/synchronizedqueue.h renamed to include/synchronizedqueue.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_SYNCHRONIZEDQUEUE_H 22 #ifndef OSDEV_COMPONENTS_MQTT_SYNCHRONIZEDQUEUE_H
20 #define OSDEV_COMPONENTS_MQTT_SYNCHRONIZEDQUEUE_H 23 #define OSDEV_COMPONENTS_MQTT_SYNCHRONIZEDQUEUE_H
21 24
src/timemeasurement.h renamed to include/timemeasurement.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_TIMEMEASUREMENT_H 22 #ifndef OSDEV_COMPONENTS_MQTT_MEASUREMENT_TIMEMEASUREMENT_H
2 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_TIMEMEASUREMENT_H 23 #define OSDEV_COMPONENTS_MQTT_MEASUREMENT_TIMEMEASUREMENT_H
3 24
src/token.h renamed to include/token.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_TOKEN_H 22 #ifndef OSDEV_COMPONENTS_MQTT_TOKEN_H
2 #define OSDEV_COMPONENTS_MQTT_TOKEN_H 23 #define OSDEV_COMPONENTS_MQTT_TOKEN_H
3 24
src/uriparser.h renamed to include/uriparser.h
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
1 #ifndef OSDEV_COMPONENTS_MQTT_URIPARSER_H 22 #ifndef OSDEV_COMPONENTS_MQTT_URIPARSER_H
2 #define OSDEV_COMPONENTS_MQTT_URIPARSER_H 23 #define OSDEV_COMPONENTS_MQTT_URIPARSER_H
3 24
src/uriutils.h renamed to include/uriutils.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_URIUTILS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_URIUTILS_H
20 #define OSDEV_COMPONENTS_MQTT_URIUTILS_H 23 #define OSDEV_COMPONENTS_MQTT_URIUTILS_H
21 24
src/utils.h renamed to include/utils.h
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #ifndef OSDEV_COMPONENTS_MQTT_UTILS_H 22 #ifndef OSDEV_COMPONENTS_MQTT_UTILS_H
20 #define OSDEV_COMPONENTS_MQTT_UTILS_H 23 #define OSDEV_COMPONENTS_MQTT_UTILS_H
21 24
scripts/setup_submodules 0 → 100755
  1 +#!/bin/bash
  2 +
  3 +# ===============================================
  4 +# == Setting some environment variables
  5 +# ===============================================
  6 +GIT_URL_SUBS="http://gitlab.osdev.nl/open_source"
  7 +FUNC_RESULT="-1"
  8 +
  9 +# Name : print_usage_exit()
  10 +# Description : Print the way this script is intended to be used and exit.
  11 +# Parameters : None.
  12 +# Returns : err_code 1 to the Operating System
  13 +# --------------------------------------------------------------------------------------
  14 +function print_usage_exit()
  15 +{
  16 + echo "Usage $0 -i|--install|-u|--update"
  17 + echo " -i or --install Install the submodules mentioned in the submodules.list"
  18 + echo " -u or --update Update the submodules mentioned in the submodules.list"
  19 + echo " "
  20 + exit 1
  21 +}
  22 +
  23 +# Name : check_top_or_sub
  24 +# Description : Determine if we're running in a "single" lib-build or part of a
  25 +# "meta"-repository ( submodule ).
  26 +# Parameters : None
  27 +# Returns : Updates the value FUNC_RESULT.
  28 +# -1 - We're neither a git-repo or submodule.
  29 +# 0 - We're a submodule
  30 +# 1 - We're a top-repo ( Single library )
  31 +# --------------------------------------------------------------------------------------
  32 +function check_top_or_sub()
  33 +{
  34 + # This function checks if we're the top-repository.
  35 + # In that case we need the submodules.. If we're already a submodule,
  36 + # we simply exit this script with a message
  37 + if [ -e ./.git ]; then
  38 + FUNC_RESULT="1"
  39 + return
  40 + elif [ -e ../.git ]; then
  41 + if [ -e ../.submodules ]; then
  42 + echo "Seems like we're already a submodule. Nothing to do here."
  43 + FUNC_RESULT="0"
  44 + return
  45 + fi
  46 + fi
  47 + FUNC_RESULT="-1"
  48 + return
  49 +}
  50 +
  51 +# Name : check_working_dir
  52 +# Description : If we're in the top of our repo, we can run this script further.
  53 +# Parameters : None.
  54 +# Returns : Updates the value FUNC_RESULT.
  55 +# -1 - Not used.
  56 +# 0 - We're not on the top-level
  57 +# 1 - We're at the top-level. Good to go.
  58 +# --------------------------------------------------------------------------------------
  59 +function check_working_dir()
  60 +{
  61 + FUNC_RESULT="-1"
  62 + # Check if we're in the top-level directory of our repository.
  63 + if [ -f ./scripts/submodules.list ]; then
  64 + # We're good to go
  65 + FUNC_RESULT="1"
  66 + return
  67 + fi
  68 + FUNC_RESULT="0"
  69 + return
  70 +}
  71 +
  72 +# Name : read_submodules
  73 +# Description : Read the list of submodules needed for this project
  74 +# Parameters : None
  75 +# Returns : Updates the value FUNC_RESULT
  76 +# 0 - Module list was not found
  77 +# 1 - Module list was found and read.
  78 +# --------------------------------------------------------------------------------------
  79 +function read_submodules()
  80 +{
  81 + FUNC_RESULT="-1"
  82 + if [ -e ./scripts/submodules.list ]; then
  83 + source ./scripts/submodules.list
  84 + FUNC_RESULT="1"
  85 + return
  86 + fi
  87 +
  88 + echo "Submodules list not found...."
  89 + FUNC_RESULT="0"
  90 + return
  91 +}
  92 +
  93 +# Name : add_submodules
  94 +# Description : Configure the repo to add the submodules.
  95 +# Parameters : None.
  96 +# Returns : None.
  97 +# --------------------------------------------------------------------------------------
  98 +function add_submodules()
  99 +{
  100 + echo -e "Adding SubModule(s)."
  101 + for SUB_MODULE in ${SUB_MODULES}
  102 + do
  103 + echo -e "< ${SUB_MODULE} >"
  104 + git submodule add -f ${GIT_URL_SUBS}/${SUB_MODULE}.git ${SUB_MODULE}
  105 + git config submodule.${SUB_MODULE}.url ${GIT_URL_SUBS}/${SUB_MODULE}.git
  106 + done
  107 +}
  108 +
  109 +# Name : get_submodules
  110 +# Description : Actually get the submodules from gitlab and add them.
  111 +# Parameters : None
  112 +# Returns : None
  113 +# --------------------------------------------------------------------------------------
  114 +function get_submodules()
  115 +{
  116 + git submodule update --init --recursive
  117 +}
  118 +
  119 +# Name : update_submodules
  120 +# Description : Update the submodules already added.
  121 +# Parameters : None
  122 +# Returns : None
  123 +# --------------------------------------------------------------------------------------
  124 +function update_submodules()
  125 +{
  126 + git submodule update --recursive
  127 +}
  128 +
  129 +# =============================================================================
  130 +# == T H E M A I N E N T R Y O F T H I S S C R I P T ==
  131 +# =============================================================================
  132 +check_top_or_sub
  133 +if [ "${FUNC_RESULT}" == "0" ]; then
  134 + echo "Seems like we're a submodule already or not part of a repository."
  135 + exit 0
  136 +fi
  137 +
  138 +check_working_dir
  139 +if [ "${FUNC_RESULT}" == "0" ]; then
  140 + echo "Go to the top of this repository and type : scripts/setup_submodules [-i|--install]"
  141 + exit 0
  142 +fi
  143 +
  144 +read_submodules
  145 +
  146 +case "$1" in
  147 + -i*|--install*)
  148 + echo "Installing submodules for this repository ( ${PWD} )"
  149 + add_submodules
  150 + get_submodules
  151 + ;;
  152 + -u*|--update*)
  153 + echo "Update submodules : ${SUB_MODULES}"
  154 + update_submodules
  155 + ;;
  156 + *)
  157 + echo "No parameters found..."
  158 + print_usage_exit
  159 + ;;
  160 +esac
  161 +
scripts/submodules.list 0 → 100644
  1 +SUB_MODULES="versioning
  2 +cmake"
src/CMakeLists.txt
1 cmake_minimum_required(VERSION 3.12) 1 cmake_minimum_required(VERSION 3.12)
2 -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) 2 +# ==============================================================================
  3 +# Check to see if we're a submodule or top-repo.
  4 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
  5 + message( STATUS "Looks like we're a single module" )
  6 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
  7 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)
  8 + message( STATUS "Looks like we're a submodule" )
  9 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake)
  10 +else()
  11 + message( FATAL_ERROR "No cmake directory found. Did you run the submodules script?" )
  12 +endif()
  13 +
  14 +# ==============================================================================
  15 +# Check to see if there is versioning information available
  16 +if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../versioning)
  17 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../versioning/cmake)
  18 +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../versioning)
  19 + LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../versioning/cmake)
  20 +else()
  21 + message( FATAL_ERROR "No ${CURRENT_SOURCE_DIR}/osdev_versioning directory found. Did you run the submodules script?" )
  22 +endif()
  23 +# ==============================================================================
3 include(projectheader) 24 include(projectheader)
4 -project_header(mqtt) 25 +
  26 +project_header(mqtt-cpp)
5 27
6 find_package( Boost REQUIRED COMPONENTS regex ) 28 find_package( Boost REQUIRED COMPONENTS regex )
7 29
8 include(compiler) 30 include(compiler)
9 31
10 include_directories( 32 include_directories(
11 - ${CMAKE_CURRENT_SOURCE_DIR}/../logutils 33 + ${CMAKE_SOURCE_DIR}/include
12 ) 34 )
13 35
14 set(SRC_LIST 36 set(SRC_LIST
  37 + ${CMAKE_CURRENT_SOURCE_DIR}/mqttpublisherbase.cpp
  38 + ${CMAKE_CURRENT_SOURCE_DIR}/mqttsubscriberbase.cpp
15 ${CMAKE_CURRENT_SOURCE_DIR}/clientpaho.cpp 39 ${CMAKE_CURRENT_SOURCE_DIR}/clientpaho.cpp
16 ${CMAKE_CURRENT_SOURCE_DIR}/commondefs.cpp 40 ${CMAKE_CURRENT_SOURCE_DIR}/commondefs.cpp
17 ${CMAKE_CURRENT_SOURCE_DIR}/connectionstatus.cpp 41 ${CMAKE_CURRENT_SOURCE_DIR}/connectionstatus.cpp
18 - ${CMAKE_CURRENT_SOURCE_DIR}/compiletimedigits.h  
19 - ${CMAKE_CURRENT_SOURCE_DIR}/compiletimestring.h  
20 ${CMAKE_CURRENT_SOURCE_DIR}/credentials.cpp 42 ${CMAKE_CURRENT_SOURCE_DIR}/credentials.cpp
21 ${CMAKE_CURRENT_SOURCE_DIR}/errorcode.cpp 43 ${CMAKE_CURRENT_SOURCE_DIR}/errorcode.cpp
22 ${CMAKE_CURRENT_SOURCE_DIR}/token.cpp 44 ${CMAKE_CURRENT_SOURCE_DIR}/token.cpp
@@ -37,24 +59,6 @@ set(SRC_LIST @@ -37,24 +59,6 @@ set(SRC_LIST
37 ${CMAKE_CURRENT_SOURCE_DIR}/sharedreaderlock.cpp 59 ${CMAKE_CURRENT_SOURCE_DIR}/sharedreaderlock.cpp
38 ${CMAKE_CURRENT_SOURCE_DIR}/stringutils.cpp 60 ${CMAKE_CURRENT_SOURCE_DIR}/stringutils.cpp
39 ${CMAKE_CURRENT_SOURCE_DIR}/uriparser.cpp 61 ${CMAKE_CURRENT_SOURCE_DIR}/uriparser.cpp
40 - # Helper files ( Utillities )  
41 - ${CMAKE_CURRENT_SOURCE_DIR}/bimap.h  
42 - ${CMAKE_CURRENT_SOURCE_DIR}/compat-c++14.h  
43 - ${CMAKE_CURRENT_SOURCE_DIR}/compat-chrono.h  
44 - ${CMAKE_CURRENT_SOURCE_DIR}/histogram.h  
45 - ${CMAKE_CURRENT_SOURCE_DIR}/histogramprovider.h  
46 - ${CMAKE_CURRENT_SOURCE_DIR}/imqttclient.h  
47 - ${CMAKE_CURRENT_SOURCE_DIR}/imqttclientimpl.h  
48 - ${CMAKE_CURRENT_SOURCE_DIR}/lockguard.h  
49 - ${CMAKE_CURRENT_SOURCE_DIR}/macrodefs.h  
50 - ${CMAKE_CURRENT_SOURCE_DIR}/measure.h  
51 - ${CMAKE_CURRENT_SOURCE_DIR}/metaprogrammingdefs.h  
52 - ${CMAKE_CURRENT_SOURCE_DIR}/mqttstream.h  
53 - ${CMAKE_CURRENT_SOURCE_DIR}/stringify.h  
54 - ${CMAKE_CURRENT_SOURCE_DIR}/stringutils.h  
55 - ${CMAKE_CURRENT_SOURCE_DIR}/synchronizedqueue.h  
56 - ${CMAKE_CURRENT_SOURCE_DIR}/utils.h  
57 - ${CMAKE_CURRENT_SOURCE_DIR}/uriutils.h  
58 ) 62 )
59 63
60 include(library) 64 include(library)
src/clientpaho.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "clientpaho.h" 22 #include "clientpaho.h"
20 23
21 #include "errorcode.h" 24 #include "errorcode.h"
src/commondefs.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "commondefs.h" 22 #include "commondefs.h"
20 23
21 // std 24 // std
src/connectionstatus.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "connectionstatus.h" 22 #include "connectionstatus.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/credentials.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "credentials.h" 22 #include "credentials.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/errorcode.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "errorcode.h" 22 #include "errorcode.h"
20 23
21 // paho 24 // paho
src/ihistogram.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "ihistogram.h" 22 #include "ihistogram.h"
20 23
21 // std 24 // std
src/imqttclientimpl.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "imqttclientimpl.h" 22 #include "imqttclientimpl.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/istatecallback.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "istatecallback.h" 22 #include "istatecallback.h"
20 23
21 #include <sstream> 24 #include <sstream>
src/mqttclient.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "mqttclient.h" 22 #include "mqttclient.h"
20 23
21 // osdev::components::mqtt 24 // osdev::components::mqtt
src/mqttfailure.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "mqttfailure.h" 22 #include "mqttfailure.h"
20 23
21 // osdev::components::mqtt 24 // osdev::components::mqtt
src/mqttidgenerator.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "mqttidgenerator.h" 22 #include "mqttidgenerator.h"
20 23
21 // std 24 // std
src/mqttmessage.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "mqttmessage.h" 22 #include "mqttmessage.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/mqttpublisherbase.cpp 0 → 100644
src/mqttsubscriberbase.cpp 0 → 100644
  1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
  22 +
  23 +// osdev::components::mqtt
  24 +#include "mqttclient.h"
  25 +#include "mqttsubscriberbase.h"
  26 +#include "mqttmessage.h"
  27 +#include "credentials.h"
  28 +
  29 +MqttSubscriberBase::MqttSubscriberBase( const std::string &client_id )
  30 + : m_mqtt_client( client_id )
  31 +{
  32 +
  33 +}
  34 +
  35 +std::string MqttSubscriberBase::getClientId() const
  36 +{
  37 + return m_mqtt_client.clientId();
  38 +}
  39 +
  40 +void MqttSubscriberBase::connect(const std::string &hostname, int portnumber,
  41 + const std::string &username, const std::string &password)
  42 +{
  43 + m_mqtt_client.connect( hostname, portnumber, osdev::components::mqtt::Credentials( username, password ) );
  44 +}
  45 +
  46 +void MqttSubscriberBase::subscribe( const std::string &message_topic )
  47 +{
  48 + m_mqtt_client.subscribe( message_topic, 1, [this]( const osdev::components::mqtt::MqttMessage &message )
  49 + {
  50 + this->receive_data( message.topic(), message.payload() );
  51 + });
  52 +}
  53 +
  54 +void MqttSubscriberBase::disconnect()
  55 +{
  56 + m_mqtt_client.disconnect();
  57 +}
src/mqttsuccess.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "mqttsuccess.h" 22 #include "mqttsuccess.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/mqtttypeconverter.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "mqtttypeconverter.h" 22 #include "mqtttypeconverter.h"
20 23
21 // std 24 // std
src/mqttutil.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "mqttutil.h" 22 #include "mqttutil.h"
20 23
21 // boost 24 // boost
src/scopeguard.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "scopeguard.h" 22 #include "scopeguard.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/serverstate.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "serverstate.h" 22 #include "serverstate.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/sharedreaderlock.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "sharedreaderlock.h" 22 #include "sharedreaderlock.h"
20 23
21 24
src/stringutils.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "stringutils.h" 22 #include "stringutils.h"
20 23
21 // std 24 // std
src/timemeasurement.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "timemeasurement.h" 22 #include "timemeasurement.h"
20 23
21 using namespace osdev::components::mqtt::measurement; 24 using namespace osdev::components::mqtt::measurement;
src/token.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "token.h" 22 #include "token.h"
20 23
21 using namespace osdev::components::mqtt; 24 using namespace osdev::components::mqtt;
src/uriparser.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "uriparser.h" 22 #include "uriparser.h"
20 23
21 // std 24 // std
src/utils.cpp
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */ 1 +/* ****************************************************************************
  2 + * Copyright 2019 Open Systems Development BV *
  3 + * *
  4 + * Permission is hereby granted, free of charge, to any person obtaining a *
  5 + * copy of this software and associated documentation files (the "Software"), *
  6 + * to deal in the Software without restriction, including without limitation *
  7 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, *
  8 + * and/or sell copies of the Software, and to permit persons to whom the *
  9 + * Software is furnished to do so, subject to the following conditions: *
  10 + * *
  11 + * The above copyright notice and this permission notice shall be included in *
  12 + * all copies or substantial portions of the Software. *
  13 + * *
  14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
  15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
  16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *
  17 + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
  18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *
  19 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *
  20 + * DEALINGS IN THE SOFTWARE. *
  21 + * ***************************************************************************/
19 #include "utils.h" 22 #include "utils.h"
20 23
21 // std 24 // std
tests/pub/publisher.h deleted
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */  
19 -#pragma once  
20 -  
21 -// std  
22 -#include <memory>  
23 -#include <string>  
24 -  
25 -// osdev::components::mqtt  
26 -#include "mqttclient.h"  
27 -#include "compat-c++14.h"  
28 -  
29 -class Publisher  
30 -{  
31 -public:  
32 - Publisher();  
33 -  
34 - virtual ~Publisher() {}  
35 -  
36 - void connect( const std::string &hostname, int portnumber = 1883, const std::string &username = std::string(), const std::string &password = std::string() );  
37 -  
38 - void publish( const std::string &message_topic, const std::string &message_payload );  
39 -  
40 -private:  
41 - osdev::components::mqtt::MqttClient m_mqtt_client;  
42 -};  
tests/sub/subscriber.cpp deleted
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */  
19 -#include "subscriber.h"  
20 -#include "mqttmessage.h"  
21 -#include "credentials.h"  
22 -  
23 -Subscriber::Subscriber()  
24 - : m_mqtt_client( "TestSubscriber" )  
25 -{  
26 -  
27 -}  
28 -  
29 -void Subscriber::connect( const std::string &hostname, int portnumber, const std::string &username, const std::string &password )  
30 -{  
31 - m_mqtt_client.connect( hostname, portnumber, osdev::components::mqtt::Credentials( username, password ) );  
32 - std::cout << "Client state : " << m_mqtt_client.state() << std::endl;  
33 -}  
34 -  
35 -void Subscriber::subscribe( const std::string &message_topic )  
36 -{  
37 - m_mqtt_client.subscribe( message_topic, 1, [this](const osdev::components::mqtt::MqttMessage &message)  
38 - {  
39 - this->receive_data(message.topic(), message.payload() );  
40 - });  
41 -}  
42 -  
43 -void Subscriber::receive_data( const std::string &message_topic, const std::string &message_payload )  
44 -{  
45 - std::cout << "[Subscriber::receive_data] - Received message : " << message_payload << " from topic : " << message_topic << std::endl;  
46 -}  
tests/sub/subscriber.h deleted
1 -/* Copyright (C) 2019  
2 - *  
3 - * This file is part of the osdev components suite  
4 - *  
5 - * This program is free software; you can redistribute it and/or modify it  
6 - * under the terms of the GNU General Public License as published by the  
7 - * Free Software Foundation; either version 2, or (at your option) any  
8 - * later version.  
9 - *  
10 - * This program is distributed in the hope that it will be useful,  
11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of  
12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
13 - * GNU General Public License for more details.  
14 - *  
15 - * You should have received a copy of the GNU General Public License  
16 - * along with this program; if not, write to the Free Software  
17 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  
18 - */  
19 -#pragma once  
20 -  
21 -// std  
22 -#include <memory>  
23 -#include <string>  
24 -  
25 -// osdev::components::mqtt  
26 -#include "mqttclient.h"  
27 -#include "compat-c++14.h"  
28 -  
29 -class Subscriber  
30 -{  
31 -public:  
32 - Subscriber();  
33 -  
34 - virtual ~Subscriber() {}  
35 -  
36 - void connect( const std::string &hostname, int portnumber, const std::string &username, const std::string &password );  
37 -  
38 - void subscribe( const std::string &message_topic );  
39 -  
40 -private:  
41 - void receive_data( const std::string &message_topic, const std::string &message_payload );  
42 -  
43 -private:  
44 - osdev::components::mqtt::MqttClient m_mqtt_client;  
45 -};