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 * @SA_Common_Interface.h
21 * @brief This file is the header file of interface of SA
25 #ifndef SA_COMMON_INTERFACE_H_
26 #define SA_COMMON_INTERFACE_H_
29 * @par Description: API to process pre-action that has to be befor sync service
31 * Exchage Pkg1 and Pkg2 with server
32 * Get Device Information
35 * @par Typical use case:
36 * @par Method of function operation:
37 * @par Important notes:
38 * @param[in] int type, transport Type(obex, FW_HTTP ...)
39 * @param[in] int type, account id
40 * @param[in] string type, session id
41 * @param[in] int type, whether server is fmm server for calllog or not
42 * @param[out] pre_sync_return_obj_s structure(result from pkg2)
44 * @return common_error_type_e enum value
57 int pre_sync(int transport_type, int account_id, char *session_id, int server_flag, void **pre_sync_return_obj);
60 * @par Description: API to generate protocol specific msg
62 * Generate MSg which be considered maxMsgSize and maxObjSize
65 * @par Typical use case:
66 * @par Method of function operation:
67 * @par Important notes:
68 * @param[in] sync_obj_s structure
69 * @param[in] int type, whether server is fmm server for calllog or not
71 * @param[out] msg size
73 * @return common_error_type_e enum value
86 int generate_msg(void **sync_obj, int server_flag, char **msg, unsigned int *msg_size);
89 * @par Description: API to exchange protocol specific msg with server
91 * Exchange protocol specific msg(request and response) using header binding information with server
94 * @par Typical use case:
95 * @par Method of function operation:
96 * @par Important notes:
97 * @param[in] int type, transport protocol type(http, obex etc)
98 * @param[in] string type, msg to send
99 * @param[in] unsigned int type, msg size
100 * @param[out] string type, receive msg
101 * @param[out] unsigned int type, receive msg size
103 * @return common_error_type_e enum value
116 int exchange_msg(int transport_type, char *send_msg, unsigned int send_msg_length, char **recv_msg, unsigned int *recv_msg_length);
119 * @par Description: API to process response msg from server
121 * Process response msg from server and convert to obj that return to Service Engine
124 * @par Typical use case:
125 * @par Method of function operation:
126 * @par Important notes:
127 * @param[in] string type, recive msg from server
128 * @param[in] unsigned int type, receive msg size
129 * @param[in] int type, whether or not to end in pkg4
130 * @param[out] sync_return_obj_s structure
131 * @param[out] int type, flag for finsih sync session
133 * @return common_error_type_e enum value
146 int process_recv_msg(char *recv_msg, unsigned int recv_msg_length, int only_from_client, void **sync_return_obj, int *is_finish);
149 * @par Description: API to free session_s structure and close connection
151 * This API for case that error or cancel occur in ServiceEngine so need to clean up resource which using in ServiceAdapter
154 * @par Typical use case:
155 * @par Method of function operation:
156 * @par Important notes:
176 * @par Description: API to process auto configure function
180 * @par Typical use case:
181 * @par Method of function operation:
182 * @par Important notes:
183 * @param[in] string type, server ip
184 * @param[in] string type, id
185 * @param[in] string type, password
186 * @param[out] GList type, list of auto configure results
188 * @return common_error_type_e enum value
201 int auto_configure(char *addr, char *id, char *password, GList ** congifure);
204 * @par Description: API to check cancel status
206 * Cancel flag is set and if engine is going to process pkg 5 & 6
207 * keep going until finish sync session
211 * @par Typical use case:
212 * @par Method of function operation:
213 * @par Important notes:
215 * @return 1 means Do cancel
216 * 0 means Do not cancel
229 int check_cancel_status();
232 * @par Description: API to suspend current sync session
234 * Send alert 224 to server and status if there are
238 * @par Typical use case:
239 * @par Method of function operation:
240 * @par Important notes:
241 * @param[in] int type, transport Type(obex, FW_HTTP ...)
242 * @param[in] int type, account id
244 * @return common_error_type_e enum value
257 int suspend_sync(int transport_type, int account_id, int server_flag);
260 * @par Description: API to cancel connection during sync session
265 * @par Typical use case:
266 * @par Method of function operation:
267 * @par Important notes:
268 * @param[in] int type, transport Type(obex, FW_HTTP ...)
270 * @return common_error_type_e enum value
283 int cancel_connection_sync_request(int transport_type);
285 #endif /* SA_COMMON_INTERFACE_H_ */