summaryrefslogtreecommitdiff
path: root/include/dm-engine/dl-manager/sa_fw_downloader.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/dm-engine/dl-manager/sa_fw_downloader.h')
-rwxr-xr-xinclude/dm-engine/dl-manager/sa_fw_downloader.h177
1 files changed, 177 insertions, 0 deletions
diff --git a/include/dm-engine/dl-manager/sa_fw_downloader.h b/include/dm-engine/dl-manager/sa_fw_downloader.h
new file mode 100755
index 0000000..3940af1
--- /dev/null
+++ b/include/dm-engine/dl-manager/sa_fw_downloader.h
@@ -0,0 +1,177 @@
+/*
+ * 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.
+ */
+
+#ifndef SA_FW_DOWNLOADER_H_
+#define SA_FW_DOWNLOADER_H_
+
+/*lib*/
+#include <glib.h>
+
+/*dm-agent*/
+#include "common/dm_error.h"
+
+typedef enum {
+ DD_DOWNLOAD = 1,
+ GET_FILE_NAME,
+ DATA_DOWNLOAD,
+ SEND_DOWNLOAD_STATUS
+} DL_SEND_MSG_TYPE;
+
+/**
+ * @par Description: API to send msg about DL
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] send_dl_type send msg type for dl
+ * @param[in] local_uri uri information
+ * @param[in] content_type content type
+ * @param[in] header_info header info g_list
+ * @param[in] sendMsg send msg
+ * @param[in] sendMsg_length send msg length
+ * @param[out] recv_header recv msg header info g_list
+ * @param[out] recvMsg recv msg
+ * @param[out] recvMsg_length recv msg length
+ *
+ * @return DM_OK
+ * DM_ERROR
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR send_download_msg(DL_SEND_MSG_TYPE send_dl_type, char *local_uri, char *content_type, GList * header_info, char *sendMsg, unsigned int sendMsg_length, GList ** recv_header, char **recvMsg, unsigned int *recvMsg_length);
+
+/**
+ * @par Description: API to download data to server
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] local_uri uri information
+ * @param[in] content_type content type
+ * @param[in] header_info header info g_list
+ * @param[in] current_file_download_size current file download size
+ * @param[in] download_folder download folder path
+ * @param[in] config wifi config
+ * @param[out] download_path download file path
+ *
+ * @return DM_OK on success
+ * DM_ERROR on fail
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+DM_ERROR download_data(char *local_uri, char *content_type, GList * header_info, int current_file_download_size, char *download_folder, int config, char **download_path);
+
+/**
+ * @par Description: API to get file name
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] recieve http header
+ * @param[out] file name
+ *
+ * @return
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+char *get_file_name(GList * recv_header, char *file_name);
+
+/**
+ * @par Description: API to get file name for header info
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] header_info header info g_list
+ *
+ * @return file name
+ * 0 error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+char *get_file_name_from_http_header(GList * header_info);
+
+/**
+ * @par Description: API to free header info g_list
+ *
+ *
+ * @par Purpose:
+ * @par Typical use case:
+ * @par par Method of function operation:
+ * @par Important notes:
+ * @param[in] header_info header info g_list
+ *
+ * @return file name
+ * 0 error
+ *
+ * @par Errors:
+ *
+ * @pre None.
+ * @post
+ * @see
+ * @remarks None.
+ *
+ * @par Sample Code:
+ * @code
+ * @endcode
+ */
+void free_header_info(GList * header_info);
+
+#endif /* SA_FW_DOWNLOADER_H_ */