}
}
+static gboolean _destroy_lite_light_resource(gpointer p)
+{
+ FN_CALL;
+ int ret;
+
+ ret = iotcon_lite_resource_destroy(g_lite_light_resource);
+ if (IOTCON_ERROR_NONE != ret)
+ ICUTC_ERR("iotcon_lite_resource_destroy() Fail(%d)", ret);
+
+ g_lite_light_resource = NULL;
+
+ return G_SOURCE_REMOVE;
+}
+
static bool _encap_found_resource(iotcon_remote_resource_h resource,
iotcon_error_e err, void *user_data)
{
_encap_main_loop_quit(false);
return IOTCON_FUNC_STOP;
}
+ g_timeout_add_seconds(3, _destroy_lite_light_resource, NULL);
return IOTCON_FUNC_STOP;
case ENCAP_START_MONITORING_N:
ret = iotcon_remote_resource_start_monitoring(NULL, _encap_monitoring_cb,
return IOTCON_FUNC_STOP;
}
-static gboolean _destroy_lite_light_resource(gpointer p)
-{
- FN_CALL;
- int ret;
-
- ret = iotcon_lite_resource_destroy(g_lite_light_resource);
- if (IOTCON_ERROR_NONE != ret)
- ICUTC_ERR("iotcon_lite_resource_destroy() Fail(%d)", ret);
-
- g_lite_light_resource = NULL;
-
- return G_SOURCE_REMOVE;
-}
-
static int _encap_handle_async(int tc_index)
{
FN_CALL;
ret = _encap_create_lite_resource();
ICUTC_ASSERT_EQ(ret, 0);
- if (ENCAP_STOP_MONITORING_P == tc_index)
- g_timeout_add_seconds(3, _destroy_lite_light_resource, NULL);
-
ret = iotcon_find_resource(IOTCON_MULTICAST_ADDRESS, IOTCON_CONNECTIVITY_IPV4,
ENCAP_LIGHT_RESOURCE_TYPE, false, _encap_found_resource, (void *)tc_index);
ICUTC_ASSERT_EQ(ret, IOTCON_ERROR_NONE);