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 SA_FW_DOWNLOADER_H_
19 #define SA_FW_DOWNLOADER_H_
25 #include "common/dm_error.h"
35 * @par Description: API to send msg about DL
39 * @par Typical use case:
40 * @par par Method of function operation:
41 * @par Important notes:
42 * @param[in] send_dl_type send msg type for dl
43 * @param[in] local_uri uri information
44 * @param[in] content_type content type
45 * @param[in] header_info header info g_list
46 * @param[in] sendMsg send msg
47 * @param[in] sendMsg_length send msg length
48 * @param[out] recv_header recv msg header info g_list
49 * @param[out] recvMsg recv msg
50 * @param[out] recvMsg_length recv msg length
66 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);
69 * @par Description: API to download data to server
73 * @par Typical use case:
74 * @par par Method of function operation:
75 * @par Important notes:
76 * @param[in] local_uri uri information
77 * @param[in] content_type content type
78 * @param[in] header_info header info g_list
79 * @param[in] current_file_download_size current file download size
80 * @param[in] download_folder download folder path
81 * @param[in] config wifi config
82 * @param[out] download_path download file path
84 * @return DM_OK on success
97 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);
100 * @par Description: API to get file name
104 * @par Typical use case:
105 * @par par Method of function operation:
106 * @par Important notes:
107 * @param[in] recieve http header
108 * @param[out] file name
123 char *get_file_name(GList * recv_header, char *file_name);
126 * @par Description: API to get file name for header info
130 * @par Typical use case:
131 * @par par Method of function operation:
132 * @par Important notes:
133 * @param[in] header_info header info g_list
149 char *get_file_name_from_http_header(GList * header_info);
152 * @par Description: API to free header info g_list
156 * @par Typical use case:
157 * @par par Method of function operation:
158 * @par Important notes:
159 * @param[in] header_info header info g_list
175 void free_header_info(GList * header_info);
177 #endif /* SA_FW_DOWNLOADER_H_ */