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