From: Sachin Agrawal Date: Mon, 6 Apr 2015 00:49:18 +0000 (-0700) Subject: Fixed bug to send discovery request as Non-Confirmable request X-Git-Tag: 1.2.0+RC1~1855^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd93b81fdb968169a5bd83560ca6b6499e11ba28;p=platform%2Fupstream%2Fiotivity.git Fixed bug to send discovery request as Non-Confirmable request 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/651 Tested-by: jenkins-iotivity Reviewed-by: Shilpa Sodani Reviewed-by: Sakthivel Samidurai Reviewed-by: Erich Keane --- diff --git a/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp b/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp index e5aad51..186a5f8 100644 --- a/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp +++ b/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp @@ -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; diff --git a/resource/csdk/stack/samples/linux/secure/occlientbasicops.h b/resource/csdk/stack/samples/linux/secure/occlientbasicops.h index 8f8326c..8dee2f2 100644 --- a/resource/csdk/stack/samples/linux/secure/occlientbasicops.h +++ b/resource/csdk/stack/samples/linux/secure/occlientbasicops.h @@ -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.