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.
21 * @brief This file is the header file of defined common interface for using oma-dm-agent
24 #ifndef OMA_DM_COMMON_H_
25 #define OMA_DM_COMMON_H_
34 #include "common/dm-status/oma_dm_status_db_common.h"
35 #include "common/dm-status/oma_dm_status_db_handler.h"
36 #include "common/dm-status/oma_dm_status_db.h"
37 #include "common/dm_common_def.h"
38 #include "common/dm_error.h"
39 #include "framework/platform-event-handler/dm_platform_event_handler.h"
42 * @par Description: API to initiate dm-service
46 * @par Typical use case:
47 * @par par Method of function operation:
48 * @par Important notes:
50 * @return DM_OK on success
66 * @par Description: API to end dm-service
70 * @par Typical use case:
71 * @par par Method of function operation:
72 * @par Important notes:
74 * @return DM_OK on success
90 * @par Description: API to reset dm-service
94 * @par Typical use case:
95 * @par par Method of function operation:
96 * @par Important notes:
98 * @return DM_OK on success
114 * @par Description: API to operate service engine (fumo, lawmo) by dm status db query API
118 * @par Typical use case:
119 * @par par Method of function operation:
120 * @par Important notes:
122 * @return DM_OK on success
135 DM_ERROR auto_operate_service_engine();
138 * @par Description: API to register scheduler(alarm)
142 * @par Typical use case:
143 * @par par Method of function operation:
144 * @par Important notes:
146 * @return 1 on success
160 int register_scheduler();
163 * @par Description: API to register wap push module
167 * @par Typical use case:
168 * @par par Method of function operation:
169 * @par Important notes:
171 * @return 1 on success
185 int register_wap_push();
188 * @par Description: API to register fumo ip push module
192 * @par Typical use case:
193 * @par par Method of function operation:
194 * @par Important notes:
196 * @return 1 on success
210 int register_fumo_ip_push();
213 * @par Description: API to register lawmo samsung account
217 * @par Typical use case:
218 * @par par Method of function operation:
219 * @par Important notes:
221 * @return 1 on success
235 int register_lawmo_samsung_account();
238 * @par Description: API to register telephony module
242 * @par Typical use case:
243 * @par par Method of function operation:
244 * @par Important notes:
246 * @return 1 on success
260 int register_telephony();
263 * @par Description: API to register network
267 * @par Typical use case:
268 * @par par Method of function operation:
269 * @par Important notes:
271 * @return 1 on success
285 int register_network();
288 * @par Description: API to cancel network callback function
292 * @par Typical use case:
293 * @par par Method of function operation:
294 * @par Important notes:
295 * @param[in] user data(network session id)
311 void network_cancel_callback(void *user_data);
314 * @par Description: API to delay network connection
318 * @par Typical use case:
319 * @par par Method of function operation:
320 * @par Important notes:
335 void network_connection_delay();
338 *@par Description: API to set account registration alarm
342 * @par Typical use case:
343 * @par par Method of function operation:
344 * @par Important notes:
345 * @param[in] alarm type string(fumo, fmm)
346 * @param[in] alarm type(fumo, fmm)
348 * @return DM_OK on success
362 DM_ERROR set_account_registration_alarm(char *alarm_str, CONFIG_TYPE alarm_type);
365 * @par Description: API to delete fota account registration alarm
369 * @par Typical use case:
370 * @par par Method of function operation:
371 * @par Important notes:
372 * @param[in] alarm type string
373 * @param[in] alarm type
388 void delete_account_registration_alarm(char *alarm_str, CONFIG_TYPE alarm_type);
391 * @par Description: API to set alarm schedule
395 * @par Typical use case:
396 * @par par Method of function operation:
397 * @par Important notes:
398 * @param[in] reminder interval
399 * @param[in] alarm type
400 * @param[in] config type
402 * @return DM_OK on success
416 DM_ERROR add_alarm_item(Reminder_Interval interval, char *alarm_type, CONFIG_TYPE conf_type);
419 * @par Description: API to delete alarm schedule
423 * @par Typical use case:
424 * @par par Method of function operation:
425 * @par Important notes:
426 * @param[in] alarm type
427 * @param[in] config type
442 void delete_alarm_item(char *alarm_type, CONFIG_TYPE conf_type);
445 * @par Description: API to start fumo service
449 * @par Typical use case:
450 * @par par Method of function operation:
451 * @par Important notes:
452 * @param[in] event contents
454 * @return DM_OK on success
468 DM_ERROR fumo_service_start(Event_Contents * pEvent_data);
471 * @par Description: API to get service engine type
475 * @par Typical use case:
476 * @par par Method of function operation:
477 * @par Important notes:
478 * @param[in] service engine type string
480 * @return SAMSUNG_FUMO_TYPE
496 SERVICE_SERVER_TYPE get_service_engine_type(const char *service_engine_type);
499 * @par Description: API to get server information
503 * @par Typical use case:
504 * @par par Method of function operation:
505 * @par Important notes:
506 * @param[in] Event contents
507 * @param[out] server id
508 * @param[out] session id
509 * @param[out] session type
511 * @return DM_OK on success
525 DM_ERROR get_server_info(Event_Contents * pEvent_data, char **server_id, char **session_id, int *session_type);
528 * @par Description: API to get fumo ui mode
532 * @par Typical use case:
533 * @par par Method of function operation:
534 * @par Important notes:
535 * @param[out] ui mode
537 * @return DM_OK on success
551 DM_ERROR get_fumo_ui_mode(char **ui_mode);
554 * @par Description: API to check existed fumo remind interval
558 * @par Typical use case:
559 * @par par Method of function operation:
560 * @par Important notes:
562 * @return 1 on success
576 int check_existed_fumo_reminder_interval();
579 * @par Description: API to init defult fumo configuration
583 * @par Typical use case:
584 * @par par Method of function operation:
585 * @par Important notes:
601 int init_default_fumo_config();
604 * @par Description: API to set configuration int value
608 * @par Typical use case:
609 * @par par Method of function operation:
610 * @par Important notes:
611 * @param[in] config_type
614 * @param[in] accessName
631 int set_config_int(CONFIG_TYPE config_type, char *key, int value, char *accessName, int isFirst);
634 * @par Description: API to set alarm configuration int value
638 * @par Typical use case:
639 * @par par Method of function operation:
640 * @par Important notes:
641 * @param[in] config_type
644 * @param[in] accessName
660 int set_alarm_config_int(CONFIG_TYPE config_type, char *key, int value, char *accessName);
663 * @par Description: API to get configuration int value
667 * @par Typical use case:
668 * @par par Method of function operation:
669 * @par Important notes:
670 * @param[in] config id
687 int get_config_int(CONFIG_TYPE config_id, char *key);
690 * @par Description: API to get wifi only config
694 * @par Typical use case:
695 * @par par Method of function operation:
696 * @par Important notes:
698 * @return 1 on success
712 int get_wifi_only_config();
715 * @par Description: API to set wifi only config
719 * @par Typical use case:
720 * @par par Method of function operation:
721 * @par Important notes:
724 * @return 1 on success
738 int set_wifi_only_config(int value);
741 * @par Description: API to get battery state
745 * @par Typical use case:
746 * @par par Method of function operation:
747 * @par Important notes:
748 * @param[out] battery value
764 DM_ERROR get_battery_state(char **battery_level);
767 * @par Description: API to check existed sd card memory
771 * @par Typical use case:
772 * @par par Method of function operation:
773 * @par Important notes:
774 * @param[out] existed sd
776 * @return DM_OK on success
777 * DM_SD_CARD_ERROR on error
790 DM_ERROR existed_sd_card_memory(int *existed_sd);
793 * @par Description: API to get telephony state
797 * @par Typical use case:
798 * @par par Method of function operation:
799 * @par Important notes:
800 * @param[out] now calling
802 * @return DM_OK on success
803 * DM_TELEPHONY_ERROR on errorS
816 DM_ERROR get_telephony_state(int *now_calling);
819 * @par Description: API to get compare memory space
823 * @par Typical use case:
824 * @par par Method of function operation:
825 * @par Important notes:
826 * @param[in] memory_type
827 * @param[in] file_size
829 * @return DM_OK on success
830 * DM_MEMORY_ERROR, DM_OVER_MEMORY_ERROR on error
843 DM_ERROR compare_memory_space(char *memory_type, long double file_size);
846 * @par Description: API to get roaming state
850 * @par Typical use case:
851 * @par par Method of function operation:
852 * @par Important notes:
853 * @param[in] roaming_state
868 void get_roaming_state(int *roaming_state);
871 * @par Description: API to get call state
875 * @par Typical use case:
876 * @par par Method of function operation:
877 * @par Important notes:
878 * @param[in] call_state
893 void get_call_sate(int *call_state);
896 * @par Description: API to get mmc state
900 * @par Typical use case:
901 * @par par Method of function operation:
902 * @par Important notes:
903 * @param[out] mmc_state
905 * @return 1 on success
919 int get_mmc_state(int *mmc_state);
922 * @par Description: API to get fota download_dir
926 * @par Typical use case:
927 * @par par Method of function operation:
928 * @par Important notes:
929 * @param[in] memory type
930 * @param[out] download folder path
932 * @return DM_OK on success
933 * DM_MEMORY_ERROR on fail
944 DM_ERROR get_fota_download_dir(MEMORY_TYPE type, char **download_folder);
947 * @par Description: API to get fota save dir
951 * @par Typical use case:
952 * @par par Method of function operation:
953 * @par Important notes:
954 * @param[in] memory type
955 * @param[out] save folder path
957 * @return DM_OK on success
958 * DM_MEMORY_ERROR on fail
971 DM_ERROR get_fota_save_dir(MEMORY_TYPE type, char **save_folder);
974 * @par Description: API to delete fumo contents
978 * @par Typical use case:
979 * @par par Method of function operation:
980 * @par Important notes:
981 * @param[in] memory type
996 void delete_fumo_contents(MEMORY_TYPE memory_type);
999 * @par Description: API to the first server bootstrap
1003 * @par Typical use case:
1004 * @par par Method of function operation:
1005 * @par Important notes:
1006 * @param[in] server id
1021 void first_server_bootstrap(char *server_id);
1024 * @par Description: API to get default noti type
1028 * @par Typical use case:
1029 * @par par Method of function operation:
1030 * @par Important notes:
1031 * @param[in] ui mode
1032 * @param[in] noti type
1047 int get_default_noti_type(char *ui_mode, NotI_Type noti_type);
1050 * @par Description: API to get new url
1054 * @par Typical use case:
1055 * @par par Method of function operation:
1056 * @par Important notes:
1058 * @param[out] new uri
1073 char *get_new_uri(char *old_object_uri);
1075 #endif /* OMA_DM_COMMON_H_ */