Fixed broken platform and device discovery
authorOmkar Hegde <omkar.m.hegde@intel.com>
Wed, 15 Jul 2015 23:54:56 +0000 (16:54 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 16 Jul 2015 01:36:16 +0000 (01:36 +0000)
The stack result was not being set on forming
the payload. Also, the device payload was being set
into the incorrect variable.

Change-Id: I18875b9ba0bd9776f0914317617c3c5d66ed64f8
Signed-off-by: Omkar Hegde <omkar.m.hegde@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1681
Reviewed-by: Erich Keane <erich.keane@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
resource/csdk/stack/src/ocresource.c

index fb7cdad..f5984e9 100644 (file)
@@ -536,16 +536,24 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
             {
                 discoveryResult = OC_STACK_NO_MEMORY;
             }
+            else
+            {
+                discoveryResult = OC_STACK_OK;
+            }
     }
     else if (virtualUriInRequest == OC_PLATFORM_URI)
     {
-            OCPlatformPayload* payload = OCPlatformPayloadCreate(
+            payload = (OCPayload*)OCPlatformPayloadCreate(
                     OC_RSRVD_PLATFORM_URI,
                     &savedPlatformInfo);
             if (!payload)
             {
                 discoveryResult = OC_STACK_NO_MEMORY;
             }
+            else
+            {
+                discoveryResult = OC_STACK_OK;
+            }
     }
 
     #ifdef WITH_PRESENCE