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 * @OMA_DS_Engine_Controller_Task.h
21 * @brief This file is the header file of registration function for using Engine Controller
24 #ifndef ENGINE_CONTROLLER_TASK_H_
25 #define ENGINE_CONTROLLER_TASK_H_
28 #include <sync_agent.h>
30 #define SYNC_MODE_MANUAL 0
31 #define SYNC_MODE_PERIODIC 1
32 #define SYNC_MODE_SAN 2
33 #define SYNC_MODE_AUTOCONFIG 3
35 typedef struct request_msg_info_s request_msg_info_t;
36 struct request_msg_info_s {
38 unsigned int request_id;
41 #define EC_MSG_TYPE_SYNC_TASK_REQUEST 1
42 #define EC_MSG_TYPE_NAME_SYNC_TASK_REQUEST "sync_request"
43 #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE 2
44 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE "add_profile"
45 #define EC_MSG_TYPE_SYNC_TASK_EDIT_PROFILE 3
46 #define EC_MSG_TYPE_NAME_SYNC_TASK_EDIT_PROFILE "edit_profile"
47 #define EC_MSG_TYPE_SYNC_TASK_DELETE_PROFILE 4
48 #define EC_MSG_TYPE_NAME_SYNC_TASK_DELETE_PROFILE "delete_profile"
49 #define EC_MSG_TYPE_SAN_TASK_REQUEST 5
50 #define EC_MSG_TYPE_NAME_SAN_TASK_REQUEST "SAN_request"
51 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_DATA 6
52 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_DATA "get_profile_data"
53 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY 7
54 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY "get_profile_sync_category"
55 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_STATISTICS 8
56 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_STATISTICS "get_profile_statistics"
57 #define EC_MSG_TYPE_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES 9
58 #define EC_MSG_TYPE_NAME_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES "reset_synchronizing_profiles"
59 #define EC_MSG_TYPE_SYNC_TASK_CANCEL_SYNC_REQUEST 10
60 #define EC_MSG_TYPE_NAME_SYNC_TASK_CANCEL_SYNC_REQUEST "cancel_sync_request"
61 #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE_CP 11
62 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE_CP "add_profile_cp"
63 #define EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE 12
64 #define EC_MSG_TYPE_NAME_SYNC_TASK_REFRESH_FROM_SERVICE "refresh_from_service"
65 #define EC_MSG_TYPE_SYNC_TASK_RESET_ALL_DATA 13
66 #define EC_MSG_TYPE_NAME_SYNC_TASK_RESET_ALL_DATA "reset_all_data"
67 #define EC_MSG_TYPE_SYNC_TASK_GET_ALL_PROFILES_DATA 14
68 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_ALL_PROFILES_DATA "get_all_profiles_data"
71 * @par Description: API to create synchronize task
75 * @par Typical use case:
76 * @par Method of function operation:
77 * @par Important notes:
81 * @return sync_agent_ec_task_spec_s structure on success
94 sync_agent_ec_task_spec_s *make_synchronize_task();
97 * @par Description: API to create synchronize task
101 * @par Typical use case:
102 * @par Method of function operation:
103 * @par Important notes:
107 * @return sync_agent_ec_task_spec_s structure on success
120 sync_agent_ec_task_spec_s *make_add_profile_task();
123 * @par Description: API to create edit profile task
127 * @par Typical use case:
128 * @par Method of function operation:
129 * @par Important notes:
133 * @return sync_agent_ec_task_spec_s structure on success
146 sync_agent_ec_task_spec_s *make_edit_profile_task();
149 * @par Description: API to create delete profiles task
153 * @par Typical use case:
154 * @par Method of function operation:
155 * @par Important notes:
159 * @return sync_agent_ec_task_spec_s structure on success
172 sync_agent_ec_task_spec_s *make_delete_profile_task();
175 * @par Description: API to create get profile data task
179 * @par Typical use case:
180 * @par Method of function operation:
181 * @par Important notes:
185 * @return sync_agent_ec_task_spec_s structure on success
198 sync_agent_ec_task_spec_s *make_get_profile_data_task();
201 * @par Description: API to create get profile sync category task
205 * @par Typical use case:
206 * @par Method of function operation:
207 * @par Important notes:
211 * @return sync_agent_ec_task_spec_s structure on success
224 sync_agent_ec_task_spec_s *make_get_profile_sync_category_task();
227 * @par Description: API to create get profile last statistics task
231 * @par Typical use case:
232 * @par Method of function operation:
233 * @par Important notes:
237 * @return sync_agent_ec_task_spec_s structure on success
250 sync_agent_ec_task_spec_s *make_get_profile_statistics_task();
253 * @par Description: API to create reset synchronizing profiles task
257 * @par Typical use case:
258 * @par Method of function operation:
259 * @par Important notes:
263 * @return sync_agent_ec_task_spec_s structure on success
276 sync_agent_ec_task_spec_s *make_reset_synchronizing_profiles_task();
279 * @par Description: API to create reset synchronizing profiles task
283 * @par Typical use case:
284 * @par Method of function operation:
285 * @par Important notes:
289 * @return sync_agent_ec_task_spec_s structure on success
302 sync_agent_ec_task_spec_s *make_add_profile_cp_task();
305 * @par Description: API to create reset refresh_from_service task
309 * @par Typical use case:
310 * @par Method of function operation:
311 * @par Important notes:
315 * @return sync_agent_ec_task_spec_s structure on success
328 sync_agent_ec_task_spec_s *make_refresh_from_service_task();
331 * @par Description: API to create cancel network session task
335 * @par Typical use case:
336 * @par Method of function operation:
337 * @par Important notes:
341 * @return sync_agent_ec_task_spec_s structure on success
354 sync_agent_ec_task_spec_s *make_cancel_request_task();
357 * @par Description: API to reset all data
361 * @par Typical use case:
362 * @par Method of function operation:
363 * @par Important notes:
367 * @return sync_agent_ec_task_spec_s structure on success
380 sync_agent_ec_task_spec_s *make_reset_all_data_task();
383 * @par Description: API to get all profiles data
387 * @par Typical use case:
388 * @par Method of function operation:
389 * @par Important notes:
393 * @return sync_agent_ec_task_spec_s structure on success
406 sync_agent_ec_task_spec_s *make_get_all_profiles_data_task();
408 * @par Description: This API is callback function which runs when synchronize task is requested
412 * @par Typical use case:
413 * @par Method of function operation:
414 * @par Important notes:
415 * @param[in] unsigned int type, parameter count
416 * @param[in] array of parameters
419 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
420 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
432 sync_agent_ec_task_error_e synchronize_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
435 * @par Description: This API is callback function which runs when add profile task is requested
439 * @par Typical use case:
440 * @par Method of function operation:
441 * @par Important notes:
442 * @param[in] unsigned int type, parameter count
443 * @param[in] array of parameters
446 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
447 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
459 sync_agent_ec_task_error_e add_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
462 * @par Description: This API is callback function which runs when edit profile task is requested
466 * @par Typical use case:
467 * @par Method of function operation:
468 * @par Important notes:
469 * @param[in] unsigned int type, parameter count
470 * @param[in] array of parameters
473 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
474 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
486 sync_agent_ec_task_error_e edit_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
489 * @par Description: This API is callback function which runs when delete profiles task is requested
493 * @par Typical use case:
494 * @par Method of function operation:
495 * @par Important notes:
496 * @param[in] unsigned int type, parameter count
497 * @param[in] array of parameters
500 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
501 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
513 sync_agent_ec_task_error_e delete_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
516 * @par Description: This API is callback function which runs when get profile name task is requested
520 * @par Typical use case:
521 * @par Method of function operation:
522 * @par Important notes:
523 * @param[in] unsigned int type, parameter count
524 * @param[in] array of parameters
527 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
528 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
540 sync_agent_ec_task_error_e get_profile_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
543 * @par Description: This API is callback function which runs when get profile sync category task is requested
547 * @par Typical use case:
548 * @par Method of function operation:
549 * @par Important notes:
550 * @param[in] unsigned int type, parameter count
551 * @param[in] array of parameters
554 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
555 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
567 sync_agent_ec_task_error_e get_profile_sync_category_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
570 * @par Description: This API is callback function which runs when get profile last statistics task is requested
574 * @par Typical use case:
575 * @par Method of function operation:
576 * @par Important notes:
577 * @param[in] unsigned int type, parameter count
578 * @param[in] array of parameters
581 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
582 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
594 sync_agent_ec_task_error_e get_profile_statistics_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
597 * @par Description: This API is callback function which runs when reset synchronizing profiles task is requested
601 * @par Typical use case:
602 * @par Method of function operation:
603 * @par Important notes:
604 * @param[in] unsigned int type, parameter count
605 * @param[in] array of parameters
608 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
609 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
621 sync_agent_ec_task_error_e reset_synchronizing_profiles_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
624 * @par Description: This API is callback function which runs when cancel is requested
628 * @par Typical use case:
629 * @par Method of function operation:
630 * @par Important notes:
631 * @param[in] unsigned int type, parameter count
632 * @param[in] array of parameters
635 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
636 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
648 sync_agent_ec_task_error_e cancel_sync_request_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
651 * @par Description: This API is callback function which runs when reset function is requested
655 * @par Typical use case:
656 * @par Method of function operation:
657 * @par Important notes:
658 * @param[in] unsigned int type, parameter count
659 * @param[in] array of parameters
662 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
663 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
675 sync_agent_ec_task_error_e reset_all_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
678 * @par Description: This API is callback function which runs when reset function is requested
682 * @par Typical use case:
683 * @par Method of function operation:
684 * @par Important notes:
685 * @param[in] unsigned int type, parameter count
686 * @param[in] array of parameters
689 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
690 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
702 sync_agent_ec_task_error_e get_all_profiles_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
705 * @par Description: This API is callback function which runs when add profile for cp task is requested
709 * @par Typical use case:
710 * @par Method of function operation:
711 * @par Important notes:
712 * @param[in] unsigned int type, parameter count
713 * @param[in] array of parameters
716 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
717 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
729 sync_agent_ec_task_error_e add_profile_cp_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
732 * @par Description: This API is callback function which runs when refresh_from_service task is requested
736 * @par Typical use case:
737 * @par Method of function operation:
738 * @par Important notes:
739 * @param[in] unsigned int type, parameter count
740 * @param[in] array of parameters
743 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
744 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
756 sync_agent_ec_task_error_e refresh_from_service_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
759 * @par Description: API to insert request_msg_info_t structure into list
763 * @par Typical use case:
764 * @par Method of function operation:
765 * @par Important notes:
766 * @param[in] sync_type(SYNC_MODE_MANUAL, SYNC_MODE_PERIODIC, SYNC_MODE_SAN, SYNC_MODE_AUTOCONFIG)
767 * @param[in] request id
783 void insert_request_msg_info(int sync_type, unsigned int request_id);
786 * @par Description: API to delete request_msg_info_t structure from list
790 * @par Typical use case:
791 * @par Method of function operation:
792 * @par Important notes:
793 * @param[in] request id
809 void delete_request_msg_info(unsigned int request_id);
812 * @par Description: API to get synchronizing request id and delete request_msg_info_t structure from list
816 * @par Typical use case:
817 * @par Method of function operation:
818 * @par Important notes:
820 * @param[out] request id
822 * @return true on success
836 bool get_synchronizing_request_id(unsigned int *request_id);
839 * @par Description: API to get manual sync request id and delete request_msg_info_t structure from list
843 * @par Typical use case:
844 * @par Method of function operation:
845 * @par Important notes:
847 * @param[out] request id
849 * @return true on success
863 bool get_manual_sync_request_id(unsigned int *request_id);
866 * @par Description: API to get periodic sync request id and delete request_msg_info_t structure from list
870 * @par Typical use case:
871 * @par Method of function operation:
872 * @par Important notes:
874 * @param[out] request id
876 * @return true on success
890 bool get_periodic_sync_request_id(unsigned int *request_id);
893 * @par Description: API to get SAN sync request id and delete request_msg_info_t structure from list
897 * @par Typical use case:
898 * @par Method of function operation:
899 * @par Important notes:
901 * @param[out] request id
903 * @return true on success
917 bool get_san_sync_request_id(unsigned int *request_id);
920 * @par Description: API to get auto configure sync request id and delete request_msg_info_t structure from list
924 * @par Typical use case:
925 * @par Method of function operation:
926 * @par Important notes:
928 * @param[out] request id
930 * @return true on success
944 bool get_auto_configure_request_id(unsigned int *request_id);
947 * @par Description: cancel current sync task(auto configure task or sync task)
949 * if auto configure task is processing, cancel auto configure task
950 * if sync task is processing, cancel sync task
953 * @par Typical use case:
954 * @par Method of function operation:
955 * @par Important notes:
959 * @return true on success
973 bool cancel_current_sync_task();
975 #endif /* ENGINE_CONTROLLER_TASK_H_ */