4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: JuHak Park <juhaki.park@samsung.com>,
7 * JuneHyuk Lee <junhyuk7.lee@samsung.com>,
8 * SunBong Ha <sunbong.ha@samsung.com>
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
29 * For any sort of issue you concern as to this software,
30 * you may use following point of contact.
31 * All resources contributed on this software
32 * are orinigally written by S-Core Inc., a member of Samsung Group.
34 * SeongWon Shim <seongwon.shim@samsung.com>
40 * @brief This file is the header file of interface of Session structure
46 #include "ServiceAdapter/SA_Define.h"
49 * @par Description: API to create Session structure
50 * This API can be used to create Session structure
53 * @par Typical use case:
54 * @par Method of function operation:
55 * @par Important notes:
56 * @param[in] enum type, protocol version(VERSION_UNKNOWN, VERSION_10, VERSION_11, VERSION_12);
57 * @param[in] enum type, protocol type(PROTOCOL_TYPE_UNKNOWN, PROTOCOL_TYPE_DS)
58 * @param[in] int type, account id
59 * @param[in] int type, session id
60 * @param[in] string type, source uri(server ip)
61 * @param[in] string type, target uri(client identifer)
62 * @param[out] Session structure
64 * @return ERROR_INTERNAL_OK on success
65 * ERROR_INTERNAL_NO_MEMORY on error
78 SA_ErrorType create_session(ProtocolVersion protocolVersion, ProtocolType protocolType,
79 int accountId, char *sessID, char *source, char *target, Session **pSession);
82 * @par Description: API to free Session structure
83 * This API can be used to free Session structure
86 * @par Typical use case:
87 * @par Method of function operation:
88 * @par Important notes:
89 * @param[in] Session structure
104 void free_session(Session *session);
107 * @par Description: API to set Cred structure in Session structure
108 * This API can be used to set Cred structure in Session structure
111 * @par Typical use case:
112 * @par Method of function operation:
113 * @par Important notes:
114 * @param[in] Session structure
115 * @param[in] Cred structure
130 void set_session_cred(Session *session, Cred *cred);
133 * @par Description: API to set DevInf structure in Session structure
134 * This API can be used to set DevInf structure in Session structure
137 * @par Typical use case:
138 * @par Method of function operation:
139 * @par Important notes:
140 * @param[in] Session structure
141 * @param[in] DevInf structure
156 void set_session_devinf(Session *session, DevInf *devInf);
159 * @par Description: API to create PendingStatus structure
160 * This API can be used to set DevInf structure in Session structure
163 * @par Typical use case:
164 * @par Method of function operation:
165 * @par Important notes:
166 * @param[in] unsigned int type, msg id
167 * @param[in] unsigned int type, cmd id
168 * @param[out] PendingStatus structure
170 * @return ERROR_INTERNAL_OK on success
171 * ERROR_INTERNAL_NO_MEMORY on error
183 SA_ErrorType create_pending_status(unsigned int msgID, unsigned int cmdID, PendingStatus **pPendingStatus);
186 * @par Description: API to process SyncHdr structure from server
187 * This API manage responseURI
188 * set server info in Session structure
189 * check header credential
190 * create Status structure for header
193 * @par Typical use case:
194 * @par Method of function operation:
195 * @par Important notes:
196 * @param[in] session structure
197 * @param[in] SyncHdr structure
199 * @return ERROR_INTERNAL_OK on success
200 * ERROR_INTERNAL_NO_MEMORY on error
212 SA_ErrorType receive_header(Session *session, SyncHdr *header);
215 * @par Description: API to process list of Status structure from server
216 * This API check credential status
217 * process Status structure for each type
218 * create AppliedStatus structure for passing to ServiceEngine
221 * @par Typical use case:
222 * @par Method of function operation:
223 * @par Important notes:
224 * @param[in] session structure
225 * @param[in] GList type, list of Status structure
226 * @param[out] GList type, list of AppliedStatus structure
228 * @return ERROR_INTERNAL_OK on success
229 * ERROR_INTERNAL_ERROR, ERROR_SERVER_FAILURE, ERROR_INTERNAL_BUSY_SIGNALING on error
241 SA_ErrorType receive_statuses(Session *session, GList *receiveStatus, GList **returnStatus);
244 * @par Description: API to process list of Command structure from server
245 * This API check credential status
246 * process Command structure for each type
247 * create ChangedDatastore structure for passing to ServiceEngine
250 * @par Typical use case:
251 * @par Method of function operation:
252 * @par Important notes:
253 * @param[in] session structure
254 * @param[in] GList type, list of Command structure
255 * @param[in] whether auto configure or not
256 * @param[out] GList type, list of ChangedDatastore structure
258 * @return ERROR_INTERNAL_OK on success
259 * ERROR_INTERNAL_ERROR, ERROR_INTERNAL_NO_MEMORY, ERROR_INTERNAL_NOT_DEFINED on error
271 SA_ErrorType receive_commands(Session *session, GList *receiveCommand, bool autoConfig, GList **returnDatastore);
275 * @par Description: API to reset cmd id(1) in session
278 * @par Typical use case:
279 * @par Method of function operation:
280 * @par Important notes:
281 * @param[in] Session structure
296 void reset_cmdID_session(Session *session);
299 #endif /* SE_SESSION_H_ */