• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 # Copyright (C) 2024 HiHope Open Source Organization .
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_SLE_ERRCODE_H
17 #define OHOS_SLE_ERRCODE_H
18 
19 #include "errcode.h"
20 /**
21  * @if Eng
22  * @brief  SLE error code base.
23  * @else
24  * @brief  SLE 错误码起始。
25  * @endif
26  */
27 #define OH_ERRCODE_SLE_COMMON_BASE 0x80006000
28 
29 /**
30  * @if Eng
31  * @brief  SLE SSAP error code base.
32  * @else
33  * @brief  SLE SSAP 错误码起始。
34  * @endif
35  */
36 #define OH_ERRCODE_SLE_SSAP_BASE   0x80006100
37 
38 /**
39  * @if Eng
40  * @brief  SLE SSAP error code end.
41  * @else
42  * @brief  SLE SSAP 错误码结束。
43  * @endif
44  */
45 #define OH_ERRCODE_SLE_SSAP_END    0x800061FF
46 
47 /**
48  * @if Eng
49  * @brief  SLE error code base.
50  * @else
51  * @brief  SLE 错误码结束。
52  * @endif
53  */
54 #define OH_ERRCODE_SLE_COMMON_END  0x800067FF
55 
56 
57 /**
58  * @if Eng
59  * @brief  SLE error code.
60  * @else
61  * @brief  SLE 错误码(非协议相关)。
62  * @endif
63  */
64 typedef enum {
65     OH_ERRCODE_SLE_SUCCESS = 0,                               /*!< @if Eng error code of success
66                                                                 @else   执行成功错误码 @endif */
67     OH_ERRCODE_SLE_CONTINUE = OH_ERRCODE_SLE_COMMON_BASE,        /*!< @if Eng error code of continue
68                                                                 @else   继续执行错误码 @endif */
69     OH_ERRCODE_SLE_DIRECT_RETURN,                             /*!< @if Eng error code of direct return
70                                                                 @else   直接返回错误码 @endif */
71     OH_ERRCODE_SLE_NO_ATTATION,                               /*!< @if Eng error code of no attention
72                                                                 @else   错误码 @endif */
73     OH_ERRCODE_SLE_PARAM_ERR,                                 /*!< @if Eng error code of parameter error
74                                                                 @else   参数错误错误码 @endif */
75     OH_ERRCODE_SLE_FAIL,                                      /*!< @if Eng error code of configure fail
76                                                                 @else   配置失败错误码 @endif */
77     OH_ERRCODE_SLE_TIMEOUT,                                   /*!< @if Eng error code of configure timeout
78                                                                 @else   配置超时错误码 @endif */
79     OH_ERRCODE_SLE_UNSUPPORTED,                               /*!< @if Eng error code of unsupported parameter
80                                                                 @else   参数不支持错误码 @endif */
81     OH_ERRCODE_SLE_GETRECORD_FAIL,                            /*!< @if Eng error code of get current record fail
82                                                                 @else   获取当前记录失败错误码 @endif */
83     OH_ERRCODE_SLE_POINTER_NULL,                              /*!< @if Eng error code of pointer is NULL
84                                                                 @else   指针为空错误码 @endif */
85     OH_ERRCODE_SLE_NO_RECORD,                                 /*!< @if Eng error code of no record return
86                                                                 @else   无记录返回错误码 @endif */
87     OH_ERRCODE_SLE_STATUS_ERR,                                /*!< @if Eng error code of state error
88                                                                 @else   状态错误错误码 @endif */
89     OH_ERRCODE_SLE_NOMEM,                                     /*!< @if Eng error code of no memory
90                                                                 @else   内存不足错误码 @endif */
91     OH_ERRCODE_SLE_AUTH_FAIL,                                 /*!< @if Eng error code of authentication failure
92                                                                 @else   认证失败错误码 @endif */
93     OH_ERRCODE_SLE_AUTH_PKEY_MISS,                            /*!< @if Eng error code of authentication fail due to pin
94                                                                         code or key lost
95                                                                 @else   PIN码或密钥丢失致认证失败错误码 @endif */
96     OH_ERRCODE_SLE_RMT_DEV_DOWN,                              /*!< @if Eng error code of remote device down
97                                                                 @else   对端设备关闭错误码 @endif */
98     OH_ERRCODE_SLE_PAIRING_REJECT,                            /*!< @if Eng error code of pair reject
99                                                                 @else   配对拒绝错误码 @endif */
100     OH_ERRCODE_SLE_BUSY,                                      /*!< @if Eng error code of system busy
101                                                                 @else   系统繁忙错误码 @endif */
102     OH_ERRCODE_SLE_NOT_READY,                                 /*!< @if Eng error code of system not ready
103                                                                 @else   系统未准备好错误码 @endif */
104     OH_ERRCODE_SLE_CONN_FAIL,                                 /*!< @if Eng error code of connect fail
105                                                                 @else   连接失败错误码 @endif */
106     OH_ERRCODE_SLE_OUT_OF_RANGE,                              /*!< @if Eng error code of out of range
107                                                                 @else   越界错误码 @endif */
108     OH_ERRCODE_SLE_MEMCPY_FAIL,                               /*!< @if Eng error code of memcpy fail
109                                                                 @else   拷贝失败错误码 @endif */
110     OH_ERRCODE_SLE_MALLOC_FAIL,                               /*!< @if Eng error code of malloc fail
111                                                                 @else   内存申请失败错误码 @endif */
112     OH_ERRCODE_SLE_MAX = OH_ERRCODE_SLE_COMMON_END               /*!< @if Eng maximum of SLE error code
113                                                                 @else   SLE 错误码最大值 @endif */
114 } ErrCodeType;
115 
116 
117 /**
118  * @if Eng
119  * @brief Enum of sle pairing state.
120  * @else
121  * @brief 星闪断链原因。
122  * @endif
123  */
124 typedef enum {
125     OH_SLE_DISCONNECT_BY_REMOTE = 0x10,    /*!< @if Eng disconnect by remote
126                                              @else   远端断链 @endif */
127     OH_SLE_DISCONNECT_BY_LOCAL  = 0x11,    /*!< @if Eng disconnect by local
128                                              @else   本端断链 @endif */
129 } SleDiscReasonType;
130 
131 #endif