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;
42 #define EC_MSG_TYPE_SYNC_TASK_REQUEST 1
43 #define EC_MSG_TYPE_NAME_SYNC_TASK_REQUEST "sync_request"
44 #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE 2
45 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE "add_profile"
46 #define EC_MSG_TYPE_SYNC_TASK_EDIT_PROFILE 3
47 #define EC_MSG_TYPE_NAME_SYNC_TASK_EDIT_PROFILE "edit_profile"
48 #define EC_MSG_TYPE_SYNC_TASK_DELETE_PROFILE 4
49 #define EC_MSG_TYPE_NAME_SYNC_TASK_DELETE_PROFILE "delete_profile"
50 #define EC_MSG_TYPE_SAN_TASK_REQUEST 5
51 #define EC_MSG_TYPE_NAME_SAN_TASK_REQUEST "SAN_request"
52 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_DATA 6
53 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_DATA "get_profile_data"
54 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY 7
55 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_SYNC_CATEGORY "get_profile_sync_category"
56 #define EC_MSG_TYPE_SYNC_TASK_GET_PROFILE_STATISTICS 8
57 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_PROFILE_STATISTICS "get_profile_statistics"
58 #define EC_MSG_TYPE_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES 9
59 #define EC_MSG_TYPE_NAME_SYNC_TASK_RESET_SYNCHRONIZING_PROFILES "reset_synchronizing_profiles"
60 #define EC_MSG_TYPE_SYNC_TASK_CANCEL_SYNC_REQUEST 10
61 #define EC_MSG_TYPE_NAME_SYNC_TASK_CANCEL_SYNC_REQUEST "cancel_sync_request"
62 #define EC_MSG_TYPE_SYNC_TASK_ADD_PROFILE_CP 11
63 #define EC_MSG_TYPE_NAME_SYNC_TASK_ADD_PROFILE_CP "add_profile_cp"
64 #define EC_MSG_TYPE_SYNC_TASK_REFRESH_FROM_SERVICE 12
65 #define EC_MSG_TYPE_NAME_SYNC_TASK_REFRESH_FROM_SERVICE "refresh_from_service"
66 #define EC_MSG_TYPE_SYNC_TASK_RESET_ALL_DATA 13
67 #define EC_MSG_TYPE_NAME_SYNC_TASK_RESET_ALL_DATA "reset_all_data"
68 #define EC_MSG_TYPE_SYNC_TASK_GET_ALL_PROFILES_DATA 14
69 #define EC_MSG_TYPE_NAME_SYNC_TASK_GET_ALL_PROFILES_DATA "get_all_profiles_data"
72 * @par Description: API to create synchronize task
76 * @par Typical use case:
77 * @par Method of function operation:
78 * @par Important notes:
82 * @return sync_agent_ec_task_spec_s structure on success
95 sync_agent_ec_task_spec_s *make_synchronize_task();
98 * @par Description: API to create synchronize task
102 * @par Typical use case:
103 * @par Method of function operation:
104 * @par Important notes:
108 * @return sync_agent_ec_task_spec_s structure on success
121 sync_agent_ec_task_spec_s *make_add_profile_task();
124 * @par Description: API to create edit profile task
128 * @par Typical use case:
129 * @par Method of function operation:
130 * @par Important notes:
134 * @return sync_agent_ec_task_spec_s structure on success
147 sync_agent_ec_task_spec_s *make_edit_profile_task();
150 * @par Description: API to create delete profiles task
154 * @par Typical use case:
155 * @par Method of function operation:
156 * @par Important notes:
160 * @return sync_agent_ec_task_spec_s structure on success
173 sync_agent_ec_task_spec_s *make_delete_profile_task();
176 * @par Description: API to create get profile data task
180 * @par Typical use case:
181 * @par Method of function operation:
182 * @par Important notes:
186 * @return sync_agent_ec_task_spec_s structure on success
199 sync_agent_ec_task_spec_s *make_get_profile_data_task();
202 * @par Description: API to create get profile sync category task
206 * @par Typical use case:
207 * @par Method of function operation:
208 * @par Important notes:
212 * @return sync_agent_ec_task_spec_s structure on success
225 sync_agent_ec_task_spec_s *make_get_profile_sync_category_task();
228 * @par Description: API to create get profile last statistics task
232 * @par Typical use case:
233 * @par Method of function operation:
234 * @par Important notes:
238 * @return sync_agent_ec_task_spec_s structure on success
251 sync_agent_ec_task_spec_s *make_get_profile_statistics_task();
254 * @par Description: API to create reset synchronizing profiles task
258 * @par Typical use case:
259 * @par Method of function operation:
260 * @par Important notes:
264 * @return sync_agent_ec_task_spec_s structure on success
277 sync_agent_ec_task_spec_s *make_reset_synchronizing_profiles_task();
280 * @par Description: API to create reset synchronizing profiles task
284 * @par Typical use case:
285 * @par Method of function operation:
286 * @par Important notes:
290 * @return sync_agent_ec_task_spec_s structure on success
303 sync_agent_ec_task_spec_s *make_add_profile_cp_task();
306 * @par Description: API to create reset refresh_from_service task
310 * @par Typical use case:
311 * @par Method of function operation:
312 * @par Important notes:
316 * @return sync_agent_ec_task_spec_s structure on success
329 sync_agent_ec_task_spec_s *make_refresh_from_service_task();
332 * @par Description: API to create cancel network session task
336 * @par Typical use case:
337 * @par Method of function operation:
338 * @par Important notes:
342 * @return sync_agent_ec_task_spec_s structure on success
355 sync_agent_ec_task_spec_s *make_cancel_request_task();
358 * @par Description: API to reset all data
362 * @par Typical use case:
363 * @par Method of function operation:
364 * @par Important notes:
368 * @return sync_agent_ec_task_spec_s structure on success
381 sync_agent_ec_task_spec_s *make_reset_all_data_task();
384 * @par Description: API to get all profiles data
388 * @par Typical use case:
389 * @par Method of function operation:
390 * @par Important notes:
394 * @return sync_agent_ec_task_spec_s structure on success
407 sync_agent_ec_task_spec_s *make_get_all_profiles_data_task();
409 * @par Description: This API is callback function which runs when synchronize task is requested
413 * @par Typical use case:
414 * @par Method of function operation:
415 * @par Important notes:
416 * @param[in] unsigned int type, parameter count
417 * @param[in] array of parameters
420 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
421 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
433 sync_agent_ec_task_error_e synchronize_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
436 * @par Description: This API is callback function which runs when add profile task is requested
440 * @par Typical use case:
441 * @par Method of function operation:
442 * @par Important notes:
443 * @param[in] unsigned int type, parameter count
444 * @param[in] array of parameters
447 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
448 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
460 sync_agent_ec_task_error_e add_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
463 * @par Description: This API is callback function which runs when edit profile task is requested
467 * @par Typical use case:
468 * @par Method of function operation:
469 * @par Important notes:
470 * @param[in] unsigned int type, parameter count
471 * @param[in] array of parameters
474 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
475 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
487 sync_agent_ec_task_error_e edit_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
490 * @par Description: This API is callback function which runs when delete profiles task is requested
494 * @par Typical use case:
495 * @par Method of function operation:
496 * @par Important notes:
497 * @param[in] unsigned int type, parameter count
498 * @param[in] array of parameters
501 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
502 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
514 sync_agent_ec_task_error_e delete_profile_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
517 * @par Description: This API is callback function which runs when get profile name task is requested
521 * @par Typical use case:
522 * @par Method of function operation:
523 * @par Important notes:
524 * @param[in] unsigned int type, parameter count
525 * @param[in] array of parameters
528 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
529 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
541 sync_agent_ec_task_error_e get_profile_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
544 * @par Description: This API is callback function which runs when get profile sync category task is requested
548 * @par Typical use case:
549 * @par Method of function operation:
550 * @par Important notes:
551 * @param[in] unsigned int type, parameter count
552 * @param[in] array of parameters
555 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
556 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
568 sync_agent_ec_task_error_e get_profile_sync_category_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
571 * @par Description: This API is callback function which runs when get profile last statistics task is requested
575 * @par Typical use case:
576 * @par Method of function operation:
577 * @par Important notes:
578 * @param[in] unsigned int type, parameter count
579 * @param[in] array of parameters
582 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
583 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
595 sync_agent_ec_task_error_e get_profile_statistics_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
598 * @par Description: This API is callback function which runs when reset synchronizing profiles task is requested
602 * @par Typical use case:
603 * @par Method of function operation:
604 * @par Important notes:
605 * @param[in] unsigned int type, parameter count
606 * @param[in] array of parameters
609 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
610 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
622 sync_agent_ec_task_error_e reset_synchronizing_profiles_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
625 * @par Description: This API is callback function which runs when cancel is requested
629 * @par Typical use case:
630 * @par Method of function operation:
631 * @par Important notes:
632 * @param[in] unsigned int type, parameter count
633 * @param[in] array of parameters
636 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
637 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
649 sync_agent_ec_task_error_e cancel_sync_request_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
652 * @par Description: This API is callback function which runs when reset function is requested
656 * @par Typical use case:
657 * @par Method of function operation:
658 * @par Important notes:
659 * @param[in] unsigned int type, parameter count
660 * @param[in] array of parameters
663 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
664 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
676 sync_agent_ec_task_error_e reset_all_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
679 * @par Description: This API is callback function which runs when all profiles data gets.
683 * @par Typical use case:
684 * @par Method of function operation:
685 * @par Important notes:
686 * @param[in] unsigned int type, parameter count
687 * @param[in] array of parameters
690 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
691 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
703 sync_agent_ec_task_error_e get_all_profiles_data_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
706 * @par Description: This API is callback function which runs when add profile for cp task is requested
710 * @par Typical use case:
711 * @par Method of function operation:
712 * @par Important notes:
713 * @param[in] unsigned int type, parameter count
714 * @param[in] array of parameters
717 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
718 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
730 sync_agent_ec_task_error_e add_profile_cp_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
733 * @par Description: This API is callback function which runs when refresh_from_service task is requested
737 * @par Typical use case:
738 * @par Method of function operation:
739 * @par Important notes:
740 * @param[in] unsigned int type, parameter count
741 * @param[in] array of parameters
744 * @return SYNC_AGENT_EC_TASK_ERROR_RUN_SUCCESS on success
745 * SYNC_AGENT_EC_TASK_ERROR_RUN_FAILED on error
757 sync_agent_ec_task_error_e refresh_from_service_task_process(unsigned int param_cnt, sync_agent_ec_param_param_s ** param_array);
760 * @par Description: API to insert request_msg_info_t structure into list
764 * @par Typical use case:
765 * @par Method of function operation:
766 * @par Important notes:
767 * @param[in] sync_type(SYNC_MODE_MANUAL, SYNC_MODE_PERIODIC, SYNC_MODE_SAN, SYNC_MODE_AUTOCONFIG)
768 * @param[in] request id
769 * @param[in] profile_id
785 void insert_request_msg_info(int sync_type, unsigned int request_id, int profile_id);
788 * @par Description: API to delete request_msg_info_t structure from list
792 * @par Typical use case:
793 * @par Method of function operation:
794 * @par Important notes:
795 * @param[in] request id
811 void delete_request_msg_info(unsigned int request_id);
814 * @par Description: API to get synchronizing request id and delete request_msg_info_t structure from list
818 * @par Typical use case:
819 * @par Method of function operation:
820 * @par Important notes:
822 * @param[out] request id
824 * @return true on success
838 bool get_synchronizing_request_id(unsigned int *request_id);
841 * @par Description: API to get synchronizing profile id
845 * @par Typical use case:
846 * @par Method of function operation:
847 * @par Important notes:
849 * @param[out] pProfile_id
851 * @return true on success
865 bool get_synchronizing_profile_id(int *pProfile_id);
868 * @par Description: API to get manual sync request id and delete request_msg_info_t structure from list
872 * @par Typical use case:
873 * @par Method of function operation:
874 * @par Important notes:
876 * @param[out] request id
878 * @return true on success
892 bool get_manual_sync_request_id(unsigned int *request_id);
895 * @par Description: API to get periodic sync request id and delete request_msg_info_t structure from list
899 * @par Typical use case:
900 * @par Method of function operation:
901 * @par Important notes:
903 * @param[out] request id
905 * @return true on success
919 bool get_periodic_sync_request_id(unsigned int *request_id);
922 * @par Description: API to get SAN sync request id and delete request_msg_info_t structure from list
926 * @par Typical use case:
927 * @par Method of function operation:
928 * @par Important notes:
930 * @param[out] request id
932 * @return true on success
946 bool get_san_sync_request_id(unsigned int *request_id);
949 * @par Description: API to get auto configure sync request id and delete request_msg_info_t structure from list
953 * @par Typical use case:
954 * @par Method of function operation:
955 * @par Important notes:
957 * @param[out] request id
959 * @return true on success
973 bool get_auto_configure_request_id(unsigned int *request_id);
976 * @par Description: cancel current sync task(auto configure task or sync task)
978 * if auto configure task is processing, cancel auto configure task
979 * if sync task is processing, cancel sync task
982 * @par Typical use case:
983 * @par Method of function operation:
984 * @par Important notes:
988 * @return true on success
1002 bool cancel_current_sync_task();
1004 #endif /* ENGINE_CONTROLLER_TASK_H_ */