static void Iotcon_update_lite_resource(void)
{
iotcon_attributes_h state = NULL;
-
+
int ret = iotcon_attributes_create(&state);
- if (IOTCON_ERROR_NONE != ret)
+ if (IOTCON_ERROR_NONE != ret)
{
FPRINTF("[Line : %d][%s] iotcon_attributes_create fail\\n", __LINE__, API_NAMESPACE);
return;
}
ret = iotcon_attributes_add_int(state, "int", ++g_brightness);
- if (IOTCON_ERROR_NONE != ret)
+ if (IOTCON_ERROR_NONE != ret)
{
FPRINTF("[Line : %d][%s] iotcon_attributes_add_int fail\\n", __LINE__, API_NAMESPACE);
iotcon_attributes_destroy(state);
return;
}
ret = iotcon_lite_resource_update_attributes(g_hLiteLightResource, state);
- if (IOTCON_ERROR_NONE != ret)
+ if (IOTCON_ERROR_NONE != ret)
{
FPRINTF("[Line : %d][%s] iotcon_lite_resource_update_attributes fail\\n", __LINE__, API_NAMESPACE);
iotcon_attributes_destroy(state);
- return;
+ return;
}
iotcon_attributes_destroy(state);
return;
iotcon_remote_resource_get_uri_path(resource, &uri);
dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] host_address[%s], uri[%s]", __FUNCTION__, __LINE__, host_address, uri);
- g_hResourceHandle = resource;
+ nRet = iotcon_remote_resource_clone(resource, &g_hResourceHandle);
+ if (IOTCON_ERROR_NONE != nRet)
+ {
+ FPRINTF("[Line : %d][%s] iotcon_remote_resource_clone fail error returned : %s\\n", __LINE__, API_NAMESPACE, IotConGetError(nRet));
+ if ( g_pMainLoop )
+ {
+ g_main_loop_quit(g_pMainLoop);
+ g_main_loop_unref(g_pMainLoop);
+ g_pMainLoop = NULL;
+ }
+ return;
+ }
+
if ( g_pMainLoop )
{
g_main_loop_quit(g_pMainLoop);
START_TEST;
uint8_t properties;
-
+
int nRet = IotconCreateRemoteResource();
if (IOTCON_ERROR_NONE != nRet)
{