1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_AV_TRANSPORT_ERRNO_H
17 #define OHOS_AV_TRANSPORT_ERRNO_H
18 
19 #include <cstdint>
20 
21 namespace OHOS {
22 namespace DistributedHardware {
23     /*
24      * The av transport module define errno, range: [-80000; -89999]
25      * Here's external errno, range: [-80000; -80199]
26      */
27     constexpr int32_t DH_AVT_SUCCESS = 0;
28     constexpr int32_t ERR_DH_AVT_INVALID_PARAM = -80001;
29     constexpr int32_t ERR_DH_AVT_INIT_FAILED = -80002;
30     constexpr int32_t ERR_DH_AVT_START_FAILED = -80003;
31     constexpr int32_t ERR_DH_AVT_STOP_FAILED = -80004;
32     constexpr int32_t ERR_DH_AVT_RELEASE_FAILED = -80005;
33     constexpr int32_t ERR_DH_AVT_SETUP_FAILED = -80006;
34     constexpr int32_t ERR_DH_AVT_PUSH_DATA_FAILED = -80007;
35     constexpr int32_t ERR_DH_AVT_PULL_DATA_FAILED = -80008;
36     constexpr int32_t ERR_DH_AVT_SEND_MESSAGE_FAILED = -80009;
37     constexpr int32_t ERR_DH_AVT_CREATE_CHANNEL_FAILED = -80010;
38     constexpr int32_t ERR_DH_AVT_CHANNEL_ALREADY_CREATED = -80011;
39     constexpr int32_t ERR_DH_AVT_UNIMPLEMENTED = -80012;
40     constexpr int32_t ERR_DH_AVT_COMMON_FAILED = -80013;
41     constexpr int32_t ERR_DH_AVT_PAUSE_FAILED = -80014;
42     constexpr int32_t ERR_DH_AVT_RESUME_FAILED = -80015;
43 
44     /* Here's internal errno, range: [-81000; -89999] */
45     constexpr int32_t ERR_DH_AVT_INVALID_PARAM_VALUE = -81000;
46     constexpr int32_t ERR_DH_AVT_INVALID_PARAM_TYPE = -81001;
47     constexpr int32_t ERR_DH_AVT_INVALID_OPERATION = -81002;
48     constexpr int32_t ERR_DH_AVT_UNSUPPORTED_FORMAT = -81003;
49     constexpr int32_t ERR_DH_AVT_NOT_EXISTED = -81004;
50     constexpr int32_t ERR_DH_AVT_TIMED_OUT = -81005;
51     constexpr int32_t ERR_DH_AVT_NO_MEMORY = -81006;
52     constexpr int32_t ERR_DH_AVT_INVALID_STATE = -81007;
53     constexpr int32_t ERR_DH_AVT_PERMISSION_DENIED = -81008;
54     constexpr int32_t ERR_DH_AVT_NO_NOTIFY = -81009;
55     constexpr int32_t ERR_DH_AVT_NULL_POINTER = -81010;
56     constexpr int32_t ERR_DH_AVT_SESSION_ERROR = -81011;
57     constexpr int32_t ERR_DH_AVT_SEND_DATA_FAILED = -81012;
58     constexpr int32_t ERR_DH_AVT_PREPARE_FAILED = -81013;
59     constexpr int32_t ERR_DH_AVT_SET_PARAM_FAILED = -81014;
60     constexpr int32_t ERR_DH_AVT_OUTPUT_DATA_FAILED = -80015;
61     constexpr int32_t ERR_DH_AVT_TIME_SYNC_FAILED = -80016;
62     constexpr int32_t ERR_DH_AVT_SERVICE_REMOTE_IS_NULL = -80017;
63     constexpr int32_t ERR_DH_AVT_SERVICE_WRITE_TOKEN_FAIL = -80018;
64     constexpr int32_t ERR_DH_AVT_SERVICE_IPC_SEND_REQUEST_FAIL = -80019;
65     constexpr int32_t ERR_DH_AVT_SERVICE_WRITE_INFO_FAIL = -80019;
66     constexpr int32_t ERR_DH_AVT_CTRL_CENTER_INIT_FAIL = -80020;
67     constexpr int32_t ERR_DH_AVT_REGISTER_CALLBACK_FAIL = -80021;
68     constexpr int32_t ERR_DH_AVT_FWK_INNER_KIT_NULL = -80022;
69     constexpr int32_t ERR_DH_AVT_SHARED_MEMORY_FAILED = -80023;
70     constexpr int32_t ERR_DH_AVT_MASTER_NOT_READY = -80024;
71     constexpr int32_t ERR_DH_AVT_SESSION_HAS_OPENED = -80025;
72 } // namespace DistributedHardware
73 } // namespace OHOS
74 #endif // OHOS_AV_TRANSPORT_ERRNO_H