From f6009a4d3ec78157e7eb2caacc64dc0210c419ac Mon Sep 17 00:00:00 2001 From: Harish Kumara Marappa Date: Sat, 25 Apr 2015 00:23:31 +0530 Subject: [PATCH] Fix for issue of Tizen TM sample not working Modified the code for selecting OC_WIFI connectivity for android and tizen and selecting OC_ETHERNET for other platforms. Change-Id: I8533f43690d9cd80d85b17a4e8e384406308e67e Signed-off-by: Harish Kumara Marappa Reviewed-on: https://gerrit.iotivity.org/gerrit/829 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka Reviewed-by: HyunJun Kim Reviewed-by: Uze Choi --- resource/csdk/stack/src/oicgroup.c | 8 ++++++++ service/things-manager/sdk/src/ThingsConfiguration.cpp | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/resource/csdk/stack/src/oicgroup.c b/resource/csdk/stack/src/oicgroup.c index 99c3a55..e2642e8 100755 --- a/resource/csdk/stack/src/oicgroup.c +++ b/resource/csdk/stack/src/oicgroup.c @@ -905,8 +905,16 @@ OCStackResult SendAction(OCDoHandle *handle, const char *targetUri, cbdata.cd = NULL; cbdata.context = (void*)DEFAULT_CONTEXT_VALUE; +// TODO: Selecting OC_WIFI for android, tizen and OC_ETHERNET for linux platform. +// It is temporary change as OC_ALL is not working currently. Remove this code and use OC_ALL +// once it is functioning. +#if defined(__ANDROID__) || defined(__TIZEN__) + return OCDoResource(handle, OC_REST_PUT, targetUri, + NULL, (char *) action, OC_WIFI, OC_NA_QOS, &cbdata, NULL, 0); +#else return OCDoResource(handle, OC_REST_PUT, targetUri, NULL, (char *) action, OC_ETHERNET, OC_NA_QOS, &cbdata, NULL, 0); +#endif } OCStackResult DoAction(OCResource* resource, OCActionSet* actionset, diff --git a/service/things-manager/sdk/src/ThingsConfiguration.cpp b/service/things-manager/sdk/src/ThingsConfiguration.cpp index 1026e00..82b8d5e 100755 --- a/service/things-manager/sdk/src/ThingsConfiguration.cpp +++ b/service/things-manager/sdk/src/ThingsConfiguration.cpp @@ -325,10 +325,17 @@ namespace OIC // For this reason, we create the resource objects. std::string host = getHostFromURI(oit->getUri()); + +// TODO: Selecting OC_WIFI for android, tizen and OC_ETHERNET for linux platform. +// It is temporary change as OC_ALL is not working currently. Remove this code and use OC_ALL +// once it is functioning. +#if defined(__ANDROID__) || defined(__TIZEN__) + tempResource = OCPlatform::constructResourceObject(host, uri, OC_WIFI, true, + oit->getResourceTypes(), m_if); +#else tempResource = OCPlatform::constructResourceObject(host, uri, OC_ETHERNET, true, oit->getResourceTypes(), m_if); - // tempResource = OCPlatform::constructResourceObject(host, uri, OC_WIFI, true, - // oit->getResourceTypes(), m_if); +#endif p_resources.push_back(tempResource); } -- 2.7.4