[IOT-1782] fixing protocol enumeration for use in introspection response.
authorSrikrishna Gurugubelli <srikguru@microsoft.com>
Fri, 27 Jan 2017 18:11:18 +0000 (10:11 -0800)
committerZiran Sun <ziran.sun@samsung.com>
Mon, 30 Jan 2017 12:39:22 +0000 (12:39 +0000)
Change-Id: I06a55b629a383ba1f47dab384bae3e45097b51af
Signed-off-by: Srikrishna Gurugubelli <srikguru@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16841
Reviewed-by: Alex Kelley <alexke@microsoft.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
resource/csdk/stack/src/ocresource.c

index 2cd0681..383bf42 100755 (executable)
@@ -764,15 +764,15 @@ OCStackResult BuildIntrospectionResponseRepresentation(const OCResource *resourc
         goto exit;
     }
 
-    // figure out which protocols this endpoint supports
-    if (resourcePtr->endpointType | OC_COAP)
+    // Figure out which protocols this endpoint supports
+    if (resourcePtr->endpointType & OC_COAP)
     {
         if (OC_STACK_OK == AddProtocolToLL(&protoLL, COAP_STR))
         {
             dimensions[0]++;
         }
     }
-    if (resourcePtr->endpointType | OC_COAPS)
+    if (resourcePtr->endpointType & OC_COAPS)
     {
         if (OC_STACK_OK == AddProtocolToLL(&protoLL, COAPS_STR))
         {
@@ -780,14 +780,14 @@ OCStackResult BuildIntrospectionResponseRepresentation(const OCResource *resourc
         }
     }
 #ifdef TCP_ADAPTER
-    if (resourcePtr->endpointType | OC_COAP_TCP)
+    if (resourcePtr->endpointType & OC_COAP_TCP)
     {
         if (OC_STACK_OK == AddProtocolToLL(&protoLL, COAP_STR))
         {
             dimensions[0]++;
         }
     }
-    if (resourcePtr->endpointType | OC_COAPS_TCP)
+    if (resourcePtr->endpointType & OC_COAPS_TCP)
     {
         if (OC_STACK_OK == AddProtocolToLL(&protoLL, COAPS_STR))
         {
@@ -796,14 +796,14 @@ OCStackResult BuildIntrospectionResponseRepresentation(const OCResource *resourc
     }
 #endif
 #ifdef HTTP_ADAPTER
-    if (resourcePtr->endpointType | OC_HTTP)
+    if (resourcePtr->endpointType & OC_HTTP)
     {
         if (OC_STACK_OK == AddProtocolToLL(&protoLL, HTTP_STR))
         {
             dimensions[0]++;
         }
     }
-    if (resourcePtr->endpointType | OC_HTTPS)
+    if (resourcePtr->endpointType & OC_HTTPS)
     {
         if (OC_STACK_OK == AddProtocolToLL(&protoLL, HTTPS_STR))
         {
@@ -812,7 +812,7 @@ OCStackResult BuildIntrospectionResponseRepresentation(const OCResource *resourc
     }
 #endif
 #ifdef EDR_ADAPTER
-    if (resourcePtr->endpointType | OC_COAP_RFCOMM)
+    if (resourcePtr->endpointType & OC_COAP_RFCOMM)
     {
         if (OC_STACK_OK == AddProtocolToLL(&protoLL, COAP_STR))
         {