3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 #include <sync_agent.h>
22 #include "common/dm_common.h"
23 #include "framework/task/oma_dm_task_register.h"
24 #include "framework/task/oma_dm_task_spec.h"
26 #ifndef OMADM_AGENT_LOG
28 #define LOG_TAG "TASK_SPEC"
31 DM_ERROR task_register()
37 sync_agent_ec_task_spec_s *pDm_InitSpec = make_dm_init_task_spec();
39 sync_agent_register_task_spec(EC_MSG_TYPE_DM_INIT_TASK_REQUEST, EC_MSG_TYPE_NAME_DM_INIT_TASK_REQUEST, pDm_InitSpec, NULL);
41 sync_agent_ec_task_spec_s *pDm_ResetSpec = make_dm_reset_task_spec();
43 sync_agent_register_task_spec(EC_MSG_TYPE_DM_RESET_TASK_REQUEST, EC_MSG_TYPE_NAME_DM_RESET_TASK_REQUEST, pDm_ResetSpec, NULL);
45 sync_agent_ec_task_spec_s *pBootstrapSpec = make_bootstrap_task_spec();
47 sync_agent_register_task_spec(EC_MSG_TYPE_BOOTSTRAP_TASK_REQUEST, EC_MSG_TYPE_NAME_BOOTSTRAP_TASK_REQUEST, pBootstrapSpec, NULL);
49 sync_agent_ec_task_spec_s *pDm_fumo_commonSpec = make_dm_fumo_common_process_task_spec();
51 sync_agent_register_task_spec(EC_MSG_TYPE_DM_FUMO_COMMON_TASK_REQUEST, EC_MSG_TYPE_NAME_DM_FUMO_COMMON_TASK_REQUEST, pDm_fumo_commonSpec, NULL);
53 sync_agent_ec_task_spec_s *pDm_fumo_uiSpec = make_dm_fumo_ui_process_task_spec();
55 sync_agent_register_task_spec(EC_MSG_TYPE_DM_FUMO_UI_TASK_REQUEST, EC_MSG_TYPE_NAME_DM_FUMO_UI_TASK_REQUEST, pDm_fumo_uiSpec, NULL);
57 sync_agent_ec_task_spec_s *pDm_lawmo_commonSpec = make_dm_lawmo_common_process_task_spec();
59 sync_agent_register_task_spec(EC_MSG_TYPE_DM_LAWMO_COMMON_TASK_REQUEST, EC_MSG_TYPE_NAME_DM_LAWMO_COMMON_TASK_REQUEST, pDm_lawmo_commonSpec, NULL);
61 sync_agent_ec_task_spec_s *pGenericAlertSpec = make_genericAlert_process_task_spec();
63 sync_agent_register_task_spec(EC_MSG_TYPE_GENERICALERT_TASK_REQUEST, EC_MSG_TYPE_NAME_GENERICALERT_TASK_REQUEST, pGenericAlertSpec, NULL);
65 sync_agent_ec_task_spec_s *pFumoServiceEngineSpec = make_fumo_serviceEngine_process_task_spec();
67 sync_agent_register_task_spec(EC_MSG_TYPE_FUMO_SERVICE_ENGINE_TASK_REQUEST, EC_MSG_TYPE_NAME_FUMO_SERVICE_ENGINE_TASK_REQUEST, pFumoServiceEngineSpec, NULL);
69 sync_agent_ec_task_spec_s *pLawmoServiceEngineSpec = make_lawmo_serviceEngine_process_task_spec();
71 sync_agent_register_task_spec(EC_MSG_TYPE_LAWMO_SERVICE_ENGINE_TASK_REQUEST, EC_MSG_TYPE_NAME_LAWMO_SERVICE_ENGINE_TASK_REQUEST, pLawmoServiceEngineSpec, NULL);
73 sync_agent_ec_task_spec_s *pFumo_schedule_Spec = make_fumo_schedule_process_task_spec();
75 sync_agent_register_task_spec(EC_MSG_TYPE_FUMO_SCHEDULE_TASK_REQUEST, EC_MSG_TYPE_NAME_FUMO_SCHEDULE_TASK_REQUEST, pFumo_schedule_Spec, NULL);
77 _DEBUG_INFO("register tasks end");
79 _DEBUG_INFO("register queuing rule start");
80 sync_agent_ec_queuing_rule_spec_s *pfumo_Rule = sync_agent_create_queuing_rule_spec_outline("dm_fumo_common_queuing_rule");
81 sync_agent_ec_queuing_rule_spec_s *plawmo_Rule = sync_agent_create_queuing_rule_spec_outline("dm_lawmo_common_queuing_rule");
83 sync_agent_ec_error_e ec_error = sync_agent_add_progress_blocking_element(pfumo_Rule,
84 EC_MSG_TYPE_DM_FUMO_COMMON_TASK_REQUEST, pDm_fumo_commonSpec,
86 ec_error = sync_agent_add_progress_blocking_element(pfumo_Rule, EC_MSG_TYPE_FUMO_SERVICE_ENGINE_TASK_REQUEST, pFumoServiceEngineSpec, 0);
87 ec_error = sync_agent_add_progress_blocking_element(pfumo_Rule, EC_MSG_TYPE_DM_FUMO_UI_TASK_REQUEST, pDm_fumo_uiSpec, 0);
89 ec_error = sync_agent_add_progress_blocking_element(plawmo_Rule, EC_MSG_TYPE_DM_LAWMO_COMMON_TASK_REQUEST, pDm_lawmo_commonSpec, 0);
90 ec_error = sync_agent_add_progress_blocking_element(plawmo_Rule, EC_MSG_TYPE_LAWMO_SERVICE_ENGINE_TASK_REQUEST, pLawmoServiceEngineSpec, 0);
92 sync_agent_register_async_queuing_rule_spec(pfumo_Rule, NULL, NULL);
93 sync_agent_unref_queuing_rule_spec(pfumo_Rule);
94 sync_agent_register_async_queuing_rule_spec(plawmo_Rule, NULL, NULL);
95 sync_agent_unref_queuing_rule_spec(plawmo_Rule);