• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021-2022 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 BLUETOOTH_ERRORCODE_H
17 #define BLUETOOTH_ERRORCODE_H
18 
19 namespace OHOS {
20 namespace Bluetooth {
21 
22 /* Bluetooth errcode defines */
23 enum BtErrCode {
24     // Common error codes
25     BT_ERR_PERMISSION_FAILED = 201,
26     BT_ERR_SYSTEM_PERMISSION_FAILED = 202,
27     BT_ERR_INVALID_PARAM = 401,
28     BT_ERR_API_NOT_SUPPORT = 801,
29 
30     // Customized error codes
31     BT_NO_ERROR = 0,
32 
33     BT_ERR_BASE_SYSCAP = 2900000,
34     BT_ERR_SERVICE_DISCONNECTED     = BT_ERR_BASE_SYSCAP + 1,
35     BT_ERR_UNBONDED_DEVICE          = BT_ERR_BASE_SYSCAP + 2,
36     BT_ERR_INVALID_STATE            = BT_ERR_BASE_SYSCAP + 3,
37     BT_ERR_PROFILE_DISABLED         = BT_ERR_BASE_SYSCAP + 4,
38     BT_ERR_DEVICE_DISCONNECTED      = BT_ERR_BASE_SYSCAP + 5,
39     BT_ERR_MAX_CONNECTION           = BT_ERR_BASE_SYSCAP + 6,
40     BT_ERR_TIMEOUT                  = BT_ERR_BASE_SYSCAP + 7,
41     BT_ERR_UNAVAILABLE_PROXY        = BT_ERR_BASE_SYSCAP + 8,
42 
43     BT_ERR_INTERNAL_ERROR           = BT_ERR_BASE_SYSCAP + 99,
44     BT_ERR_IPC_TRANS_FAILED         = BT_ERR_BASE_SYSCAP + 100,
45 
46     BT_ERR_GATT_READ_NOT_PERMITTED  = BT_ERR_BASE_SYSCAP + 1000,
47     BT_ERR_GATT_WRITE_NOT_PERMITTED = BT_ERR_BASE_SYSCAP + 1001,
48     BT_ERR_GATT_MAX_SERVER          = BT_ERR_BASE_SYSCAP + 1002,
49 
50     BT_ERR_SPP_SERVER_STATE         = BT_ERR_BASE_SYSCAP + 1050,
51     BT_ERR_SPP_BUSY                 = BT_ERR_BASE_SYSCAP + 1051,
52     BT_ERR_SPP_DEVICE_NOT_FOUND     = BT_ERR_BASE_SYSCAP + 1052,
53     BT_ERR_SPP_IO                   = BT_ERR_BASE_SYSCAP + 1054,
54 
55     // will deprected
56     NO_ERROR = 0,
57     ERR_INVALID_STATE = 1,
58     ERR_INVALID_VALUE = 2,
59     ERROR = 3,
60 };
61 
62 }  // namespace Bluetooth
63 }  // namespace OHOS
64 
65 #endif  // BLUETOOTH_ERRORCODE_H