Fix for issue of Tizen TM sample not working
authorHarish Kumara Marappa <h.marappa@samsung.com>
Fri, 24 Apr 2015 18:53:31 +0000 (00:23 +0530)
committerUze Choi <uzchoi@samsung.com>
Mon, 27 Apr 2015 08:25:48 +0000 (08:25 +0000)
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 <h.marappa@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/829
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
Reviewed-by: HyunJun Kim <hyunjun2.kim@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
resource/csdk/stack/src/oicgroup.c
service/things-manager/sdk/src/ThingsConfiguration.cpp

index 99c3a55..e2642e8 100755 (executable)
@@ -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,
index 1026e00..82b8d5e 100755 (executable)
@@ -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);
         }