Matter SDK Coverage Report
Current view: top level - lib/core - CHIPError.h (source / functions) Coverage Total Hit
Test: SHA:4d2388ac7eed75b2fe5e05e20de377999c632502 Lines: 100.0 % 38 38
Test Date: 2025-07-27 07:17:09 Functions: 100.0 % 21 21

            Line data    Source code
       1              : /*
       2              :  *
       3              :  *    Copyright (c) 2020-2022 Project CHIP Authors
       4              :  *    Copyright (c) 2013-2017 Nest Labs, Inc.
       5              :  *
       6              :  *    Licensed under the Apache License, Version 2.0 (the "License");
       7              :  *    you may not use this file except in compliance with the License.
       8              :  *    You may obtain a copy of the License at
       9              :  *
      10              :  *        http://www.apache.org/licenses/LICENSE-2.0
      11              :  *
      12              :  *    Unless required by applicable law or agreed to in writing, software
      13              :  *    distributed under the License is distributed on an "AS IS" BASIS,
      14              :  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      15              :  *    See the License for the specific language governing permissions and
      16              :  *    limitations under the License.
      17              :  */
      18              : 
      19              : /**
      20              :  *    @file
      21              :  *      This file defines error constants for the CHIP core
      22              :  *      subsystem.
      23              :  *
      24              :  *      Error types, ranges, and mappings overrides may be made by
      25              :  *      defining the appropriate CHIP_CONFIG_* or _CHIP_CONFIG_*
      26              :  *      macros.
      27              :  */
      28              : 
      29              : #pragma once
      30              : 
      31              : #include <inttypes.h>
      32              : #include <limits>
      33              : #include <type_traits>
      34              : 
      35              : #include <lib/core/CHIPConfig.h>
      36              : #include <lib/support/TypeTraits.h>
      37              : 
      38              : #if CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
      39              : #include <source_location>
      40              : #endif
      41              : 
      42              : namespace chip {
      43              : 
      44              : /**
      45              :  * This class represents CHIP errors.
      46              :  *
      47              :  * At the top level, an error belongs to a Range and has an integral Value whose meaning depends on the Range.
      48              :  * One, Range::kSDK, is used for the CHIP SDK's own errors; others encapsulate error codes from external sources
      49              :  * (e.g. libraries, OS) into a CHIP_ERROR.
      50              :  *
      51              :  * CHIP SDK errors inside Range::kSDK consist of a component identifier given by SdkPart and an arbitrary small
      52              :  * integer Code.
      53              :  */
      54              : class ChipError
      55              : {
      56              : public:
      57              :     /// Internal representation of an error.
      58              :     using StorageType = uint32_t;
      59              : 
      60              :     /// Type for encapsulated error values.
      61              :     using ValueType = StorageType;
      62              : 
      63              :     /// Integer `printf` format for errors. This is a C macro in order to allow for string literal concatenation.
      64              : #define CHIP_ERROR_INTEGER_FORMAT PRIx32
      65              : 
      66              : #if CHIP_CONFIG_ERROR_FORMAT_AS_STRING
      67              : 
      68              :     /// Type returned by Format().
      69              :     using FormatType = const char *;
      70              :     /// `printf` format for Format(). This is a C macro in order to allow for string literal concatenation.
      71              : #define CHIP_ERROR_FORMAT "s"
      72              : 
      73              : #else // CHIP_CONFIG_ERROR_FORMAT_AS_STRING
      74              : 
      75              :     /// Type returned by Format().
      76              :     using FormatType = StorageType;
      77              :     /// `printf` format for Format(). This is a C macro in order to allow for string literal concatenation.
      78              : #define CHIP_ERROR_FORMAT CHIP_ERROR_INTEGER_FORMAT
      79              : 
      80              : #endif // CHIP_CONFIG_ERROR_FORMAT_AS_STRING
      81              : 
      82              :     /**
      83              :      * Top-level error classification.
      84              :      *
      85              :      * Every error belongs to a Range and has an integral Value whose meaning depends on the Range.
      86              :      * All native CHIP SDK errors belong to the kSDK range. Other ranges are used to encapsulate error
      87              :      * codes from other subsystems (e.g. platform or library) used by the CHIP SDK.
      88              :      */
      89              :     enum class Range : uint8_t
      90              :     {
      91              :         kSDK        = 0x0, ///< CHIP SDK errors.
      92              :         kOS         = 0x1, ///< Encapsulated OS errors, other than POSIX errno.
      93              :         kPOSIX      = 0x2, ///< Encapsulated POSIX errno values.
      94              :         kLwIP       = 0x3, ///< Encapsulated LwIP errors.
      95              :         kOpenThread = 0x4, ///< Encapsulated OpenThread errors.
      96              :         kPlatform   = 0x5, ///< Platform-defined encapsulation.
      97              :         kLastRange  = kPlatform,
      98              :     };
      99              : 
     100              :     /**
     101              :      * Secondary classification of CHIP SDK errors (Range::kSDK).
     102              :      */
     103              :     enum class SdkPart : uint8_t
     104              :     {
     105              :         kCore            = 0, ///< SDK core errors.
     106              :         kInet            = 1, ///< Inet layer errors; see <inet/InetError.h>.
     107              :         kDevice          = 2, ///< Device layer errors; see <platform/CHIPDeviceError.h>.
     108              :         kASN1            = 3, ///< ASN1 errors; see <asn1/ASN1Error.h>.
     109              :         kBLE             = 4, ///< BLE layer errors; see <ble/BleError.h>.
     110              :         kIMGlobalStatus  = 5, ///< Interaction Model global status code.
     111              :         kIMClusterStatus = 6, ///< Interaction Model cluster-specific status code.
     112              :         kApplication     = 7, ///< Application-defined errors; see CHIP_APPLICATION_ERROR
     113              :     };
     114              : 
     115              :     ChipError() = default;
     116              : 
     117              :     /**
     118              :      * Helper macro to provide a source location arguments to the ChipError constructor.
     119              :      */
     120              : #if CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     121              : #define CHIP_ERROR_SOURCE_LOCATION_NULL , std::source_location()
     122              : #define CHIP_ERROR_SOURCE_LOCATION , std::source_location::current()
     123              : #elif CHIP_CONFIG_ERROR_SOURCE
     124              : #define CHIP_ERROR_SOURCE_LOCATION_NULL , nullptr, 0
     125              : #define CHIP_ERROR_SOURCE_LOCATION , __FILE__, __LINE__
     126              : #else
     127              : #define CHIP_ERROR_SOURCE_LOCATION_NULL
     128              : #define CHIP_ERROR_SOURCE_LOCATION
     129              : #endif
     130              : 
     131              :     /**
     132              :      * Construct a CHIP_ERROR encapsulating @a value inside the Range @a range.
     133              :      *
     134              :      * @note
     135              :      *  The result is valid only if CanEncapsulate() is true.
     136              :      */
     137              : #if CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     138              :     constexpr ChipError(Range range, ValueType value, std::source_location location = std::source_location()) :
     139              :         mError(MakeInteger(range, (value & MakeMask(0, kValueLength)))), mSourceLocation(location)
     140              :     {}
     141              : #elif CHIP_CONFIG_ERROR_SOURCE
     142        21701 :     constexpr ChipError(Range range, ValueType value, const char * file = nullptr, unsigned int line = 0) :
     143        21701 :         mError(MakeInteger(range, (value & MakeMask(0, kValueLength)))), mLine(line), mFile(file)
     144        21701 :     {}
     145              : #else
     146              :     constexpr ChipError(Range range, ValueType value) : mError(MakeInteger(range, (value & MakeMask(0, kValueLength)))) {}
     147              : #endif
     148              : 
     149              :     /**
     150              :      *  Helper macro to construct a CHIP_ERROR from a range and a value.
     151              :      */
     152              : #define CHIP_GENERIC_ERROR(range, value) ::chip::ChipError(range, value CHIP_ERROR_SOURCE_LOCATION)
     153              : 
     154              :     /**
     155              :      * Construct a CHIP_ERROR for SdkPart @a part with @a code.
     156              :      *
     157              :      * @note
     158              :      *  The macro version CHIP_SDK_ERROR checks that the numeric value is constant and well-formed.
     159              :      */
     160              : #if CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     161              :     constexpr ChipError(SdkPart part, uint8_t code, std::source_location location = std::source_location()) :
     162              :         mError(MakeInteger(part, code)), mSourceLocation(location)
     163              :     {}
     164              : #elif CHIP_CONFIG_ERROR_SOURCE
     165          145 :     constexpr ChipError(SdkPart part, uint8_t code, const char * file = nullptr, unsigned int line = 0) :
     166          145 :         mError(MakeInteger(part, code)), mLine(line), mFile(file)
     167          145 :     {}
     168              : #else
     169              :     constexpr ChipError(SdkPart part, uint8_t code) : mError(MakeInteger(part, code)) {}
     170              : #endif
     171              : 
     172              :     /**
     173              :      * Construct a CHIP_ERROR constant for SdkPart @a part with @a code at the current source line.
     174              :      * This checks that the numeric value is constant and well-formed.
     175              :      * (In C++20 this could be replaced by a consteval constructor.)
     176              :      */
     177              : #define CHIP_SDK_ERROR(part, code)                                                                                                 \
     178              :     (::chip::ChipError(::chip::ChipError::SdkErrorConstant<(part), (code)>::value CHIP_ERROR_SOURCE_LOCATION))
     179              : 
     180              :     /**
     181              :      * Construct a CHIP_ERROR from the underlying storage type.
     182              :      *
     183              :      * @note
     184              :      *  This is intended to be used only in foreign function interfaces.
     185              :      */
     186              : #if CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     187              :     explicit constexpr ChipError(StorageType error, std::source_location location = std::source_location()) :
     188              :         mError(error), mSourceLocation(location)
     189              :     {}
     190              : #elif CHIP_CONFIG_ERROR_SOURCE
     191    210365249 :     explicit constexpr ChipError(StorageType error, const char * file = nullptr, unsigned int line = 0) :
     192    210365249 :         mError(error), mLine(line), mFile(file)
     193    210365249 :     {}
     194              : #else
     195              :     explicit constexpr ChipError(StorageType error) : mError(error) {}
     196              : #endif
     197              : 
     198              :     /**
     199              :      * Compare errors for equality.
     200              :      *
     201              :      * @note
     202              :      *  This only compares the error code. Under the CHIP_CONFIG_ERROR_SOURCE configuration, errors compare equal
     203              :      *  if they have the same error code, even if they have different source locations.
     204              :      */
     205      5385275 :     bool operator==(const ChipError & other) const { return mError == other.mError; }
     206     42409557 :     bool operator!=(const ChipError & other) const { return mError != other.mError; }
     207              : 
     208              :     /**
     209              :      * Return an integer code for the error.
     210              :      */
     211         2353 :     constexpr StorageType AsInteger() const { return mError; }
     212              : 
     213              :     /*
     214              :      * IsSuccess() is intended to support macros that can take either a ChipError or an integer error code.
     215              :      * The latter follows the C convention that a non-zero integer indicates an error.
     216              :      *
     217              :      * @note
     218              :      *  Normal code should use `status == CHIP_NO_ERROR` rather than `IsSuccess(status)`.
     219              :      */
     220     91758340 :     static constexpr bool IsSuccess(ChipError error) { return error.mError == 0; }
     221              :     static constexpr bool IsSuccess(StorageType error) { return error == 0; }
     222              : 
     223              :     /**
     224              :      * Format an @a error for printing.
     225              :      *
     226              :      * Normally, this is used with the `printf()`-style macro CHIP_ERROR_FORMAT.
     227              :      * For example,
     228              :      *  @code
     229              :      *      ChipLogError(subsystem, "A bad thing happened! %" CHIP_ERROR_FORMAT, status.Format());
     230              :      *  @endcode
     231              :      */
     232              : #if CHIP_CONFIG_ERROR_FORMAT_AS_STRING
     233          376 :     FormatType Format() const { return AsString(); }
     234              : #else  // CHIP_CONFIG_ERROR_FORMAT_AS_STRING
     235              :     FormatType Format() const { return mError; }
     236              : #endif // CHIP_CONFIG_ERROR_FORMAT_AS_STRING
     237              : 
     238              :     /**
     239              :      * Format an @a error as a string for printing.
     240              :      *
     241              :      * @note
     242              :      *  Normally, prefer to use Format()
     243              :      */
     244         5535 :     const char * AsString(bool withSourceLocation = true) const
     245              :     {
     246              :         extern const char * ErrorStr(ChipError, bool);
     247         5535 :         return ErrorStr(*this, withSourceLocation);
     248              :     }
     249              : 
     250              :     /**
     251              :      * Test whether @a error belongs to the Range @a range.
     252              :      */
     253           60 :     constexpr bool IsRange(Range range) const
     254              :     {
     255           60 :         return (mError & MakeMask(kRangeStart, kRangeLength)) == MakeField(kRangeStart, static_cast<StorageType>(range));
     256              :     }
     257              : 
     258              :     /**
     259              :      * Get the Range to which the @a error belongs.
     260              :      */
     261              :     constexpr Range GetRange() const { return static_cast<Range>(GetField(kRangeStart, kRangeLength, mError)); }
     262              : 
     263              :     /**
     264              :      * Get the encapsulated value of an @a error.
     265              :      */
     266           12 :     constexpr ValueType GetValue() const { return GetField(kValueStart, kValueLength, mError); }
     267              : 
     268              :     /**
     269              :      * Test whether type @a T can always be losslessly encapsulated in a CHIP_ERROR.
     270              :      */
     271              :     template <typename T>
     272              :     static constexpr bool CanEncapsulate()
     273              :     {
     274              :         return std::numeric_limits<typename std::make_unsigned_t<T>>::digits <= kValueLength;
     275              :     }
     276              : 
     277              :     /**
     278              :      * Test whether if @a value can be losslessly encapsulated in a CHIP_ERROR.
     279              :      */
     280              :     template <typename T>
     281              :     static constexpr bool CanEncapsulate(T value)
     282              :     {
     283              :         return CanEncapsulate<T>() || FitsInField(kValueLength, static_cast<ValueType>(value));
     284              :     }
     285              : 
     286              :     /**
     287              :      * Test whether @a error is an SDK error belonging to the SdkPart @a part.
     288              :      */
     289         7160 :     constexpr bool IsPart(SdkPart part) const
     290              :     {
     291         7160 :         return (mError & (MakeMask(kRangeStart, kRangeLength) | MakeMask(kSdkPartStart, kSdkPartLength))) ==
     292         7160 :             (MakeField(kRangeStart, static_cast<StorageType>(Range::kSDK)) |
     293         7160 :              MakeField(kSdkPartStart, static_cast<StorageType>(part)));
     294              :     }
     295              : 
     296              :     /**
     297              :      * Get the SDK code for an SDK error.
     298              :      */
     299           84 :     constexpr uint8_t GetSdkCode() const { return static_cast<uint8_t>(GetField(kSdkCodeStart, kSdkCodeLength, mError)); }
     300              : 
     301              :     /**
     302              :      * Test whether @a error is an SDK error representing an Interaction Model
     303              :      * status.  If it is, it can be converted to/from an interaction model
     304              :      * StatusIB struct.
     305              :      */
     306          229 :     constexpr bool IsIMStatus() const
     307              :     {
     308              :         // Open question: should CHIP_NO_ERROR be treated as an IM status for
     309              :         // purposes of this test?
     310          229 :         return IsPart(SdkPart::kIMGlobalStatus) || IsPart(SdkPart::kIMClusterStatus);
     311              :     }
     312              : 
     313              : #if CHIP_CONFIG_ERROR_SOURCE
     314              : 
     315              :     /**
     316              :      * Get the source file name of the point where the error occurred.
     317              :      *
     318              :      * @note
     319              :      *  This will be `nullptr` if the error was not created with a file name.
     320              :      */
     321         6640 :     const char * GetFile() const
     322              :     {
     323              : #if CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     324              :         return mSourceLocation.file_name();
     325              : #else
     326         6640 :         return mFile;
     327              : #endif
     328              :     }
     329              : 
     330              :     /**
     331              :      * Get the source line number of the point where the error occurred.
     332              :      *
     333              :      * @note
     334              :      *  This will be 0 if the error was not created with a file name.
     335              :      */
     336          697 :     unsigned int GetLine() const
     337              :     {
     338              : #if CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     339              :         return mSourceLocation.line();
     340              : #else
     341          697 :         return mLine;
     342              : #endif
     343              :     }
     344              : 
     345              : #if CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     346              :     /**
     347              :      * Get the source_location of the point where the error occurred.
     348              :      */
     349              :     const std::source_location & GetSourceLocation() { return mSourceLocation; }
     350              : #endif // CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     351              : 
     352              : #endif // CHIP_CONFIG_ERROR_SOURCE
     353              : 
     354              : private:
     355              :     /*
     356              :      * The representation of a CHIP_ERROR is structured so that SDK error code constants are small, in order to improve code
     357              :      * density on embedded builds. Arm 32, Xtensa, and RISC-V can all handle 11-bit values in a move-immediate instruction.
     358              :      * Further, SdkPart::kCore is 0 so that the most common errors fit in 8 bits for additional density on some processors.
     359              :      *
     360              :      *  31    28      24      20      16      12       8       4       0    Bit
     361              :      *  |       |       |       |       |       |       |       |       |
     362              :      *  |     range     |                     value                     |
     363              :      *  |    kSdk==0    |       0               |0| part|    code       |   SDK error
     364              :      *  |    01 - FF    |          encapsulated error code              |   Encapsulated error
     365              :      */
     366              :     static constexpr int kRangeStart  = 24;
     367              :     static constexpr int kRangeLength = 8;
     368              :     static constexpr int kValueStart  = 0;
     369              :     static constexpr int kValueLength = 24;
     370              : 
     371              :     static constexpr int kSdkPartStart  = 8;
     372              :     static constexpr int kSdkPartLength = 3;
     373              :     static constexpr int kSdkCodeStart  = 0;
     374              :     static constexpr int kSdkCodeLength = 8;
     375              : 
     376           96 :     static constexpr StorageType GetField(unsigned int start, unsigned int length, StorageType value)
     377              :     {
     378           96 :         return (value >> start) & ((1u << length) - 1);
     379              :     }
     380        36081 :     static constexpr StorageType MakeMask(unsigned int start, unsigned int length) { return ((1u << length) - 1) << start; }
     381        58362 :     static constexpr StorageType MakeField(unsigned int start, StorageType value) { return value << start; }
     382              :     static constexpr bool FitsInField(unsigned int length, StorageType value) { return value < (1u << length); }
     383              : 
     384        21846 :     static constexpr StorageType MakeInteger(Range range, StorageType value)
     385              :     {
     386        21846 :         return MakeField(kRangeStart, to_underlying(range)) | MakeField(kValueStart, value);
     387              :     }
     388          145 :     static constexpr StorageType MakeInteger(SdkPart part, uint8_t code)
     389              :     {
     390          145 :         return MakeInteger(Range::kSDK, MakeField(kSdkPartStart, to_underlying(part)) | MakeField(kSdkCodeStart, code));
     391              :     }
     392              :     template <unsigned int START, unsigned int LENGTH>
     393              :     struct MaskConstant
     394              :     {
     395              :         static constexpr StorageType value = ((1u << LENGTH) - 1) << START;
     396              :     };
     397              : 
     398              :     // Assert that Range and Value fields fit in StorageType and don't overlap.
     399              :     static_assert(kRangeStart + kRangeLength <= std::numeric_limits<StorageType>::digits, "Range does not fit in StorageType");
     400              :     static_assert(kValueStart + kValueLength <= std::numeric_limits<StorageType>::digits, "Value does not fit in StorageType");
     401              :     static_assert((MaskConstant<kRangeStart, kRangeLength>::value & MaskConstant<kValueStart, kValueLength>::value) == 0,
     402              :                   "Range and Value overlap");
     403              : 
     404              :     // Assert that SDK Part and Code fields fit in SdkCode field and don't overlap.
     405              :     static_assert(kSdkPartStart + kSdkPartLength <= kValueLength, "SdkPart does not fit in Value");
     406              :     static_assert(kSdkCodeStart + kSdkCodeLength <= kValueLength, "SdkCode does not fit in Value");
     407              :     static_assert((MaskConstant<kSdkPartStart, kSdkPartLength>::value & MaskConstant<kSdkCodeStart, kSdkCodeLength>::value) == 0,
     408              :                   "SdkPart and SdkCode overlap");
     409              : 
     410              :     // Assert that Value fits in ValueType.
     411              :     static_assert(kValueStart + kValueLength <= std::numeric_limits<ValueType>::digits, "Value does not fit in ValueType");
     412              : 
     413              :     StorageType mError;
     414              : 
     415              : #if CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_STD_SOURCE_LOCATION
     416              :     std::source_location mSourceLocation;
     417              : #elif CHIP_CONFIG_ERROR_SOURCE
     418              :     unsigned int mLine;
     419              :     const char * mFile;
     420              : #endif
     421              : 
     422              : public:
     423              :     /**
     424              :      * Helper for constructing error constants.
     425              :      *
     426              :      * This template ensures that the numeric value is constant and well-formed.
     427              :      */
     428              :     template <SdkPart PART, StorageType SCODE>
     429              :     struct SdkErrorConstant
     430              :     {
     431              :         static_assert(FitsInField(kSdkPartLength, to_underlying(PART)), "part is too large");
     432              :         static_assert(FitsInField(kSdkCodeLength, SCODE), "code is too large");
     433              :         static_assert(MakeInteger(PART, SCODE) != 0, "value is zero");
     434              :         static constexpr StorageType value = MakeInteger(PART, SCODE);
     435              :     };
     436              : };
     437              : 
     438              : } // namespace chip
     439              : 
     440              : /**
     441              :  *  The basic type for all CHIP errors.
     442              :  */
     443              : using CHIP_ERROR = ::chip::ChipError;
     444              : 
     445              : /**
     446              :  * Applications using the CHIP SDK can use this to define error codes in the CHIP_ERROR space for their own purposes.
     447              :  * This is suitable for a small fixed set of errors, similar to `CHIP_ERROR_…` constants. For embedding arbitrary or
     448              :  * larger values, use a custom Range offset from Range::kLastRange.
     449              :  */
     450              : #define CHIP_APPLICATION_ERROR(e) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kApplication, (e))
     451              : 
     452              : #define CHIP_CORE_ERROR(e) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kCore, (e))
     453              : 
     454              : #define CHIP_IM_GLOBAL_STATUS(type)                                                                                                \
     455              :     CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMGlobalStatus,                                                                    \
     456              :                    ::chip::to_underlying(::chip::Protocols::InteractionModel::Status::type))
     457              : 
     458              : // Defines a runtime-value for a chip-error that contains a global IM Status.
     459              : #define CHIP_ERROR_IM_GLOBAL_STATUS_VALUE(status_value)                                                                            \
     460              :     CHIP_GENERIC_ERROR(::chip::ChipError::SdkPart::kIMGlobalStatus, ::chip::to_underlying(status_value))
     461              : 
     462              : //
     463              : // type must be a compile-time constant as mandated by CHIP_SDK_ERROR.
     464              : //
     465              : #define CHIP_IM_CLUSTER_STATUS(type) CHIP_SDK_ERROR(::chip::ChipError::SdkPart::kIMClusterStatus, type)
     466              : 
     467              : // Defines a runtime-value for a chip-error that contains a cluster-specific error status.
     468              : // Must not be used with cluster-specific success status codes.
     469              : #define CHIP_ERROR_IM_CLUSTER_STATUS_VALUE(status_value)                                                                           \
     470              :     CHIP_GENERIC_ERROR(::chip::ChipError::SdkPart::kIMClusterStatus, status_value)
     471              : 
     472              : // clang-format off
     473              : 
     474              : /**
     475              :  *  @name Error Definitions
     476              :  *
     477              :  *  @{
     478              :  */
     479              : 
     480              : /**
     481              :  *  @def CHIP_NO_ERROR
     482              :  *
     483              :  *  @brief
     484              :  *    This defines the CHIP error code for success or no error.
     485              :  *
     486              :  */
     487              : #if CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_SOURCE_NO_ERROR
     488              : #define CHIP_NO_ERROR                                          CHIP_ERROR(0 CHIP_ERROR_SOURCE_LOCATION)
     489              : #else // CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_SOURCE_NO_ERROR
     490              : #define CHIP_NO_ERROR                                          CHIP_ERROR(0 CHIP_ERROR_SOURCE_LOCATION_NULL)
     491              : #endif // CHIP_CONFIG_ERROR_SOURCE && CHIP_CONFIG_ERROR_SOURCE_NO_ERROR
     492              : 
     493              : /**
     494              :  *  @def CHIP_ERROR_SENDING_BLOCKED
     495              :  *
     496              :  *  @brief
     497              :  *    A message exceeds the sent limit.
     498              :  *
     499              :  */
     500              : #define CHIP_ERROR_SENDING_BLOCKED                             CHIP_CORE_ERROR(0x01)
     501              : 
     502              : /**
     503              :  *  @def CHIP_ERROR_CONNECTION_ABORTED
     504              :  *
     505              :  *  @brief
     506              :  *    A connection has been aborted.
     507              :  *
     508              :  */
     509              : #define CHIP_ERROR_CONNECTION_ABORTED                          CHIP_CORE_ERROR(0x02)
     510              : 
     511              : /**
     512              :  *  @def CHIP_ERROR_INCORRECT_STATE
     513              :  *
     514              :  *  @brief
     515              :  *    An unexpected state was encountered.
     516              :  *
     517              :  */
     518              : #define CHIP_ERROR_INCORRECT_STATE                             CHIP_CORE_ERROR(0x03)
     519              : 
     520              : /**
     521              :  *  @def CHIP_ERROR_MESSAGE_TOO_LONG
     522              :  *
     523              :  *  @brief
     524              :  *    A message is too long.
     525              :  *
     526              :  */
     527              : #define CHIP_ERROR_MESSAGE_TOO_LONG                            CHIP_CORE_ERROR(0x04)
     528              : 
     529              : /**
     530              :  *    Recursion depth overflow
     531              :  */
     532              : #define CHIP_ERROR_RECURSION_DEPTH_LIMIT                       CHIP_CORE_ERROR(0x05)
     533              : 
     534              : /**
     535              :  *  @def CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS
     536              :  *
     537              :  *  @brief
     538              :  *    The attempt to register an unsolicited message handler failed because the
     539              :  *    unsolicited message handler pool is full.
     540              :  *
     541              :  */
     542              : #define CHIP_ERROR_TOO_MANY_UNSOLICITED_MESSAGE_HANDLERS       CHIP_CORE_ERROR(0x06)
     543              : 
     544              : /**
     545              :  *  @def CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER
     546              :  *
     547              :  *  @brief
     548              :  *    The attempt to unregister an unsolicited message handler failed because
     549              :  *    the target handler was not found in the unsolicited message handler pool.
     550              :  *
     551              :  */
     552              : #define CHIP_ERROR_NO_UNSOLICITED_MESSAGE_HANDLER              CHIP_CORE_ERROR(0x07)
     553              : 
     554              : /**
     555              :  *  @def CHIP_ERROR_NO_CONNECTION_HANDLER
     556              :  *
     557              :  *  @brief
     558              :  *    No callback has been registered for handling a connection.
     559              :  *
     560              :  */
     561              : #define CHIP_ERROR_NO_CONNECTION_HANDLER                       CHIP_CORE_ERROR(0x08)
     562              : 
     563              : /**
     564              :  *  @def CHIP_ERROR_TOO_MANY_PEER_NODES
     565              :  *
     566              :  *  @brief
     567              :  *    The number of peer nodes exceeds the maximum limit of a local node.
     568              :  *
     569              :  */
     570              : #define CHIP_ERROR_TOO_MANY_PEER_NODES                         CHIP_CORE_ERROR(0x09)
     571              : 
     572              : /**
     573              :  *  @def CHIP_ERROR_SENTINEL
     574              :  *
     575              :  *  @brief
     576              :  *    For use locally to mark conditions such as value found or end of iteration.
     577              :  *
     578              :  */
     579              : #define CHIP_ERROR_SENTINEL                                    CHIP_CORE_ERROR(0x0a)
     580              : 
     581              : /**
     582              :  *  @def CHIP_ERROR_NO_MEMORY
     583              :  *
     584              :  *  @brief
     585              :  *    The attempt to allocate a buffer or object failed due to a lack of memory.
     586              :  *
     587              :  */
     588              : #define CHIP_ERROR_NO_MEMORY                                   CHIP_CORE_ERROR(0x0b)
     589              : 
     590              : /**
     591              :  *  @def CHIP_ERROR_NO_MESSAGE_HANDLER
     592              :  *
     593              :  *  @brief
     594              :  *    No callback has been registered for handling a message.
     595              :  *
     596              :  */
     597              : #define CHIP_ERROR_NO_MESSAGE_HANDLER                          CHIP_CORE_ERROR(0x0c)
     598              : 
     599              : /**
     600              :  *  @def CHIP_ERROR_MESSAGE_INCOMPLETE
     601              :  *
     602              :  *  @brief
     603              :  *    A message is incomplete.
     604              :  *
     605              :  */
     606              : #define CHIP_ERROR_MESSAGE_INCOMPLETE                          CHIP_CORE_ERROR(0x0d)
     607              : 
     608              : /**
     609              :  *  @def CHIP_ERROR_DATA_NOT_ALIGNED
     610              :  *
     611              :  *  @brief
     612              :  *    The data is not aligned.
     613              :  *
     614              :  */
     615              : #define CHIP_ERROR_DATA_NOT_ALIGNED                            CHIP_CORE_ERROR(0x0e)
     616              : 
     617              : /**
     618              :  *  @def CHIP_ERROR_UNKNOWN_KEY_TYPE
     619              :  *
     620              :  *  @brief
     621              :  *    The encryption key type is unknown.
     622              :  *
     623              :  */
     624              : #define CHIP_ERROR_UNKNOWN_KEY_TYPE                            CHIP_CORE_ERROR(0x0f)
     625              : 
     626              : /**
     627              :  *  @def CHIP_ERROR_KEY_NOT_FOUND
     628              :  *
     629              :  *  @brief
     630              :  *    The encryption key is not found.
     631              :  *
     632              :  */
     633              : #define CHIP_ERROR_KEY_NOT_FOUND                               CHIP_CORE_ERROR(0x10)
     634              : 
     635              : /**
     636              :  *  @def CHIP_ERROR_WRONG_ENCRYPTION_TYPE
     637              :  *
     638              :  *  @brief
     639              :  *    The encryption type is incorrect for the specified key.
     640              :  *
     641              :  */
     642              : #define CHIP_ERROR_WRONG_ENCRYPTION_TYPE                       CHIP_CORE_ERROR(0x11)
     643              : 
     644              : /**
     645              :  *  @def CHIP_ERROR_INVALID_UTF8
     646              :  *
     647              :  *  @brief
     648              :  *    Invalid UTF8 string (contains some characters that are invalid)
     649              :  *
     650              :  */
     651              : #define CHIP_ERROR_INVALID_UTF8                                CHIP_CORE_ERROR(0x12)
     652              : 
     653              : /**
     654              :  *  @def CHIP_ERROR_INTEGRITY_CHECK_FAILED
     655              :  *
     656              :  *  @brief
     657              :  *    The integrity check in the message does not match the expected integrity
     658              :  *    check.
     659              :  *
     660              :  */
     661              : #define CHIP_ERROR_INTEGRITY_CHECK_FAILED                      CHIP_CORE_ERROR(0x13)
     662              : 
     663              : /**
     664              :  *  @def CHIP_ERROR_INVALID_SIGNATURE
     665              :  *
     666              :  *  @brief
     667              :  *    Invalid signature.
     668              :  *
     669              :  */
     670              : #define CHIP_ERROR_INVALID_SIGNATURE                           CHIP_CORE_ERROR(0x14)
     671              : 
     672              : /**
     673              :  *  @def CHIP_ERROR_INVALID_TLV_CHAR_STRING
     674              :  *
     675              :  *  @brief
     676              :  *    Invalid TLV character string (e.g. null terminator)
     677              :  *
     678              :  */
     679              : #define CHIP_ERROR_INVALID_TLV_CHAR_STRING                     CHIP_CORE_ERROR(0x15)
     680              : 
     681              : /**
     682              :  *  @def CHIP_ERROR_LIT_SUBSCRIBE_INACTIVE_TIMEOUT
     683              :  *
     684              :  *  @brief
     685              :  *    Subscription timeout caused by LIT ICD device inactive mode
     686              :  *
     687              :  */
     688              : #define CHIP_ERROR_LIT_SUBSCRIBE_INACTIVE_TIMEOUT              CHIP_CORE_ERROR(0x16)
     689              : 
     690              : /**
     691              :  *  @def CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE
     692              :  *
     693              :  *  @brief
     694              :  *    A signature type is unsupported.
     695              :  *
     696              :  */
     697              : #define CHIP_ERROR_UNSUPPORTED_SIGNATURE_TYPE                  CHIP_CORE_ERROR(0x17)
     698              : 
     699              : /**
     700              :  *  @def CHIP_ERROR_INVALID_MESSAGE_LENGTH
     701              :  *
     702              :  *  @brief
     703              :  *    A message length is invalid.
     704              :  *
     705              :  */
     706              : #define CHIP_ERROR_INVALID_MESSAGE_LENGTH                      CHIP_CORE_ERROR(0x18)
     707              : 
     708              : /**
     709              :  *  @def CHIP_ERROR_BUFFER_TOO_SMALL
     710              :  *
     711              :  *  @brief
     712              :  *    A buffer is too small.
     713              :  *
     714              :  */
     715              : #define CHIP_ERROR_BUFFER_TOO_SMALL                            CHIP_CORE_ERROR(0x19)
     716              : 
     717              : /**
     718              :  *  @def CHIP_ERROR_DUPLICATE_KEY_ID
     719              :  *
     720              :  *  @brief
     721              :  *    A key id is duplicate.
     722              :  *
     723              :  */
     724              : #define CHIP_ERROR_DUPLICATE_KEY_ID                            CHIP_CORE_ERROR(0x1a)
     725              : 
     726              : /**
     727              :  *  @def CHIP_ERROR_WRONG_KEY_TYPE
     728              :  *
     729              :  *  @brief
     730              :  *    A key type does not match the expected key type.
     731              :  *
     732              :  */
     733              : #define CHIP_ERROR_WRONG_KEY_TYPE                              CHIP_CORE_ERROR(0x1b)
     734              : 
     735              : /**
     736              :  *  @def CHIP_ERROR_UNINITIALIZED
     737              :  *
     738              :  *  @brief
     739              :  *    A requested object is uninitialized.
     740              :  *
     741              :  */
     742              : #define CHIP_ERROR_UNINITIALIZED                               CHIP_CORE_ERROR(0x1c)
     743              : 
     744              : /**
     745              :  *  @def CHIP_ERROR_INVALID_IPK
     746              :  *
     747              :  *  @brief
     748              :  *    The IPK is invalid
     749              :  *
     750              :  */
     751              : #define CHIP_ERROR_INVALID_IPK                                 CHIP_CORE_ERROR(0x1d)
     752              : 
     753              : /**
     754              :  *  @def CHIP_ERROR_INVALID_STRING_LENGTH
     755              :  *
     756              :  *  @brief
     757              :  *    A string length is invalid.
     758              :  *
     759              :  */
     760              : #define CHIP_ERROR_INVALID_STRING_LENGTH                       CHIP_CORE_ERROR(0x1e)
     761              : 
     762              : /**
     763              :  *  @def CHIP_ERROR_INVALID_LIST_LENGTH
     764              :  *
     765              :  *  @brief
     766              :  *    A list length is invalid.
     767              :  *
     768              :  */
     769              : #define CHIP_ERROR_INVALID_LIST_LENGTH                         CHIP_CORE_ERROR(0x1f)
     770              : 
     771              : /**
     772              :  *  @def CHIP_ERROR_FAILED_DEVICE_ATTESTATION
     773              :  *
     774              :  *  @brief
     775              :  *    Device Attestation failed.
     776              :  *
     777              :  */
     778              : #define CHIP_ERROR_FAILED_DEVICE_ATTESTATION                   CHIP_CORE_ERROR(0x20)
     779              : 
     780              : /**
     781              :  *  @def CHIP_END_OF_TLV
     782              :  *
     783              :  *  @brief
     784              :  *    The end of a TLV encoding,
     785              :  *    or the end of a TLV container element has been reached.
     786              :  *
     787              :  */
     788              : #define CHIP_ERROR_END_OF_TLV                                  CHIP_CORE_ERROR(0x21)
     789              : #define CHIP_END_OF_TLV CHIP_ERROR_END_OF_TLV
     790              : 
     791              : /**
     792              :  *  @def CHIP_ERROR_TLV_UNDERRUN
     793              :  *
     794              :  *  @brief
     795              :  *    The TLV encoding ended prematurely.
     796              :  *
     797              :  */
     798              : #define CHIP_ERROR_TLV_UNDERRUN                                CHIP_CORE_ERROR(0x22)
     799              : 
     800              : /**
     801              :  *  @def CHIP_ERROR_INVALID_TLV_ELEMENT
     802              :  *
     803              :  *  @brief
     804              :  *    A TLV element is invalid.
     805              :  *
     806              :  */
     807              : #define CHIP_ERROR_INVALID_TLV_ELEMENT                         CHIP_CORE_ERROR(0x23)
     808              : 
     809              : /**
     810              :  *  @def CHIP_ERROR_INVALID_TLV_TAG
     811              :  *
     812              :  *  @brief
     813              :  *    A TLV tag is invalid.
     814              :  *
     815              :  */
     816              : #define CHIP_ERROR_INVALID_TLV_TAG                             CHIP_CORE_ERROR(0x24)
     817              : 
     818              : /**
     819              :  *  @def CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG
     820              :  *
     821              :  *  @brief
     822              :  *    An implicitly encoded TLV tag was encountered,
     823              :  *    but an implicit profile id has not been defined.
     824              :  *
     825              :  */
     826              : #define CHIP_ERROR_UNKNOWN_IMPLICIT_TLV_TAG                    CHIP_CORE_ERROR(0x25)
     827              : 
     828              : /**
     829              :  *  @def CHIP_ERROR_WRONG_TLV_TYPE
     830              :  *
     831              :  *  @brief
     832              :  *    A TLV type is wrong.
     833              :  *
     834              :  */
     835              : #define CHIP_ERROR_WRONG_TLV_TYPE                              CHIP_CORE_ERROR(0x26)
     836              : 
     837              : /**
     838              :  *  @def CHIP_ERROR_TLV_CONTAINER_OPEN
     839              :  *
     840              :  *  @brief
     841              :  *    A TLV container is unexpectedly open.
     842              :  *
     843              :  */
     844              : #define CHIP_ERROR_TLV_CONTAINER_OPEN                          CHIP_CORE_ERROR(0x27)
     845              : 
     846              : /**
     847              :  *  @def CHIP_ERROR_IN_USE
     848              :  *
     849              :  *  @brief
     850              :  *    A value is already used. Generally indicates an unavailable resource.
     851              :  *    As opposed to CHIP_ERROR_BUSY, the use is not considered transient/temporary.
     852              :  *
     853              :  */
     854              : #define CHIP_ERROR_IN_USE                                      CHIP_CORE_ERROR(0x28)
     855              : 
     856              : /**
     857              :  *  @def CHIP_ERROR_HAD_FAILURES
     858              :  *
     859              :  *  @brief
     860              :  *    Report a multi-part operation as having had failures.
     861              :  *    This is used as an aggregate of a single CHIP_ERROR when several underlying
     862              :  *    calls may have failed and no single point of failure is reported.
     863              :  */
     864              : #define CHIP_ERROR_HAD_FAILURES                                CHIP_CORE_ERROR(0x29)
     865              : 
     866              : /**
     867              :  *  @def CHIP_ERROR_INVALID_MESSAGE_TYPE
     868              :  *
     869              :  *  @brief
     870              :  *    A message type is invalid.
     871              :  *
     872              :  */
     873              : #define CHIP_ERROR_INVALID_MESSAGE_TYPE                        CHIP_CORE_ERROR(0x2a)
     874              : 
     875              : /**
     876              :  *  @def CHIP_ERROR_UNEXPECTED_TLV_ELEMENT
     877              :  *
     878              :  *  @brief
     879              :  *    An unexpected TLV element was encountered.
     880              :  *
     881              :  */
     882              : #define CHIP_ERROR_UNEXPECTED_TLV_ELEMENT                      CHIP_CORE_ERROR(0x2b)
     883              : 
     884              : /**
     885              :  *  @def CHIP_ERROR_ALREADY_INITIALIZED
     886              :  *
     887              :  *  @brief
     888              :  *    Mark that an object has already beein initialized and cannot be
     889              :  *    initialized again
     890              :  *
     891              :  */
     892              : #define CHIP_ERROR_ALREADY_INITIALIZED                        CHIP_CORE_ERROR(0x2c)
     893              : 
     894              : /**
     895              :  *  @def CHIP_ERROR_NOT_IMPLEMENTED
     896              :  *
     897              :  *  @brief
     898              :  *    A requested function or feature is not implemented.
     899              :  *
     900              :  */
     901              : #define CHIP_ERROR_NOT_IMPLEMENTED                             CHIP_CORE_ERROR(0x2d)
     902              : 
     903              : /**
     904              :  *  @def CHIP_ERROR_INVALID_ADDRESS
     905              :  *
     906              :  *  @brief
     907              :  *    An address is invalid.
     908              :  *
     909              :  */
     910              : #define CHIP_ERROR_INVALID_ADDRESS                             CHIP_CORE_ERROR(0x2e)
     911              : 
     912              : /**
     913              :  *  @def CHIP_ERROR_INVALID_ARGUMENT
     914              :  *
     915              :  *  @brief
     916              :  *    An argument is invalid.
     917              :  *
     918              :  */
     919              : #define CHIP_ERROR_INVALID_ARGUMENT                            CHIP_CORE_ERROR(0x2f)
     920              : 
     921              : /**
     922              :  *  @def CHIP_ERROR_INVALID_PATH_LIST
     923              :  *
     924              :  *  @brief
     925              :  *    A TLV path list is invalid.
     926              :  *
     927              :  */
     928              : #define CHIP_ERROR_INVALID_PATH_LIST                           CHIP_CORE_ERROR(0x30)
     929              : 
     930              : /**
     931              :  *  @def CHIP_ERROR_INVALID_DATA_LIST
     932              :  *
     933              :  *  @brief
     934              :  *    A TLV data list is invalid.
     935              :  *
     936              :  */
     937              : #define CHIP_ERROR_INVALID_DATA_LIST                           CHIP_CORE_ERROR(0x31)
     938              : 
     939              : /**
     940              :  *  @def CHIP_ERROR_TIMEOUT
     941              :  *
     942              :  *  @brief
     943              :  *    A request timed out.
     944              :  *
     945              :  */
     946              : #define CHIP_ERROR_TIMEOUT                                     CHIP_CORE_ERROR(0x32)
     947              : 
     948              : /**
     949              :  *  @def CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR
     950              :  *
     951              :  *  @brief
     952              :  *    A device descriptor is invalid.
     953              :  *
     954              :  */
     955              : #define CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR                   CHIP_CORE_ERROR(0x33)
     956              : 
     957              : // AVAILABLE: 0x34
     958              : // AVAILABLE: 0x35
     959              : // AVAILABLE: 0x36
     960              : // AVAILABLE: 0x37
     961              : 
     962              : /**
     963              :  *  @def CHIP_ERROR_INVALID_PASE_PARAMETER
     964              :  *
     965              :  *  @brief
     966              :  *    A PASE parameter is invalid.
     967              :  *
     968              :  */
     969              : #define CHIP_ERROR_INVALID_PASE_PARAMETER                      CHIP_CORE_ERROR(0x38)
     970              : 
     971              : // AVAILABLE: 0x39
     972              : // AVAILABLE: 0x3a
     973              : 
     974              : /**
     975              :  *  @def CHIP_ERROR_INVALID_USE_OF_SESSION_KEY
     976              :  *
     977              :  *  @brief
     978              :  *    A use of session key is invalid.
     979              :  *
     980              :  */
     981              : #define CHIP_ERROR_INVALID_USE_OF_SESSION_KEY                  CHIP_CORE_ERROR(0x3b)
     982              : 
     983              : /**
     984              :  *  @def CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY
     985              :  *
     986              :  *  @brief
     987              :  *    A connection is closed unexpectedly.
     988              :  *
     989              :  */
     990              : #define CHIP_ERROR_CONNECTION_CLOSED_UNEXPECTEDLY              CHIP_CORE_ERROR(0x3c)
     991              : 
     992              : /**
     993              :  *  @def CHIP_ERROR_MISSING_TLV_ELEMENT
     994              :  *
     995              :  *  @brief
     996              :  *    A TLV element is missing.
     997              :  *
     998              :  */
     999              : #define CHIP_ERROR_MISSING_TLV_ELEMENT                         CHIP_CORE_ERROR(0x3d)
    1000              : 
    1001              : /**
    1002              :  *  @def CHIP_ERROR_RANDOM_DATA_UNAVAILABLE
    1003              :  *
    1004              :  *  @brief
    1005              :  *    Secure random data is not available.
    1006              :  *
    1007              :  */
    1008              : #define CHIP_ERROR_RANDOM_DATA_UNAVAILABLE                     CHIP_CORE_ERROR(0x3e)
    1009              : 
    1010              : // AVAILABLE: 0x3f
    1011              : // AVAILABLE: 0x40
    1012              : 
    1013              : /**
    1014              :  *  @def CHIP_ERROR_HOST_PORT_LIST_EMPTY
    1015              :  *
    1016              :  *  @brief
    1017              :  *    A host/port list is empty.
    1018              :  *
    1019              :  */
    1020              : #define CHIP_ERROR_HOST_PORT_LIST_EMPTY                        CHIP_CORE_ERROR(0x41)
    1021              : 
    1022              : // AVAILABLE: 0x42
    1023              : // AVAILABLE: 0x43
    1024              : // AVAILABLE: 0x44
    1025              : 
    1026              : /**
    1027              :  *  @def CHIP_ERROR_FORCED_RESET
    1028              :  *
    1029              :  *  @brief
    1030              :  *    A service manager is forced to reset.
    1031              :  *
    1032              :  */
    1033              : #define CHIP_ERROR_FORCED_RESET                                CHIP_CORE_ERROR(0x45)
    1034              : 
    1035              : /**
    1036              :  *  @def CHIP_ERROR_NO_ENDPOINT
    1037              :  *
    1038              :  *  @brief
    1039              :  *    No endpoint is available.
    1040              :  *
    1041              :  */
    1042              : #define CHIP_ERROR_NO_ENDPOINT                                 CHIP_CORE_ERROR(0x46)
    1043              : 
    1044              : /**
    1045              :  *  @def CHIP_ERROR_INVALID_DESTINATION_NODE_ID
    1046              :  *
    1047              :  *  @brief
    1048              :  *    A destination node id is invalid.
    1049              :  *
    1050              :  */
    1051              : #define CHIP_ERROR_INVALID_DESTINATION_NODE_ID                 CHIP_CORE_ERROR(0x47)
    1052              : 
    1053              : /**
    1054              :  *  @def CHIP_ERROR_NOT_CONNECTED
    1055              :  *
    1056              :  *  @brief
    1057              :  *    The operation cannot be performed because the underlying object is not
    1058              :  *    connected.
    1059              :  *
    1060              :  */
    1061              : #define CHIP_ERROR_NOT_CONNECTED                               CHIP_CORE_ERROR(0x48)
    1062              : 
    1063              : // AVAILABLE: 0x49
    1064              : 
    1065              : /**
    1066              :  *  @def CHIP_ERROR_CA_CERT_NOT_FOUND
    1067              :  *
    1068              :  *  @brief
    1069              :  *    CA certificate is not found.
    1070              :  *
    1071              :  */
    1072              : #define CHIP_ERROR_CA_CERT_NOT_FOUND                           CHIP_CORE_ERROR(0x4a)
    1073              : 
    1074              : /**
    1075              :  *  @def CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED
    1076              :  *
    1077              :  *  @brief
    1078              :  *    A certificate path length exceeds the constraint.
    1079              :  *
    1080              :  */
    1081              : #define CHIP_ERROR_CERT_PATH_LEN_CONSTRAINT_EXCEEDED           CHIP_CORE_ERROR(0x4b)
    1082              : 
    1083              : /**
    1084              :  *  @def CHIP_ERROR_CERT_PATH_TOO_LONG
    1085              :  *
    1086              :  *  @brief
    1087              :  *    A certificate path is too long.
    1088              :  *
    1089              :  */
    1090              : #define CHIP_ERROR_CERT_PATH_TOO_LONG                          CHIP_CORE_ERROR(0x4c)
    1091              : 
    1092              : /**
    1093              :  *  @def CHIP_ERROR_CERT_USAGE_NOT_ALLOWED
    1094              :  *
    1095              :  *  @brief
    1096              :  *    A requested certificate usage is not allowed.
    1097              :  *
    1098              :  */
    1099              : #define CHIP_ERROR_CERT_USAGE_NOT_ALLOWED                      CHIP_CORE_ERROR(0x4d)
    1100              : 
    1101              : /**
    1102              :  *  @def CHIP_ERROR_CERT_EXPIRED
    1103              :  *
    1104              :  *  @brief
    1105              :  *    A certificate expired.
    1106              :  *
    1107              :  */
    1108              : #define CHIP_ERROR_CERT_EXPIRED                                CHIP_CORE_ERROR(0x4e)
    1109              : 
    1110              : /**
    1111              :  *  @def CHIP_ERROR_CERT_NOT_VALID_YET
    1112              :  *
    1113              :  *  @brief
    1114              :  *    A certificate is not valid yet.
    1115              :  *
    1116              :  */
    1117              : #define CHIP_ERROR_CERT_NOT_VALID_YET                          CHIP_CORE_ERROR(0x4f)
    1118              : 
    1119              : /**
    1120              :  *  @def CHIP_ERROR_UNSUPPORTED_CERT_FORMAT
    1121              :  *
    1122              :  *  @brief
    1123              :  *    A certificate format is unsupported.
    1124              :  *
    1125              :  */
    1126              : #define CHIP_ERROR_UNSUPPORTED_CERT_FORMAT                     CHIP_CORE_ERROR(0x50)
    1127              : 
    1128              : /**
    1129              :  *  @def CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE
    1130              :  *
    1131              :  *  @brief
    1132              :  *    An elliptic curve is unsupported.
    1133              :  *
    1134              :  */
    1135              : #define CHIP_ERROR_UNSUPPORTED_ELLIPTIC_CURVE                  CHIP_CORE_ERROR(0x51)
    1136              : 
    1137              : // AVAILABLE: 0x52
    1138              : 
    1139              : /**
    1140              :  *  @def CHIP_ERROR_CERT_NOT_FOUND
    1141              :  *
    1142              :  *  @brief
    1143              :  *    A certificate is not found.
    1144              :  *
    1145              :  */
    1146              : #define CHIP_ERROR_CERT_NOT_FOUND                              CHIP_CORE_ERROR(0x53)
    1147              : 
    1148              : /**
    1149              :  *  @def CHIP_ERROR_INVALID_CASE_PARAMETER
    1150              :  *
    1151              :  *  @brief
    1152              :  *    A CASE parameter is invalid.
    1153              :  *
    1154              :  */
    1155              : #define CHIP_ERROR_INVALID_CASE_PARAMETER                      CHIP_CORE_ERROR(0x54)
    1156              : 
    1157              : // AVAILABLE: 0x55
    1158              : 
    1159              : /**
    1160              :  *  @def CHIP_ERROR_CERT_LOAD_FAILED
    1161              :  *
    1162              :  *  @brief
    1163              :  *    A certificate load failed.
    1164              :  *
    1165              :  */
    1166              : #define CHIP_ERROR_CERT_LOAD_FAILED                            CHIP_CORE_ERROR(0x56)
    1167              : 
    1168              : /**
    1169              :  *  @def CHIP_ERROR_CERT_NOT_TRUSTED
    1170              :  *
    1171              :  *  @brief
    1172              :  *    A certificate is not trusted.
    1173              :  *
    1174              :  */
    1175              : #define CHIP_ERROR_CERT_NOT_TRUSTED                            CHIP_CORE_ERROR(0x57)
    1176              : 
    1177              : // AVAILABLE: 0x58
    1178              : 
    1179              : /**
    1180              :  *  @def CHIP_ERROR_WRONG_CERT_DN
    1181              :  *
    1182              :  *  @brief
    1183              :  *    A certificate subject/issuer distinguished name is wrong.
    1184              :  *
    1185              :  */
    1186              : #define CHIP_ERROR_WRONG_CERT_DN                               CHIP_CORE_ERROR(0x59)
    1187              : 
    1188              : // AVAILABLE: 0x5a
    1189              : // AVAILABLE: 0x5b
    1190              : 
    1191              : /**
    1192              :  *  @def CHIP_ERROR_WRONG_NODE_ID
    1193              :  *
    1194              :  *  @brief
    1195              :  *    A node id is wrong.
    1196              :  *
    1197              :  */
    1198              : #define CHIP_ERROR_WRONG_NODE_ID                               CHIP_CORE_ERROR(0x5c)
    1199              : 
    1200              : // AVAILABLE: 0x5d
    1201              : // AVAILABLE: 0x5e
    1202              : // AVAILABLE: 0x5f
    1203              : // AVAILABLE: 0x60
    1204              : // AVAILABLE: 0x61
    1205              : // AVAILABLE: 0x62
    1206              : // AVAILABLE: 0x63
    1207              : 
    1208              : /**
    1209              :  *  @def CHIP_ERROR_RETRANS_TABLE_FULL
    1210              :  *
    1211              :  *  @brief
    1212              :  *    A retransmission table is already full.
    1213              :  *
    1214              :  */
    1215              : #define CHIP_ERROR_RETRANS_TABLE_FULL                          CHIP_CORE_ERROR(0x64)
    1216              : 
    1217              : // AVAILABLE: 0x65
    1218              : // AVAILABLE: 0x66
    1219              : // AVAILABLE: 0x67
    1220              : 
    1221              : /**
    1222              :  *  @def CHIP_ERROR_TRANSACTION_CANCELED
    1223              :  *
    1224              :  *  @brief
    1225              :  *    A transaction is cancelled.
    1226              :  *
    1227              :  */
    1228              : #define CHIP_ERROR_TRANSACTION_CANCELED                        CHIP_CORE_ERROR(0x68)
    1229              : 
    1230              : // AVAILABLE: 0x69
    1231              : // AVAILABLE: 0x6a
    1232              : 
    1233              : /**
    1234              :  *  @def CHIP_ERROR_INVALID_SUBSCRIPTION
    1235              :  *
    1236              :  *  @brief
    1237              :  *    A message was received as part of a subscription exchange that has a mis-matching subscription id.
    1238              :  *
    1239              :  */
    1240              : #define CHIP_ERROR_INVALID_SUBSCRIPTION                               CHIP_CORE_ERROR(0x6b)
    1241              : 
    1242              : /**
    1243              :  *  @def CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE
    1244              :  *
    1245              :  *  @brief
    1246              :  *    A CHIP feature is unsupported.
    1247              :  *
    1248              :  */
    1249              : #define CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE                    CHIP_CORE_ERROR(0x6c)
    1250              : 
    1251              : /**
    1252              :  *  @def CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR
    1253              :  *
    1254              :  *  @brief
    1255              :  *    An unsolicited message with the originator bit clear.
    1256              :  *
    1257              :  */
    1258              : #define CHIP_ERROR_UNSOLICITED_MSG_NO_ORIGINATOR               CHIP_CORE_ERROR(0x70)
    1259              : 
    1260              : /**
    1261              :  *  @def CHIP_ERROR_INVALID_FABRIC_INDEX
    1262              :  *
    1263              :  *  @brief
    1264              :  *    A fabric index is invalid.
    1265              :  *
    1266              :  */
    1267              : #define CHIP_ERROR_INVALID_FABRIC_INDEX                        CHIP_CORE_ERROR(0x71)
    1268              : 
    1269              : /**
    1270              :  *  @def CHIP_ERROR_TOO_MANY_CONNECTIONS
    1271              :  *
    1272              :  *  @brief
    1273              :  *    The attempt to allocate a connection object failed because too many
    1274              :  *    connections exist.
    1275              :  *
    1276              :  */
    1277              : #define CHIP_ERROR_TOO_MANY_CONNECTIONS                        CHIP_CORE_ERROR(0x72)
    1278              : 
    1279              : /**
    1280              :  * @def CHIP_ERROR_SHUT_DOWN
    1281              :  *
    1282              :  * @brief
    1283              :  *   The operation cancelled because a shut down was initiated
    1284              :  */
    1285              : #define CHIP_ERROR_SHUT_DOWN                                   CHIP_CORE_ERROR(0x73)
    1286              : 
    1287              : /**
    1288              :  * @def CHIP_ERROR_CANCELLED
    1289              :  *
    1290              :  * @brief
    1291              :  *   The operation has been cancelled, generally by calling a cancel/abort request.
    1292              :  */
    1293              : #define CHIP_ERROR_CANCELLED                                   CHIP_CORE_ERROR(0x74)
    1294              : 
    1295              : // AVAILABLE: 0x75
    1296              : 
    1297              : /**
    1298              :  *  @def CHIP_ERROR_TLV_TAG_NOT_FOUND
    1299              :  *
    1300              :  *  @brief
    1301              :  *    A specified TLV tag was not found.
    1302              :  *
    1303              :  */
    1304              : #define CHIP_ERROR_TLV_TAG_NOT_FOUND                           CHIP_CORE_ERROR(0x76)
    1305              : 
    1306              : /**
    1307              :  * @def CHIP_ERROR_MISSING_SECURE_SESSION
    1308              :  *
    1309              :  * @brief
    1310              :  *
    1311              :  *  A secure session is needed to do work, but is missing/is not present.
    1312              :  */
    1313              : #define CHIP_ERROR_MISSING_SECURE_SESSION                      CHIP_CORE_ERROR(0x77)
    1314              : 
    1315              : /**
    1316              :  * @def CHIP_ERROR_INVALID_ADMIN_SUBJECT
    1317              :  *
    1318              :  * @brief
    1319              :  *   The CaseAdminSubject field is not valid in AddNOC command.
    1320              :  *
    1321              :  */
    1322              : #define CHIP_ERROR_INVALID_ADMIN_SUBJECT                      CHIP_CORE_ERROR(0x78)
    1323              : 
    1324              : /**
    1325              :  * @def CHIP_ERROR_INSUFFICIENT_PRIVILEGE
    1326              :  *
    1327              :  * @brief
    1328              :  *   Required privilege was insufficient during an operation.
    1329              :  *
    1330              :  */
    1331              : #define CHIP_ERROR_INSUFFICIENT_PRIVILEGE                          CHIP_CORE_ERROR(0x79)
    1332              : 
    1333              : // AVAILABLE: 0x7a
    1334              : // AVAILABLE: 0x7b
    1335              : // AVAILABLE: 0x7c
    1336              : 
    1337              : /**
    1338              :  * @def CHIP_ERROR_MESSAGE_COUNTER_EXHAUSTED
    1339              :  *
    1340              :  * @brief
    1341              :  *   The message counter of the session is exhausted, the session should be closed.
    1342              :  */
    1343              : #define CHIP_ERROR_MESSAGE_COUNTER_EXHAUSTED                 CHIP_CORE_ERROR(0x7d)
    1344              : 
    1345              : /**
    1346              :  *  @def CHIP_ERROR_FABRIC_EXISTS
    1347              :  *
    1348              :  *  @brief
    1349              :  *    The fabric with the given fabric id and root public key already exists.
    1350              :  *
    1351              :  */
    1352              : #define CHIP_ERROR_FABRIC_EXISTS                               CHIP_CORE_ERROR(0x7e)
    1353              : 
    1354              : /**
    1355              :  *  @def CHIP_ERROR_ENDPOINT_EXISTS
    1356              :  *
    1357              :  *  @brief
    1358              :  *    The endpoint with the given endpoint id already exists.
    1359              :  *
    1360              :  */
    1361              : #define CHIP_ERROR_ENDPOINT_EXISTS                               CHIP_CORE_ERROR(0x7f)
    1362              : 
    1363              : /**
    1364              :  *  @def CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER
    1365              :  *
    1366              :  *  @brief
    1367              :  *    The wrong encryption type error received from a peer node.
    1368              :  *
    1369              :  */
    1370              : #define CHIP_ERROR_WRONG_ENCRYPTION_TYPE_FROM_PEER             CHIP_CORE_ERROR(0x80)
    1371              : 
    1372              : // AVAILABLE: 0x81
    1373              : // AVAILABLE: 0x82
    1374              : // AVAILABLE: 0x83
    1375              : // AVAILABLE: 0x84
    1376              : 
    1377              : /**
    1378              :  *  @def CHIP_ERROR_INVALID_KEY_ID
    1379              :  *
    1380              :  *  @brief
    1381              :  *    A key id is invalid.
    1382              :  *
    1383              :  */
    1384              : #define CHIP_ERROR_INVALID_KEY_ID                              CHIP_CORE_ERROR(0x85)
    1385              : 
    1386              : /**
    1387              :  *  @def CHIP_ERROR_INVALID_TIME
    1388              :  *
    1389              :  *  @brief
    1390              :  *    Time has invalid value.
    1391              :  *
    1392              :  */
    1393              : #define CHIP_ERROR_INVALID_TIME                                CHIP_CORE_ERROR(0x86)
    1394              : 
    1395              : // AVAILABLE: 0x87
    1396              : // AVAILABLE: 0x88
    1397              : // AVAILABLE: 0x89
    1398              : // AVAILABLE: 0x8a
    1399              : // AVAILABLE: 0x8b
    1400              : // AVAILABLE: 0x8c
    1401              : // AVAILABLE: 0x8d
    1402              : 
    1403              : /**
    1404              :  *  @def CHIP_ERROR_SCHEMA_MISMATCH
    1405              :  *
    1406              :  *  @brief
    1407              :  *    A mismatch in schema was encountered.
    1408              :  *
    1409              :  */
    1410              : #define CHIP_ERROR_SCHEMA_MISMATCH                             CHIP_CORE_ERROR(0x8e)
    1411              : 
    1412              : /**
    1413              :  *  @def CHIP_ERROR_INVALID_INTEGER_VALUE
    1414              :  *
    1415              :  *  @brief
    1416              :  *    An integer does not have the kind of value we expect.
    1417              :  *
    1418              :  */
    1419              : #define CHIP_ERROR_INVALID_INTEGER_VALUE                       CHIP_CORE_ERROR(0x8f)
    1420              : 
    1421              : // AVAILABLE: 0x90
    1422              : // AVAILABLE: 0x91
    1423              : 
    1424              : /**
    1425              :  *  @def CHIP_ERROR_BAD_REQUEST
    1426              :  *
    1427              :  *  @brief
    1428              :  *    The request cannot be processed or fulfilled
    1429              :  *
    1430              :  */
    1431              : #define CHIP_ERROR_BAD_REQUEST                                 CHIP_CORE_ERROR(0x92)
    1432              : 
    1433              : // AVAILABLE: 0x93
    1434              : // AVAILABLE: 0x94
    1435              : // AVAILABLE: 0x95
    1436              : // AVAILABLE: 0x96
    1437              : // AVAILABLE: 0x97
    1438              : // AVAILABLE: 0x98
    1439              : // AVAILABLE: 0x99
    1440              : // AVAILABLE: 0x9a
    1441              : // AVAILABLE: 0x9b
    1442              : // AVAILABLE: 0x9c
    1443              : 
    1444              : /**
    1445              :  * @def CHIP_ERROR_WRONG_CERT_TYPE
    1446              :  *
    1447              :  * @brief
    1448              :  *   The presented certificate was of the wrong type.
    1449              :  */
    1450              : #define CHIP_ERROR_WRONG_CERT_TYPE                             CHIP_CORE_ERROR(0x9d)
    1451              : 
    1452              : // AVAILABLE: 0x9e
    1453              : 
    1454              : /**
    1455              :  *  @def CHIP_ERROR_PERSISTED_STORAGE_FAILED
    1456              :  *
    1457              :  *  @brief
    1458              :  *    Persisted storage memory read/write failure.
    1459              :  *
    1460              :  */
    1461              : #define CHIP_ERROR_PERSISTED_STORAGE_FAILED                    CHIP_CORE_ERROR(0x9f)
    1462              : 
    1463              : /**
    1464              :  *  @def CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND
    1465              :  *
    1466              :  *  @brief
    1467              :  *    The specific value is not found in the persisted storage.
    1468              :  *
    1469              :  */
    1470              : #define CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND           CHIP_CORE_ERROR(0xa0)
    1471              : 
    1472              : /**
    1473              :  * @def CHIP_ERROR_IM_FABRIC_DELETED
    1474              :  *
    1475              :  * @brief
    1476              :  *   The fabric is deleted, and the corresponding IM resources are released
    1477              :  */
    1478              : #define CHIP_ERROR_IM_FABRIC_DELETED                            CHIP_CORE_ERROR(0xa1)
    1479              : 
    1480              : // AVAILABLE: 0xa2
    1481              : // AVAILABLE: 0xa3
    1482              : 
    1483              : /**
    1484              :  * @def CHIP_ERROR_IN_PROGRESS
    1485              :  *
    1486              :  * @brief
    1487              :  *   The operation is still in progress
    1488              :  */
    1489              : #define CHIP_ERROR_IN_PROGRESS                                 CHIP_CORE_ERROR(0xa4)
    1490              : 
    1491              : /**
    1492              :  *  @def CHIP_ERROR_ACCESS_DENIED
    1493              :  *
    1494              :  *  @brief
    1495              :  *    The CHIP message is not granted access for further processing.
    1496              :  */
    1497              : #define CHIP_ERROR_ACCESS_DENIED                               CHIP_CORE_ERROR(0xa5)
    1498              : 
    1499              : /**
    1500              :  *  @def CHIP_ERROR_UNKNOWN_RESOURCE_ID
    1501              :  *
    1502              :  *  @brief
    1503              :  *    Unknown resource ID
    1504              :  *
    1505              :  */
    1506              : #define CHIP_ERROR_UNKNOWN_RESOURCE_ID                         CHIP_CORE_ERROR(0xa6)
    1507              : 
    1508              : /**
    1509              :  * @def CHIP_ERROR_VERSION_MISMATCH
    1510              :  *
    1511              :  * @brief
    1512              :  *   The conditional update of a trait instance path has failed
    1513              :  *   because the local changes are based on an obsolete version of the
    1514              :  *   data.
    1515              :  */
    1516              : #define CHIP_ERROR_VERSION_MISMATCH                            CHIP_CORE_ERROR(0xa7)
    1517              : 
    1518              : /**
    1519              :  *  @def CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL
    1520              :  *
    1521              :  *  @brief
    1522              :  *    The CHIP message is not granted access for further processing due to Access Restriction List.
    1523              :  */
    1524              : #define CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL                    CHIP_CORE_ERROR(0xa8)
    1525              : 
    1526              : // AVAILABLE: 0xa9
    1527              : // AVAILABLE: 0xaa
    1528              : 
    1529              : /**
    1530              :  * @def CHIP_EVENT_ID_FOUND
    1531              :  *
    1532              :  * @brief
    1533              :  *   Event ID matching the criteria was found
    1534              :  */
    1535              : #define CHIP_ERROR_EVENT_ID_FOUND                              CHIP_CORE_ERROR(0xab)
    1536              : #define CHIP_EVENT_ID_FOUND CHIP_ERROR_EVENT_ID_FOUND
    1537              : 
    1538              : /**
    1539              :  * @def CHIP_ERROR_INTERNAL
    1540              :  *
    1541              :  * @brief
    1542              :  *   Internal error
    1543              :  */
    1544              : #define CHIP_ERROR_INTERNAL                                    CHIP_CORE_ERROR(0xac)
    1545              : 
    1546              : /**
    1547              :  * @def CHIP_ERROR_OPEN_FAILED
    1548              :  *
    1549              :  * @brief
    1550              :  *   Open file failed
    1551              :  */
    1552              : #define CHIP_ERROR_OPEN_FAILED                                 CHIP_CORE_ERROR(0xad)
    1553              : 
    1554              : /**
    1555              :  * @def CHIP_ERROR_READ_FAILED
    1556              :  *
    1557              :  * @brief
    1558              :  *   Read from file failed
    1559              :  */
    1560              : #define CHIP_ERROR_READ_FAILED                                 CHIP_CORE_ERROR(0xae)
    1561              : 
    1562              : /**
    1563              :  * @def CHIP_ERROR_WRITE_FAILED
    1564              :  *
    1565              :  * @brief
    1566              :  *   Write to file failed
    1567              :  */
    1568              : #define CHIP_ERROR_WRITE_FAILED                                CHIP_CORE_ERROR(0xaf)
    1569              : 
    1570              : /**
    1571              :  * @def CHIP_ERROR_DECODE_FAILED
    1572              :  *
    1573              :  * @brief
    1574              :  *   Decoding failed
    1575              :  */
    1576              : #define CHIP_ERROR_DECODE_FAILED                               CHIP_CORE_ERROR(0xb0)
    1577              : 
    1578              : // AVAILABLE: 0xb1
    1579              : // AVAILABLE: 0xb2
    1580              : 
    1581              : /**
    1582              :  *  @def CHIP_ERROR_DNS_SD_UNAUTHORIZED
    1583              :  *
    1584              :  *  @brief
    1585              :  *    The application is not authorized to do DNS_SD lookups.
    1586              :  *
    1587              :  */
    1588              : #define CHIP_ERROR_DNS_SD_UNAUTHORIZED                        CHIP_CORE_ERROR(0xb3)
    1589              : 
    1590              : /**
    1591              :  *  @def CHIP_ERROR_MDNS_COLLISION
    1592              :  *
    1593              :  *  @brief
    1594              :  *    The registered service name has collision on the LAN.
    1595              :  *
    1596              :  */
    1597              : #define CHIP_ERROR_MDNS_COLLISION                             CHIP_CORE_ERROR(0xb4)
    1598              : 
    1599              : /**
    1600              :  * @def CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB
    1601              :  *
    1602              :  * @brief
    1603              :  *   The Attribute path IB is malformed: it does not contain
    1604              :  *   the required path
    1605              :  */
    1606              : #define CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB                CHIP_CORE_ERROR(0xb5)
    1607              : 
    1608              : /**
    1609              :  * @def CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB
    1610              :  *
    1611              :  * @brief
    1612              :  *   The Event Path IB is malformed: it does not contain
    1613              :  *   the required elements
    1614              :  */
    1615              : #define CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB                     CHIP_CORE_ERROR(0xb6)
    1616              : 
    1617              : // AVAILABLE: 0xb7
    1618              : // AVAILABLE: 0xb8
    1619              : 
    1620              : /**
    1621              :  * @def CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB
    1622              :  *
    1623              :  * @brief
    1624              :  *   The Command Data IB is malformed: it does not contain
    1625              :  *   the required elements
    1626              :  */
    1627              : #define CHIP_ERROR_IM_MALFORMED_COMMAND_DATA_IB           CHIP_CORE_ERROR(0xb9)
    1628              : 
    1629              : /**
    1630              :  * @def CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB
    1631              :  *
    1632              :  * @brief
    1633              :  *   The Event Data IB is malformed: it does not contain
    1634              :  *   the required elements
    1635              :  */
    1636              : #define CHIP_ERROR_IM_MALFORMED_EVENT_DATA_IB             CHIP_CORE_ERROR(0xba)
    1637              : 
    1638              : /**
    1639              :  * @def CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED
    1640              :  *
    1641              :  * @brief
    1642              :  *   Caller is trying to add more invoke command paths
    1643              :  *   than what the remote node reports supporting.
    1644              :  */
    1645              : #define CHIP_ERROR_MAXIMUM_PATHS_PER_INVOKE_EXCEEDED           CHIP_CORE_ERROR(0xbb)
    1646              : 
    1647              : /**
    1648              :  * @def CHIP_ERROR_PEER_NODE_NOT_FOUND
    1649              :  *
    1650              :  * @brief
    1651              :  *   Unable to find the peer node
    1652              :  */
    1653              : #define CHIP_ERROR_PEER_NODE_NOT_FOUND                         CHIP_CORE_ERROR(0xbc)
    1654              : 
    1655              : /**
    1656              :  * @def CHIP_ERROR_HSM
    1657              :  *
    1658              :  * @brief
    1659              :  *   Error in Hardware security module. Used for software fallback option.
    1660              :  */
    1661              : #define CHIP_ERROR_HSM                                         CHIP_CORE_ERROR(0xbd)
    1662              : 
    1663              : // AVAILABLE: 0xbe
    1664              : 
    1665              : /**
    1666              :  *  @def CHIP_ERROR_REAL_TIME_NOT_SYNCED
    1667              :  *
    1668              :  *  @brief
    1669              :  *      The system's real time clock is not synchronized to an accurate time source.
    1670              :  */
    1671              : #define CHIP_ERROR_REAL_TIME_NOT_SYNCED                        CHIP_CORE_ERROR(0xbf)
    1672              : 
    1673              : /**
    1674              :  *  @def CHIP_ERROR_UNEXPECTED_EVENT
    1675              :  *
    1676              :  *  @brief
    1677              :  *      An unexpected event was encountered.
    1678              :  */
    1679              : #define CHIP_ERROR_UNEXPECTED_EVENT                            CHIP_CORE_ERROR(0xc0)
    1680              : 
    1681              : /**
    1682              :  *  @def CHIP_ERROR_ENDPOINT_POOL_FULL
    1683              :  *
    1684              :  *  @brief
    1685              :  *    No endpoint pool entry is available.
    1686              :  *
    1687              :  */
    1688              : #define CHIP_ERROR_ENDPOINT_POOL_FULL                          CHIP_CORE_ERROR(0xc1)
    1689              : 
    1690              : /**
    1691              :  *  @def CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG
    1692              :  *
    1693              :  *  @brief
    1694              :  *    More inbound message data is pending than available buffer space available to copy it.
    1695              :  *
    1696              :  */
    1697              : #define CHIP_ERROR_INBOUND_MESSAGE_TOO_BIG                     CHIP_CORE_ERROR(0xc2)
    1698              : 
    1699              : /**
    1700              :  *  @def CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG
    1701              :  *
    1702              :  *  @brief
    1703              :  *    More outbound message data is pending than available buffer space available to copy it.
    1704              :  *
    1705              :  */
    1706              : #define CHIP_ERROR_OUTBOUND_MESSAGE_TOO_BIG                    CHIP_CORE_ERROR(0xc3)
    1707              : 
    1708              : /**
    1709              :  * @def CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED
    1710              :  *
    1711              :  * @brief
    1712              :  *   The received message is a duplicate of a previously received message.
    1713              :  */
    1714              : #define CHIP_ERROR_DUPLICATE_MESSAGE_RECEIVED                  CHIP_CORE_ERROR(0xc4)
    1715              : 
    1716              : /**
    1717              :  * @def CHIP_ERROR_INVALID_PUBLIC_KEY
    1718              :  *
    1719              :  * @brief
    1720              :  *   The received public key doesn't match locally generated key.
    1721              :  */
    1722              : #define CHIP_ERROR_INVALID_PUBLIC_KEY                          CHIP_CORE_ERROR(0xc5)
    1723              : 
    1724              : /**
    1725              :  * @def CHIP_ERROR_FABRIC_MISMATCH_ON_ICA
    1726              :  *
    1727              :  * @brief
    1728              :  *   The fabric ID in ICA certificate doesn't match the one in NOC.
    1729              :  */
    1730              : #define CHIP_ERROR_FABRIC_MISMATCH_ON_ICA                      CHIP_CORE_ERROR(0xc6)
    1731              : 
    1732              : // AVAILABLE: 0xc7
    1733              : // AVAILABLE: 0xc8
    1734              : 
    1735              : /**
    1736              :  * @def CHIP_ERROR_NO_SHARED_TRUSTED_ROOT
    1737              :  *
    1738              :  * @brief
    1739              :  *   The CASE session could not be established as peer's credentials do not have
    1740              :  *   a common root of trust.
    1741              :  */
    1742              : #define CHIP_ERROR_NO_SHARED_TRUSTED_ROOT                      CHIP_CORE_ERROR(0xc9)
    1743              : 
    1744              : /*
    1745              :  * @def CHIP_ERROR_IM_STATUS_CODE_RECEIVED
    1746              :  *
    1747              :  * @brief
    1748              :  *   Indicates an IM status code was received. Usually accompanied with
    1749              :  *   the actual IM status code.
    1750              :  */
    1751              : #define CHIP_ERROR_IM_STATUS_CODE_RECEIVED                     CHIP_CORE_ERROR(0xca)
    1752              : 
    1753              : // AVAILABLE 0xcb
    1754              : // AVAILABLE 0xcc
    1755              : // AVAILABLE 0xcd
    1756              : // AVAILABLE 0xce
    1757              : // AVAILABLE 0xcf
    1758              : // AVAILABLE 0xd0
    1759              : // AVAILABLE 0xd1
    1760              : // AVAILABLE 0xd2
    1761              : // AVAILABLE 0xd3
    1762              : // AVAILABLE 0xd4
    1763              : // AVAILABLE 0xd5
    1764              : // AVAILABLE 0xd6
    1765              : 
    1766              : /**
    1767              :  * @def CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB
    1768              :  *
    1769              :  * @brief
    1770              :  *   The Data Version Filter IB is malformed: it does not contain
    1771              :  *   the required elements
    1772              :  */
    1773              : #define CHIP_ERROR_IM_MALFORMED_DATA_VERSION_FILTER_IB             CHIP_CORE_ERROR(0xd7)
    1774              : 
    1775              : /**
    1776              :  * @def CHIP_ERROR_NOT_FOUND
    1777              :  *
    1778              :  * @brief
    1779              :  *   The item referenced in the function call was not found
    1780              :  */
    1781              : #define CHIP_ERROR_NOT_FOUND                                       CHIP_CORE_ERROR(0xd8)
    1782              : 
    1783              : // AVAILABLE: 0xd9
    1784              : 
    1785              : /**
    1786              :  * @def CHIP_ERROR_INVALID_FILE_IDENTIFIER
    1787              :  *
    1788              :  * @brief
    1789              :  *   The file identifier, encoded in the first few bytes of a processed file,
    1790              :  *   has unexpected value.
    1791              :  */
    1792              : #define CHIP_ERROR_INVALID_FILE_IDENTIFIER                     CHIP_CORE_ERROR(0xda)
    1793              : 
    1794              : /**
    1795              :  * @def CHIP_ERROR_BUSY
    1796              :  *
    1797              :  * @brief
    1798              :  *   The Resource is busy and cannot process the request. Trying again might work.
    1799              :  */
    1800              : #define CHIP_ERROR_BUSY                                        CHIP_CORE_ERROR(0xdb)
    1801              : 
    1802              : /**
    1803              :   * @def CHIP_ERROR_MAX_RETRY_EXCEEDED
    1804              :   *
    1805              :   * @brief
    1806              :   *   The maximum retry limit has been exceeded.
    1807              :   */
    1808              :  #define CHIP_ERROR_MAX_RETRY_EXCEEDED                         CHIP_CORE_ERROR(0xdc)
    1809              : 
    1810              :  /**
    1811              :   * @def CHIP_ERROR_PROVIDER_LIST_EXHAUSTED
    1812              :   *
    1813              :   * @brief
    1814              :   *   The provider list has been exhausted.
    1815              :   */
    1816              :  #define CHIP_ERROR_PROVIDER_LIST_EXHAUSTED                    CHIP_CORE_ERROR(0xdd)
    1817              : 
    1818              : // AVAILABLE: 0xde
    1819              : 
    1820              : /**
    1821              :  * @def CHIP_ERROR_INVALID_SCHEME_PREFIX
    1822              :  *
    1823              :  * @brief
    1824              :  *   The scheme field contains an invalid prefix
    1825              :  */
    1826              : #define CHIP_ERROR_INVALID_SCHEME_PREFIX                      CHIP_CORE_ERROR(0xdf)
    1827              : 
    1828              : /**
    1829              :  * @def CHIP_ERROR_MISSING_URI_SEPARATOR
    1830              :  *
    1831              :  * @brief
    1832              :  *   The URI separator is missing
    1833              :  */
    1834              : #define CHIP_ERROR_MISSING_URI_SEPARATOR                      CHIP_CORE_ERROR(0xe0)
    1835              : 
    1836              : /**
    1837              :  * @def CHIP_ERROR_HANDLER_NOT_SET
    1838              :  *
    1839              :  * @brief
    1840              :  *   Callback function or callable object is not set
    1841              :  */
    1842              : #define CHIP_ERROR_HANDLER_NOT_SET                            CHIP_CORE_ERROR(0xe1)
    1843              : 
    1844              : // WHEN ADDING A NEW ERROR CODE: Look for "AVAILABLE" comments above and fill in gaps.
    1845              : 
    1846              : // clang-format on
    1847              : 
    1848              : // !!!!! IMPORTANT !!!!!  If you add new CHIP errors, please update the translation
    1849              : // of error codes to strings in CHIPError.cpp, and add them to kTestElements[]
    1850              : // in core/tests/TestCHIPErrorStr.cpp
    1851              : 
    1852              : namespace chip {
    1853              : 
    1854              : extern void RegisterCHIPLayerErrorFormatter();
    1855              : extern void DeregisterCHIPLayerErrorFormatter();
    1856              : extern bool FormatCHIPError(char * buf, uint16_t bufSize, CHIP_ERROR err);
    1857              : 
    1858              : } // namespace chip
        

Generated by: LCOV version 2.0-1