This change can protect from crash when class instance is removed.
Change-Id: I0db76ee443a88ac15d11d62a44af0b92b754d697
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16037
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
ESResult discoverResource();
static void onDiscoveredCallback(const std::shared_ptr<OC::OCResource> resource,
- std::weak_ptr<RemoteEnrollee> this_ptr);
+ std::weak_ptr<RemoteEnrollee> this_ptr);
+
+ static void onGetStatusHandlerCallback(
+ const std::shared_ptr< GetEnrolleeStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr);
+
+ static void onGetConfigurationStatusHandlerCallback(
+ const std::shared_ptr< GetConfigurationStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr);
+
+ static void onDevicePropProvisioningStatusHandlerCallback(
+ const std::shared_ptr< DevicePropProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr);
+
+ static void onCloudPropProvisioningStatusHandlerCallback(
+ const std::shared_ptr< CloudPropProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr);
+
+ static void onSecurityStatusHandlerCallback(
+ const std::shared_ptr< SecProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr);
+
+ static ESOwnershipTransferData onSecurityStatusWithOptionHandlerCallback(
+ const std::shared_ptr< SecProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr);
void onDeviceDiscovered(const std::shared_ptr<OC::OCResource> resource);
void initCloudResource();
m_ocResource = resource;
}
+ void CloudResource::onCloudProvResponseSafetyCb(const HeaderOptions& headerOptions,
+ const OCRepresentation& rep,
+ const int eCode,
+ ESCloudResourceCb cb,
+ std::weak_ptr<CloudResource> this_ptr)
+ {
+ OIC_LOG_V(DEBUG, ES_CLOUD_RES_TAG, "onCloudProvResponseSafetyCb");
+ std::shared_ptr<CloudResource> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ cb(headerOptions, rep, eCode);
+ }
+ }
+
+
void CloudResource::provisionProperties(const CloudProp& cloudProp)
{
OIC_LOG (DEBUG, ES_CLOUD_RES_TAG, "provisionProperties IN");
OCRepresentation provisioningRepresentation = cloudProp.toOCRepresentation();
+ ESCloudResourceCb cb = std::bind(&CloudResource::onCloudProvResponseSafetyCb,
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
+ static_cast<ESCloudResourceCb>(
+ std::bind(&CloudResource::onCloudProvResponse, this,
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)),
+ shared_from_this());
+
m_ocResource->post(OC_RSRVD_ES_RES_TYPE_PROV, BATCH_INTERFACE,
- provisioningRepresentation, QueryParamsMap(),
- std::function<
- void(const HeaderOptions& headerOptions,
- const OCRepresentation& rep, const int eCode) >(
- std::bind(&CloudResource::onCloudProvResponse, this,
- std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3)), OC::QualityOfService::HighQos);
+ provisioningRepresentation, QueryParamsMap(), cb, OC::QualityOfService::HighQos);
OIC_LOG (DEBUG, ES_CLOUD_RES_TAG, "provisionProperties OUT");
}
namespace Service
{
class OCResource;
+ typedef std::function<void(const HeaderOptions& headerOptions,
+ const OCRepresentation& rep,
+ const int eCode)> ESCloudResourceCb;
/**
* This class contains the resource discovery methods.
*
* @see CloudResource
*/
- class CloudResource
+ class CloudResource : public std::enable_shared_from_this<CloudResource>
{
public:
CloudResource(std::shared_ptr< OC::OCResource > resource);
void provisionProperties(const CloudProp& CloudProp);
private:
+ static void onCloudProvResponseSafetyCb(const HeaderOptions& headerOptions,
+ const OCRepresentation& rep,
+ const int eCode,
+ ESCloudResourceCb cb,
+ std::weak_ptr<CloudResource> this_ptr);
void onCloudProvResponse(const HeaderOptions& headerOptions,
const OCRepresentation& rep,
const int eCode);
m_ocResource = resource;
}
+ void EnrolleeResource::onEnrolleeResourceSafetyCB(const HeaderOptions& headerOptions,
+ const OCRepresentation& rep,
+ const int eCode,
+ ESEnrolleeResourceCb cb,
+ std::weak_ptr<EnrolleeResource> this_ptr)
+ {
+ OIC_LOG_V(DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "onEnrolleeResourceSafetyCB");
+ std::shared_ptr<EnrolleeResource> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ cb(headerOptions, rep, eCode);
+ }
+ }
+
void EnrolleeResource::onProvisioningResponse(const HeaderOptions& /*headerOptions*/,
const OCRepresentation& /*rep*/, const int eCode)
{
std::function< OCStackResult(void) > getStatus = [&]
{
- return m_ocResource->get(m_ocResource->getResourceTypes().at(0),
- DEFAULT_INTERFACE, query, std::function<void(const HeaderOptions& headerOptions,
- const OCRepresentation& rep, const int eCode) >(
+ ESEnrolleeResourceCb cb = std::bind(&EnrolleeResource::onEnrolleeResourceSafetyCB,
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
+ static_cast<ESEnrolleeResourceCb>(
std::bind(&EnrolleeResource::onGetStatusResponse, this,
- std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3)), OC::QualityOfService::HighQos);
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)),
+ shared_from_this());
+
+ return m_ocResource->get(m_ocResource->getResourceTypes().at(0),
+ DEFAULT_INTERFACE, query, cb, OC::QualityOfService::HighQos);
};
OCStackResult result = getStatus();
std::function< OCStackResult(void) > getConfigurationStatus = [&]
{
- return m_ocResource->get(m_ocResource->getResourceTypes().at(0),
- BATCH_INTERFACE, query, std::function<void(const HeaderOptions& headerOptions,
- const OCRepresentation& rep, const int eCode) >(
+ ESEnrolleeResourceCb cb = std::bind(&EnrolleeResource::onEnrolleeResourceSafetyCB,
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
+ static_cast<ESEnrolleeResourceCb>(
std::bind(&EnrolleeResource::onGetConfigurationResponse, this,
- std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3)), OC::QualityOfService::HighQos);
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)),
+ shared_from_this());
+
+ return m_ocResource->get(m_ocResource->getResourceTypes().at(0),
+ BATCH_INTERFACE, query, cb, OC::QualityOfService::HighQos);
};
OCStackResult result = getConfigurationStatus();
OC::QueryParamsMap query;
OC::OCRepresentation provisioningRepresentation = deviceProp.toOCRepresentation();
+ ESEnrolleeResourceCb cb = std::bind(&EnrolleeResource::onEnrolleeResourceSafetyCB,
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
+ static_cast<ESEnrolleeResourceCb>(
+ std::bind(&EnrolleeResource::onProvisioningResponse, this,
+ std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)),
+ shared_from_this());
+
m_ocResource->post(OC_RSRVD_ES_RES_TYPE_PROV, BATCH_INTERFACE,
- provisioningRepresentation, QueryParamsMap(),
- std::function<
- void(const HeaderOptions& headerOptions,
- const OCRepresentation& rep, const int eCode) >(
- std::bind(&EnrolleeResource::onProvisioningResponse, this,
- std::placeholders::_1, std::placeholders::_2,
- std::placeholders::_3)), OC::QualityOfService::HighQos);
+ provisioningRepresentation, QueryParamsMap(), cb, OC::QualityOfService::HighQos);
OIC_LOG (DEBUG, ES_REMOTE_ENROLLEE_RES_TAG, "provisionProperties OUT");
}
class OCResource;
class EnrolleeSecurity;
+ typedef std::function<void(const HeaderOptions& headerOptions,
+ const OCRepresentation& rep,
+ const int eCode)> ESEnrolleeResourceCb;
/**
* This class contains the resource discovery methods.
*
* @see EnrolleeResource
*/
- class EnrolleeResource
+ class EnrolleeResource : public std::enable_shared_from_this<EnrolleeResource>
{
friend class EnrolleeSecurity;
DevicePropProvStatusCb m_devicePropProvStatusCb;
private:
+ static void onEnrolleeResourceSafetyCB(const HeaderOptions& headerOptions,
+ const OCRepresentation& rep,
+ const int eCode,
+ ESEnrolleeResourceCb cb,
+ std::weak_ptr<EnrolleeResource> this_ptr);
+
+
void onGetStatusResponse(const HeaderOptions& headerOptions,
const OCRepresentation& rep,
const int eCode);
m_ownershipTransferData = {};
}
+ void EnrolleeSecurity::onEnrolleeSecuritySafetyCB(OC::PMResultList_t *result,
+ int hasError,
+ ESSecurityCb cb,
+ std::weak_ptr<EnrolleeSecurity> this_ptr)
+ {
+ OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "onEnrolleeSecuritySafetyCB");
+ std::shared_ptr<EnrolleeSecurity> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ cb(result, hasError);
+ }
+ }
+
void EnrolleeSecurity::convertUUIDToString(const uint8_t uuid[UUID_SIZE],
std::string& uuidString)
{
"Found Unowned device's DevID at DB of ownedDevices list");
OC::ResultCallBack removeDeviceWithUuidCB = std::bind(
- &EnrolleeSecurity::removeDeviceWithUuidCB,
- this, std::placeholders::_1, std::placeholders::_2);
+ &EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
+ std::placeholders::_1, std::placeholders::_2,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::removeDeviceWithUuidCB,
+ this, std::placeholders::_1, std::placeholders::_2)),
+ shared_from_this());
result = OCSecure::removeDeviceWithUuid(ES_SEC_DISCOVERY_TIMEOUT,
m_ocResource->sid(),
!m_ownershipTransferData.getPreConfiguredPin().empty())
{
OC::ResultCallBack preconfigPinProvCB = std::bind(
- &EnrolleeSecurity::PreconfigPinProvCB, this, std::placeholders::_1,
- std::placeholders::_2);
+ &EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
+ std::placeholders::_1, std::placeholders::_2,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::PreconfigPinProvCB,
+ this, std::placeholders::_1, std::placeholders::_2)),
+ shared_from_this());
std::string pin = m_ownershipTransferData.getPreConfiguredPin();
OIC_PRECONFIG_PIN == m_ownershipTransferData.getMOTMethod() ||
OIC_RANDOM_DEVICE_PIN == m_ownershipTransferData.getMOTMethod())
{
-
OC::ResultCallBack selectMOTMethodCB = std::bind(
- &EnrolleeSecurity::SelectMOTMethodCB, this, std::placeholders::_1,
- std::placeholders::_2);
+ &EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
+ std::placeholders::_1, std::placeholders::_2,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::SelectMOTMethodCB,
+ this, std::placeholders::_1, std::placeholders::_2)),
+ shared_from_this());
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "selectMOTMethod is called.");
if(OC_STACK_OK != m_securedResource->selectMOTMethod(
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Transfering ownership for : %s ",
m_securedResource->getDeviceID().c_str());
- OC::ResultCallBack ownershipTransferCb = std::bind(
- &EnrolleeSecurity::ownershipTransferCb, this, std::placeholders::_1,
- std::placeholders::_2);
+ OC::ResultCallBack ownershipTransferCb =
+ std::bind(&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
+ std::placeholders::_1, std::placeholders::_2,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::ownershipTransferCb,
+ this, std::placeholders::_1, std::placeholders::_2)),
+ shared_from_this());
+
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "doOwnershipTransfer is excuted");
result = m_securedResource->doOwnershipTransfer(ownershipTransferCb);
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Preconfig PIN : %s", pin.c_str());
}
- OC::ResultCallBack multipleOwnershipTransferCb = std::bind(
- &EnrolleeSecurity::MultipleOwnershipTransferCb, this, std::placeholders::_1,
- std::placeholders::_2);
+ OC::ResultCallBack multipleOwnershipTransferCb =
+ std::bind(&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
+ std::placeholders::_1, std::placeholders::_2,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::MultipleOwnershipTransferCb,
+ this, std::placeholders::_1, std::placeholders::_2)),
+ shared_from_this());
OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "doMultipleOwnershipTransfer is excuted");
OIC_LOG_V(DEBUG, ENROLEE_SECURITY_TAG, "Given CredId: %d", credId);
- OC::ResultCallBack CertProvisioningCb = std::bind(
- &EnrolleeSecurity::CertProvisioningCb, this, std::placeholders::_1,
- std::placeholders::_2);
+ OC::ResultCallBack CertProvisioningCb =
+ std::bind(&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
+ std::placeholders::_1, std::placeholders::_2,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::CertProvisioningCb,
+ this, std::placeholders::_1, std::placeholders::_2)),
+ shared_from_this());
+
OCStackResult rst = ownedDevice->provisionTrustCertChain(SIGNED_ASYMMETRIC_KEY,
static_cast<uint16_t>(credId),
CertProvisioningCb);
return res;
}
- OC::ResultCallBack aclProvisioningCb = std::bind(
- &EnrolleeSecurity::ACLProvisioningCb, this, std::placeholders::_1,
- std::placeholders::_2);
+ OC::ResultCallBack aclProvisioningCb =
+ std::bind(&EnrolleeSecurity::onEnrolleeSecuritySafetyCB,
+ std::placeholders::_1, std::placeholders::_2,
+ static_cast<ESSecurityCb>(std::bind(&EnrolleeSecurity::ACLProvisioningCb,
+ this, std::placeholders::_1, std::placeholders::_2)),
+ shared_from_this());
+
// ACL provisioning to Enrollee
OCStackResult rst = ownedDevice->provisionACL(acl, aclProvisioningCb);
if(OC_STACK_OK != rst)
#include <atomic>
#include <condition_variable>
+
#include "ESRichCommon.h"
#include "OCProvisioningManager.hpp"
class OCSecureResource;
typedef std::vector<OCProvisionResult_t> PMResultList_t;
+ typedef std::function<void(OC::PMResultList_t *result, int hasError)> ESSecurityCb;
/**
* This class contains the methods needed for security layer interaction.
*
* @see EnrolleeSecurity
*/
- class EnrolleeSecurity
+ class EnrolleeSecurity : public std::enable_shared_from_this<EnrolleeSecurity>
{
public:
EnrolleeSecurity(std::shared_ptr< OC::OCResource > resource,
ESOwnershipTransferData m_ownershipTransferData;
+ static void onEnrolleeSecuritySafetyCB(OC::PMResultList_t *result,
+ int hasError,
+ ESSecurityCb cb,
+ std::weak_ptr<EnrolleeSecurity> this_ptr);
+
ESResult performOwnershipTransfer();
bool isOwnedDeviceRegisteredInSVRDB();
void removeDeviceWithUuidCB(OC::PMResultList_t *result, int hasError);
void PreconfigPinProvCB(PMResultList_t *result, int hasError);
void MultipleOwnershipTransferCb(OC::PMResultList_t *result, int hasError);
#endif
+ static void onOwnershipTransferCb(PMResultList_t *result,
+ int hasError,
+ std::weak_ptr<EnrolleeSecurity> this_ptr);
void ownershipTransferCb(OC::PMResultList_t *result, int hasError);
void convertUUIDToString(const uint8_t uuid[UUID_SIZE],
std::string& uuidString);
m_deviceId = resource->sid();
}
+ void RemoteEnrollee::onSecurityStatusHandlerCallback(
+ const std::shared_ptr< SecProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr)
+ {
+ OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onSecurityStatusHandlerCallback");
+ std::shared_ptr<RemoteEnrollee> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ Ptr->securityStatusHandler(status);
+ }
+ }
+
void RemoteEnrollee::securityStatusHandler(
const std::shared_ptr< SecProvisioningStatus > status) const
{
OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "securityStatusHandlr OUT");
}
+ ESOwnershipTransferData RemoteEnrollee::onSecurityStatusWithOptionHandlerCallback(
+ const std::shared_ptr< SecProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr)
+ {
+ OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onSecurityStatusWithOptionHandlerCallback");
+ std::shared_ptr<RemoteEnrollee> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ return Ptr->securityStatusWithOptionHandler(status);
+ }
+ return ESOwnershipTransferData();
+ }
+
ESOwnershipTransferData RemoteEnrollee::securityStatusWithOptionHandler(
const std::shared_ptr< SecProvisioningStatus > status) const
{
return m_securityProvStatusCbWithOption(status);
}
+ void RemoteEnrollee::onGetStatusHandlerCallback(
+ const std::shared_ptr< GetEnrolleeStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr)
+ {
+ OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onGetStatusHandlerCallback");
+ std::shared_ptr<RemoteEnrollee> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ Ptr->getStatusHandler(status);
+ }
+ }
+
void RemoteEnrollee::getStatusHandler(
const std::shared_ptr< GetEnrolleeStatus > status) const
{
OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getStatusHandler OUT");
}
+ void RemoteEnrollee::onGetConfigurationStatusHandlerCallback(
+ const std::shared_ptr< GetConfigurationStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr)
+ {
+ OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onGetConfigurationStatusHandlerCallback");
+ std::shared_ptr<RemoteEnrollee> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ Ptr->getConfigurationStatusHandler(status);
+ }
+ }
+
void RemoteEnrollee::getConfigurationStatusHandler (
const std::shared_ptr< GetConfigurationStatus > status) const
{
OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "getConfigurationStatusHandler OUT");
}
+ void RemoteEnrollee::onDevicePropProvisioningStatusHandlerCallback(
+ const std::shared_ptr< DevicePropProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr)
+ {
+ OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onDevicePropProvisioningStatusHandlerCallback");
+ std::shared_ptr<RemoteEnrollee> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ Ptr->devicePropProvisioningStatusHandler(status);
+ }
+ }
+
void RemoteEnrollee::devicePropProvisioningStatusHandler(
const std::shared_ptr< DevicePropProvisioningStatus > status) const
{
OIC_LOG(DEBUG, ES_REMOTE_ENROLLEE_TAG, "devicePropProvisioningStatusHandler OUT");
}
+ void RemoteEnrollee::onCloudPropProvisioningStatusHandlerCallback(
+ const std::shared_ptr< CloudPropProvisioningStatus > status,
+ std::weak_ptr<RemoteEnrollee> this_ptr)
+ {
+ OIC_LOG_V(DEBUG,ES_REMOTE_ENROLLEE_TAG,"onCloudPropProvisioningStatusHandlerCallback");
+ std::shared_ptr<RemoteEnrollee> Ptr = this_ptr.lock();
+ if(Ptr)
+ {
+ Ptr->cloudPropProvisioningStatusHandler(status);
+ }
+ }
+
void RemoteEnrollee::cloudPropProvisioningStatusHandler (
const std::shared_ptr< CloudPropProvisioningStatus > status) const
{
m_securityProvStatusCb = callback;
SecurityProvStatusCb securityProvStatusCb = std::bind(
- &RemoteEnrollee::securityStatusHandler,
- this,
- std::placeholders::_1);
+ &RemoteEnrollee::onSecurityStatusHandlerCallback,
+ std::placeholders::_1,
+ shared_from_this());
//TODO : DBPath is passed empty as of now. Need to take dbpath from application.
if(!m_localEnrolleeSecurity.get())
{
m_securityProvStatusCbWithOption = callback;
SecurityProvStatusCbWithOption securityProvStatusCbWithOption = std::bind(
- &RemoteEnrollee::securityStatusWithOptionHandler,
- this,
- std::placeholders::_1);
+ &RemoteEnrollee::onSecurityStatusWithOptionHandlerCallback,
+ std::placeholders::_1,
+ shared_from_this());
if(!m_localEnrolleeSecurity.get())
{
m_getStatusCb = callback;
GetStatusCb getStatusCb = std::bind(
- &RemoteEnrollee::getStatusHandler, this, std::placeholders::_1);
+ &RemoteEnrollee::onGetStatusHandlerCallback,
+ std::placeholders::_1,
+ shared_from_this());
+
m_enrolleeResource->registerGetStatusCallback(getStatusCb);
m_enrolleeResource->getStatus();
m_getConfigurationStatusCb = callback;
GetConfigurationStatusCb getConfigurationStatusCb = std::bind(
- &RemoteEnrollee::getConfigurationStatusHandler, this, std::placeholders::_1);
+ &RemoteEnrollee::onGetConfigurationStatusHandlerCallback,
+ std::placeholders::_1,
+ shared_from_this());
+
m_enrolleeResource->registerGetConfigurationStatusCallback(getConfigurationStatusCb);
m_enrolleeResource->getConfiguration();
}
DevicePropProvStatusCb devicePropProvStatusCb = std::bind(
- &RemoteEnrollee::devicePropProvisioningStatusHandler,
- this, std::placeholders::_1);
+ &RemoteEnrollee::onDevicePropProvisioningStatusHandlerCallback,
+ std::placeholders::_1,
+ shared_from_this());
m_enrolleeResource->registerDevicePropProvStatusCallback(devicePropProvStatusCb);
m_enrolleeResource->provisionProperties(deviceProp);
}
CloudPropProvStatusCb cloudPropProvStatusCb = std::bind(
- &RemoteEnrollee::cloudPropProvisioningStatusHandler,
- this, std::placeholders::_1);
+ &RemoteEnrollee::onCloudPropProvisioningStatusHandlerCallback,
+ std::placeholders::_1,
+ shared_from_this());
m_cloudResource->registerCloudPropProvisioningStatusCallback(cloudPropProvStatusCb);
m_cloudResource->provisionProperties(cloudProp);