switch (result)
{
case OC_STACK_OK:
- requestURI << "coap://" << hostAddress << ":" << OC_MULTICAST_PORT <<
- "/oc/core?rt=SSManager.Sensor";
+ requestURI << "coap://" << hostAddress << "/oc/core?rt=SSManager.Sensor";
ret = OC::OCPlatform::findResource("", requestURI.str(), OC_WIFI,
std::bind(&CResourceFinder::onResourceFound, this, std::placeholders::_1));
if (ret != OC_STACK_OK)
SSM_CLEANUP_ASSERT(SSM_E_FAIL);
- ret = OC::OCPlatform::findResource("", requestURI.str(), OC_ETHERNET,\r
- std::bind(&CResourceFinder::onResourceFound, this, std::placeholders::_1));\r
-\r
- if (ret != OC_STACK_OK)\r
- SSM_CLEANUP_ASSERT(SSM_E_FAIL);\r
-\r
+ ret = OC::OCPlatform::findResource("", requestURI.str(), OC_ETHERNET,
+ std::bind(&CResourceFinder::onResourceFound, this, std::placeholders::_1));
+
+ if (ret != OC_STACK_OK)
+ SSM_CLEANUP_ASSERT(SSM_E_FAIL);
+
break;
case OC_STACK_PRESENCE_STOPPED:
- case OC_STACK_PRESENCE_TIMEOUT:
if (m_mapResources.find(hostAddress) != m_mapResources.end())
{
while (!m_mapResources[hostAddress].empty())
}
break;
+ case OC_STACK_PRESENCE_TIMEOUT:
+ break;
+
case OC_STACK_VIRTUAL_DO_NOT_HANDLE:
break;
if (ret != OC_STACK_OK)
SSM_CLEANUP_ASSERT(SSM_E_FAIL);
- ret = OC::OCPlatform::findResource("", requestURI.str(), OC_ETHERNET,\r
- std::bind(&CResourceFinder::onResourceFound, this, std::placeholders::_1));\r
-\r
- if (ret != OC_STACK_OK)\r
- SSM_CLEANUP_ASSERT(SSM_E_FAIL);\r
-\r
+ ret = OC::OCPlatform::findResource("", requestURI.str(), OC_ETHERNET,
+ 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, OC_MULTICAST_IP,
"SSManager.Sensor", OC_WIFI, 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);
- ret = OC::OCPlatform::subscribePresence(m_multicastPresenceHandle, OC_MULTICAST_IP,\r
- "SSManager.Sensor", OC_ETHERNET, std::bind(&CResourceFinder::presenceHandler, this,\r
- std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));\r
-\r
- if (ret != OC_STACK_OK)\r
- SSM_CLEANUP_ASSERT(SSM_E_FAIL);\r
-\r
+ ret = OC::OCPlatform::subscribePresence(m_multicastPresenceHandle, OC_MULTICAST_IP,
+ "SSManager.Sensor", OC_ETHERNET, 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);
+
res = SSM_S_OK;
CLEANUP:
if (ret != OC_STACK_OK)
SSM_CLEANUP_ASSERT(SSM_E_FAIL);
- ret = OC::OCPlatform::subscribePresence(presenceHandle, ((ISSMResource *)pMessage[1])->ip,\r
- "SSManager.Sensor", OC_ETHERNET, std::bind(&CResourceFinder::presenceHandler, this,\r
- std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));\r
-\r
- if (ret != OC_STACK_OK)\r
- SSM_CLEANUP_ASSERT(SSM_E_FAIL);\r
-\r
+ ret = OC::OCPlatform::subscribePresence(presenceHandle, ((ISSMResource *)pMessage[1])->ip,
+ "SSManager.Sensor", OC_ETHERNET, 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_mapResourcePresenceHandles[((ISSMResource *)pMessage[1])->ip] = presenceHandle;
}
- m_pResourceFinderEvent->onResourceFound((ISSMResource *)pMessage[1]);\r
-\r
- if (ret != OC_STACK_OK)\r
- SSM_CLEANUP_ASSERT(SSM_E_FAIL);\r
-\r
+ m_pResourceFinderEvent->onResourceFound((ISSMResource *)pMessage[1]);
+
+ if (ret != OC_STACK_OK)
+ SSM_CLEANUP_ASSERT(SSM_E_FAIL);
+
break;
case RESOURCE_DISCOVER_UNINSTALL_RESOURCE: