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 FW_DOWNLOADER_H_
19 #define FW_DOWNLOADER_H_
22 #include "common/dm_error.h"
23 #include "dm-engine/dl-manager/dd_object.h"
26 EXIST_PARTIAL_FILE = 1,
29 } DOWNLOAD_FILE_STATUS;
32 int current_data_size;
35 } Data_Resume_Infomation;
38 * @par Description: API to get object information from dd_server_uri
42 * @par Typical use case:
43 * @par par Method of function operation:
44 * @par Important notes:
45 * @param[in] dd_server_uri dd server uri
46 * @param[out] download_descriptor download_descriptor
47 * @param[out] dd_object_information dd object information
63 DM_ERROR get_object_information(char *dd_server_uri, int *file_size, Download_Descriptor ** download_descriptor, DM_ERROR * download_status);
66 * @par Description: API to check file resume
70 * @par Typical use case:
71 * @par par Method of function operation:
72 * @par Important notes:
73 * @param[in] checked_download_folder folder path
74 * @param[in] download_descriptor download_descriptor
75 * @param[out] file_status file status
91 DM_ERROR check_file_resume(const char *checked_download_folder, DOWNLOAD_FILE_STATUS * file_status, Download_Descriptor * download_descriptor, Data_Resume_Infomation ** data_resume_info);
94 * @par Description: API to download object for object path
98 * @par Typical use case:
99 * @par par Method of function operation:
100 * @par Important notes:
101 * @param[in] download_folder downloaded folder path
102 * @parma[in] config wifi config
103 * @param[in] download_descriptor download_descriptor
104 * @param[out] object_downloaded_path downloaded file path
121 DM_ERROR download_object(const char *download_folder, char **object_downloaded_path, Data_Resume_Infomation * data_resume_info, int config, Download_Descriptor * download_descriptor, DM_ERROR * downoad_status);
124 * @par Description: API to send download status to server
128 * @par Typical use case:
129 * @par par Method of function operation:
130 * @par Important notes:
131 * @param[in] download_status DM_ERROR
132 * @param[in] download_descriptor download_descriptor
148 DM_ERROR send_donwload_status(DM_ERROR download_status, Download_Descriptor * download_descriptor);
151 * @par Description: API to free download descriptor
155 * @par Typical use case:
156 * @par par Method of function operation:
157 * @par Important notes:
158 * @param[in] download_descriptor download_descriptor
173 void free_Download_Descriptor(Download_Descriptor ** download_descriptor);
175 #endif /* FW_DOWNLOADER_H_ */