Fix a bug of discoverResource that doesn't invoke the callback even when a resource...
authorcoderhyme <jhyo.kim@samsung.com>
Tue, 23 Jun 2015 03:57:30 +0000 (12:57 +0900)
committerUze Choi <uzchoi@samsung.com>
Tue, 23 Jun 2015 05:01:39 +0000 (05:01 +0000)
And also change the name of callback of discoverResource

Change-Id: I36cfe430f611467b350f83d61ad9484bf422cc89
Signed-off-by: coderhyme <jhyo.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1390
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/basis/common/primitiveResource/include/PrimitiveResource.h
service/basis/common/primitiveResource/src/PrimitiveResource.cpp

index 2d7fa3b..9f91b2c 100755 (executable)
@@ -79,10 +79,10 @@ namespace OIC
             PrimitiveResource& operator=(PrimitiveResource&&) const = delete;
         };
 
-        using FindCallback = std::function<void(std::shared_ptr<PrimitiveResource>)>;
+        using DiscoverCallback = std::function<void(std::shared_ptr<PrimitiveResource>)>;
 
         void discoverResource(const std::string& host, const std::string& resourceURI,
-                OCConnectivityType connectivityType, FindCallback resourceHandler);
+                OCConnectivityType, DiscoverCallback);
 
     }
 }
index 570e296..a46311e 100755 (executable)
@@ -37,10 +37,11 @@ namespace OIC
         }
 
         void discoverResource(const std::string& host, const std::string& resourceURI,
-                OCConnectivityType connectivityType, FindCallback resourceHandler)
+                OCConnectivityType connectivityType, DiscoverCallback callback)
         {
             OC::OCPlatform::findResource(host, resourceURI, connectivityType,
-                    std::bind(&PrimitiveResource::create, std::placeholders::_1));
+                    std::bind(callback,
+                            std::bind(&PrimitiveResource::create, std::placeholders::_1)));
         }
 
     }