Commit 469d7364 authored by Kishen Maloor's avatar Kishen Maloor

Merge branch 'origin/master' into wes

Signed-off-by: Kishen Maloor's avatarKishen Maloor <kishen.maloor@intel.com>
parents b3ea948c 207bbfde
Pipeline #532 failed with stage
in 6 minutes and 11 seconds
......@@ -12,10 +12,12 @@
*.vcxproj text eol=crlf
*.vcxproj.filters text eol=crlf
*.vcxproj.user text eol=crlf
*.cmd text eol=crlf
*.bat text eol=crlf
# Declare files that will always have LF line endings on checkout.
*.pem text eol=lf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
\ No newline at end of file
*.jpg binary
port/android/client
port/android/server
port/android/temp_sensor
port/android/simpleclient
port/android/simpleserver
port/android/server_collections_linux
port/android/client_collections_linux
port/android/client_block_linux
port/android/server_block_linux
port/android/smart_home_server_linux
port/android/multi_device_client
port/android/multi_device_server
port/android/onboarding_tool
port/android/server_multithread_linux
port/android/client_multithread_linux
port/android/smart_lock
port/android/libiotivity-lite-client.*
port/android/libiotivity-lite-server.*
port/android/libiotivity-lite-client-server.*
port/android/*.so
port/linux/client
port/linux/server
port/linux/temp_sensor
......@@ -51,6 +72,7 @@ port/openthread/output
*.gcno
.clang-format
_clang-format
whitespace_commit_checker.sh
port/linux/platformtest
port/linux/storage_test
port/linux/apitest
......
---
image: gcc
Linux_Secured_Test:
stage: build
before_script:
- apt update && apt -y install make autoconf
- set -o pipefail
- export VERBOSE=false
- export CCACHE_DISABLE=false
script:
- cd port/linux
- make DYNAMIC=1 IPV4=1 TCP=1 SECURE=1 test
Linux_Unsecured_Test:
stage: build
before_script:
- apt update && apt -y install make autoconf
- set -o pipefail
- export VERBOSE=false
- export CCACHE_DISABLE=false
script:
- cd port/linux
- make DYNAMIC=1 IPV4=1 TCP=1 SECURE=0 test
Android_build:
stage: build
image: openjdk:8-jdk
before_script:
- apt-get --quiet update --yes
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 make autoconf swig patch
- wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
- unzip -d android-sdk-linux android-sdk.zip
- echo y | android-sdk-linux/tools/bin/sdkmanager "ndk-bundle" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-28" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
- echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;28.0.2" >/dev/null
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
# temporarily disable checking for EPIPE error and use yes to accept all licenses
- set +o pipefail
- yes | android-sdk-linux/tools/bin/sdkmanager --licenses
- set -o pipefail
- ./android-sdk-linux/ndk-bundle/build/tools/make_standalone_toolchain.py --arch arm --api 23 --install-dir ~/android-arm-23
script:
- cd port/android
- make DYNAMIC=1 TCP=1 IPV4=1 SECURE=1 PKI=1 CLOUD=1 JAVA=1 DEBUG=0
whitespace_and_doxygen:
stage: build
before_script:
- apt update && apt -y install make autoconf doxygen clang-format
script:
- clang-format --version
- doxygen --version
- cp tools/_clang-format _clang-format
- cp tools/whitespace_commit_checker.sh whitespace_commit_checker.sh
- ./whitespace_commit_checker.sh
- cd tools
- ./build_doc.sh
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -32,7 +32,7 @@ Contents
IoTivity-Lite Architecture
---------------------------------
.. image:: IoTivityLite-Arch.png
.. image:: Architecture.png
:scale: 100%
:alt: IoTivity-Lite Architecture
:align: center
......@@ -145,6 +145,10 @@ apps/*
service/*
contains OCF services
swig/*
contains instructions and code to build Java language bindings using
the SWIG tool.
Setup source tree
-----------------
......@@ -216,3 +220,94 @@ This needs to be present in one of the include paths.
Pre-populated (sample) configurations for the sample applications for all
targets are present in ``port/<OS>/oc_config.h``.
Onboarding and Provisioning
----------------------------
Runing the onboarding tool
~~~~~~~~~~~~~~~~~~~~~~~~~~~
At this time there are three versions of the onboarding tool. The command line C version, the
command line Java version, and the GUI Android version. Both command line versions are identical.
It does not matter which version of the onboarding tool is used.
The C version of the onboarding tool can be found in ``<iotivity-lite>/port/linux`` see Linux build
instructions.
A Java version of the onboarding-tool can be found in
``<iotivity-lite>/swig/apps/java_onboarding_tool``
The following instructions assume the onboarding tool has been built and can run.
Simple Step-by-Step guide for onboarding and provisioning
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This guide assumes you are starting one discoverable device at a time. Multiple devices can be
discovered and onboarded at the same time however it becomes the responsibility of the user to
figure out which UUID belongs to which device.
Once you have successfully onboarded the samples the first time using the following step-by-step
options feel free to RESET the devices and play around with different provisioning options.
The below steps use the command line version of the onboarding tool. The steps for the Android
onboarding tool is very similar but are not described here.
(Step 1) Onboard and Provision the Server
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are multiple methods to onboard and provision server and client samples. Below is given one
of the many possible ways the this could be done.
- start the server sample
- start onboarding tool it will print a menu with many option
- Type ``1`` **Enter** to ``Discover un-owned devices``
- Type ``8`` **Enter** to *Take ownership of device*
+ Type ``0`` **Enter**. If you have multiple unowned devices you will have to select the correct
device from the list.
- Type ``4`` **Enter** to ``Discover owned devices`` the device you just took ownership of should be
listed.
- Type ``13`` **Enter** to ``Provision ACE2``. There are many ways to properly provision the device.
This will give instruction for using wildcard provisioning.
+ Type ``0`` **Enter**. If you have multiple unowned devices you will have to select the correct
device from the list.
+ Type ``1`` **Enter** for an ``auth-crypt`` ACE
+ Type ``1`` **Enter** in response to ``Enter number of resources in this ACE:``
+ Type ``0`` **Enter** in response to ``Have resource href? [0-No, 1-Yes]:``
+ Type ``1`` **Enter** in response to ``Set wildcard resource? [0-No, 1-Yes]:``
+ Type ``2`` **Enter** to select the ``All discoverable resources`` option
+ Type ``0`` **Enter** in response to ``Enter number of resource types [0-None]:``
+ Type ``0`` **Enter** in response to ``Enter number of interfaces [0-None]``
+ Type ``0`` **Enter** for CREATE, ``1`` **Enter** for RETRIEVE, ``1`` **Enter** for UPDATE,
``0`` **Enter** for DELETE, and ``1`` **Enter** for NOTIFY.
+ ``Successfully issued request to provision ACE`` should be printed on the screen upon success
(Step 2) Onboard the client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- start the client sample
- Type ``1`` **Enter** to ``Discover un-owned devices``
- Type ``8`` **Enter** to *Take ownership of device*
+ Type ``0`` **Enter**. If you have multiple unowned devices you will have to select the correct
device from the list.
- Type ``2`` **Enter** to ``Discover owned devices`` the server and client should be listed
(Step 3) Pair Server and Client
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Start the client and server samples
- Type ``12`` **Enter** to ``Provision pair-wise credentials``
- Type ``0`` **Enter** ``1`` **Enter** to pair the client and server. If you have multiple owned
devices you will have to select the correct devices from the list.
(Step 4) Restart and Test
~~~~~~~~~~~~~~~~~~~~~~~~~~
The samples should be onboarded and provisioned. Restart the server and then the client they should
discover each other and run without difficulty.
Send Feedback
-------------------------------------------------
Questions
`IoTivity-Lite Developer Mailing List <https://iotivity.groups.io/g/iotivity-dev>`_
Bugs
`Gitlab issues <https://gitlab.iotivity.org/iotivity/iotivity-lite/issues>`_
......@@ -108,6 +108,8 @@ cloud_deregister_on_reset_internal(oc_cloud_context_t *ctx,
(void)status;
(void)data;
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
ctx->last_error = 0;
......@@ -151,6 +153,7 @@ oc_cloud_provision_conf_resource(oc_cloud_context_t *ctx, const char *server,
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
......@@ -167,6 +170,8 @@ oc_cloud_provision_conf_resource(oc_cloud_context_t *ctx, const char *server,
ctx->store.status = OC_CLOUD_INITIALIZED;
ctx->cps = OC_CPS_READYTOREGISTER;
cloud_store_dump_async(&ctx->store);
if (ctx->cloud_manager) {
cloud_reconnect(ctx);
}
......@@ -180,6 +185,7 @@ cloud_update_by_resource(oc_cloud_context_t *ctx,
{
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
cloud_store_initialize(&ctx->store);
cloud_manager_stop(ctx);
if (data->auth_provider && data->auth_provider_len) {
......@@ -307,6 +313,8 @@ oc_cloud_manager_stop(oc_cloud_context_t *ctx)
cloud_manager_stop(ctx);
cloud_store_initialize(&ctx->store);
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
ctx->cloud_manager = false;
return 0;
}
......@@ -350,6 +358,7 @@ oc_cloud_shutdown(void)
cloud_store_deinit(&ctx->store);
cloud_close_endpoint(ctx->cloud_ep);
oc_free_endpoint(ctx->cloud_ep);
oc_list_remove(cloud_context_list, ctx);
oc_memb_free(&cloud_context_pool, ctx);
OC_DBG("cloud_shutdown for %d", (int)device);
}
......
......@@ -28,8 +28,7 @@
#include "oc_cloud.h"
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
typedef struct cloud_conf_update_t
......
......@@ -162,6 +162,8 @@ _register_handler(oc_cloud_context_t *ctx, oc_client_response_t *data)
if (!ci_server || oc_string_len(ctx->store.ci_server) != size ||
strcmp(ci_server, value)) {
cloud_close_endpoint(ctx->cloud_ep);
memset(ctx->cloud_ep, 0, sizeof(oc_endpoint_t));
ctx->cloud_ep_state = OC_SESSION_DISCONNECTED;
}
cloud_set_string(&ctx->store.ci_server, value, size);
}
......
......@@ -21,43 +21,20 @@
#include "oc_api.h"
#include "oc_cloud_internal.h"
#include "oc_rep.h"
#include "oc_config.h"
#ifdef OC_DYNAMIC_ALLOCATION
#include <stdlib.h>
#endif /* OC_DYNAMIC_ALLOCATION */
#ifndef OC_STORAGE
#error Preprocessor macro OC_CLOUD is defined but OC_STORAGE is not defined \
check oc_config.h and make sure OC_STORAGE is defined if OC_CLOUD is defined.
#endif
#define CLOUD_STORE_NAME "cloud"
#define CLOUD_TAG_MAX (32)
#ifndef OC_SECURITY
// dummy storage
int
oc_storage_config(const char *store)
{
(void)st