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 2d7fa3b544db2520e6c3ae509c963209062c28f2..9f91b2c20b0a5bbfed677e9d7e54b305f17ffa43 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 570e2962adbb3de0bb86d17c7c3ec7a13bc3442d..a46311e708c8ca706a7f6601efc0f915a2d71fa7 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)));
         }
 
     }