1 /* 2 * Copyright (C) 2022-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_PROHIBITED_BY_EDM = 203, 28 BT_ERR_INVALID_PARAM = 401, 29 BT_ERR_API_NOT_SUPPORT = 801, 30 31 // Customized error codes 32 BT_NO_ERROR = 0, 33 34 BT_ERR_BASE_SYSCAP = 2900000, 35 BT_ERR_SERVICE_DISCONNECTED = BT_ERR_BASE_SYSCAP + 1, 36 BT_ERR_UNBONDED_DEVICE = BT_ERR_BASE_SYSCAP + 2, 37 BT_ERR_INVALID_STATE = BT_ERR_BASE_SYSCAP + 3, 38 BT_ERR_PROFILE_DISABLED = BT_ERR_BASE_SYSCAP + 4, 39 BT_ERR_DEVICE_DISCONNECTED = BT_ERR_BASE_SYSCAP + 5, 40 BT_ERR_MAX_CONNECTION = BT_ERR_BASE_SYSCAP + 6, 41 BT_ERR_TIMEOUT = BT_ERR_BASE_SYSCAP + 7, 42 BT_ERR_UNAVAILABLE_PROXY = BT_ERR_BASE_SYSCAP + 8, 43 BT_ERR_DIALOG_FOR_USER_CONFIRM = BT_ERR_BASE_SYSCAP + 9, 44 BT_ERR_MAX_RESOURCES = BT_ERR_BASE_SYSCAP + 10, 45 46 BT_ERR_INTERNAL_ERROR = BT_ERR_BASE_SYSCAP + 99, 47 BT_ERR_IPC_TRANS_FAILED = BT_ERR_BASE_SYSCAP + 100, 48 49 BT_ERR_GATT_READ_NOT_PERMITTED = BT_ERR_BASE_SYSCAP + 1000, 50 BT_ERR_GATT_WRITE_NOT_PERMITTED = BT_ERR_BASE_SYSCAP + 1001, 51 BT_ERR_GATT_MAX_SERVER = BT_ERR_BASE_SYSCAP + 1002, 52 53 BT_ERR_SPP_SERVER_STATE = BT_ERR_BASE_SYSCAP + 1050, 54 BT_ERR_SPP_BUSY = BT_ERR_BASE_SYSCAP + 1051, 55 BT_ERR_SPP_DEVICE_NOT_FOUND = BT_ERR_BASE_SYSCAP + 1052, 56 BT_ERR_SPP_IO = BT_ERR_BASE_SYSCAP + 1054, 57 58 BT_ERR_NO_ACTIVE_HFP_DEVICE = BT_ERR_BASE_SYSCAP + 2000, 59 BT_ERR_NULL_HFP_STATE_MACHINE = BT_ERR_BASE_SYSCAP + 2001, 60 BT_ERR_HFP_NOT_CONNECT = BT_ERR_BASE_SYSCAP + 2002, 61 BT_ERR_SCO_HAS_BEEN_CONNECTED = BT_ERR_BASE_SYSCAP + 2003, 62 BT_ERR_VR_HAS_BEEN_STARTED = BT_ERR_BASE_SYSCAP + 2004, 63 BT_ERR_AUDIO_NOT_IDLE = BT_ERR_BASE_SYSCAP + 2005, 64 BT_ERR_VIRTUAL_CALL_NOT_STARTED = BT_ERR_BASE_SYSCAP + 2006, 65 BT_ERR_DISCONNECT_SCO_FAILED = BT_ERR_BASE_SYSCAP + 2007, 66 67 BT_ERR_BLE_SCAN_ALREADY_STARTED = BT_ERR_BASE_SYSCAP + 2050, 68 BT_ERR_BLE_SCAN_MAX_FILTER = BT_ERR_BASE_SYSCAP + 2051, 69 BT_ERR_BLE_CHANGE_SCAN_FILTER_FAIL = BT_ERR_BASE_SYSCAP + 2052, 70 BT_ERR_BLE_CHANGE_SCAN_WRONG_STATE = BT_ERR_BASE_SYSCAP + 2053, 71 72 // will deprected 73 NO_ERROR = BT_NO_ERROR, 74 ERROR = BT_ERR_INTERNAL_ERROR, 75 ERR_INVALID_STATE = BT_ERR_INVALID_STATE, 76 }; 77 } // namespace Bluetooth 78 } // namespace OHOS 79 80 #endif // BLUETOOTH_ERRORCODE_H