******************************************************************/
#include "ResourceFinder.h"
+OCConnectivityType g_connectivityType = CT_DEFAULT;
+
SSMRESULT CResourceFinder::finalConstruct()
{
SSMRESULT res = SSM_E_FAIL;
switch (result)
{
case OC_STACK_OK:
- requestURI << "coap://" << hostAddress << "/oc/core?rt=SSManager.Sensor";
+ requestURI << "coap://" << hostAddress << OC_RSRVD_WELL_KNOWN_URI << "?rt=SSManager.Sensor";
- ret = OC::OCPlatform::findResource("", requestURI.str(), CT_DEFAULT,
+ ret = OC::OCPlatform::findResource("", requestURI.str(), g_connectivityType,
std::bind(&CResourceFinder::onResourceFound, this, std::placeholders::_1));
if (ret != OC_STACK_OK)
case OC_STACK_PRESENCE_TIMEOUT:
break;
- case OC_STACK_VIRTUAL_DO_NOT_HANDLE:
+ case OC_STACK_PRESENCE_DO_NOT_HANDLE:
break;
default:
std::ostringstream multicastPresenceURI;
multicastPresenceURI << "coap://" << OC_MULTICAST_PREFIX;
- ret = OC::OCPlatform::findResource("", requestURI.str(), CT_DEFAULT,
+ ret = OC::OCPlatform::findResource("", requestURI.str(), g_connectivityType,
std::bind(&CResourceFinder::onResourceFound, this, std::placeholders::_1));
if (ret != OC_STACK_OK)
SSM_CLEANUP_ASSERT(SSM_E_FAIL);
ret = OC::OCPlatform::subscribePresence(m_multicastPresenceHandle, multicastPresenceURI.str(),
- "SSManager.Sensor", CT_DEFAULT, std::bind(&CResourceFinder::presenceHandler, this,
+ "SSManager.Sensor", g_connectivityType, std::bind(&CResourceFinder::presenceHandler, this,
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
if (ret != OC_STACK_OK)
pResourceHandler = new OICResourceHandler();
res = pResourceHandler->initHandler(*pResource, this);
- if(res != SSM_S_OK)
+ if (res != SSM_S_OK)
{
SAFE_DELETE(pResourceHandler);
SSM_CLEANUP_ASSERT(res);
m_mapResourcePresenceHandles.end())
{
ret = OC::OCPlatform::subscribePresence(presenceHandle, ((ISSMResource *)pMessage[1])->ip,
- "SSManager.Sensor", CT_DEFAULT, std::bind(&CResourceFinder::presenceHandler, this,
- std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
+ "SSManager.Sensor", (OCConnectivityType)(((ISSMResource *)pMessage[1])->connectivityType),
+ std::bind(&CResourceFinder::presenceHandler, this, std::placeholders::_1, std::placeholders::_2,
+ std::placeholders::_3));
if (ret != OC_STACK_OK)
SSM_CLEANUP_ASSERT(SSM_E_FAIL);
m_pResourceFinderEvent->onResourceFound((ISSMResource *)pMessage[1]);
- if (ret != OC_STACK_OK)
- SSM_CLEANUP_ASSERT(SSM_E_FAIL);
-
break;
case RESOURCE_DISCOVER_UNINSTALL_RESOURCE: