From 17f82e70a3815536a6cd3eb6aa4dc0c3a49cdcad Mon Sep 17 00:00:00 2001 From: Sudarshan Prasad Date: Thu, 25 Dec 2014 02:31:14 -0800 Subject: [PATCH] Merge from master to CA branch Change-Id: If6c0c7db4d8212ce74e523ca03c0ebd7eca024d1 Signed-off-by: Sudarshan Prasad --- resource/csdk/occoap/src/occoap.c | 1 + .../samples/linux/SimpleClientServer/occlient.cpp | 1 + resource/examples/makefile | 2 - resource/include/OCPlatform.h | 4 +- resource/include/OCPlatform_impl.h | 1 + resource/src/InProcClientWrapper.cpp | 3 +- resource/src/OCPlatform.cpp | 41 ++++++----- .../protocol-plugin/sample-app/linux/SConscript | 1 + service/soft-sensor-manager/SConscript | 3 +- service/things-manager/Readme.txt | 83 ++++++++++++++++++++++ 10 files changed, 117 insertions(+), 23 deletions(-) create mode 100755 service/things-manager/Readme.txt diff --git a/resource/csdk/occoap/src/occoap.c b/resource/csdk/occoap/src/occoap.c index 491d125..20f40ed 100644 --- a/resource/csdk/occoap/src/occoap.c +++ b/resource/csdk/occoap/src/occoap.c @@ -338,6 +338,7 @@ static void HandleCoAPResponses(struct coap_context_t *ctx, (OCDevAddr *) &(rcvdResponse->remote), sequenceNumber, NULL); VERIFY_SUCCESS(result, OC_STACK_OK); + result = FormOCResponse(&response, NULL, maxAge, fullUri, rcvdUri, &rcvdToken, clientResponse, bufRes); VERIFY_SUCCESS(result, OC_STACK_OK); diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp index 78465d3..343496a 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp @@ -416,6 +416,7 @@ int InitPresence() return result; } #endif + int InitGetRequestToUnavailableResource() { OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__); diff --git a/resource/examples/makefile b/resource/examples/makefile index bc411b8..2377f40 100755 --- a/resource/examples/makefile +++ b/resource/examples/makefile @@ -119,8 +119,6 @@ devicediscoveryserver: devicediscoveryserver.cpp devicediscoveryclient: devicediscoveryclient.cpp $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OUT_DIR)/$@ devicediscoveryclient.cpp $(CXX_INC) $(CXX_LIBS) - - ocicuc_target: cd ocicuc && $(MAKE) apps diff --git a/resource/include/OCPlatform.h b/resource/include/OCPlatform.h index af4c089..d83dc67 100644 --- a/resource/include/OCPlatform.h +++ b/resource/include/OCPlatform.h @@ -140,12 +140,12 @@ namespace OC OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI, uint8_t connectivityType, FindDeviceCallback deviceInfoHandler, QualityOfService QoS); -#else +#endif OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI, FindDeviceCallback deviceInfoHandler); OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI, FindDeviceCallback deviceInfoHandler, QualityOfService QoS); -#endif + /** * This API registers a resource with the server * NOTE: This API applies to server side only. diff --git a/resource/include/OCPlatform_impl.h b/resource/include/OCPlatform_impl.h index b4d4810..46bc9d9 100644 --- a/resource/include/OCPlatform_impl.h +++ b/resource/include/OCPlatform_impl.h @@ -173,6 +173,7 @@ namespace OC OCStackResult getDeviceInfo(const std::string& host, const std::string& deviceURI, FindDeviceCallback deviceInfoHandler, QualityOfService QoS); #endif + /** * This API registers a resource with the server * NOTE: This API applies to server side only. diff --git a/resource/src/InProcClientWrapper.cpp b/resource/src/InProcClientWrapper.cpp index 35ff469..c2762bf 100644 --- a/resource/src/InProcClientWrapper.cpp +++ b/resource/src/InProcClientWrapper.cpp @@ -148,6 +148,7 @@ namespace OC try { + #ifdef CA_INT ListenOCContainer container(clientWrapper, *clientResponse->addr, clientResponse->connType, requestStream); @@ -253,12 +254,10 @@ namespace OC OCStackResult result; OCCallbackData cbdata = {0}; - ClientCallbackContext::DeviceListenContext* context = new ClientCallbackContext::DeviceListenContext(); context->callback = callback; context->clientWrapper = shared_from_this(); - cbdata.context = static_cast(context); cbdata.cb = listenDeviceCallback; cbdata.cd = [](void* c){delete static_cast(c);}; diff --git a/resource/src/OCPlatform.cpp b/resource/src/OCPlatform.cpp index fa9ffc4..c240480 100644 --- a/resource/src/OCPlatform.cpp +++ b/resource/src/OCPlatform.cpp @@ -118,22 +118,6 @@ namespace OC return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, connectivityType, deviceInfoHandler, QoS); } -#else - OCStackResult getDeviceInfo(const std::string& host, - const std::string& deviceURI, - FindDeviceCallback deviceInfoHandler) - { - return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, deviceInfoHandler); - } - - OCStackResult getDeviceInfo(const std::string& host, - const std::string& deviceURI, - FindDeviceCallback deviceInfoHandler, - QualityOfService QoS) - { - return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, - deviceInfoHandler, QoS); - } #endif OCStackResult findResource(const std::string& host, @@ -179,6 +163,31 @@ namespace OC #endif } + OCStackResult getDeviceInfo(const std::string& host, + const std::string& deviceURI, + FindDeviceCallback deviceInfoHandler) + { +#ifdef CA_INT + return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, OC_WIFI | OC_ETHERNET, + deviceInfoHandler); +#else + return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, deviceInfoHandler); +#endif + } + + OCStackResult getDeviceInfo(const std::string& host, + const std::string& deviceURI, + FindDeviceCallback deviceInfoHandler, + QualityOfService QoS) + { +#ifdef CA_INT + return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, OC_WIFI | OC_ETHERNET, + deviceInfoHandler, QoS); +#else + return OCPlatform_impl::Instance().getDeviceInfo(host, deviceURI, deviceInfoHandler, QoS); +#endif + } + OCStackResult registerResource(OCResourceHandle& resourceHandle, std::string& resourceURI, diff --git a/service/protocol-plugin/sample-app/linux/SConscript b/service/protocol-plugin/sample-app/linux/SConscript index 8b3cf05..cbbbac1 100644 --- a/service/protocol-plugin/sample-app/linux/SConscript +++ b/service/protocol-plugin/sample-app/linux/SConscript @@ -35,3 +35,4 @@ mqttclient = sample_env.Program('mqtt/mqttclient', 'mqtt/mqttclient.cpp') Alias('mqttclient', mqttclient) env.AppendTarget('mqttclient') + diff --git a/service/soft-sensor-manager/SConscript b/service/soft-sensor-manager/SConscript index 687b690..7ad090a 100644 --- a/service/soft-sensor-manager/SConscript +++ b/service/soft-sensor-manager/SConscript @@ -76,8 +76,9 @@ ssmcore_env.AppendUnique(CPPPATH = [ import os.path +SSMINTERFACE_PATH = 'SSMCore/src/SSMInterface/' + if target_os != 'android': - SSMINTERFACE_PATH = 'SSMCore/src/SSMInterface/' omit_src = ['SSMCore_JNI.cpp'] ssminterface_src = [f for f in env.Glob(SSMINTERFACE_PATH + '*.cpp') if os.path.basename(f.path) not in omit_src] else : diff --git a/service/things-manager/Readme.txt b/service/things-manager/Readme.txt new file mode 100755 index 0000000..15cb473 --- /dev/null +++ b/service/things-manager/Readme.txt @@ -0,0 +1,83 @@ +/****************************************************************** +* +* Copyright 2014 Samsung Electronics All Rights Reserved. +* +* +* +* 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. +* +******************************************************************/ + + +=============================================================================== +== How to Build Things Manager == +=============================================================================== + +Once the source code is downloaded in your local specific folder, you may follow +the steps to build and execute Things Manager and its applications. +In this context, we assume that the code was downloaded into 'oic' folder. + +======================================= +1. Download source code +======================================= + +From the url, you can download Things Manager source code; +https://www.iotivity.org/downloads + +Once you download the codes, and Make sure that the downloaded code structure is as follows; +Four directories for oic; extlib, resource, service, and tools. + +oic/extlib +oic/resource +oic/service +oic/tools + +The path for Things Manager is as following; + +oic/service/things-manager + +The things-manager directory includes following sub directories; + +Directories Description +oic/service/things-manager/sdk : The SDK APIs for applications is located. + The main functionality of this SDK is to provide + developer-friendly APIs of Things manager component + to application developers. +oic/service/things-manager/sampleapp : It is the sample application on Ubuntu. + Basically, the input and output of application + on Ubuntu are displayed in the console. +oic/service/things-manager/build : Whole library files and binary files would be made + in this folder + + + +======================================= +2. Build +======================================= +Simply, type "make" to build things manager as follows; + +/oic/service/things-manager/build/linux$ make + +======================================= +3. Build the API reference documentation +======================================= +To build the API reference documentation: +a. Navigate to oic-resource/docs folder using the terminal window. +b. Run the following command: + + $ doxygen + +This command builds the API reference documentation in the output directory. + +The output directory for this command is oic-resource/docs/html/index.html. + -- 2.7.4