2 * Copyright (c) 2012 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _Download_Agent_Defs_H
18 #define _Download_Agent_Defs_H
21 #define DEPRECATED __attribute__((deprecated))
25 * Max count to download files simultaneously. \n
26 * Main reason for this restriction is because of Network bandwidth.
28 #define DA_MAX_DOWNLOAD_REQ_AT_ONCE 50
30 #define DA_RESULT_OK 0
35 #define DA_INVALID_ID -1
37 #define DA_RESULT_USER_CANCELED -10
39 // InputError Input error (-100 ~ -199)
40 // Client passed wrong parameter
41 #define DA_ERR_INVALID_ARGUMENT -100
42 #define DA_ERR_INVALID_DL_REQ_ID -101
43 #define DA_ERR_INVALID_URL -103
44 #define DA_ERR_INVALID_INSTALL_PATH -104
45 #define DA_ERR_INVALID_MIME_TYPE -105
47 // Client passed correct parameter, but Download Agent rejects the request because of internal policy.
48 #define DA_ERR_ALREADY_CANCELED -160
49 #define DA_ERR_ALREADY_SUSPENDED -161
50 #define DA_ERR_ALREADY_RESUMED -162
51 #define DA_ERR_CANNOT_SUSPEND -170
52 #define DA_ERR_CANNOT_RESUME -171
53 #define DA_ERR_INVALID_STATE -190
54 #define DA_ERR_ALREADY_MAX_DOWNLOAD -191
55 #define DA_ERR_UNSUPPORTED_PROTOCAL -192
57 // System error (-200 ~ -299)
58 #define DA_ERR_FAIL_TO_MEMALLOC -200
59 #define DA_ERR_FAIL_TO_CREATE_THREAD -210
60 #define DA_ERR_FAIL_TO_OBTAIN_MUTEX -220
61 #define DA_ERR_FAIL_TO_ACCESS_FILE -230
62 #define DA_ERR_DISK_FULL -240
64 // Platform error (-300 ~ -399)
65 #define DA_ERR_FAIL_TO_GET_CONF_VALUE -300
66 #define DA_ERR_FAIL_TO_ACCESS_STORAGE -310
67 #define DA_ERR_DLOPEN_FAIL -330
69 // Network error (-400 ~ -499)
70 #define DA_ERR_NETWORK_FAIL -400
71 #define DA_ERR_UNREACHABLE_SERVER -410
72 #define DA_ERR_HTTP_TIMEOUT -420
73 #define DA_ERR_SSL_FAIL -430
74 #define DA_ERR_TOO_MANY_REDIECTS -440
76 // HTTP error - not conforming with HTTP spec (-500 ~ -599)
77 #define DA_ERR_MISMATCH_CONTENT_TYPE -500
78 #define DA_ERR_MISMATCH_CONTENT_SIZE -501
79 #define DA_ERR_SERVER_RESPOND_BUT_SEND_NO_CONTENT -502
81 // DRM error - not conforming with DRM spec (-700 ~ -799)
82 #define DA_ERR_DRM_FAIL -700
83 #define DA_ERR_DRM_FILE_FAIL -710
85 // install error (-800 ~ -899)
86 #define DA_ERR_FAIL_TO_INSTALL_FILE -800