Retrieve on /oic/res?rt=oic.d.xxx should return as per oic.if.ll
authorZiran Sun <ziran.sun@samsung.com>
Wed, 1 Jun 2016 09:25:26 +0000 (10:25 +0100)
committerZiran Sun <ziran.sun@samsung.com>
Wed, 22 Jun 2016 09:13:17 +0000 (09:13 +0000)
rather than returning as per oic.if.baseline.

This change set the default interface of /oic/res as oic.if.ll when
no interface is specified in the enquiry.

JIRA issue: https://jira.iotivity.org/browse/IOT-1103

Change-Id: I7694be578aec57b640ba6fdc84c4fec472fe92f5
Signed-off-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8415
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Mushfiqul Islam <i.mushfiq@samsung.com>
resource/csdk/stack/src/ocresource.c

index ea051a4..5349740 100755 (executable)
@@ -752,13 +752,6 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
                     for (; resource && discoveryResult == OC_STACK_OK; resource = resource->next)
                     {
                         bool result = false;
-                        if (resource->resourceProperties & OC_EXPLICIT_DISCOVERABLE)
-                        {
-                            if (resourceTypeQuery && resourceMatchesRTFilter(resource, resourceTypeQuery))
-                            {
-                                result = true;
-                            }
-                        }
                         if (resource->resourceProperties & OC_DISCOVERABLE)
                         {
                             result = true;
@@ -773,8 +766,7 @@ static OCStackResult HandleVirtualResource (OCServerRequest *request, OCResource
                 }
                 else
                 {
-                    if ((interfaceQuery && (0 != strcmp(interfaceQuery, OC_RSRVD_INTERFACE_LL))) ||
-                        !interfaceQuery)
+                    if (interfaceQuery && (0 != strcmp(interfaceQuery, OC_RSRVD_INTERFACE_LL)))
                     {
                         discPayload->uri = OICStrdup(OC_RSRVD_WELL_KNOWN_URI);
                         VERIFY_NON_NULL(discPayload->uri, ERROR, OC_STACK_NO_MEMORY);