+ catch(std::exception& e)
+ {
+ std::cout << "Exception: " << e.what() << " in onGet" << std::endl;
+ }
+ }
+
+
+ void discoverRemoteEnrolleeCbToGetCloudRsrc(std::shared_ptr<OC::OCResource> resource)
+ {
+ if(!isValidResourceToTest(resource))
+ {
+ return ;
+ }
+
+ if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_COAPCLOUDCONF) && m_getCloudCb)
+ {
+ QueryParamsMap test;
+ resource->get(test, std::bind(
+ &ESMediatorSimulator::getCloudRsrcCallback, this, std::placeholders::_1,
+ std::placeholders::_2, std::placeholders::_3));
+ }
+ }
+
+ void getDevConfCallback(const HeaderOptions&, const OCRepresentation& rep, const int eCode)
+ {
+ try
+ {
+ if(eCode == OC_STACK_OK)
+ {
+ std::cout << "GET request was successful" << std::endl;
+ std::cout << "Resource URI: " << rep.getUri() << std::endl;
+ if(m_getDevConfCb != NULL)
+ {
+ m_getDevConfCb(rep);
+ m_getDevConfCb = NULL;
+ }
+ }
+ else
+ {
+ std::cout << "onGET Response error: " << eCode << std::endl;
+ std::exit(-1);
+ }
+ }
+ catch(std::exception& e)
+ {
+ std::cout << "Exception: " << e.what() << " in onGet" << std::endl;
+ }
+ }
+
+ void discoverRemoteEnrolleeCbToGetDevConf(std::shared_ptr<OC::OCResource> resource)
+ {
+ if(!isValidResourceToTest(resource))
+ {
+ return ;
+ }
+
+ if(!resource->getResourceTypes().at(0).compare(OC_RSRVD_ES_RES_TYPE_DEVCONF) && m_getDevConfCb)
+ {
+ QueryParamsMap test;
+ resource->get(test, std::bind(
+ &ESMediatorSimulator::getDevConfCallback, this, std::placeholders::_1,
+ std::placeholders::_2, std::placeholders::_3));
+ }