return _resource->observe(ObserveType::Observe, _query_params, _observe_handler);
}
+OCStackResult IOT_Resource::cancelObserve(const std::shared_ptr<OC::OCResource> _resource)
+{
+ return _resource->cancelObserve();
+}
+
OCStackResult IOT_Resource::post(const std::shared_ptr<OC::OCResource> _resource, const std::string& _type, const std::string& _interface, const OCRepresentation& _representation, const QueryParamsMap& _query_params)
{
OCStackResult res = OC_STACK_ERROR;
static OCStackResult observeResource(const std::shared_ptr<OC::OCResource> _resource, const QueryParamsMap& _query_params, ObserveCallback _observe_handler);
+ static OCStackResult cancelObserve(const std::shared_ptr<OC::OCResource> _resource);
+
static OCStackResult post(const std::shared_ptr<OC::OCResource> _resource, const std::string& _type, const std::string& _interface, const OCRepresentation& _representation, const QueryParamsMap& _query_params);
static std::string representationToString(const OCRepresentation& _rep);
#include <fstream>\r
#include <vector>\r
\r
+#if defined(__TIZEN__)\r
+ #include <system_info.h>\r
+#endif\r
+\r
#include "utils.h"\r
\r
namespace NMD\r
\r
/*******************************************************/\r
/*******************************************************/\r
+#if defined(__TIZEN__)\r
+std::string get_device_model_name()\r
+{\r
+ char* value = nullptr;\r
+\r
+ if(system_info_get_platform_string("tizen.org/system/manufacturer", &value) != SYSTEM_INFO_ERROR_NONE)\r
+ return std::string();\r
+\r
+ std::string res(value);\r
+ free(value);\r
+ return res;\r
+}\r
+#endif\r
+\r
+/*******************************************************/\r
+/*******************************************************/\r
static bool wl(const char* _msg, va_list _vl)\r
{\r
bool res = false;\r
void write_config(const nmdaemon_config& _config);\r
\r
bool write_log(const char* _msg, ...);\r
+\r
+#if defined(__TIZEN__)\r
+std::string get_device_model_name();\r
+#endif\r
}\r
\r
#endif /* __UTILS_H__ */\r
throw runtime_error("Failed to post policy");
cvar.wait_for(lck, chrono::seconds(3));
- policy_res->cancelObserve();
+
+ IOT_Resource::cancelObserve(policy_res);
} );
ASSERT_TRUE(res);
}