From: coderhyme Date: Tue, 23 Jun 2015 03:57:30 +0000 (+0900) Subject: Fix a bug of discoverResource that doesn't invoke the callback even when a resource... X-Git-Tag: 1.2.0+RC1~1430^2~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04d019cabdd98db0966d9fca4ce8463709b12932;p=platform%2Fupstream%2Fiotivity.git Fix a bug of discoverResource that doesn't invoke the callback even when a resource is discovered. And also change the name of callback of discoverResource Change-Id: I36cfe430f611467b350f83d61ad9484bf422cc89 Signed-off-by: coderhyme Reviewed-on: https://gerrit.iotivity.org/gerrit/1390 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/basis/common/primitiveResource/include/PrimitiveResource.h b/service/basis/common/primitiveResource/include/PrimitiveResource.h index 2d7fa3b..9f91b2c 100755 --- a/service/basis/common/primitiveResource/include/PrimitiveResource.h +++ b/service/basis/common/primitiveResource/include/PrimitiveResource.h @@ -79,10 +79,10 @@ namespace OIC PrimitiveResource& operator=(PrimitiveResource&&) const = delete; }; - using FindCallback = std::function)>; + using DiscoverCallback = std::function)>; void discoverResource(const std::string& host, const std::string& resourceURI, - OCConnectivityType connectivityType, FindCallback resourceHandler); + OCConnectivityType, DiscoverCallback); } } diff --git a/service/basis/common/primitiveResource/src/PrimitiveResource.cpp b/service/basis/common/primitiveResource/src/PrimitiveResource.cpp index 570e296..a46311e 100755 --- a/service/basis/common/primitiveResource/src/PrimitiveResource.cpp +++ b/service/basis/common/primitiveResource/src/PrimitiveResource.cpp @@ -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))); } }