• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 DEVICESTATUS_ERRORS_H
17 #define DEVICESTATUS_ERRORS_H
18 
19 #include <errors.h>
20 
21 namespace OHOS {
22 namespace Msdp {
23 namespace DeviceStatus {
24 enum {
25     DEVICESTATUS_MODULE_TYPE_SERVICE = 0,
26     DEVICESTATUS_MODULE_TYPE_KIT = 1,
27     DEVICESTATUS_MODULE_TYPE_CLIENT = 2
28 };
29 
30 constexpr ErrCode DEVICESTATUS_SERVICE_ERR_OFFSET = ErrCodeOffset(SUBSYS_MSDP, DEVICESTATUS_MODULE_TYPE_SERVICE);
31 
32 enum {
33     E_DEVICESTATUS_WRITE_PARCEL_ERROR = DEVICESTATUS_SERVICE_ERR_OFFSET,
34     E_DEVICESTATUS_READ_PARCEL_ERROR,
35     E_DEVICESTATUS_GET_SYSTEM_ABILITY_MANAGER_FAILED,
36     E_DEVICESTATUS_GET_SERVICE_FAILED,
37     E_DEVICESTATUS_ADD_DEATH_RECIPIENT_FAILED,
38     E_DEVICESTATUS_INNER_ERR,
39     ETASKS_INIT_FAIL,
40     ETASKS_WAIT_TIMEOUT,
41     ETASKS_WAIT_DEFERRED,
42     ETASKS_POST_SYNCTASK_FAIL,
43     ETASKS_POST_ASYNCTASK_FAIL,
44     EPOLL_CREATE_FAIL,
45     MSG_SEND_FAIL
46 };
47 
48 enum {
49     FILE_OPEN_FAIL = ErrCodeOffset(SUBSYS_MSDP, DEVICESTATUS_MODULE_TYPE_KIT),
50     STREAM_BUF_READ_FAIL,
51     EVENT_REG_FAIL,
52     PARAM_INPUT_FAIL
53 };
54 
55 enum {
56     NON_STD_EVENT = ErrCodeOffset(SUBSYS_MSDP, DEVICESTATUS_MODULE_TYPE_CLIENT),
57     VAL_NOT_EXP,
58     ERROR_UNSUPPORT,
59     ERROR_NULL_POINTER
60 };
61 
62 enum {
63     DEVICESTATUS_OK = 0,
64     DEVICESTATUS_FAILED = -1,
65     DEVICESTATUS_INVALID_FD = -2,
66     DEVICESTATUS_NOT_FIND_JSON_ITEM = -3
67 };
68 
69 enum {
70     INIT_FAIL = -1,
71     INIT_SUCCESS = 0,
72     INIT_CANCEL = 1
73 };
74 } // namespace DeviceStatus
75 } // namespace Msdp
76 } // namespace OHOS
77 
78 #endif // DEVICESTATUS_ERRORS_H
79