1 /*
2  * Copyright (c) 2024 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 CAPI_INCLUDE_IPC_ERROR_CODE_H
17 #define CAPI_INCLUDE_IPC_ERROR_CODE_H
18 
19 /**
20  * @addtogroup OHIPCErrorCode
21  * @{
22  *
23  * @brief Provides IPC error codes.
24  *
25  * @syscap SystemCapability.Communication.IPC.Core
26  * @since 12
27  */
28 
29 /**
30  * @file ipc_error_code.h
31  *
32  * @brief Defines IPC error codes.
33  *
34  * @library libipc_capi.so
35  * @syscap SystemCapability.Communication.IPC.Core
36  * @since 12
37  */
38 
39 /**
40 * @brief Enumerates IPC error codes.
41 *
42 * @since 12
43 */
44 typedef enum {
45     /** @error Execution successful. */
46     OH_IPC_SUCCESS = 0,
47     /** @error Start error code. */
48     OH_IPC_ERROR_CODE_BASE = 1901000,
49     /** @error Invalid parameters. */
50     OH_IPC_CHECK_PARAM_ERROR = OH_IPC_ERROR_CODE_BASE,
51     /** @error Failed to write data to the serialized object. */
52     OH_IPC_PARCEL_WRITE_ERROR = OH_IPC_ERROR_CODE_BASE + 1,
53     /** @error Failed to read data from the serialized object. */
54     OH_IPC_PARCEL_READ_ERROR = OH_IPC_ERROR_CODE_BASE + 2,
55     /** @error Failed to allocate memory. */
56     OH_IPC_MEM_ALLOCATOR_ERROR = OH_IPC_ERROR_CODE_BASE + 3,
57     /** @error The command word is out of the value range [0x01,0x00ffffff]. */
58     OH_IPC_CODE_OUT_OF_RANGE = OH_IPC_ERROR_CODE_BASE + 4,
59     /** @error The remote object is dead. */
60     OH_IPC_DEAD_REMOTE_OBJECT = OH_IPC_ERROR_CODE_BASE + 5,
61     /** @error The custom error code is out of range [1900001, 1999999]. */
62     OH_IPC_INVALID_USER_ERROR_CODE = OH_IPC_ERROR_CODE_BASE + 6,
63     /** @error IPC internal error. */
64     OH_IPC_INNER_ERROR = OH_IPC_ERROR_CODE_BASE + 7,
65     /** @error Maximum error code. */
66     OH_IPC_ERROR_CODE_MAX = OH_IPC_ERROR_CODE_BASE + 1000,
67     /** @error Minimum value for a custom error code. */
68     OH_IPC_USER_ERROR_CODE_MIN = 1909000,
69     /** @error Maximum value for a custom error code. */
70     OH_IPC_USER_ERROR_CODE_MAX = 1909999,
71 } OH_IPC_ErrorCode;
72 
73 /** @} */
74 #endif