1 /* 2 * Copyright (c) 2022-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 OHOS_AVSESSION_ERRORS_H 17 #define OHOS_AVSESSION_ERRORS_H 18 19 #include <cinttypes> 20 21 #include "errors.h" 22 23 namespace OHOS::AVSession { 24 constexpr int32_t AVSESSION_ERROR = -1; 25 constexpr int32_t AVSESSION_SUCCESS = 0; 26 constexpr int32_t AVSESSION_ERROR_BASE = 1000; 27 28 constexpr int32_t ERR_NO_MEMORY = -(AVSESSION_ERROR_BASE + 1); 29 constexpr int32_t ERR_INVALID_PARAM = -(AVSESSION_ERROR_BASE + 2); 30 constexpr int32_t ERR_SERVICE_NOT_EXIST = -(AVSESSION_ERROR_BASE + 3); 31 constexpr int32_t ERR_SESSION_LISTENER_EXIST = -(AVSESSION_ERROR_BASE + 4); 32 constexpr int32_t ERR_MARSHALLING = -(AVSESSION_ERROR_BASE + 5); 33 constexpr int32_t ERR_UNMARSHALLING = -(AVSESSION_ERROR_BASE + 6); 34 constexpr int32_t ERR_IPC_SEND_REQUEST = -(AVSESSION_ERROR_BASE + 7); 35 constexpr int32_t ERR_SESSION_EXCEED_MAX = -(AVSESSION_ERROR_BASE + 8); 36 constexpr int32_t ERR_SESSION_NOT_EXIST = -(AVSESSION_ERROR_BASE + 9); 37 constexpr int32_t ERR_COMMAND_NOT_SUPPORT = -(AVSESSION_ERROR_BASE + 10); 38 constexpr int32_t ERR_CONTROLLER_NOT_EXIST = -(AVSESSION_ERROR_BASE + 11); 39 constexpr int32_t ERR_NO_PERMISSION = -(AVSESSION_ERROR_BASE + 12); 40 constexpr int32_t ERR_SESSION_DEACTIVE = -(AVSESSION_ERROR_BASE + 13); 41 constexpr int32_t ERR_CONTROLLER_IS_EXIST = -(AVSESSION_ERROR_BASE + 14); 42 constexpr int32_t ERR_START_ABILITY_IS_RUNNING = -(AVSESSION_ERROR_BASE + 15); 43 constexpr int32_t ERR_ABILITY_NOT_AVAILABLE = -(AVSESSION_ERROR_BASE + 16); 44 constexpr int32_t ERR_START_ABILITY_TIMEOUT = -(AVSESSION_ERROR_BASE + 17); 45 constexpr int32_t ERR_COMMAND_SEND_EXCEED_MAX = -(AVSESSION_ERROR_BASE + 18); 46 constexpr int32_t ERR_RPC_SEND_REQUEST = -(AVSESSION_ERROR_BASE + 19); 47 constexpr int32_t ERR_DEVICE_CONNECTION_FAILED = -(AVSESSION_ERROR_BASE + 20); 48 constexpr int32_t ERR_REMOTE_CONNECTION_NOT_EXIST = -(AVSESSION_ERROR_BASE + 21); 49 constexpr int32_t ERR_SESSION_IS_EXIST = -(AVSESSION_ERROR_BASE + 22); 50 constexpr int32_t ERR_PERMISSION_DENIED = -(AVSESSION_ERROR_BASE + 23); 51 constexpr int32_t ERR_WAIT_ALLCONNECT_TIMEOUT = -(AVSESSION_ERROR_BASE + 24); 52 constexpr int32_t ERR_ALLCONNECT_CAST_REJECT = -(AVSESSION_ERROR_BASE + 25); 53 constexpr int32_t ERR_ALLCONNECT_PREEMPTED_BY_OTHERS = -(AVSESSION_ERROR_BASE + 26); 54 } // namespace OHOS::AVSession 55 56 #endif // OHOS_AVSESSION_ERRORS_H 57