xref: /interface/sdk_c/IPCKit/ipc_error_code.h (revision 7777dab0)
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 * @kit IPCKit
36 * @syscap SystemCapability.Communication.IPC.Core
37 * @since 12
38 */
39
40/**
41* @brief Enumerates IPC error codes.
42*
43* @since 12
44*/
45typedef enum {
46    /** @error Execution successful. */
47    OH_IPC_SUCCESS = 0,
48    /** @error Start error code. */
49    OH_IPC_ERROR_CODE_BASE = 1901000,
50    /** @error Invalid parameters. */
51    OH_IPC_CHECK_PARAM_ERROR = OH_IPC_ERROR_CODE_BASE,
52    /** @error Failed to write data to the serialized object. */
53    OH_IPC_PARCEL_WRITE_ERROR = OH_IPC_ERROR_CODE_BASE + 1,
54    /** @error Failed to read data from the serialized object. */
55    OH_IPC_PARCEL_READ_ERROR = OH_IPC_ERROR_CODE_BASE + 2,
56    /** @error Failed to allocate memory. */
57    OH_IPC_MEM_ALLOCATOR_ERROR = OH_IPC_ERROR_CODE_BASE + 3,
58    /** @error The command word is out of the value range [0x01,0x00ffffff]. */
59    OH_IPC_CODE_OUT_OF_RANGE = OH_IPC_ERROR_CODE_BASE + 4,
60    /** @error The remote object is dead. */
61    OH_IPC_DEAD_REMOTE_OBJECT = OH_IPC_ERROR_CODE_BASE + 5,
62    /** @error The custom error code is out of range [1900001, 1999999]. */
63    OH_IPC_INVALID_USER_ERROR_CODE = OH_IPC_ERROR_CODE_BASE + 6,
64    /** @error IPC internal error. */
65    OH_IPC_INNER_ERROR = OH_IPC_ERROR_CODE_BASE + 7,
66    /** @error Maximum error code. */
67    OH_IPC_ERROR_CODE_MAX = OH_IPC_ERROR_CODE_BASE + 1000,
68    /** @error Minimum value for a custom error code. */
69    OH_IPC_USER_ERROR_CODE_MIN = 1909000,
70    /** @error Maximum value for a custom error code. */
71    OH_IPC_USER_ERROR_CODE_MAX = 1909999,
72} OH_IPC_ErrorCode;
73
74/** @} */
75#endif
76