1 // Copyright (C) 2022 Beken Corporation 2 // 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 #pragma once 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #include <common/bk_err.h> 22 23 #define kNoErr 0 //! No error occurred. 24 #define kGeneralErr -1 //! General error. 25 #define kInProgressErr 1 //! Operation in progress. 26 27 // Generic error codes are in the range -6700 to -6779. 28 #define kGenericErrorBase -6700 //! Starting error code for all generic errors. 29 30 #define kUnknownErr -6700 //! Unknown error occurred. 31 #define kOptionErr -6701 //! Option was not acceptable. 32 #define kSelectorErr -6702 //! Selector passed in is invalid or unknown. 33 #define kExecutionStateErr -6703 //! Call made in the wrong execution state (e.g. called at interrupt time). 34 #define kPathErr -6704 //! Path is invalid, too long, or otherwise not usable. 35 #define kParamErr -6705 //! Parameter is incorrect, missing, or not appropriate. 36 #define kUserRequiredErr -6706 //! User interaction is required. 37 #define kCommandErr -6707 //! Command invalid or not supported. 38 #define kIDErr -6708 //! Unknown, invalid, or inappropriate identifier. 39 #define kStateErr -6709 //! Not in appropriate state to perform operation. 40 #define kRangeErr -6710 //! Index is out of range or not valid. 41 #define kRequestErr -6711 //! Request was improperly formed or not appropriate. 42 #define kResponseErr -6712 //! Response was incorrect or out of sequence. 43 #define kChecksumErr -6713 //! Checksum does not match the actual data. 44 #define kNotHandledErr -6714 //! Operation was not handled (or not handled completely). 45 #define kVersionErr -6715 //! Version is not correct or not compatible. 46 #define kSignatureErr -6716 //! Signature did not match what was expected. 47 #define kFormatErr -6717 //! Unknown, invalid, or inappropriate file/data format. 48 #define kNotInitializedErr -6718 //! Action request before needed services were initialized. 49 #define kAlreadyInitializedErr -6719 //! Attempt made to initialize when already initialized. 50 #define kNotInUseErr -6720 //! Object not in use (e.g. cannot abort if not already in use). 51 #define kAlreadyInUseErr -6721 //! Object is in use (e.g. cannot reuse active param blocks). 52 #define kTimeoutErr -6722 //! Timeout occurred. 53 #define kCanceledErr -6723 //! Operation canceled (successful cancel). 54 #define kAlreadyCanceledErr -6724 //! Operation has already been canceled. 55 #define kCannotCancelErr -6725 //! Operation could not be canceled (maybe already done or invalid). 56 #define kDeletedErr -6726 //! Object has already been deleted. 57 #define kNotFoundErr -6727 //! Something was not found. 58 #define kNoMemoryErr -6728 //! Not enough memory was available to perform the operation. 59 #define kNoResourcesErr -6729 //! Resources unavailable to perform the operation. 60 #define kDuplicateErr -6730 //! Duplicate found or something is a duplicate. 61 #define kImmutableErr -6731 //! Entity is not changeable. 62 #define kUnsupportedDataErr -6732 //! Data is unknown or not supported. 63 #define kIntegrityErr -6733 //! Data is corrupt. 64 #define kIncompatibleErr -6734 //! Data is not compatible or it is in an incompatible format. 65 #define kUnsupportedErr -6735 //! Feature or option is not supported. 66 #define kUnexpectedErr -6736 //! Error occurred that was not expected. 67 #define kValueErr -6737 //! Value is not appropriate. 68 #define kNotReadableErr -6738 //! Could not read or reading is not allowed. 69 #define kNotWritableErr -6739 //! Could not write or writing is not allowed. 70 #define kBadReferenceErr -6740 //! An invalid or inappropriate reference was specified. 71 #define kFlagErr -6741 //! An invalid, inappropriate, or unsupported flag was specified. 72 #define kMalformedErr -6742 //! Something was not formed correctly. 73 #define kSizeErr -6743 //! Size was too big, too small, or not appropriate. 74 #define kNameErr -6744 //! Name was not correct, allowed, or appropriate. 75 #define kNotPreparedErr -6745 //! Device or service is not ready. 76 #define kReadErr -6746 //! Could not read. 77 #define kWriteErr -6747 //! Could not write. 78 #define kMismatchErr -6748 //! Something does not match. 79 #define kDateErr -6749 //! Date is invalid or out-of-range. 80 #define kUnderrunErr -6750 //! Less data than expected. 81 #define kOverrunErr -6751 //! More data than expected. 82 #define kEndingErr -6752 //! Connection, session, or something is ending. 83 #define kConnectionErr -6753 //! Connection failed or could not be established. 84 #define kAuthenticationErr -6754 //! Authentication failed or is not supported. 85 #define kOpenErr -6755 //! Could not open file, pipe, device, etc. 86 #define kTypeErr -6756 //! Incorrect or incompatible type (e.g. file, data, etc.). 87 #define kSkipErr -6757 //! Items should be or was skipped. 88 #define kNoAckErr -6758 //! No acknowledge. 89 #define kCollisionErr -6759 //! Collision occurred (e.g. two on bus at same time). 90 #define kBackoffErr -6760 //! Backoff in progress and operation intentionally failed. 91 #define kNoAddressAckErr -6761 //! No acknowledge of address. 92 #define kInternalErr -6762 //! An error internal to the implementation occurred. 93 #define kNoSpaceErr -6763 //! Not enough space to perform operation. 94 #define kCountErr -6764 //! Count is incorrect. 95 #define kEndOfDataErr -6765 //! Reached the end of the data (e.g. recv returned 0). 96 #define kWouldBlockErr -6766 //! Would need to block to continue (e.g. non-blocking read/write). 97 #define kLookErr -6767 //! Special case that needs to be looked at (e.g. interleaved data). 98 #define kSecurityRequiredErr -6768 //! Security is required for the operation (e.g. must use encryption). 99 #define kOrderErr -6769 //! Order is incorrect. 100 #define kUpgradeErr -6770 //! Must upgrade. 101 #define kAsyncNoErr -6771 //! Async operation successfully started and is now in progress. 102 #define kDeprecatedErr -6772 //! Operation or data is deprecated. 103 #define kPermissionErr -6773 //! Permission denied. 104 105 #define kGenericErrorEnd -6779 //! Last generic error code (inclusive) 106 107 #ifdef __cplusplus 108 } 109 #endif 110