Update error handling logic in EnrolleeSecurity.
authorParkhi <h_w.park@samsung.com>
Mon, 20 Feb 2017 06:09:05 +0000 (15:09 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 20 Feb 2017 08:26:42 +0000 (08:26 +0000)
 - OCSecure::discoverSingleDevice API is updated with another return value.(https://gerrit.iotivity.org/gerrit/#/c/17361/)
   According that patch, EnrolleeSecurity::discoverTargetSecureResource api is updated additional error handling logic.

Change-Id: If0e9c2e1000c1c754386c77f204a7bdd5bd0923b
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17363
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp

index 71f1b16..dee43d3 100755 (executable)
@@ -596,7 +596,6 @@ namespace OIC
                 std::string GattAddress = getResourceDeviceAddress(m_ocResource->host());
                 if(!GattAddress.empty())
                 {
-
                     result = OCSecure::discoverSingleDeviceInUnicast(ES_SEC_DISCOVERY_TIMEOUT,
                                                             &uuid,
                                                             GattAddress,
@@ -604,7 +603,7 @@ namespace OIC
                                                             m_securedResource);
                     if(result != OC_STACK_OK)
                     {
-                        return ES_ERROR;
+                        return ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
                     }
                 }
                 else
@@ -620,7 +619,7 @@ namespace OIC
                                                         m_securedResource);
                 if(result != OC_STACK_OK)
                 {
-                    return ES_ERROR;
+                    return ES_SECURE_RESOURCE_DISCOVERY_FAILURE;
                 }
             }