- d2d daemon now does not exit even discovery/service providers fail to initiate
Change-Id: Iaf79842897ab495a0a15b295ec8a5c9ea3198a3c
Signed-off-by: kmook <kmook.choi@samsung.com>
int conv::discovery_manager_impl::init()
{
_D("Discovery_Manager Init!!..");
- IF_FAIL_RETURN_TAG(register_provider(new(std::nothrow) conv::smartview_discovery_provider()) == CONV_ERROR_NONE, CONV_ERROR_INVALID_OPERATION, _E, "smartview_discover_provider register failed");
- IF_FAIL_RETURN_TAG(register_provider(new(std::nothrow) conv::ble_discovery_provider()) == CONV_ERROR_NONE, CONV_ERROR_INVALID_OPERATION, _E, "ble_discovery_provider register failed");
- IF_FAIL_RETURN_TAG(register_provider(new(std::nothrow) conv::iotcon_discovery_provider()) == CONV_ERROR_NONE, CONV_ERROR_INVALID_OPERATION, _E, "iotcon_discovery_provider register failed");
+ register_provider(new(std::nothrow) conv::smartview_discovery_provider());
+ register_provider(new(std::nothrow) conv::ble_discovery_provider());
+ register_provider(new(std::nothrow) conv::iotcon_discovery_provider());
request_map.clear();
request_timer_map.clear();
return CONV_ERROR_INVALID_PARAMETER;
}
- provider_list.push_back(provider);
-
if (provider->set_manager(this) != CONV_ERROR_NONE) {
_E("Provider set_manager failed");
+ delete provider;
return CONV_ERROR_INVALID_OPERATION;
}
if (provider->init() != CONV_ERROR_NONE) {
_E("Provider initialization failed");
+ delete provider;
return CONV_ERROR_INVALID_OPERATION;
}
+ provider_list.push_back(provider);
+
return CONV_ERROR_NONE;
}
int conv::discovery_manager_impl::convert_device_into_json(conv::device_iface* device_info, json* json_data)
int conv::ble_discovery_provider::init()
{
//init_wfd_client((void*)this);
+ _D("ble_discovery_provider init done");
return CONV_ERROR_NONE;
}
int ret = iotcon_initialize(CONV_IOTCON_FILEPATH);
if (ret != IOTCON_ERROR_NONE) {
_E("Failed iotcon_connect... Error:%d", ret);
+ return CONV_ERROR_INVALID_OPERATION;
}
if (resource_h_map != NULL)
delete resource_h_map;
resource_h_map = new(std::nothrow) resource_h_map_t;
+ _D("iotcon_discovery_provider init done");
+
return CONV_ERROR_NONE;
}
int conv::service_manager_impl::init()
{
- IF_FAIL_RETURN_TAG(register_provider(new(std::nothrow) conv::app_comm_service_provider()) == CONV_ERROR_NONE, CONV_ERROR_INVALID_OPERATION, _E, "app_comm_service_provider register failed");
- IF_FAIL_RETURN_TAG(register_provider(new(std::nothrow) conv::remote_app_control_service_provider()) == CONV_ERROR_NONE, CONV_ERROR_INVALID_OPERATION, _E, "remote_app_control_service_provider register failed");
+ register_provider(new(std::nothrow) conv::app_comm_service_provider());
+ register_provider(new(std::nothrow) conv::remote_app_control_service_provider());
register_discovery_info();
return CONV_ERROR_NONE;
return CONV_ERROR_INVALID_PARAMETER;
}
- provider_list.push_back(provider);
-
if (provider->init() != CONV_ERROR_NONE) {
_E("Provider initialization failed");
+ delete provider;
return CONV_ERROR_INVALID_OPERATION;
}
+ provider_list.push_back(provider);
+
return CONV_ERROR_NONE;
}
int conv::app_comm_service_provider::init()
{
+ _D("app_comm_service_provider init done");
return CONV_ERROR_NONE;
}
error = iotcon_resource_create(CONV_URI_SMARTVIEW_REMOTE_APP_CONTROL, resource_types, resource_ifaces, properties, iotcon_request_cb, NULL, &iotcon_resource);
IF_FAIL_RETURN_TAG(error == IOTCON_ERROR_NONE, CONV_ERROR_INVALID_OPERATION, _E, "resource creation failed");
-
iotcon_resource_types_destroy(resource_types);
iotcon_resource_interfaces_destroy(resource_ifaces);
+ _D("remote_app_control_service_provider init done");
+
return CONV_ERROR_NONE;
}