From 9dc1901386c89a8a761f3dca68578854d9b66ce8 Mon Sep 17 00:00:00 2001 From: dr3amf4ll Date: Fri, 28 Oct 2016 17:13:37 +0300 Subject: [PATCH 001/152] KAA-1536: Toggle mobile sidebar menu issue --- gh-pages-stub/public/js/scripts.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gh-pages-stub/public/js/scripts.js b/gh-pages-stub/public/js/scripts.js index 307bed5f94..fef3f0853c 100644 --- a/gh-pages-stub/public/js/scripts.js +++ b/gh-pages-stub/public/js/scripts.js @@ -81,11 +81,10 @@ var DOM = (function () { $(document).ready(function(){/* off-canvas sidebar toggle */ $('[data-toggle=offcanvas]').click(function() { - $(this).toggleClass('visible-xs text-center'); $(this).find('i').toggleClass('glyphicon-chevron-right glyphicon-chevron-left'); $('.row-offcanvas').toggleClass('active'); - $('#lg-menu').toggleClass('hidden-xs').toggleClass('visible-xs'); - $('#xs-menu').toggleClass('visible-xs').toggleClass('hidden-xs'); + $('#lg-menu').toggleClass('hidden-xs').toggleClass('visible'); + $('#xs-menu').toggleClass('visible-xs').toggleClass('hidden'); $('#btnShow').toggle(); }); }); From 2dbca2d72b6ee9ece8c471903fb10a0e9fe96738 Mon Sep 17 00:00:00 2001 From: Roman Hulenko Date: Tue, 8 Nov 2016 17:21:54 +0200 Subject: [PATCH 002/152] KAA-1441 Fix The ThreadPoolTest logic flow Reorganize test commands to avoid race condition. --- .../test/impl/utils/ThreadPoolTest.cpp | 100 ++++++++++++------ 1 file changed, 65 insertions(+), 35 deletions(-) diff --git a/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp b/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp index dd84c888ef..258da78adc 100644 --- a/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp +++ b/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp @@ -248,54 +248,84 @@ BOOST_AUTO_TEST_CASE(AwaitTerminationAllTaskCompletedTest) BOOST_AUTO_TEST_CASE(AwaitTerminationTimeoutTest) { - std::mutex mutex; - std::condition_variable onStartCondition; - ThreadPool threadPool; + class Condition final + { + public: - bool isStart = false; - std::size_t taskExecutionTime = 1; - std::uint16_t expectedTaskCount = 0; - std::atomic_uint actualTaskCount(0); - std::size_t timeToWaitAllTasks = 0; + explicit Condition(const bool state = false) : + mutex_(), variable_(), state_(state) + {} - ThreadPoolTask task = [&mutex, &onStartCondition, &actualTaskCount, &isStart, &taskExecutionTime] () - { - { - std::unique_lock lock(mutex); - onStartCondition.wait(lock, [&isStart] () { return isStart; }); - } - std::this_thread::sleep_for(std::chrono::seconds(taskExecutionTime)); - actualTaskCount++; - }; + bool state() + { + std::unique_lock lock(mutex_); + return state_; + } - // Executed. - threadPool.add(task); - ++expectedTaskCount; - timeToWaitAllTasks += taskExecutionTime; + bool state(const bool newState) + { + std::unique_lock lock(mutex_); - // Executed. - threadPool.add(task); - ++expectedTaskCount; - timeToWaitAllTasks += taskExecutionTime; + if(state_ == newState) { + return false; + } - // Declined. - threadPool.add(task); - timeToWaitAllTasks += taskExecutionTime; + state_ = newState; - { - std::unique_lock lock(mutex); - isStart = true; - onStartCondition.notify_all(); + if(newState) { + variable_.notify_all(); + } + + return true; + } + + bool yes() { return state(true); } + + bool no() { return state(false); } + + void check() + { + std::unique_lock lock(mutex_); + variable_.wait(lock, [this] () { return state_; }); + } + + private: + + std::mutex mutex_; + std::condition_variable variable_; + bool state_; + } isReady; + + // One worker thread for sequential execution + ThreadPool threadPool; + + constexpr std::size_t taskExecutionTime = 1; + constexpr std::size_t waitedTaskCount = 2; + constexpr std::size_t totalTaskCount = 4; + + std::atomic_uint actualTaskCount(0); + + for(std::size_t index = 0; index != totalTaskCount ; ++index) { + ThreadPoolTask task = [&isReady, &actualTaskCount, taskExecutionTime] () + { + isReady.check(); + std::this_thread::sleep_for(std::chrono::seconds(taskExecutionTime)); + ++actualTaskCount; + }; + + threadPool.add(std::move(task)); } + isReady.yes(); + threadPool.shutdown(); - threadPool.awaitTermination(expectedTaskCount * taskExecutionTime); + threadPool.awaitTermination(waitedTaskCount * taskExecutionTime); // Assume no tasks have not been declined so wait for all of them - std::this_thread::sleep_for(std::chrono::seconds(timeToWaitAllTasks)); + std::this_thread::sleep_for(std::chrono::seconds(totalTaskCount * taskExecutionTime)); - BOOST_CHECK_EQUAL(actualTaskCount.load(), expectedTaskCount); + BOOST_CHECK(actualTaskCount.load() < totalTaskCount); } BOOST_AUTO_TEST_SUITE_END() From abb2abc98b9ad7f4a00d85984e7129aee7ee428e Mon Sep 17 00:00:00 2001 From: sbeltser Date: Fri, 11 Nov 2016 17:44:53 +0200 Subject: [PATCH 003/152] KAA-1565: Incorrect Documentation link in footer Administration UI 0.10.0 --- .../kaa/server/admin/client/i18n/KaaAdminMessages.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/node/src/main/resources/org/kaaproject/kaa/server/admin/client/i18n/KaaAdminMessages.properties b/server/node/src/main/resources/org/kaaproject/kaa/server/admin/client/i18n/KaaAdminMessages.properties index 33089b0f79..7efcd9421a 100644 --- a/server/node/src/main/resources/org/kaaproject/kaa/server/admin/client/i18n/KaaAdminMessages.properties +++ b/server/node/src/main/resources/org/kaaproject/kaa/server/admin/client/i18n/KaaAdminMessages.properties @@ -17,7 +17,7 @@ emptyEndpointKeyHash = Enter the endpoint keyhash emptyUsernameOrPassword = The username and the password cannot be empty! -footerMessage = Powered by Kaa IoT platform {0} \u00B7 Report a bug \u00B7 Documentation +footerMessage = Powered by Kaa IoT platform {0} \u00B7 Report a bug \u00B7 Documentation incompatibleRemoteService = This client is not compatible with the server. Clean up and refresh the browser. From 9fdc7558fafd257fe13f998980082add3ed333be Mon Sep 17 00:00:00 2001 From: AlexeyGamov Date: Wed, 2 Nov 2016 18:04:17 +0200 Subject: [PATCH 004/152] KAA-1510 Add Ubuntu 16.04 support --- .../C++/SDK-Linux/index.md | 44 +++++++++++++++++-- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md index 8753e22922..4eba88fd22 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md @@ -19,6 +19,7 @@ This page describes Kaa C++ SDK build process on Linux system. **All steps described in this guide were tested on:** - **Host OS:** Ubuntu 14.04 LTS Desktop 64-bit + - **Host OS:** Ubuntu 16.04 LTS Desktop 64-bit ### Dependencies @@ -27,10 +28,42 @@ Before building the C++ endpoint SDK, install the following components on your m 1. Install g++, [CMake](https://cmake.org/download/), [Boost](http://www.boost.org/users/download/) and [SQLite3](https://sqlite.org/download.html): ``` - sudo apt-get install g++ cmake libboost1.55-all-dev libsqlite3-0 libsqlite3-dev + sudo apt-get install g++ cmake python libsqlite3-0 libsqlite3-dev ``` -4. Install the [AvroC++](http://avro.apache.org/docs/1.7.5/api/cpp/html/index.html) library manually: +2. Install Boost: + +
    +
  • + + +
    +
    + +```bash +sudo apt-get install libboost1.55-all-dev +``` + +
    + +```bash +wget https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz +tar -xf boost_1_55_0.tar.gz +cd boost_1_55_0 +./bootstrap.sh +sudo ./bjam install +``` + +
    +
  • +
+ +{: start="3"} +3. Install the [AvroC++](http://avro.apache.org/docs/1.7.5/api/cpp/html/index.html) library manually: + ``` wget http://archive.apache.org/dist/avro/avro-1.7.5/cpp/avro-cpp-1.7.5.tar.gz @@ -40,7 +73,7 @@ Before building the C++ endpoint SDK, install the following components on your m sudo make install ``` -5. Install the [Botan](http://botan.randombit.net/) 1.11 library. The stock 1.10 version is not recommended for C++11 projects, +4. Install the [Botan](http://botan.randombit.net/) 1.11 library. The stock 1.10 version is not recommended for C++11 projects, so the newer 1.11 version is used in Kaa C++ SDK. To install, proceed as follows: @@ -51,6 +84,11 @@ To install, proceed as follows: ./configure.py sudo make install ``` +5. After all the dependencies have been installed, dynamic loader's links (and, selectively, its cache) should be updated. That's the way for the loader to know where libraries are located. To update links, proceed as follows: + + ``` + sudo ldconfig + ``` ## Compiling SDK From 2050288d0e9b784dc8e16ad6b369d56f86365b42 Mon Sep 17 00:00:00 2001 From: Roman Hulenko Date: Mon, 14 Nov 2016 16:25:01 +0200 Subject: [PATCH 005/152] KAA-1441 Fix The ThreadPoolTest logic flow Reorganize test commands to avoid race condition. --- .../test/impl/utils/ThreadPoolTest.cpp | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp b/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp index 258da78adc..41379affdd 100644 --- a/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp +++ b/client/client-multi/client-cpp/test/impl/utils/ThreadPoolTest.cpp @@ -249,6 +249,13 @@ BOOST_AUTO_TEST_CASE(AwaitTerminationAllTaskCompletedTest) BOOST_AUTO_TEST_CASE(AwaitTerminationTimeoutTest) { + /** + * It provides a flexible thread safe way to notify the occurrence of external condition. + * + * setState(bool), setNo(), setYes() methods set a current state of condition. + * getState() return a current state of condition. + * check() wait until condition will occurred, i.e. state will be true. + */ class Condition final { public: @@ -257,32 +264,32 @@ BOOST_AUTO_TEST_CASE(AwaitTerminationTimeoutTest) mutex_(), variable_(), state_(state) {} - bool state() + bool getState() { std::unique_lock lock(mutex_); return state_; } - bool state(const bool newState) + bool setState(const bool newState) { std::unique_lock lock(mutex_); - if(state_ == newState) { + if (state_ == newState) { return false; } state_ = newState; - if(newState) { + if (newState) { variable_.notify_all(); } return true; } - bool yes() { return state(true); } + bool setYes() { return setState(true); } - bool no() { return state(false); } + bool setNo() { return setState(false); } void check() { @@ -295,7 +302,9 @@ BOOST_AUTO_TEST_CASE(AwaitTerminationTimeoutTest) std::mutex mutex_; std::condition_variable variable_; bool state_; - } isReady; + }; + + Condition isReady; // One worker thread for sequential execution ThreadPool threadPool; @@ -306,18 +315,18 @@ BOOST_AUTO_TEST_CASE(AwaitTerminationTimeoutTest) std::atomic_uint actualTaskCount(0); - for(std::size_t index = 0; index != totalTaskCount ; ++index) { - ThreadPoolTask task = [&isReady, &actualTaskCount, taskExecutionTime] () - { - isReady.check(); - std::this_thread::sleep_for(std::chrono::seconds(taskExecutionTime)); - ++actualTaskCount; - }; + for (std::size_t index = 0; index != totalTaskCount ; ++index) { - threadPool.add(std::move(task)); + threadPool.add(ThreadPoolTask( + [&isReady, &actualTaskCount, taskExecutionTime] () + { + isReady.check(); + std::this_thread::sleep_for(std::chrono::seconds(taskExecutionTime)); + ++actualTaskCount; + })); } - isReady.yes(); + isReady.setYes(); threadPool.shutdown(); threadPool.awaitTermination(waitedTaskCount * taskExecutionTime); @@ -325,7 +334,7 @@ BOOST_AUTO_TEST_CASE(AwaitTerminationTimeoutTest) // Assume no tasks have not been declined so wait for all of them std::this_thread::sleep_for(std::chrono::seconds(totalTaskCount * taskExecutionTime)); - BOOST_CHECK(actualTaskCount.load() < totalTaskCount); + BOOST_CHECK_LE(actualTaskCount.load(), totalTaskCount); } BOOST_AUTO_TEST_SUITE_END() From f0e0c6774d8273d0f36fc3888599efa6475788aa Mon Sep 17 00:00:00 2001 From: RostakaGmfun Date: Wed, 9 Nov 2016 09:35:09 +0200 Subject: [PATCH 006/152] KAA-1573: [C++] No linking to threading library on Intel Edison platform --- client/client-multi/client-cpp/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/client-multi/client-cpp/CMakeLists.txt b/client/client-multi/client-cpp/CMakeLists.txt index 0b7e95eefe..e894402698 100644 --- a/client/client-multi/client-cpp/CMakeLists.txt +++ b/client/client-multi/client-cpp/CMakeLists.txt @@ -133,7 +133,7 @@ # Default: `0`. cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) -project(KaaCppSdk CXX) +project(KaaCppSdk C CXX) macro(DECCHAR2HEX VAR VAL) if(${VAL} LESS 10) @@ -393,6 +393,7 @@ endif() find_package(Boost 1.54 REQUIRED COMPONENTS log system thread) find_package(Avro REQUIRED) find_package(Botan REQUIRED) +find_package(Threads REQUIRED) if(KAA_WITH_SQLITE_LOG_STORAGE) find_package(Sqlite3 REQUIRED) From 763232fc87aaef7d6d20c432af22a0bf8eec96b1 Mon Sep 17 00:00:00 2001 From: Sergii PAradiuk Date: Mon, 14 Nov 2016 18:38:04 +0200 Subject: [PATCH 007/152] Removed outdated information from auto generated docs --- client/client-multi/client-c/src/kaa/Mainpage.dox | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/client/client-multi/client-c/src/kaa/Mainpage.dox b/client/client-multi/client-c/src/kaa/Mainpage.dox index a3eeb281f4..dd760c9d79 100644 --- a/client/client-multi/client-c/src/kaa/Mainpage.dox +++ b/client/client-multi/client-c/src/kaa/Mainpage.dox @@ -20,7 +20,6 @@
  • \link quickstart Quick start \endlink
  • \link programminguide Programming guide \endlink
  • -
  • \link demo Demo application \endlink
\section quickstart Quick start @@ -147,11 +146,5 @@ Collecting data from endpoints + */ - \section demo Demo application - - To better familiarize yourself with Kaa C SDK, you may look at our demo application. - - Find the demo source code in the 'example' directory located in the root of the Kaa project. - - */ \ No newline at end of file From 9a7190c775b83f69bfc65847de152150d2557adb Mon Sep 17 00:00:00 2001 From: Sergii PAradiuk Date: Tue, 15 Nov 2016 14:01:08 +0200 Subject: [PATCH 008/152] Fixed a problem with references --- .../client-multi/client-c/src/kaa/Mainpage.dox | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/client/client-multi/client-c/src/kaa/Mainpage.dox b/client/client-multi/client-c/src/kaa/Mainpage.dox index dd760c9d79..6261a6dae3 100644 --- a/client/client-multi/client-c/src/kaa/Mainpage.dox +++ b/client/client-multi/client-c/src/kaa/Mainpage.dox @@ -34,7 +34,7 @@ $ make install @endcode - Specific build options are described in the README and in the official online documentation. + Specific platforms' build options are described in the README and in the official online documentation. \subsection linkage Link Kaa library to your project @@ -122,7 +122,7 @@ @endcode @note To use the log collection feature, go through - additional initialization steps. + additional initialization steps. To finish the Kaa C SDK initialization, execute the following command: @code @@ -134,17 +134,6 @@ \section programminguide Programming guide - For more information about functions supported by the Kaa C SDK, see our Programming guide: - + For more information about functions supported by the Kaa C SDK, see our Key platform features. */ From 64ce7e9c1ede400d3c2c413f475bbbc6d2cb0bb3 Mon Sep 17 00:00:00 2001 From: sbeltser Date: Tue, 15 Nov 2016 17:15:13 +0200 Subject: [PATCH 009/152] KAA-1585: fix email validation while update account profile --- .../kaa/server/admin/client/util/Utils.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java index 1d6e96df69..57870e5ecb 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java @@ -43,6 +43,8 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Utils { @@ -174,14 +176,15 @@ public static String millisecondsToDateTimeString(long millis) { * @return boolean 'true' if email address is valid */ public static boolean validateEmail(String mail) { - boolean result = false; - if (mail != null && mail.length() != 0) { - if (mail.indexOf('@') != INCORRECT_IDX - && mail.indexOf('.') != INCORRECT_IDX) { - result = true; - } + if (mail == null || mail.length() == 0) { + return false; } - return result; + Pattern pattern = Pattern + .compile( + "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE + ); + Matcher matcher = pattern.matcher(mail); + return matcher.find(); } /** From 25ef9692e51ec37257e334c10a073fee52434452 Mon Sep 17 00:00:00 2001 From: sbeltser Date: Tue, 15 Nov 2016 17:15:13 +0200 Subject: [PATCH 010/152] KAA-1585: Account profile can be updated with an invalid email --- .../view/application/ApplicationViewImpl.java | 6 +++++- .../kaa/server/admin/client/util/Utils.java | 17 ++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java index 9f5e4497b9..024ad1ae9f 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java @@ -74,9 +74,13 @@ protected void initDetailsTable() { applicationName.setFocus(true); if (!create) { - applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, editable); +// applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, editable); +// applicationToken.setWidth("100%"); +// applicationToken.setEnabled(false); + applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, false); applicationToken.setWidth("100%"); applicationToken.setEnabled(false); + applicationToken.setReadOnly(true); Label tokenLabel = new Label(Utils.constants.appToken()); detailsTable.setWidget(2, 0, tokenLabel); diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java index 1d6e96df69..57870e5ecb 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java @@ -43,6 +43,8 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Utils { @@ -174,14 +176,15 @@ public static String millisecondsToDateTimeString(long millis) { * @return boolean 'true' if email address is valid */ public static boolean validateEmail(String mail) { - boolean result = false; - if (mail != null && mail.length() != 0) { - if (mail.indexOf('@') != INCORRECT_IDX - && mail.indexOf('.') != INCORRECT_IDX) { - result = true; - } + if (mail == null || mail.length() == 0) { + return false; } - return result; + Pattern pattern = Pattern + .compile( + "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE + ); + Matcher matcher = pattern.matcher(mail); + return matcher.find(); } /** From ab9a9003b89d92b8e3b7610943de95b6167986cd Mon Sep 17 00:00:00 2001 From: Dubland Date: Tue, 15 Nov 2016 19:45:06 +0200 Subject: [PATCH 011/152] KAA-1510: Fix instruction for Ubuntu 16 --- .../Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md index 4eba88fd22..dddbcf307d 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md @@ -54,7 +54,7 @@ wget https://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar. tar -xf boost_1_55_0.tar.gz cd boost_1_55_0 ./bootstrap.sh -sudo ./bjam install +sudo ./bjam cxxflags=-std=c++11 install ``` From c74d222968c73000599db55e873f7d8bcda5c785 Mon Sep 17 00:00:00 2001 From: Rybachenko Andrey Date: Wed, 16 Nov 2016 13:36:04 +0200 Subject: [PATCH 012/152] KAA-1551: fix error when creating default record for AVRO schema with 'bytes' field having no default value. --- .../generation/DefaultRecordGenerationAlgorithmImpl.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/core/src/main/java/org/kaaproject/kaa/server/common/core/algorithms/generation/DefaultRecordGenerationAlgorithmImpl.java b/common/core/src/main/java/org/kaaproject/kaa/server/common/core/algorithms/generation/DefaultRecordGenerationAlgorithmImpl.java index 1b66b360eb..0fca375d33 100644 --- a/common/core/src/main/java/org/kaaproject/kaa/server/common/core/algorithms/generation/DefaultRecordGenerationAlgorithmImpl.java +++ b/common/core/src/main/java/org/kaaproject/kaa/server/common/core/algorithms/generation/DefaultRecordGenerationAlgorithmImpl.java @@ -184,10 +184,7 @@ private Object processType(Schema schemaNode, JsonNode byDefault) case ENUM: return processEnum(schemaToProcess); case BYTES: - ByteBuffer byteBuffer = ByteBuffer.allocate(byDefault.size()); - byteBuffer.put((byte) 0); - byteBuffer.flip(); - return byteBuffer; + return ByteBuffer.allocate(0).flip(); case MAP: throw new ConfigurationGenerationException("Map is not supported."); case INT: From afad3ab998bb1d1a7f6e27d9a2e5329335064dec Mon Sep 17 00:00:00 2001 From: yverzun Date: Wed, 16 Nov 2016 13:57:53 +0200 Subject: [PATCH 013/152] KAA-1497:updated cmake version in C++ SDK docs --- .../Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md index 4eba88fd22..5f6912ff22 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/index.md @@ -188,7 +188,7 @@ The step-by-step explanation of CMakeLists.txt follows. Firstly, the minimum required CMake version is specified: ```CMake -cmake_minimum_required(VERSION 3.0.2) +cmake_minimum_required(VERSION 2.8.12) ``` Next, we tell CMake about our project and enable C++11 standard: From a7321acd0ac932271cc64a01f85ea42e89fa1b44 Mon Sep 17 00:00:00 2001 From: Rybachenko Andrey Date: Wed, 16 Nov 2016 17:46:46 +0200 Subject: [PATCH 014/152] KAA-1551: add test for saving CTL shema with bytes field --- .../common/dao/service/CtlServiceImplTest.java | 17 +++++++++++++++++ .../resources/dao/ctl/noDependenciesCtl.json | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json diff --git a/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java b/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java index 02222b1d03..bcf94b8986 100644 --- a/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java +++ b/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java @@ -30,6 +30,7 @@ import org.kaaproject.kaa.server.common.dao.AbstractTest; import org.kaaproject.kaa.server.common.dao.exception.DatabaseProcessingException; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -51,6 +52,7 @@ public class CtlServiceImplTest extends AbstractTest { private static final String TEST_CTL_SCHEMA_ALPHA_FLAT = "dao/ctl/alphaFlat.json"; private static final String TEST_CTL_SCHEMA_BETA = "dao/ctl/beta.json"; private static final String TEST_CTL_SCHEMA_GAMMA = "dao/ctl/gamma.json"; + private static final String TEST_CTL_SCHEMA_NO_DEPENDENCIES = "dao/ctl/noDependenciesCtl.json"; private ExecutorService executorService = Executors.newFixedThreadPool(10); private TenantDto tenant; private ApplicationDto appDto; @@ -146,6 +148,21 @@ public void before() throws Exception { alpha = ctlService.findCtlSchemaById(alpha.getId()); } + @Test + public void testSaveCtlSchemaWithNoDependencies() throws IOException { + + CTLSchemaDto testCtl = new CTLSchemaDto(); + CtlSchemaMetaInfoDto ctlMetaInfo = new CtlSchemaMetaInfoDto("org.kaaproject.kaa.NoDependenciesCtlExample", tenant.getId()); + testCtl.setMetaInfo(ctlMetaInfo); + testCtl.setVersion(1); + testCtl.setBody(readSchemaFileAsString(TEST_CTL_SCHEMA_NO_DEPENDENCIES)); + testCtl = ctlService.saveCtlSchema(testCtl); + + CTLSchemaDto foundCtl = ctlService.findCtlSchemaById(testCtl.getId()); + + Assert.assertNotNull(foundCtl); + } + @Test public void testRemoveCTLSchemaByFqnAndVerAndTenantIdAndApplicationId() { String schemaId = tenantSchema.getId(); diff --git a/server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json b/server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json new file mode 100644 index 0000000000..e8b4df7ccd --- /dev/null +++ b/server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json @@ -0,0 +1,14 @@ +{ + "type" : "record", + "name" : "NoDependenciesCtlExample", + "namespace" : "org.kaaproject.kaa", + "displayName" : "example schema", + "version" : 1, + "fields" : [ + { + "name" : "bytesField", + "type" : "bytes" + } + ], + "dependencies" : [ ] +} \ No newline at end of file From 69edf4182d1832549e6831edf72a66e908d6c778 Mon Sep 17 00:00:00 2001 From: pyshankov Date: Wed, 16 Nov 2016 18:37:11 +0200 Subject: [PATCH 015/152] KAA-1563: 'Create new version' button doesn't work in the System CTL --- .../client/mvp/activity/CtlSchemaActivity.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java index 39a687c8d6..a45b25189b 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java @@ -17,6 +17,7 @@ package org.kaaproject.kaa.server.admin.client.mvp.activity; import static org.kaaproject.kaa.common.dto.ctl.CTLSchemaScopeDto.APPLICATION; +import static org.kaaproject.kaa.common.dto.ctl.CTLSchemaScopeDto.SYSTEM; import static org.kaaproject.kaa.common.dto.ctl.CTLSchemaScopeDto.TENANT; import com.google.gwt.event.dom.client.ClickEvent; @@ -252,15 +253,15 @@ protected void bind(final EventBus eventBus) { @Override public void onValueChange(ValueChangeEvent event) { detailsView.getVersion().setValue(version); - if (place.getScope() == APPLICATION) { - goTo(new CtlSchemaPlace(place.getMetaInfoId(), event.getValue(), place.getScope(), - place.getApplicationId(), place.isEditable(), false)); - } else if (place.getScope() == TENANT) { + if (place.getScope() == TENANT) { goTo(new CtlSchemaPlace( place.getMetaInfoId(), event.getValue(), place.getScope(), place.getEcfId(), place.getEcfVersionId(), place.getEcfVersion(), place.isEditable(), false) ); + } else { + goTo(new CtlSchemaPlace(place.getMetaInfoId(), event.getValue(), place.getScope(), + place.getApplicationId(), place.isEditable(), false)); } } })); @@ -270,13 +271,13 @@ public void onValueChange(ValueChangeEvent event) { public void onClick(ClickEvent event) { Integer version = detailsView.getVersion().getValue(); CtlSchemaPlace newPlace = null; - if (place.getScope() == APPLICATION) { + if (place.getScope() == TENANT) { + newPlace = new CtlSchemaPlace(place.getMetaInfoId(), version, place.getScope(), + place.getEcfId(), place.getEcfVersionId(), place.getEcfVersion(), true, true); + } else { newPlace = new CtlSchemaPlace( place.getMetaInfoId(), version, place.getScope(), place.getApplicationId(), true, true); - } else if (place.getScope() == TENANT) { - newPlace = new CtlSchemaPlace(place.getMetaInfoId(), version, place.getScope(), - place.getEcfId(), place.getEcfVersionId(), place.getEcfVersion(), true, true); } newPlace.setPreviousPlace(place); goTo(newPlace); From 113aec8f9bdbd681fd31f51254d0b9cd745494c5 Mon Sep 17 00:00:00 2001 From: Rybachenko Andrey Date: Wed, 16 Nov 2016 19:03:16 +0200 Subject: [PATCH 016/152] KAA-1551: add primitive and complex types to test schema in 'save CTL schema' test --- .../dao/service/CtlServiceImplTest.java | 18 ++- .../resources/dao/ctl/flatCtlExample.json | 112 ++++++++++++++++++ .../resources/dao/ctl/noDependenciesCtl.json | 14 --- 3 files changed, 127 insertions(+), 17 deletions(-) create mode 100644 server/common/dao/src/test/resources/dao/ctl/flatCtlExample.json delete mode 100644 server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json diff --git a/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java b/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java index bcf94b8986..c49a21a14e 100644 --- a/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java +++ b/server/common/dao/src/test/java/org/kaaproject/kaa/server/common/dao/service/CtlServiceImplTest.java @@ -52,7 +52,7 @@ public class CtlServiceImplTest extends AbstractTest { private static final String TEST_CTL_SCHEMA_ALPHA_FLAT = "dao/ctl/alphaFlat.json"; private static final String TEST_CTL_SCHEMA_BETA = "dao/ctl/beta.json"; private static final String TEST_CTL_SCHEMA_GAMMA = "dao/ctl/gamma.json"; - private static final String TEST_CTL_SCHEMA_NO_DEPENDENCIES = "dao/ctl/noDependenciesCtl.json"; + private static final String TEST_CTL_SCHEMA_FLAT = "dao/ctl/flatCtlExample.json"; private ExecutorService executorService = Executors.newFixedThreadPool(10); private TenantDto tenant; private ApplicationDto appDto; @@ -149,18 +149,30 @@ public void before() throws Exception { } @Test - public void testSaveCtlSchemaWithNoDependencies() throws IOException { + public void testSaveFlatCtlSchema() throws IOException { CTLSchemaDto testCtl = new CTLSchemaDto(); CtlSchemaMetaInfoDto ctlMetaInfo = new CtlSchemaMetaInfoDto("org.kaaproject.kaa.NoDependenciesCtlExample", tenant.getId()); testCtl.setMetaInfo(ctlMetaInfo); testCtl.setVersion(1); - testCtl.setBody(readSchemaFileAsString(TEST_CTL_SCHEMA_NO_DEPENDENCIES)); + testCtl.setBody(readSchemaFileAsString(TEST_CTL_SCHEMA_FLAT)); testCtl = ctlService.saveCtlSchema(testCtl); CTLSchemaDto foundCtl = ctlService.findCtlSchemaById(testCtl.getId()); + String defaultRecord = foundCtl.getDefaultRecord(); Assert.assertNotNull(foundCtl); + Assert.assertTrue(defaultRecord.contains("\"bytesField\":\"\"")); + Assert.assertTrue(defaultRecord.contains("\"booleanField\":false")); + Assert.assertTrue(defaultRecord.contains("\"intField\":0")); + Assert.assertTrue(defaultRecord.contains("\"longField\":0")); + Assert.assertTrue(defaultRecord.contains("\"floatField\":0.0")); + Assert.assertTrue(defaultRecord.contains("\"doubleField\":0.0")); + Assert.assertTrue(defaultRecord.contains("\"stringField\":\"\"")); + Assert.assertTrue(defaultRecord.contains("\"enumField\":\"SPADES\"")); + Assert.assertTrue(defaultRecord.contains("\"arrayField\":[]")); + Assert.assertTrue(defaultRecord.contains("\"recordsArrayField\":[]")); + Assert.assertTrue(defaultRecord.contains("\"recordField\":{\"bytesFieldInRecord\":\"\",\"booleanFieldInRecord\":false,\"intFieldInRecord\":0,\"floatFieldInRecord\":0.0}")); } @Test diff --git a/server/common/dao/src/test/resources/dao/ctl/flatCtlExample.json b/server/common/dao/src/test/resources/dao/ctl/flatCtlExample.json new file mode 100644 index 0000000000..05f1ece1b5 --- /dev/null +++ b/server/common/dao/src/test/resources/dao/ctl/flatCtlExample.json @@ -0,0 +1,112 @@ +{ + "type" : "record", + "name" : "NoDependenciesCtlExample", + "namespace" : "org.kaaproject.kaa", + "displayName" : "example schema", + "version" : 1, + "fields" : [ + { + "name" : "bytesField", + "type" : "bytes" + }, + { + "name" : "booleanField", + "type" : "boolean" + }, + { + "name" : "intField", + "type" : "int" + }, + { + "name" : "longField", + "type" : "long" + }, + { + "name" : "floatField", + "type" : "float" + }, + { + "name" : "doubleField", + "type" : "double" + }, + { + "name" : "stringField", + "type" : "string" + }, + { + "name" : "enumField", + "type" : { + "type" : "enum", + "name" : "TestEnum", + "namespace" : "org.kaaproject.kaa", + "symbols" : [ + "SPADES", + "HEARTS", + "DIAMONDS", + "CLUBS" + ] + } + }, + { + "name" : "arrayField", + "type" : { + "type" : "array", + "items" : "string" + } + }, + { + "name" : "recordsArrayField", + "type" : { + "type" : "array", + "items" : { + "type" : "record", + "name" : "TestArrayRecord", + "fields" : [ + { + "name" : "bytesFieldInArrayRecord", + "type" : "bytes" + }, + { + "name" : "booleanFieldInArrayRecord", + "type" : "boolean" + }, + { + "name" : "intFieldInArrayRecord", + "type" : "int" + }, + { + "name" : "floatFieldInArrayRecord", + "type" : "float" + } + ] + } + } + }, + { + "name" : "recordField", + "type" : { + "type" : "record", + "name" : "NestedRecord", + "fields": [ + { + "name": "bytesFieldInRecord", + "type": "bytes" + }, + { + "name": "booleanFieldInRecord", + "type": "boolean" + }, + { + "name": "intFieldInRecord", + "type": "int" + }, + { + "name": "floatFieldInRecord", + "type": "float" + } + ] + } + } + ], + "dependencies" : [ ] +} \ No newline at end of file diff --git a/server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json b/server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json deleted file mode 100644 index e8b4df7ccd..0000000000 --- a/server/common/dao/src/test/resources/dao/ctl/noDependenciesCtl.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "type" : "record", - "name" : "NoDependenciesCtlExample", - "namespace" : "org.kaaproject.kaa", - "displayName" : "example schema", - "version" : 1, - "fields" : [ - { - "name" : "bytesField", - "type" : "bytes" - } - ], - "dependencies" : [ ] -} \ No newline at end of file From fa5488e77a826360023780737ccfb0d98aeb28ba Mon Sep 17 00:00:00 2001 From: yverzun Date: Wed, 16 Nov 2016 19:51:55 +0200 Subject: [PATCH 017/152] Change KAA SDK path in cmake arguments --- .../Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md index 9738ce226e..0219d43a34 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md @@ -339,7 +339,7 @@ To invoke CMake, proceed as follows: mkdir build cd build cmake .. \ - -DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/esp8266.cmake \ + -DCMAKE_TOOLCHAIN_FILE=../kaa/toolchains/esp8266.cmake \ -DKAA_PLATFORM=esp8266 \ -DCMAKE_BUILD_TYPE=MinSizeRel \ -DWITH_EXTENSION_CONFIGURATION=OFF \ From 5811fd2d6662b3dc4dd7a58f3481058c16eb089b Mon Sep 17 00:00:00 2001 From: pyshankov Date: Wed, 16 Nov 2016 21:14:15 +0200 Subject: [PATCH 018/152] KAA-1563: 'Create new version' button doesn't work in the System CTL --- .../kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java | 1 - 1 file changed, 1 deletion(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java index a45b25189b..3e1c5899a1 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/activity/CtlSchemaActivity.java @@ -17,7 +17,6 @@ package org.kaaproject.kaa.server.admin.client.mvp.activity; import static org.kaaproject.kaa.common.dto.ctl.CTLSchemaScopeDto.APPLICATION; -import static org.kaaproject.kaa.common.dto.ctl.CTLSchemaScopeDto.SYSTEM; import static org.kaaproject.kaa.common.dto.ctl.CTLSchemaScopeDto.TENANT; import com.google.gwt.event.dom.client.ClickEvent; From 84b191becc2b1fc84e94d5911b28c295f6cd1d46 Mon Sep 17 00:00:00 2001 From: Max Lysenko Date: Tue, 15 Nov 2016 17:00:14 +0200 Subject: [PATCH 019/152] KAA-1557 C SDK documentation issue --- .../Using-Kaa-endpoint-SDKs/C/SDK-Linux/index.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Linux/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Linux/index.md index 56343b36e8..39de3e6084 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Linux/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Linux/index.md @@ -35,6 +35,13 @@ To install dependencies on Ubuntu execute the following command: sudo apt-get install cmake build-essential ``` +To build C SDK with Maven or to run unit tests, the cmocka unit testing framework has to be installed as well: + +``` +sudo apt-get install libcmocka0 libcmocka-dev +``` + + ### Build procedure After you generated archive with C SDK, proceed as follows: From 79f3384d7ad13a190f86c12193c9de9cd52948b4 Mon Sep 17 00:00:00 2001 From: RostakaGmfun Date: Thu, 3 Nov 2016 14:32:59 +0200 Subject: [PATCH 020/152] KAA-1554: Update sample applications build instructions in C/C++ SDKs documentation pages --- .../C++/SDK-Windows/index.md | 6 ++++-- .../attach/esp8266-sample/CMakeLists.txt | 8 ++++++++ .../C/SDK-ESP8266/index.md | 16 ++++++++++++---- .../C/SDK-TI-CC3200/index.md | 12 ++++-------- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Windows/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Windows/index.md index 709611cee3..8923ab3c60 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Windows/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Windows/index.md @@ -109,7 +109,7 @@ and run the following commands: cd KAA_BUILD_DIR tools\env.bat avrogen.bat - md build && cd build + mkdir build && cd build ``` 1. To build Kaa C++ SDK with `nmake` run: @@ -149,5 +149,7 @@ and run the following commands: ``` KAA_BUILD_DIR\env.bat - build.bat deploy + mkdir build + cd build + cmake -G "NMake Makefiles" -DCMAKE_FIND_ROOT_PATH=%ROOT_PATH% .. ``` diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/attach/esp8266-sample/CMakeLists.txt b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/attach/esp8266-sample/CMakeLists.txt index e3a8aa0631..eff601ff37 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/attach/esp8266-sample/CMakeLists.txt +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/attach/esp8266-sample/CMakeLists.txt @@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.0.2) project(kaa_demo C) +# Disable unused features +set(KAA_WITH_EXTENSION_CONFIGURATION OFF) +set(KAA_WITH_EXTENSION_EVENT OFF) +set(KAA_WITH_EXTENSION_NOTIFICATION OFF) +set(KAA_WITH_EXTENSION_LOGGING OFF) +set(KAA_WITH_EXTENSION_USER OFF) +set(KAA_WITH_EXTENSION_PROFILE OFF) + # Add Kaa SDK directory add_subdirectory(kaa) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md index 0219d43a34..c9f035b9d9 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-ESP8266/index.md @@ -248,6 +248,18 @@ cmake_minimum_required(VERSION 3.0.2) project(kaa_demo C) ``` +Next, set configuration CMake variables which will be used by Kaa SDK during build configuration. +Here we disable all SDK features, since we don't use them in scope of this example application: + +```CMake +set(KAA_WITH_EXTENSION_CONFIGURATION OFF) +set(KAA_WITH_EXTENSION_EVENT OFF) +set(KAA_WITH_EXTENSION_NOTIFICATION OFF) +set(KAA_WITH_EXTENSION_LOGGING OFF) +set(KAA_WITH_EXTENSION_USER OFF) +set(KAA_WITH_EXTENSION_PROFILE OFF) +``` + We also add Kaa SDK subdirectory, so that we can build it together with the application. ```CMake @@ -342,10 +354,6 @@ To invoke CMake, proceed as follows: -DCMAKE_TOOLCHAIN_FILE=../kaa/toolchains/esp8266.cmake \ -DKAA_PLATFORM=esp8266 \ -DCMAKE_BUILD_TYPE=MinSizeRel \ - -DWITH_EXTENSION_CONFIGURATION=OFF \ - -DWITH_EXTENSION_EVENT=OFF \ - -DWITH_EXTENSION_NOTIFICATION=OFF \ - -DWITH_EXTENSION_LOGGING=OFF \ -DKAA_MAX_LOG_LEVEL=3 make diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-TI-CC3200/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-TI-CC3200/index.md index 43841363ee..0c3128722a 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-TI-CC3200/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-TI-CC3200/index.md @@ -150,14 +150,10 @@ Connect CC3200 LaunchPad to your PC through a micro-USB connector and execute th ``` tar -xzf configuration_demo.tar.gz cd CConfigurationDemo -./build.sh build -``` - -You will be asked for desired platform. Type `cc32xx` into the console. - -``` -Please enter a target (default is x86-64): -cc32xx +tar -zxf libs/kaa/kaa-* -C libs/kaa +mkdir -p build +cd build +cmake -DKAA_PLATFORM=cc32xx -DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/cc32xx.cmake .. ``` To launch the application, execute the following: From c1baec2d7b1e0dd9298d88e5d7efb671e53396c2 Mon Sep 17 00:00:00 2001 From: RostakaGmfun Date: Wed, 9 Nov 2016 12:19:18 +0200 Subject: [PATCH 021/152] KAA-1571: Introduce CMake toolchain file for Intel Edison platform. This commit also slightly corrects this toolchain file. --- .../client-c/toolchains/edison.cmake | 78 +++++++++++++++++++ .../client-cpp/toolchains/edison.cmake | 28 ++++--- 2 files changed, 94 insertions(+), 12 deletions(-) create mode 100644 client/client-multi/client-c/toolchains/edison.cmake diff --git a/client/client-multi/client-c/toolchains/edison.cmake b/client/client-multi/client-c/toolchains/edison.cmake new file mode 100644 index 0000000000..dcecc49d27 --- /dev/null +++ b/client/client-multi/client-c/toolchains/edison.cmake @@ -0,0 +1,78 @@ +# +# Copyright 2014-2016 CyberVision, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +if(NOT DEFINED SDK_32bits) + set(SDK_32bits FALSE) +endif() + +#Set the target parameters +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_VERSION 3.10.17-poky-edison+) +set(CMAKE_SYSTEM_PROCESSOR i686) + +if(NOT DEFINED EDISON_SDK_ROOT) + if(WIN32) + if(${SDK_32bits}) + set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2) + else() + set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2) + endif() + else(WIN32) + set(EDISON_SDK_ROOT /opt/poky-edison/1.6) + endif(WIN32) +endif(NOT DEFINED EDISON_SDK_ROOT) + +message(STATUS "EDISON_SDK_ROOT: ${EDISON_SDK_ROOT}") + +#Set the host parameters +if(WIN32) + #Windows host + if(${SDK_32bits}) + set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-mingw32) + #MinGW make + set(CMAKE_MAKE_PROGRAM "C:/Program Files/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") + else() + set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-mingw32) + #MinGW make + set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") + endif() + set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc.exe) + set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++.exe) +else() + #Linux host + if(${SDK_32bits}) + set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-linux) + else() + set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-linux) + endif() + set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc) + set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++) +endif() + + +set(CMAKE_SYSROOT ${EDISON_SDK_ROOT}/sysroots/core2-32-poky-linux) +set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +SET(CMAKE_C_FLAGS "-Os -g3 -Wall --sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) +SET(CMAKE_CXX_FLAGS "-Os -g3 -Wall --sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) + +INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include) +INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include/c++) +INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include/c++/i586-poky-linux) diff --git a/client/client-multi/client-cpp/toolchains/edison.cmake b/client/client-multi/client-cpp/toolchains/edison.cmake index 8e9d4e20f5..dcecc49d27 100644 --- a/client/client-multi/client-cpp/toolchains/edison.cmake +++ b/client/client-multi/client-cpp/toolchains/edison.cmake @@ -23,19 +23,23 @@ set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_VERSION 3.10.17-poky-edison+) set(CMAKE_SYSTEM_PROCESSOR i686) -if(NOT DEFINED EDISON_SDK_ROOT AND WIN32) - if(${SDK_32bits}) - set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2) - else() - set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2) - endif() -else(NOT DEFINED EDISON_SDK_ROOT) - set(EDISON_SDK_ROOT /opt/poky-edison/1.6) -endif() +if(NOT DEFINED EDISON_SDK_ROOT) + if(WIN32) + if(${SDK_32bits}) + set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2) + else() + set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2) + endif() + else(WIN32) + set(EDISON_SDK_ROOT /opt/poky-edison/1.6) + endif(WIN32) +endif(NOT DEFINED EDISON_SDK_ROOT) + +message(STATUS "EDISON_SDK_ROOT: ${EDISON_SDK_ROOT}") #Set the host parameters if(WIN32) - #Windows host + #Windows host if(${SDK_32bits}) set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-mingw32) #MinGW make @@ -46,7 +50,7 @@ if(WIN32) set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") endif() set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc.exe) - set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++.exe) + set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++.exe) else() #Linux host if(${SDK_32bits}) @@ -55,7 +59,7 @@ else() set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-linux) endif() set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc) - set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++) + set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++) endif() From 5eceb67bc9d4c9ae980919cf0b89d8a59c0db70f Mon Sep 17 00:00:00 2001 From: RostakaGmfun Date: Wed, 9 Nov 2016 13:28:50 +0200 Subject: [PATCH 022/152] KAA-1571: Update documentation --- .../Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md index 41876dd2bf..ae1f4684dc 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md @@ -44,8 +44,7 @@ Now, dependencies are installed and it is time to create Kaa application. Since Edison is running Linux, you can refer to [the Linux guide]({{root_url}}Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Linux/#c-sdk-build) for detailed process of application creation. But remember, you must specify correct compiler when compiling your Kaa application for Intel Edison: - export EDISON_CC=/opt/poky-edison/1.6.1/sysroots/x86_64-pokysdk-linux/usr/bin/i586-poky-linux/i586-poky-linux-gcc - cmake -DKAA_MAX_LOG_LEVEL=3 -DCMAKE_C_COMPILER=$EDISON_CC .. + cmake -DKAA_MAX_LOG_LEVEL=3 -DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/edison.cmake .. make For more details on how to build, upload and run your application on Edison board, you may refer to official [user guide](https://software.intel.com/en-us/intel-edison-board-user-guide). From 46a359c804480846b5e3de35afb7d4f0738412ff Mon Sep 17 00:00:00 2001 From: RostakaGmfun Date: Thu, 10 Nov 2016 10:11:22 +0200 Subject: [PATCH 023/152] KAA-1571: Review fixes --- .../client-c/toolchains/edison.cmake | 59 +++++++------------ .../client-cpp/toolchains/edison.cmake | 57 ++++++++++++------ .../C++/SDK-Edison/index.md | 4 +- .../C/SDK-Edison/index.md | 5 +- 4 files changed, 66 insertions(+), 59 deletions(-) diff --git a/client/client-multi/client-c/toolchains/edison.cmake b/client/client-multi/client-c/toolchains/edison.cmake index dcecc49d27..f297385bca 100644 --- a/client/client-multi/client-c/toolchains/edison.cmake +++ b/client/client-multi/client-c/toolchains/edison.cmake @@ -13,9 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# +# The following configuration variables are accepted: +# +# * EDISON_SDK_ROOT +# Absolute path to the Intel Edison SDK root directory. +# Default value: /opt/poky-edison/1.6 +# + if(NOT DEFINED SDK_32bits) - set(SDK_32bits FALSE) + set(SDK_32bits FALSE) endif() #Set the target parameters @@ -24,43 +32,18 @@ set(CMAKE_SYSTEM_VERSION 3.10.17-poky-edison+) set(CMAKE_SYSTEM_PROCESSOR i686) if(NOT DEFINED EDISON_SDK_ROOT) - if(WIN32) - if(${SDK_32bits}) - set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2) - else() - set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2) - endif() - else(WIN32) - set(EDISON_SDK_ROOT /opt/poky-edison/1.6) - endif(WIN32) -endif(NOT DEFINED EDISON_SDK_ROOT) + set(EDISON_SDK_ROOT /opt/poky-edison/1.6) +endif() message(STATUS "EDISON_SDK_ROOT: ${EDISON_SDK_ROOT}") -#Set the host parameters -if(WIN32) - #Windows host - if(${SDK_32bits}) - set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-mingw32) - #MinGW make - set(CMAKE_MAKE_PROGRAM "C:/Program Files/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") - else() - set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-mingw32) - #MinGW make - set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") - endif() - set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc.exe) - set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++.exe) +if(SDK_32bits) + set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-linux) else() - #Linux host - if(${SDK_32bits}) - set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-linux) - else() - set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-linux) - endif() - set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc) - set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++) + set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-linux) endif() +set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc) +set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++) set(CMAKE_SYSROOT ${EDISON_SDK_ROOT}/sysroots/core2-32-poky-linux) @@ -70,9 +53,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -SET(CMAKE_C_FLAGS "-Os -g3 -Wall --sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) -SET(CMAKE_CXX_FLAGS "-Os -g3 -Wall --sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) +SET(CMAKE_C_FLAGS "--sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) +SET(CMAKE_CXX_FLAGS "--sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) -INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include) -INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include/c++) -INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include/c++/i586-poky-linux) +include_directories(${CMAKE_SYSROOT}/usr/include) +include_directories(${CMAKE_SYSROOT}/usr/include/c++) +include_directories(${CMAKE_SYSROOT}/usr/include/c++/i586-poky-linux) diff --git a/client/client-multi/client-cpp/toolchains/edison.cmake b/client/client-multi/client-cpp/toolchains/edison.cmake index dcecc49d27..fb4a68116e 100644 --- a/client/client-multi/client-cpp/toolchains/edison.cmake +++ b/client/client-multi/client-cpp/toolchains/edison.cmake @@ -13,9 +13,25 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# +# The following configuration variables are accepted: +# +# * EDISON_SDK_ROOT +# Absolute path to the Intel Edison SDK root directory. +# Default value: +# * Windows: +# * 32-bit: C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2 +# * 64-bit: C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2 +# * UNIX: /opt/poky-edison/1.6 +# * EDISON_MAKE_PROGRAM +# Used on Windows platform to supply absolute path to make utility. +# Default value: +# * 32-bit: C:/Program Files/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe +# * 64-bit: C:/Program Files (x86)/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe +# if(NOT DEFINED SDK_32bits) - set(SDK_32bits FALSE) + set(SDK_32bits FALSE) endif() #Set the target parameters @@ -25,35 +41,40 @@ set(CMAKE_SYSTEM_PROCESSOR i686) if(NOT DEFINED EDISON_SDK_ROOT) if(WIN32) - if(${SDK_32bits}) - set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2) + if(SDK_32bits) + set(EDISON_SDK_ROOT "C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2") else() - set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2) + set(EDISON_SDK_ROOT "C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2") endif() - else(WIN32) + else() set(EDISON_SDK_ROOT /opt/poky-edison/1.6) - endif(WIN32) -endif(NOT DEFINED EDISON_SDK_ROOT) + endif() +endif() message(STATUS "EDISON_SDK_ROOT: ${EDISON_SDK_ROOT}") #Set the host parameters if(WIN32) + if(NOT DEFINED EDISON_MAKE_PROGRAM) + if(SDK_32bits) + set(CMAKE_MAKE_PROGRAM "C:/Program Files/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") + else(SDK_32bits) + set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") + endif(SDK_32bits) + else() + set(CMAKE_MAKE_PROGRAM "${EDISON_MAKE_PROGRAM}") + endif() #Windows host - if(${SDK_32bits}) + if(SDK_32bits) set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-mingw32) - #MinGW make - set(CMAKE_MAKE_PROGRAM "C:/Program Files/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") else() set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-mingw32) - #MinGW make - set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe") endif() set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc.exe) set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++.exe) else() #Linux host - if(${SDK_32bits}) + if(SDK_32bits) set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-linux) else() set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-linux) @@ -70,9 +91,9 @@ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -SET(CMAKE_C_FLAGS "-Os -g3 -Wall --sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) -SET(CMAKE_CXX_FLAGS "-Os -g3 -Wall --sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) +SET(CMAKE_C_FLAGS "--sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) +SET(CMAKE_CXX_FLAGS "--sysroot=${CMAKE_SYSROOT} -m32 -march=i586 -ffunction-sections -fdata-sections" CACHE STRING "" FORCE) -INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include) -INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include/c++) -INCLUDE_DIRECTORIES(${CMAKE_SYSROOT}/usr/include/c++/i586-poky-linux) +include_directories(${CMAKE_SYSROOT}/usr/include) +include_directories(${CMAKE_SYSROOT}/usr/include/c++) +include_directories(${CMAKE_SYSROOT}/usr/include/c++/i586-poky-linux) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Edison/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Edison/index.md index 8a36a27b4b..d57bc31690 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Edison/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Edison/index.md @@ -11,13 +11,15 @@ sort_idx: 60 The guide explains how to build applications for Intel Edison based on the Kaa C++ endpoint SDK. + # Configuring Intel Edison board If this is the first time you use the Intel Edison technology, you have to start with configuring your board. For this purpose, refer to the official Edison getting started guide. After finishing with the guide, you will be able to access your board through both a serial terminal and the ssh client. ->**Note:** The instructions below are for the official Intel Edison firmware. +>**Note:** The instructions below are for the official Intel Edison firmware, Poky (Yocto Project Reference Distro) 1.7.3, kernel version 3.10.17-poky-edison+. + ## Installing third-party components for C++ SDK diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md index ae1f4684dc..4c2ea1b8e2 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Edison/index.md @@ -17,7 +17,7 @@ Refer to [the Linux guide]({{root_url}}Programming-guide/Using-Kaa-endpoint-SDKs **Verified against:** - **Host OS:** Ubuntu 16.04 64-bit LTS - - **Target OS:** Poky (Yocto Project Reference Distro) 1.7.3 + - **Target OS:** Poky (Yocto Project Reference Distro) 1.7.3, kernel version 3.10.17-poky-edison+. # Install dependencies @@ -44,8 +44,9 @@ Now, dependencies are installed and it is time to create Kaa application. Since Edison is running Linux, you can refer to [the Linux guide]({{root_url}}Programming-guide/Using-Kaa-endpoint-SDKs/C/SDK-Linux/#c-sdk-build) for detailed process of application creation. But remember, you must specify correct compiler when compiling your Kaa application for Intel Edison: - cmake -DKAA_MAX_LOG_LEVEL=3 -DCMAKE_TOOLCHAIN_FILE=../libs/kaa/toolchains/edison.cmake .. + cmake -DKAA_MAX_LOG_LEVEL=3 -DCMAKE_TOOLCHAIN_FILE=PATH_TO_KAA_SDK/toolchains/edison.cmake .. make +Where `PATH_TO_KAA_SDK` is path to Kaa C SDK relative to the `build` directory. For more details on how to build, upload and run your application on Edison board, you may refer to official [user guide](https://software.intel.com/en-us/intel-edison-board-user-guide). From 09be8db1bb8213d59d645e0c09f920695906d75e Mon Sep 17 00:00:00 2001 From: sbeltser Date: Thu, 17 Nov 2016 16:58:57 +0200 Subject: [PATCH 024/152] KAA-1585: make 'emailpattern' static field --- .../kaa/server/admin/client/util/Utils.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java index 57870e5ecb..5235691960 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java @@ -56,6 +56,9 @@ public class Utils { public static final KaaAdminStyle kaaAdminStyle = resources.kaaAdminStyle(); public static final AvroUiStyle avroUiStyle = avroUiResources.avroUiStyle(); private static final int MAX_ERROR_LINE_LENGTH = 200; + private static Pattern emailPattern = Pattern.compile( + "^.+@.+$", Pattern.CASE_INSENSITIVE + ); private static final DateTimeFormat simpleDateFormat = getFormat("MM/dd/yyyy"); @@ -82,9 +85,9 @@ public static void handleException(Throwable caught, /** * Exception handler. * - * @param caught the Throwable - * @param hasErrorMessage the has error message - * @param errorMessageCustomizer the error message customizer + * @param caught the Throwable + * @param hasErrorMessage the has error message + * @param errorMessageCustomizer the error message customizer */ public static void handleException(Throwable caught, HasErrorMessage hasErrorMessage, @@ -179,11 +182,7 @@ public static boolean validateEmail(String mail) { if (mail == null || mail.length() == 0) { return false; } - Pattern pattern = Pattern - .compile( - "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$", Pattern.CASE_INSENSITIVE - ); - Matcher matcher = pattern.matcher(mail); + Matcher matcher = emailPattern.matcher(mail); return matcher.find(); } From a161a2d99ca8511723184863f886f86f3da027a4 Mon Sep 17 00:00:00 2001 From: tmakhmudov Date: Thu, 17 Nov 2016 17:54:27 +0200 Subject: [PATCH 025/152] Java code style page - 'Automatic code formatter' fixed. The rest of the page is to be reviewed later. --- .../Code-style/Java/index.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/Customization-guide/Code-style/Java/index.md b/doc/Customization-guide/Code-style/Java/index.md index 1bf16b9ed6..c8ca047913 100644 --- a/doc/Customization-guide/Code-style/Java/index.md +++ b/doc/Customization-guide/Code-style/Java/index.md @@ -5,6 +5,8 @@ permalink: /:path/ sort_idx: 10 --- +{% include variables.md %} + * TOC {:toc} @@ -12,7 +14,7 @@ The entire Java source code of the Kaa project must conform to the [Google Java This guide describes some tools which can be used to ensure proper style and format of the Java source code. -# IntelliJ IDEA plugin +## IntelliJ IDEA plugin [Checkstyle](https://github.com/jshiell/checkstyle-idea) plugin installation: 1. Go to **File>Settings>IDE Settings>plugins**. @@ -31,15 +33,16 @@ Plugin usage: 1. Go to **Analyze>Inspect code**. 2. Select the inspection scope and the inspection profile. -# Eclipse plugin +## Eclipse plugin Follow [tutorial](http://eclipse-cs.sourceforge.net/#!/install) to install the checkstyle plugin. -# Maven plugin +## Maven plugin The [check style maven plugin](https://maven.apache.org/plugins/maven-checkstyle-plugin/usage.html) is used to continuously verify the style of the Java code. By default, it is already configured to use the Google coding conventions. The configuration is located in the root of the Kaa project (`checkstyle.xml`). -# Automatic code formatter -To automate formatting of the Java code, it is recommended that you use IntelliJ IDEA with appropriate Google Java Style settings. To install the code style settings, proceed as follows: +## Automatic code formatter +To automate formatting of the Java code, it is recommended that you use IntelliJ IDEA with appropriate code style settings. +To install the code style settings: + +1. Click **File** > **Settings** > **Editor** > **Code Style**. -1. Download [IntelliJ Java Google Style](https://github.com/google/styleguide/blob/gh-pages/intellij-java-google-style.xml). -2. Go to **File>Settings>Editor>Code Style**. -3. Press **Manage** and import the checkstyle configuration (`checkstyle.xml`) from the root of the Kaa project. +2. Click **Manage** and import the `checkstyle.xml` configuration file from the Kaa project root directory. \ No newline at end of file From 61abc6d64de32adbaa2b41472a6fa9df31a470d8 Mon Sep 17 00:00:00 2001 From: tmakhmudov Date: Thu, 17 Nov 2016 18:52:01 +0200 Subject: [PATCH 026/152] KAA-1509: Your first Kaa application - fixed. 'Administration' changed to 'Administration UI'. --- .../Your-first-Kaa-application/index.md | 61 +++++++++++-------- 1 file changed, 37 insertions(+), 24 deletions(-) diff --git a/doc/Programming-guide/Your-first-Kaa-application/index.md b/doc/Programming-guide/Your-first-Kaa-application/index.md index 2153befeed..fde58a28fb 100644 --- a/doc/Programming-guide/Your-first-Kaa-application/index.md +++ b/doc/Programming-guide/Your-first-Kaa-application/index.md @@ -41,13 +41,13 @@ In this example, the Configuration feature will be used to send the sampling per To add an application: -1. On the Sandbox main page, click **Administration** and log in as a tenant administrator using default **admin** username and **admin123** password. +1. On the Sandbox main page, click **Administration UI** and log in as a [tenant administrator]({{root_url}}Glossary/#tenant-administrator) using default **admin** username and **admin123** password. -2. On the **Administration** page, click **Add application**. +2. On the **Administration UI** page, click **Add application**. 3. On the **Application details** page, enter a title for your new application, select a credentials service and click **Add**. - ![Administration page](attach/new_app.png) + ![Administration UI](attach/new_app.png) ## Create schemas @@ -88,7 +88,7 @@ The `by_default` parameter defines the default sampling period value which is se 3. Use the **Upload from file** section to [create CT schemas]({{root_url}}/Programming-guide/Key-platform-features/Common-Type-Library/#create-a-new-ct) of Application scope from the data-schema.json and configuration-schema.json files. -4. On the Sandbox main page, click **Administration** and log in as a tenant developer using default **devuser** username and **devuser123** password. +4. On the Sandbox main page, click **Administration UI** and log in as a [tenant developer]({{root_url}}Glossary/#tenant-developer) using default **devuser** username and **devuser123** password. 5. Click the **Applications** arrow to unfold the list and click the arrow of the application you created in [Add application](#add-application), then click **Schemas** > **Log** and click the **Add schema** button. @@ -98,7 +98,7 @@ The `by_default` parameter defines the default sampling period value which is se 7. Click the **Add** button at the top of the page. ->**NOTE:** Alternatively, you can use the Schema Avro UI form to create the schema. +>**NOTE:** Alternatively, you can use the [Avro UI form]({{root_url}}Glossary/#avro-ui-form) to create the schema. {: .note} To create a configuration schema repeat the same procedure using the configuration-schema.json file. @@ -935,23 +935,36 @@ This will clean up the mess that can occur when debug logs are enabled. To launch your Java application: - -1. Save the application code into FirstKaaDemo.java file located in the demo_app directory. - -2. Download the [slf4j-simple-1.7.21.jar](http://central.maven.org/maven2/org/slf4j/slf4j-simple/1.7.21/slf4j-simple-1.7.21.jar) to the demo_app directory. - In Linux terminal you can just go to the demo_app directory and run the command: -
wget http://central.maven.org/maven2/org/slf4j/slf4j-simple/1.7.21/slf4j-simple-1.7.21.jar
- -3. Build the application by running the following command from the demo_app directory. -
javac -cp kaa-*.jar *.java
- -4. Launch the application. -
- Unix-based OS -
java -cp '.:./*' FirstKaaDemo
-
- Windows OS -
java -cp '.;.\*' FirstKaaDemo
+
    +
  1. + Save the application code into FirstKaaDemo.java file located in the **demo_app** directory. +
  2. +
  3. + Build the application by running the following command from the **demo_app** directory. + +
    +			javac -cp *.jar *.java
    +		
    + +
  4. +
  5. + Launch the application. + +
    +
    + Unix-based OS +
    +			java -cp '.:./*' FirstKaaDemo
    +		
    + +
    +
    + Windows OS +
    +			java -cp '.;.\*' FirstKaaDemo
    +		
    +
  6. +
@@ -1012,7 +1025,7 @@ To do this: 1. Make sure your client application is running and transmitting the temperature values. -2. Log in to the **Administration** page as a Tenant Developer using the default **devuser** username and **devuser123** password. +2. Log in to the **Administration UI** page as a tenant developer using the default **devuser** username and **devuser123** password. In the **Applications** list, select the **Endpoint Groups** section of your new application. ![Endpoint groups](attach/endpoint_group.png) @@ -1041,7 +1054,7 @@ Your client application console will display the following messages. Sampled temperature: 34 Sampled temperature: 25 -This means that the sampling period has been successfully modified. + This means that the sampling period has been successfully modified. ## Further reading From 3691227296368e8543d06cb18fc387a98711f325 Mon Sep 17 00:00:00 2001 From: vchizhevsky Date: Fri, 18 Nov 2016 14:13:11 +0200 Subject: [PATCH 027/152] KAA-1566: small fix for upgradeKaa0100to0101 script --- .../upgradeKaa0100to0101.sh} | 8 ++++---- .../upgradeSql0100to0101kaaVersionMariadb.sql} | 0 .../upgradeSql0100to0101kaaVersionPostgreSQL.sql} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename server/upgrade/{data-migration-0.10.0-0.11.0/upgradeKaa0100to0110.sh => data-migration-0.10.0-0.10.1/upgradeKaa0100to0101.sh} (82%) rename server/upgrade/{data-migration-0.10.0-0.11.0/upgradeSql0100to0110kaaVersionMariadb.sql => data-migration-0.10.0-0.10.1/upgradeSql0100to0101kaaVersionMariadb.sql} (100%) rename server/upgrade/{data-migration-0.10.0-0.11.0/upgradeSql0100to0110kaaVersionPostgreSQL.sql => data-migration-0.10.0-0.10.1/upgradeSql0100to0101kaaVersionPostgreSQL.sql} (100%) diff --git a/server/upgrade/data-migration-0.10.0-0.11.0/upgradeKaa0100to0110.sh b/server/upgrade/data-migration-0.10.0-0.10.1/upgradeKaa0100to0101.sh similarity index 82% rename from server/upgrade/data-migration-0.10.0-0.11.0/upgradeKaa0100to0110.sh rename to server/upgrade/data-migration-0.10.0-0.10.1/upgradeKaa0100to0101.sh index c46eca16f4..315f77cec7 100755 --- a/server/upgrade/data-migration-0.10.0-0.11.0/upgradeKaa0100to0110.sh +++ b/server/upgrade/data-migration-0.10.0-0.10.1/upgradeKaa0100to0101.sh @@ -23,12 +23,12 @@ mariadb or postgresql" else case $SQL_PROVIDER_NAME in mariadb) - echo "Upgrade mariadb 0.10.0 to 0.11.0 Kaa version" - mysql -usqladmin -padmin kaa < upgradeSql0100to0110kaaVersionMariadb.sql + echo "Upgrade mariadb 0.10.0 to 0.10.1 Kaa version" + mysql -usqladmin -padmin kaa < upgradeSql0100to0101kaaVersionMariadb.sql ;; postgresql) - echo "Upgrade postgresql 0.10.0 to 0.11.0 Kaa version" - sudo -u postgres psql -d kaa -a -f upgradeSql0100to0110kaaVersionPostgreSQL.sql + echo "Upgrade postgresql 0.10.0 to 0.10.1 Kaa version" + sudo -u postgres psql -d kaa -a -f upgradeSql0100to0101kaaVersionPostgreSQL.sql ;; *) exit 1 diff --git a/server/upgrade/data-migration-0.10.0-0.11.0/upgradeSql0100to0110kaaVersionMariadb.sql b/server/upgrade/data-migration-0.10.0-0.10.1/upgradeSql0100to0101kaaVersionMariadb.sql similarity index 100% rename from server/upgrade/data-migration-0.10.0-0.11.0/upgradeSql0100to0110kaaVersionMariadb.sql rename to server/upgrade/data-migration-0.10.0-0.10.1/upgradeSql0100to0101kaaVersionMariadb.sql diff --git a/server/upgrade/data-migration-0.10.0-0.11.0/upgradeSql0100to0110kaaVersionPostgreSQL.sql b/server/upgrade/data-migration-0.10.0-0.10.1/upgradeSql0100to0101kaaVersionPostgreSQL.sql similarity index 100% rename from server/upgrade/data-migration-0.10.0-0.11.0/upgradeSql0100to0110kaaVersionPostgreSQL.sql rename to server/upgrade/data-migration-0.10.0-0.10.1/upgradeSql0100to0101kaaVersionPostgreSQL.sql From a20b1a540b2f2bb163e2dff5eae0a3ed873222cd Mon Sep 17 00:00:00 2001 From: tmakhmudov Date: Fri, 18 Nov 2016 15:24:03 +0200 Subject: [PATCH 028/152] KAA-1509: Your first Kaa application - fixed upon QA review. --- .../Your-first-Kaa-application/index.md | 42 +++++++------------ 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/doc/Programming-guide/Your-first-Kaa-application/index.md b/doc/Programming-guide/Your-first-Kaa-application/index.md index fde58a28fb..2b93957b68 100644 --- a/doc/Programming-guide/Your-first-Kaa-application/index.md +++ b/doc/Programming-guide/Your-first-Kaa-application/index.md @@ -935,36 +935,26 @@ This will clean up the mess that can occur when debug logs are enabled. To launch your Java application: -
    -
  1. - Save the application code into FirstKaaDemo.java file located in the **demo_app** directory. -
  2. -
  3. - Build the application by running the following command from the **demo_app** directory. - -
    -			javac -cp *.jar *.java
    -		
    +1. Save the application code into FirstKaaDemo.java file located in the **demo_app** directory. + +2. Download the [slf4j-simple-1.7.21.jar](http://central.maven.org/maven2/org/slf4j/slf4j-simple/1.7.21/slf4j-simple-1.7.21.jar) and save it to the **demo_app** directory. +In Linux terminal, run the following command from the **demo_app** directory. + + wget http://central.maven.org/maven2/org/slf4j/slf4j-simple/1.7.21/slf4j-simple-1.7.21.jar + +3. Build the application by running the following command from the **demo_app** directory. -
  4. -
  5. - Launch the application. + javac -cp *.jar *.java + +4. Launch the application. + + * Unix-based OS -
    -
    - Unix-based OS -
     			java -cp '.:./*' FirstKaaDemo
    -		
    - -
    -
    - Windows OS -
    +	
    +	* Windows OS
    +	
     			java -cp '.;.\*' FirstKaaDemo
    -		
    -
  6. -
From fa6615bd46e924d04609ed1132827ea0ca1e2ace Mon Sep 17 00:00:00 2001 From: tmakhmudov Date: Fri, 18 Nov 2016 18:48:25 +0200 Subject: [PATCH 029/152] KAA-1620: 'Documentation contribution' merged into 'How to contribute'. --- .../Contribution-guide/index.md | 83 ------------------- .../How-to-contribute/index.md | 81 +++++++++++++++++- 2 files changed, 78 insertions(+), 86 deletions(-) delete mode 100644 doc/Customization-guide/How-to-contribute/Contribution-guide/index.md diff --git a/doc/Customization-guide/How-to-contribute/Contribution-guide/index.md b/doc/Customization-guide/How-to-contribute/Contribution-guide/index.md deleted file mode 100644 index f09901cd00..0000000000 --- a/doc/Customization-guide/How-to-contribute/Contribution-guide/index.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -layout: page -title: Documentation contribution guide -permalink: /:path/ -sort_idx: 30 ---- -{% include variables.md %} - -Kaa documentation is a part of the [Kaa source code](https://github.com/kaaproject/kaa) and is located in the `doc/` folder. -For a full description of the contribution process, see [How to contribute]({{root_url}}Customization-guide/How-to-contribute/). -The key differences between contributing source code and documentation are: - -* Select `Component: Documentation` in the [Jira](http://jira.kaaproject.org/) ticket. -* Generate and check documentation locally before committing. -* Be sure to check the [Documentation style guide]({{root_url}}Customization-guide/How-to-contribute/Style-guide/). - -## Preview documentation - -1. Install required software: - * [Git](https://git-scm.com/) - * [Ruby](https://www.ruby-lang.org) - * [Jekyll](https://jekyllrb.com/) - * [Jekyll-sitemap](https://github.com/jekyll/jekyll-sitemap) - * [Jekyll-gist](https://github.com/jekyll/jekyll-gist) - * [Rouge](https://github.com/jneen/rouge) - - See the detailed installation instructions in the table below. - Click the tab to select a platform: -
    -
  • - - -
    -
    - -```bash -sudo apt-get update -sudo apt-get install -y git ruby2.0 ruby2.0-dev build-essential -sudo gem2.0 install -N jekyll jekyll-gist jekyll-sitemap rouge -``` - -
    - -```bash -sudo apt-get update -sudo apt-get install -y git build-essential ruby ruby-dev ruby-ffi -sudo gem install -N jekyll jekyll-gist jekyll-sitemap rouge -``` - -
    - -```bash -sudo yum install -y ruby git ruby-devel -sudo yum groupinstall -y 'Development Tools' -sudo gem install -N jekyll jekyll-gist jekyll-sitemap rouge -``` - -
    - -```bash -nix-shell doc/shell.nix --run ./test-gh-pages.sh -``` - -
    -
  • -
- -{: start="2"} -2. Go to the root directory of your git code branch. -3. Delete `test-gh-pages-*/` if it exists. -4. Run `test-gh-pages.sh` script to generate documentation and start development server at [http://localhost:4000/](http://localhost:4000/). - - ```bash - user@host:/kaa$ ./test-gh-pages.sh - ... - Server address: http://127.0.0.1:4000/kaa/ - Server running... press ctrl-c to stop. - ``` diff --git a/doc/Customization-guide/How-to-contribute/index.md b/doc/Customization-guide/How-to-contribute/index.md index 4cbbeb28fc..e098a0161c 100644 --- a/doc/Customization-guide/How-to-contribute/index.md +++ b/doc/Customization-guide/How-to-contribute/index.md @@ -40,9 +40,84 @@ If you are willing to contribute to the Kaa code base, or submit sample [applica >See [Git flow]({{root_url}}Customization-guide/How-to-contribute/Git-flow/). {:.note} -## Improve documentation +## Contribute to documentation Documentation is a part of the Kaa code base. You can find the documentation files in the `doc/` subdirectory of the [main repository](https://github.com/kaaproject/kaa). -That means that the contribution process is the same for both the source code and documentation. -See [Documentation contribution guide]({{root_url}}Customization-guide/How-to-contribute/Contribution-guide/). \ No newline at end of file +This means that the contribution process is the same for both the source code and documentation. + +Contributing to the Kaa documentation, make sure to complete the following: + +* Select `Component: Documentation` in the corresponding [Jira](http://jira.kaaproject.org/) ticket. +* Generate and check documentation locally before committing. +See [Preview documentation]({{root_url}}Customization-guide/How-to-contribute/#preview-documentation). +* Check with the [Documentation style guide]({{root_url}}Customization-guide/How-to-contribute/Style-guide/) to make sure your contribution complies with the Kaa requirements. + +### Preview documentation + +To preview the documentation locally and make sure it meets the Kaa requirements: + +1. Install the required software: + * [Git](https://git-scm.com/) + * [Ruby](https://www.ruby-lang.org) + * [Jekyll](https://jekyllrb.com/) + * [Jekyll-sitemap](https://github.com/jekyll/jekyll-sitemap) + * [Jekyll-gist](https://github.com/jekyll/jekyll-gist) + * [Rouge](https://github.com/jneen/rouge) + + Follow the instructions for your platform below. + +
    +
  • + + +
    +
    + +```bash +sudo apt-get update +sudo apt-get install -y git ruby2.0 ruby2.0-dev build-essential +sudo gem2.0 install -N jekyll jekyll-gist jekyll-sitemap rouge +``` + +
    + +```bash +sudo apt-get update +sudo apt-get install -y git build-essential ruby ruby-dev ruby-ffi +sudo gem install -N jekyll jekyll-gist jekyll-sitemap rouge +``` + +
    + +```bash +sudo yum install -y ruby git ruby-devel +sudo yum groupinstall -y 'Development Tools' +sudo gem install -N jekyll jekyll-gist jekyll-sitemap rouge +``` + +
    + +```bash +nix-shell doc/shell.nix --run ./test-gh-pages.sh +``` + +
    +
  • +
+ +{: start="2"} +2. Open the root directory of your git code branch and delete the `test-gh-pages-*/` folder if it exists. +3. Run the `test-gh-pages.sh` script to generate documentation and access it at your [http://localhost:4000/](http://127.0.0.1:4000/kaa/). + + ```bash + user@host:/kaa$ ./test-gh-pages.sh + ... + Server address: http://127.0.0.1:4000/kaa/ + Server running... press ctrl-c to stop. + ``` From 9fcb7da827e605b6fb93dc759a96df8775b1f584 Mon Sep 17 00:00:00 2001 From: Kirill Liubun Date: Mon, 21 Nov 2016 11:55:10 +0200 Subject: [PATCH 030/152] KAA-1567. Make application token unmodified --- .../admin/client/mvp/view/application/ApplicationViewImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java index 9f5e4497b9..5388488eeb 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java @@ -74,7 +74,7 @@ protected void initDetailsTable() { applicationName.setFocus(true); if (!create) { - applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, editable); + applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, false); applicationToken.setWidth("100%"); applicationToken.setEnabled(false); From 4cf26d708a794123131aca19eceab40483b1eb22 Mon Sep 17 00:00:00 2001 From: Acarus Date: Mon, 21 Nov 2016 12:58:10 +0200 Subject: [PATCH 031/152] Removed redundant lines and make the code compile. --- .../view/application/ApplicationViewImpl.java | 3 --- .../kaa/server/admin/client/util/Utils.java | 20 +++++++++---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java index 024ad1ae9f..b7c5c29f32 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/mvp/view/application/ApplicationViewImpl.java @@ -74,9 +74,6 @@ protected void initDetailsTable() { applicationName.setFocus(true); if (!create) { -// applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, editable); -// applicationToken.setWidth("100%"); -// applicationToken.setEnabled(false); applicationToken = new KaaAdminSizedTextBox(DEFAULT_TEXTBOX_SIZE * 2, false); applicationToken.setWidth("100%"); applicationToken.setEnabled(false); diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java index 5235691960..b554fd2b24 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java @@ -21,6 +21,8 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.http.client.Response; import com.google.gwt.i18n.client.DateTimeFormat; +import com.google.gwt.regexp.shared.MatchResult; +import com.google.gwt.regexp.shared.RegExp; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException; import com.google.gwt.user.client.rpc.StatusCodeException; @@ -43,8 +45,6 @@ import java.util.Collections; import java.util.Date; import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; public class Utils { @@ -56,9 +56,11 @@ public class Utils { public static final KaaAdminStyle kaaAdminStyle = resources.kaaAdminStyle(); public static final AvroUiStyle avroUiStyle = avroUiResources.avroUiStyle(); private static final int MAX_ERROR_LINE_LENGTH = 200; - private static Pattern emailPattern = Pattern.compile( - "^.+@.+$", Pattern.CASE_INSENSITIVE - ); + private static RegExp emailPattern = RegExp.compile("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]" + + "+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])" + + "*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?" + + "[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f" + + "\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])", "i"); private static final DateTimeFormat simpleDateFormat = getFormat("MM/dd/yyyy"); @@ -84,10 +86,6 @@ public static void handleException(Throwable caught, /** * Exception handler. - * - * @param caught the Throwable - * @param hasErrorMessage the has error message - * @param errorMessageCustomizer the error message customizer */ public static void handleException(Throwable caught, HasErrorMessage hasErrorMessage, @@ -182,8 +180,8 @@ public static boolean validateEmail(String mail) { if (mail == null || mail.length() == 0) { return false; } - Matcher matcher = emailPattern.matcher(mail); - return matcher.find(); + MatchResult matcher = emailPattern.exec(mail); + return matcher != null; } /** From bb70e11a1cf2da086e260e996ff3d29288cfdfca Mon Sep 17 00:00:00 2001 From: Acarus Date: Mon, 21 Nov 2016 13:03:41 +0200 Subject: [PATCH 032/152] Simplified the validateEmail function. --- .../org/kaaproject/kaa/server/admin/client/util/Utils.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java index b554fd2b24..fe4d2fef0b 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java @@ -177,11 +177,7 @@ public static String millisecondsToDateTimeString(long millis) { * @return boolean 'true' if email address is valid */ public static boolean validateEmail(String mail) { - if (mail == null || mail.length() == 0) { - return false; - } - MatchResult matcher = emailPattern.exec(mail); - return matcher != null; + return !(mail == null || mail.length() == 0) && emailPattern.exec(mail) != null; } /** From b5ebbaec64446f24faede23c631ff70363936955 Mon Sep 17 00:00:00 2001 From: Sergii PAradiuk Date: Mon, 21 Nov 2016 13:35:38 +0200 Subject: [PATCH 033/152] Fixed the problem with FindBotan.cmake on Beaglebone --- client/client-multi/client-cpp/Modules/FindBotan.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/client-multi/client-cpp/Modules/FindBotan.cmake b/client/client-multi/client-cpp/Modules/FindBotan.cmake index 351d9ed1f7..9fdcbe4c03 100644 --- a/client/client-multi/client-cpp/Modules/FindBotan.cmake +++ b/client/client-multi/client-cpp/Modules/FindBotan.cmake @@ -38,7 +38,7 @@ endif(NOT WIN32) find_path(BOTAN_INCLUDE_DIR botan/version.h HINTS - ${CMAKE_FIND_ROOT_PATH}/include + ${CMAKE_FIND_ROOT_PATH}/include/${BOTAN_VERSION_CODE} ${BOTAN_INCLUDE_DIRS}) # locate the library From b323a6b07fba8104aab3644951505e0262290f4b Mon Sep 17 00:00:00 2001 From: Dubland Date: Fri, 18 Nov 2016 19:08:41 +0200 Subject: [PATCH 034/152] APP-465: Add information about dependencies for host machine --- .../Using-Kaa-endpoint-SDKs/C++/SDK-Samsung-Artik-5/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Samsung-Artik-5/index.md b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Samsung-Artik-5/index.md index a51ff12c62..c473edb84f 100644 --- a/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Samsung-Artik-5/index.md +++ b/doc/Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Samsung-Artik-5/index.md @@ -45,6 +45,8 @@ The following third-party components must be installed before building the C++ S - Avro (1.7.5). - Botan (1.11). +Before installing the components for a target, install the dependencies for the [host machine]({{root_url}Programming-guide/Using-Kaa-endpoint-SDKs/C++/SDK-Linux/#Dependencies). + To build Avro version higher than 1.7.5, you will need Boost with the iostream library. To build Boost with iostreams, you will need to build the zlib and the libbz2 libraries as described below. From 0ffd589e33f3b6e33641e0ef2df2d68f3d850a6c Mon Sep 17 00:00:00 2001 From: Acarus Date: Mon, 21 Nov 2016 16:50:12 +0200 Subject: [PATCH 035/152] Added emails without subdomains to the validation regex. --- .../kaa/server/admin/client/util/Utils.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java index fe4d2fef0b..8b33508d4c 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java @@ -21,7 +21,6 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.http.client.Response; import com.google.gwt.i18n.client.DateTimeFormat; -import com.google.gwt.regexp.shared.MatchResult; import com.google.gwt.regexp.shared.RegExp; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException; @@ -56,11 +55,11 @@ public class Utils { public static final KaaAdminStyle kaaAdminStyle = resources.kaaAdminStyle(); public static final AvroUiStyle avroUiStyle = avroUiResources.avroUiStyle(); private static final int MAX_ERROR_LINE_LENGTH = 200; - private static RegExp emailPattern = RegExp.compile("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]" - + "+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])" - + "*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?" - + "[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f" - + "\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])", "i"); + private static RegExp emailPattern = RegExp.compile("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*" + + "|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@" + + "(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" + + "\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]" + + "|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])", "i"); private static final DateTimeFormat simpleDateFormat = getFormat("MM/dd/yyyy"); From 0331d6fc0ce6260b969014d56ab51b4b16325017 Mon Sep 17 00:00:00 2001 From: Oleh Klishch Date: Mon, 21 Nov 2016 18:37:58 +0200 Subject: [PATCH 036/152] Made regex final. --- .../java/org/kaaproject/kaa/server/admin/client/util/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java index 8b33508d4c..39ced357bb 100644 --- a/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java +++ b/server/node/src/main/java/org/kaaproject/kaa/server/admin/client/util/Utils.java @@ -55,7 +55,7 @@ public class Utils { public static final KaaAdminStyle kaaAdminStyle = resources.kaaAdminStyle(); public static final AvroUiStyle avroUiStyle = avroUiResources.avroUiStyle(); private static final int MAX_ERROR_LINE_LENGTH = 200; - private static RegExp emailPattern = RegExp.compile("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*" + private static final RegExp emailPattern = RegExp.compile("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*" + "|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@" + "(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" + "\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]" From f8c36e4038430db3c7e7d488202fba382befbb6e Mon Sep 17 00:00:00 2001 From: tmakhmudov Date: Mon, 21 Nov 2016 20:13:35 +0200 Subject: [PATCH 037/152] KAA-1632: Updated formatting style for names of files and folders. --- .../MariaDB-cluster-setup-guide/index.md | 6 +-- .../Cluster-setup/index.md | 12 +++--- .../Docker-deployment/index.md | 18 ++++----- .../Single-node-installation/index.md | 24 ++++++------ .../Troubleshooting/index.md | 6 +-- .../0.8.1-to-0.9.0/index.md | 2 +- .../Log-appenders/index.md | 22 ++++++----- .../Owner-verifiers/index.md | 20 +++++----- .../How-to-contribute/Style-guide/index.md | 13 +++++-- doc/Getting-started/index.md | 10 ++--- doc/Glossary/index.md | 4 +- .../Common-Type-Library/index.md | 4 +- .../Cassandra-log-appender/index.md | 2 +- .../Couchbase-log-appender/index.md | 2 +- .../File-system-log-appender/index.md | 16 ++++---- .../Flume-log-appender/index.md | 4 +- .../Kafka-log-appender/index.md | 8 ++-- .../MongoDB-log-appender/index.md | 2 +- .../Oracle-NoSQL-log-appender/index.md | 2 +- .../Rest-log-appender/index.md | 2 +- .../index.md | 14 +++---- .../Endpoint-groups/index.md | 6 +-- .../C++/SDK-Beaglebone/index.md | 2 +- .../C++/SDK-Samsung-Artik-5/index.md | 2 +- .../Using-Kaa-endpoint-SDKs/C++/index.md | 2 +- .../C/SDK-ESP8266/index.md | 16 ++++---- .../Using-Kaa-endpoint-SDKs/C/index.md | 8 ++-- .../Using-Kaa-endpoint-SDKs/Java/index.md | 8 ++-- .../Objective-C/index.md | 20 +++++----- .../Your-first-Kaa-application/index.md | 38 +++++++++---------- doc/Welcome/index.md | 2 +- 31 files changed, 153 insertions(+), 144 deletions(-) diff --git a/doc/Administration-guide/System-installation/Cluster-setup/MariaDB-cluster-setup-guide/index.md b/doc/Administration-guide/System-installation/Cluster-setup/MariaDB-cluster-setup-guide/index.md index 96c4fa4ea7..691ee78e54 100644 --- a/doc/Administration-guide/System-installation/Cluster-setup/MariaDB-cluster-setup-guide/index.md +++ b/doc/Administration-guide/System-installation/Cluster-setup/MariaDB-cluster-setup-guide/index.md @@ -78,7 +78,7 @@ If, for some reason, you do not already have `rsync` installed on your machines, #### MySQL Settings -First of all, open the `"/etc/mysql/my.cnf"` file and **comment** the following lines **on all the three nodes**: +First of all, open the `/etc/mysql/my.cnf` file and **comment** the following lines **on all the three nodes**: ```bash root@ubuntu-nodeX:~# nano /etc/mysql/my.cnf @@ -216,13 +216,13 @@ To fix this, copy the contents of the maintenance file to each individual node a basedir = /usr ``` -**They should be exactly the same now.** Save and close the files. +They should be exactly the same now. Save and close the files. ### Start MariaDB cluster To start the MariaDB cluster, do the following: -> Please check ports 4444 and 4567. This ports must be free and open for connections from hosts with other nodes - this is important for ```wsrep``` communication. +> Please check ports 4444 and 4567. This ports must be free and open for connections from hosts with other nodes - this is important for `wsrep` communication. 1. Stop the running MariaDB service by typing the following line on each of the nodes. diff --git a/doc/Administration-guide/System-installation/Cluster-setup/index.md b/doc/Administration-guide/System-installation/Cluster-setup/index.md index a1d6e7f9a6..c95dc97503 100644 --- a/doc/Administration-guide/System-installation/Cluster-setup/index.md +++ b/doc/Administration-guide/System-installation/Cluster-setup/index.md @@ -22,7 +22,7 @@ It includes instructions on how to configure the **Kaa node** service and the re To set up a Kaa cluster, you need to have at least 3 Linux nodes with the Kaa node service installed on each of them. See [Single node installation]({{root_url}}Administration-guide/System-installation/Single-node-installation/). -Every Kaa node service generates two sets of public.key and private.key file pairs for [Bootstrap]({{root_url}}Architecture-overview/#bootstrap-service) and [Operations]({{root_url}}Architecture-overview/#operations-service) services. +Every Kaa node service generates two sets of `public.key` and `private.key` file pairs for [Bootstrap]({{root_url}}Architecture-overview/#bootstrap-service) and [Operations]({{root_url}}Architecture-overview/#operations-service) services. Each Kaa server must have a unique RSA security key pair. To ensure that every Kaa node service uses a unique security key pair, you can compare checksums of the key files on different servers. @@ -141,7 +141,7 @@ $ sudo service kaa-node stop ### Configure Kaa node -To enable or disable the Kaa services (Bootstrap, Control or Operations), edit the corresponding properties in the /etc/kaa-node/conf/kaa-node.properties file. +To enable or disable the Kaa services (Bootstrap, Control or Operations), edit the corresponding properties in the `/etc/kaa-node/conf/kaa-node.properties` file. ```bash # Specifies if Control Service is enabled. @@ -203,7 +203,7 @@ Therefore, the node configuration will look as follows. zk_host_port_list=172.1.1.1:2181,172.2.2.2:2181,172.3.3.3:2181 ``` -For each node, specify the node ID in the /etc/zookeeper/myid file. +For each node, specify the node ID in the `/etc/zookeeper/myid` file. This file consists a single string of text representing the ID of the machine. The ID must be unique within the cluster and must be a value between 1 and 255. For this example, let's have **1**, **2**, and **3** as the IDs of the node 1, node 2, and node 3 accordingly. @@ -227,7 +227,7 @@ See [SQL database configuration]({{root_url}}Administration-guide/System-install To configure an SQL database in the cluster: -1. Set the SQL database host and port properties in the /etc/kaa-node/conf/sql-dao.properties configuration file. +1. Set the SQL database host and port properties in the `/etc/kaa-node/conf/sql-dao.properties` configuration file.