/* * oma-ds-agent * Copyright (c) 2012 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @OMA_DS_Engine_Controller_Task.h * @version 0.1 * @brief This file is the header file of registration function for using Engine Controller */ #ifndef ENGINE_CONTROLLER_TASK_H_ #define ENGINE_CONTROLLER_TASK_H_ #include #include #define SYNC_MODE_MANUAL 0 #define SYNC_MODE_PERIODIC 1 #define SYNC_MODE_SAN 2 #define SYNC_MODE_AUTOCONFIG 3 typedef struct request_msg_info_s request_msg_info_t; struct request_msg_info_s { int sync_type; unsigned int request_id; }; #define EC_MSG_TYPE_SYNC_TASK_REQUEST 1 #define EC_MSG_TYPE_NAME_SYNC_TASK_REQUEST "sync_request" #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE 2 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE "add_profile" #define EC_MSG_TYPE_SYNC_TASK_EDIT_PROFILE 3 #define EC_MSG_TYPE_NAME_SYNC_TASK_EDIT_PROFILE "edit_profile" #define EC_MSG_TYPE_SYNC_TASK_DELETE_PROFILE 4 #define EC_MSG_TYPE_NAME_SYNC_TASK_DELETE_PROFILE "delete_profile" #define EC_MSG_TYPE_SAN_TASK_REQUEST 5 #define EC_MSG_TYPE_NAME_SAN_TASK_REQUEST "SAN_request" #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_DATA 6 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_DATA "get_profile_data" #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY 7 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY "get_profile_sync_category" #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_STATISTICS 8 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_STATISTICS "get_profile_statistics" #define EC_MSG_TYPE_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES 9 #define EC_MSG_TYPE_NAME_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES "reset_synchronizing_profiles" #define EC_MSG_TYPE_SYNC_TASK_CANCEL_SYNC_REQUEST 10 #define EC_MSG_TYPE_NAME_SYNC_TASK_CANCEL_SYNC_REQUEST "cancel_sync_request" #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE_CP 11 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE_CP "add_profile_cp" #define EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE 12 #define EC_MSG_TYPE_NAME_SYNC_TASK_REFRESH_FROM_SERVICE "refresh_from_service" #define EC_MSG_TYPE_SYNC_TASK_RESET_ALL_DATA 13 #define EC_MSG_TYPE_NAME_SYNC_TASK_RESET_ALL_DATA "reset_all_data" #define EC_MSG_TYPE_SYNC_TASK_GET_ALL_PROFILES_DATA 14 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_ALL_PROFILES_DATA "get_all_profiles_data" /** * @par Description: API to create synchronize task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_synchronize_task(); /** * @par Description: API to create synchronize task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_add_profile_task(); /** * @par Description: API to create edit profile task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_edit_profile_task(); /** * @par Description: API to create delete profiles task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_delete_profile_task(); /** * @par Description: API to create get profile data task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_get_profile_data_task(); /** * @par Description: API to create get profile sync category task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_get_profile_sync_category_task(); /** * @par Description: API to create get profile last statistics task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_get_profile_statistics_task(); /** * @par Description: API to create reset synchronizing profiles task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_reset_synchronizing_profiles_task(); /** * @par Description: API to create reset synchronizing profiles task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_add_profile_cp_task(); /** * @par Description: API to create reset refresh_from_service task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_refresh_from_service_task(); /** * @par Description: API to create cancel network session task * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_cancel_request_task(); /** * @par Description: API to reset all data * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_reset_all_data_task(); /** * @par Description: API to get all profiles data * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return sync_agent_ec_task_spec_s structure on success * NYLL on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_spec_s *make_get_all_profiles_data_task(); /** * @par Description: This API is callback function which runs when synchronize task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e synchronize_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when add profile task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e add_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when edit profile task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e edit_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when delete profiles task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e delete_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when get profile name task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e get_profile_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when get profile sync category task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e get_profile_sync_category_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when get profile last statistics task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e get_profile_statistics_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when reset synchronizing profiles task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e reset_synchronizing_profiles_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when cancel is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e cancel_sync_request_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when reset function is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e reset_all_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when reset function is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e get_all_profiles_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when add profile for cp task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e add_profile_cp_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: This API is callback function which runs when refresh_from_service task is requested * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] unsigned int type, parameter count * @param[in] array of parameters * @param[out] * * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ sync_agent_ec_task_error_e refresh_from_service_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array); /** * @par Description: API to insert request_msg_info_t structure into list * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] sync_type(SYNC_MODE_MANUAL, SYNC_MODE_PERIODIC, SYNC_MODE_SAN, SYNC_MODE_AUTOCONFIG) * @param[in] request id * @param[out] * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void insert_request_msg_info(int sync_type, unsigned int request_id); /** * @par Description: API to delete request_msg_info_t structure from list * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] request id * @param[out] * * @return * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ void delete_request_msg_info(unsigned int request_id); /** * @par Description: API to get synchronizing request id and delete request_msg_info_t structure from list * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] request id * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool get_synchronizing_request_id(unsigned int *request_id); /** * @par Description: API to get manual sync request id and delete request_msg_info_t structure from list * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] request id * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool get_manual_sync_request_id(unsigned int *request_id); /** * @par Description: API to get periodic sync request id and delete request_msg_info_t structure from list * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] request id * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool get_periodic_sync_request_id(unsigned int *request_id); /** * @par Description: API to get SAN sync request id and delete request_msg_info_t structure from list * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] request id * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool get_san_sync_request_id(unsigned int *request_id); /** * @par Description: API to get auto configure sync request id and delete request_msg_info_t structure from list * * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] request id * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool get_auto_configure_request_id(unsigned int *request_id); /** * @par Description: cancel current sync task(auto configure task or sync task) * * if auto configure task is processing, cancel auto configure task * if sync task is processing, cancel sync task * * @par Purpose: * @par Typical use case: * @par Method of function operation: * @par Important notes: * @param[in] * @param[out] * * @return true on success * false on error * * @par Errors: * * @pre None. * @post * @see * @remarks None. * * @par Sample Code: * @code * @endcode */ bool cancel_current_sync_task(); #endif /* ENGINE_CONTROLLER_TASK_H_ */