[Easy-setup] Commented check for Intended resource 75/6075/4
authorJay Sharma <jay.sharma@samsung.com>
Mon, 21 Mar 2016 03:37:25 +0000 (09:07 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Mon, 21 Mar 2016 06:53:08 +0000 (06:53 +0000)
- commented the condition for checking the intended resource in
  RemoteEnrolleeResource class.

Change-Id: I937c07d151eb503e238215ec60abe69ba83dde14
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/6075
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/easy-setup/mediator/richsdk/src/RemoteEnrolleeResource.cpp

index 1a6a1ae..f3414f6 100755 (executable)
@@ -266,24 +266,14 @@ namespace OIC
                     OIC_LOG_V (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
                             "Host address of the resource: %s", hostAddress.c_str());
 
-                    std::size_t foundIP =
-                        hostAddress.find(
-                                std::string(m_wifiOnboardingconn.ipAddress));
-
-                    if(resourceURI == ES_PROV_RES_URI && foundIP!=std::string::npos)
-                    {
-                        m_ocResource = resource;
-                        m_discoveryResponse = true;
-
-                        OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG,
-                                "Found the device with the resource");
-
-                        return;
-                    }
-                    else
-                    {
-                        OIC_LOG (ERROR, ES_REMOTE_ENROLLEE_RES_TAG, "NOT the intended resource.");
-                    }
+                    /*
+                     * Easysetup is always performed with a single Enrollee device and
+                     * in a private network (SoftAP or BLE), so the assumption is that
+                     * only the intended device will respond for the discovery.
+                     * With the above assumption the below two statements are written.
+                     */
+                    m_ocResource = resource;
+                    m_discoveryResponse = true;
                 }
                 else
                 {