Fixed bug to send discovery request as Non-Confirmable request
authorSachin Agrawal <sachin.agrawal@intel.com>
Mon, 6 Apr 2015 00:49:18 +0000 (17:49 -0700)
committerErich Keane <erich.keane@intel.com>
Tue, 7 Apr 2015 22:24:05 +0000 (22:24 +0000)
Discovery requests needs to be send as Non-Con requests. Recent change
was failing some of the test cases supported by sample apps.

Change-Id: Ic6a701eaabdcf51cc388618c1afc07baefc3362f
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/651
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Shilpa Sodani <shilpa.a.sodani@intel.com>
Reviewed-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp
resource/csdk/stack/samples/linux/secure/occlientbasicops.h

index e5aad51..186a5f8 100644 (file)
@@ -236,7 +236,7 @@ int InitGetRequest(OCQualityOfService qos)
             OC_HIGH_QOS:OC_LOW_QOS, getReqCB, NULL, 0));
 }
 
-int InitDiscovery(OCQualityOfService qos)
+int InitDiscovery()
 {
     OCStackResult ret;
     OCCallbackData cbData;
@@ -279,7 +279,7 @@ int InitDiscovery(OCQualityOfService qos)
         szQueryUri);
 
     ret = OCDoResource(NULL, OC_REST_GET, szQueryUri, 0, 0,
-            discoveryReqConnType, ((qos == OC_HIGH_QOS) ? OC_HIGH_QOS: OC_LOW_QOS),
+            discoveryReqConnType, OC_LOW_QOS,
             &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {
@@ -333,14 +333,7 @@ int main(int argc, char* argv[])
         return 0;
     }
 
-    if(TEST_CASE == TEST_NON_CON_OP)
-    {
-        InitDiscovery(OC_LOW_QOS);
-    }
-    else if(TEST_CASE == TEST_CON_OP)
-    {
-        InitDiscovery(OC_HIGH_QOS);
-    }
+    InitDiscovery();
 
     timeout.tv_sec  = 0;
     timeout.tv_nsec = 100000000L;
index 8f8326c..8dee2f2 100644 (file)
@@ -56,7 +56,7 @@ std::string getQueryStrForGetPut(OCClientResponse * clientResponse);
 int InitPutRequest(OCQualityOfService qos);
 int InitGetRequest(OCQualityOfService qos);
 int InitPostRequest(OCQualityOfService qos);
-int InitDiscovery(OCQualityOfService qos);
+int InitDiscovery();
 
 /* Function to retrieve ip address, port no. of the server
  *  and query for the operations to be performed.