summaryrefslogtreecommitdiff
path: root/include/common/dm_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/common/dm_common.h')
-rwxr-xr-xinclude/common/dm_common.h1075
1 files changed, 1075 insertions, 0 deletions
diff --git a/include/common/dm_common.h b/include/common/dm_common.h
new file mode 100755
index 0000000..56ef319
--- /dev/null
+++ b/include/common/dm_common.h
@@ -0,0 +1,1075 @@
+/*
+ * oma-dm-agent
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @DM_Common.h
+ * @version 0.1
+ * @brief This file is the header file of defined common interface for using oma-dm-agent
+ */
+
+#ifndef OMA_DM_COMMON_H_
+#define OMA_DM_COMMON_H_
+
+/*lib*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+/*dm-agent*/
+#include "common/dm-status/oma_dm_status_db_common.h"
+#include "common/dm-status/oma_dm_status_db_handler.h"
+#include "common/dm-status/oma_dm_status_db.h"
+#include "common/dm_common_def.h"
+#include "common/dm_error.h"
+#include "framework/platform-event-handler/dm_platform_event_handler.h"
+
+/**
+ * @par Description: API to initiate dm-service
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return DM_OK on success
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR init_dm();
+
+/**
+ * @par Description: API to end dm-service
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return DM_OK on success
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR end_dm();
+
+/**
+ * @par Description: API to reset dm-service
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return DM_OK on success
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR reset_dm();
+
+/**
+ * @par Description: API to operate service engine (fumo, lawmo) by dm status db query API
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return DM_OK on success
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR auto_operate_service_engine();
+
+/**
+ * @par Description: API to register scheduler(alarm)
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int register_scheduler();
+
+/**
+ * @par Description: API to register wap push module
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int register_wap_push();
+
+/**
+ * @par Description: API to register fumo ip push module
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int register_fumo_ip_push();
+
+/**
+ * @par Description: API to register lawmo samsung account
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int register_lawmo_samsung_account();
+
+/**
+ * @par Description: API to register telephony module
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int register_telephony();
+
+/**
+ * @par Description: API to register network
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int register_network();
+
+/**
+ * @par Description: API to cancel network callback function
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] user data(network session id)
+ *
+ * @return
+ *
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void network_cancel_callback(void *user_data);
+
+/**
+ * @par Description: API to delay network connection
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void network_connection_delay();
+
+/**
+ *@par Description: API to set account registration alarm
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] alarm type string(fumo, fmm)
+ * @param[in] alarm type(fumo, fmm)
+ *
+ * @return DM_OK on success
+ * DM_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR set_account_registration_alarm(char *alarm_str, CONFIG_TYPE alarm_type);
+
+/**
+ * @par Description: API to delete fota account registration alarm
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] alarm type string
+ * @param[in] alarm type
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void delete_account_registration_alarm(char *alarm_str, CONFIG_TYPE alarm_type);
+
+/**
+ * @par Description: API to set alarm schedule
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] reminder interval
+ * @param[in] alarm type
+ * @param[in] config type
+ *
+ * @return DM_OK on success
+ * DM_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR add_alarm_item(Reminder_Interval interval, char *alarm_type, CONFIG_TYPE conf_type);
+
+/**
+ * @par Description: API to delete alarm schedule
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] alarm type
+ * @param[in] config type
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void delete_alarm_item(char *alarm_type, CONFIG_TYPE conf_type);
+
+/**
+ * @par Description: API to start fumo service
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] event contents
+ *
+ * @return DM_OK on success
+ * DM_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR fumo_service_start(Event_Contents * pEvent_data);
+
+/**
+ * @par Description: API to get service engine type
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] service engine type string
+ *
+ * @return SAMSUNG_FUMO_TYPE
+ * SAMSUNG_FMM_TYPE
+ * GCF_TYPE
+ * NO_ENGINE_TYPE
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+SERVICE_SERVER_TYPE get_service_engine_type(const char *service_engine_type);
+
+/**
+ * @par Description: API to get server information
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] Event contents
+ * @param[out] server id
+ * @param[out] session id
+ * @param[out] session type
+ *
+ * @return DM_OK on success
+ * DM_ERRORS on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR get_server_info(Event_Contents * pEvent_data, char **server_id, char **session_id, int *session_type);
+
+/**
+ * @par Description: API to get fumo ui mode
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[out] ui mode
+ *
+ * @return DM_OK on success
+ * DM_ERRORS on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR get_fumo_ui_mode(char **ui_mode);
+
+/**
+ * @par Description: API to check existed fumo remind interval
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int check_existed_fumo_reminder_interval();
+
+/**
+ * @par Description: API to init defult fumo configuration
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 success
+ * -1 error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int init_default_fumo_config();
+
+/**
+ * @par Description: API to set configuration int value
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] config_type
+ * @param[in] key
+ * @param[in] value
+ * @param[in] accessName
+ * @param[in] isFirst
+ *
+ * @return 1 success
+ * -1 error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int set_config_int(CONFIG_TYPE config_type, char *key, int value, char *accessName, int isFirst);
+
+/**
+ * @par Description: API to set alarm configuration int value
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] config_type
+ * @param[in] key
+ * @param[in] value
+ * @param[in] accessName
+ *
+ * @return 1 success
+ * 0 error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int set_alarm_config_int(CONFIG_TYPE config_type, char *key, int value, char *accessName);
+
+/**
+ * @par Description: API to get configuration int value
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] config id
+ * @param[in] key
+ *
+ * @return 1 success
+ * 0 error
+ * 0
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int get_config_int(CONFIG_TYPE config_id, char *key);
+
+/**
+ * @par Description: API to get wifi only config
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ *
+ * @return 1 on success
+ * -1 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int get_wifi_only_config();
+
+/**
+ * @par Description: API to set wifi only config
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] value
+ *
+ * @return 1 on success
+ * -1 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int set_wifi_only_config(int value);
+
+/**
+ * @par Description: API to get battery state
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[out] battery value
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+
+DM_ERROR get_battery_state(char **battery_level);
+
+/**
+ * @par Description: API to check existed sd card memory
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[out] existed sd
+ *
+ * @return DM_OK on success
+ * DM_SD_CARD_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR existed_sd_card_memory(int *existed_sd);
+
+/**
+ * @par Description: API to get telephony state
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[out] now calling
+ *
+ * @return DM_OK on success
+ * DM_TELEPHONY_ERROR on errorS
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR get_telephony_state(int *now_calling);
+
+/**
+ * @par Description: API to get compare memory space
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] memory_type
+ * @param[in] file_size
+ *
+ * @return DM_OK on success
+ * DM_MEMORY_ERROR, DM_OVER_MEMORY_ERROR on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR compare_memory_space(char *memory_type, long double file_size);
+
+/**
+ * @par Description: API to get roaming state
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] roaming_state
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void get_roaming_state(int *roaming_state);
+
+/**
+ * @par Description: API to get call state
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] call_state
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void get_call_sate(int *call_state);
+
+/**
+ * @par Description: API to get mmc state
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[out] mmc_state
+ *
+ * @return 1 on success
+ * 0 on error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int get_mmc_state(int *mmc_state);
+
+/**
+ * @par Description: API to get fota download_dir
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] memory type
+ * @param[out] download folder path
+ *
+ * @return DM_OK on success
+ * DM_MEMORY_ERROR on fail
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR get_fota_download_dir(MEMORY_TYPE type, char **download_folder);
+
+/**
+ * @par Description: API to get fota save dir
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] memory type
+ * @param[out] save folder path
+ *
+ * @return DM_OK on success
+ * DM_MEMORY_ERROR on fail
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR get_fota_save_dir(MEMORY_TYPE type, char **save_folder);
+
+/**
+ * @par Description: API to delete fumo contents
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] memory type
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void delete_fumo_contents(MEMORY_TYPE memory_type);
+
+/**
+ * @par Description: API to the first server bootstrap
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] server id
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void first_server_bootstrap(char *server_id);
+
+/**
+ * @par Description: API to get default noti type
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] ui mode
+ * @param[in] noti type
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+int get_default_noti_type(char *ui_mode, NotI_Type noti_type);
+
+/**
+ * @par Description: API to get new url
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] uri
+ * @param[out] new uri
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+char *get_new_uri(char *old_object_uri);
+
+#endif /* OMA_DM_COMMON_H_ */