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.
18 #ifndef DM_MO_COMMON_H_
19 #define DM_MO_COMMON_H_
22 #include <sync_agent.h>
25 #include "common/dm_common.h"
26 #include "dm_mo_common_internal.h"
27 #include "serviceadapter/sa_define.h"
29 /*=================================================================
31 * =================================================================
35 * @par Description: API to free dm acc
39 * @par Typical use case:
40 * @par Method of function operation:
41 * @par Important notes:
42 * @param[in] dm_acc structure
44 * @return DM_OK success
59 void free_dm_acc(dm_acc * dmaccount);
62 * @par Description: API to get_client_dmacc
66 * @par Typical use case:
67 * @par Method of function operation:
68 * @par Important notes:
69 * @param[in] server id server id
70 * @param[out] client id client id
71 * @param[out] client pw client pw
72 * @param[out] source url source url
73 * @param[out] target url targer url
74 * @param[out] base64 base64
75 * @param[out] nextnonce nextnonce
76 * @param[out] authType authType
78 * @return DM_OK success
93 DM_ERROR get_client_dmacc(char *pServer_id, char **client_id, char **client_pwd, char **sourceUrl, char **targetUrl, int *isBase64, char **nextNonce, char **authType);
96 * @par Description: API to get_server_dmacc
100 * @par Typical use case:
101 * @par Method of function operation:
102 * @par Important notes:
103 * @param[in] server id server id
104 * @param[out] client id client id
105 * @param[out] client pw client pw
106 * @param[out] source url source url
107 * @param[out] target url targer url
108 * @param[out] base64 base64
109 * @param[out] nextnonce nextnonce
110 * @param[out] authType authType
112 * @return DM_OK success
127 DM_ERROR get_server_dmacc(char *pServer_id, char **server_id, char **server_pwd, char **sourceUrl, char **targetUrl, int *isBase64, char **nextNonce, char **authType);
130 * @par Description: API to update dm acc
134 * @par Typical use case:
135 * @par Method of function operation:
136 * @par Important notes:
137 * @param[in] server id server id
138 * @param[out] dm_acc structure
155 int update_dmacc(char *pServer_id, dm_acc * dmaccount);
158 * @par Description: API to get dm acc auth type
162 * @par Typical use case:
163 * @par Method of function operation:
164 * @par Important notes:
165 * @param[in] server id server id
166 * @param[out] AuthType Auth type
168 * @return DM_OK success
183 DM_ERROR get_dmacc_authType(char *pServer_id, AuthType * pAuthType);
186 * @par Description: API to get_format
190 * @par Typical use case:
191 * @par Method of function operation:
192 * @par Important notes:
193 * @param[in] mo format mo format
194 * @param[out] format format
196 * @return DM_OK success
211 DM_ERROR get_format(sync_agent_dm_mo_format_e format_enum, char **format);
214 * @par Description: API to get_format_enum
218 * @par Typical use case:
219 * @par Method of function operation:
220 * @par Important notes:
221 * @param[in] format format
222 * @param[out] format_enum format_enum
224 * @return DM_OK success
239 DM_ERROR get_format_enum(char *format, sync_agent_dm_mo_format_e * format_enum);
242 * @par Description: API to get_contenttype
246 * @par Typical use case:
247 * @par Method of function operation:
248 * @par Important notes:
249 * @param[in] mo contenttype mo contenttype
250 * @param[out] contenttype contenttype
252 * @return DM_OK success
267 DM_ERROR get_contenttype(sync_agent_dm_mo_df_type_e contenttype_enum, char **contenttype);
271 * @par Description: API to reset dmacc mscserver
275 * @par Typical use case:
276 * @par Method of function operation:
277 * @par Important notes:
293 void reset_dmacc_mscserver();
296 * @par Description: API to reset dmacc msctestserver
300 * @par Typical use case:
301 * @par Method of function operation:
302 * @par Important notes:
318 void reset_dmacc_msctestserver();
321 * @par Description: API to get_format
325 * @par Typical use case:
326 * @par Method of function operation:
327 * @par Important notes:
343 void reset_dmacc_gcf();
346 * @par Description: API to reset_devinfo
350 * @par Typical use case:
351 * @par Method of function operation:
352 * @par Important notes:
368 void reset_devinfo();
371 * @par Description: API to reset_devdetail
375 * @par Typical use case:
376 * @par Method of function operation:
377 * @par Important notes:
393 void reset_devdetail();
396 * @par Description: API to get_mo_root_path
400 * @par Typical use case:
401 * @par Method of function operation:
402 * @par Important notes:
403 * @param[in] mo full path
404 * @param[in] root path
406 * @return DM_OK success
420 DM_ERROR get_mo_root_path(const char *mo_full_path, char **root_path);
423 * @par Description: API to get_engine_type_by_serverid
427 * @par Typical use case:
428 * @par Method of function operation:
429 * @par Important notes:
430 * @param[in] server id
432 * @return SERVICE_SERVER_TYPE
445 SERVICE_SERVER_TYPE get_engine_type_by_serverid(const char *server_id);
448 * @par Description: API to get_engine_type_by_serverid
452 * @par Typical use case:
453 * @par Method of function operation:
454 * @par Important notes:
455 * @param[in] mo full path
457 * @return SERVICE_SERVER_TYPE
470 SERVICE_SERVER_TYPE get_service_type(const char *mo_full_path);
473 * @par Description: API to get server id
477 * @par Typical use case:
478 * @par Method of function operation:
479 * @par Important notes:
480 * @param[in] server type
481 * @param[out] server id
483 * @return SERVICE_SERVER_TYPE
496 DM_ERROR get_Serverid(SERVICE_SERVER_TYPE mo_type, char **server_id);
499 * @par Description: API to get server type
503 * @par Typical use case:
504 * @par Method of function operation:
505 * @par Important notes:
506 * @param[in] server_id
507 * @param[out] mo_type
509 * @return SERVICE_SERVER_TYPE
522 DM_ERROR get_server_type(char *server_id, int *mo_type);
525 * @par Description: API to add dm acc
529 * @par Typical use case:
530 * @par Method of function operation:
531 * @par Important notes:
532 * @param[in] server_type server type
547 DM_ERROR add_dm_acc(SERVICE_SERVER_TYPE server_type);
550 * @par Description: API to remove dm acc
554 * @par Typical use case:
555 * @par Method of function operation:
556 * @par Important notes:
557 * @param[in] mo_path mo full path
572 DM_ERROR remove_dm_acc(char *mo_path);
575 * @par Description: API to check dm acc
579 * @par Typical use case:
580 * @par Method of function operation:
581 * @par Important notes:
582 * @param[in] dmacc_type dm acc type
583 * @param[out] is_exist check exist flag
598 DM_ERROR is_exist_dmacc(SERVICE_SERVER_TYPE dmacc_type, int *is_exist);
600 /*=================================================================
602 * =================================================================
605 * @par Description: API to this code is temp code fo test
609 * @par Typical use case:
610 * @par Method of function operation:
611 * @par Important notes:
627 void dmacc_define_fumo();
628 void dmacc_define_lawmo();
629 void devinfo_define();
630 void devdetail_define();
635 #endif /* DM_MO_COMMON_H_ */