Skip to content

Commit 4236f3c

Browse files
pimpalemaheshesp
authored and
esp
committed
backend: copyright header change, retrieve api return value changed
1 parent 66f50db commit 4236f3c

File tree

11 files changed

+47
-12
lines changed

11 files changed

+47
-12
lines changed

examples/temperature-measurement-app/esp32/main/diagnostic-logs-provider-delegate-impl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ CHIP_ERROR LogProvider::PrepareLogContextForIntent(LogContext * context, IntentE
128128
ChipLogError(DeviceLayer, "Empty Diagnostic buffer"));
129129
// Retrieve data from the diagnostic storage
130130
CHIP_ERROR err = mStorageInstance->Retrieve(endUserSupportSpan, sReadEntries);
131-
if (err != CHIP_NO_ERROR)
131+
if (err != CHIP_NO_ERROR && err != CHIP_ERROR_BUFFER_TOO_SMALL && err != CHIP_ERROR_END_OF_TLV)
132132
{
133-
ChipLogError(DeviceLayer, "Failed to retrieve data: %" CHIP_ERROR_FORMAT, err.Format());
133+
ChipLogError(DeviceLayer, "Failed to retrieve data: %s", ErrorStr(err));
134134
return err;
135135
}
136136
context->EndUserSupport.span = endUserSupportSpan;

src/tracing/esp32_diagnostic_trace/BUILD.gn

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
#Copyright (c) 2024 Project CHIP Authors
2+
#Copyright (c) 2025 Project CHIP Authors
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

src/tracing/esp32_diagnostic_trace/Counter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2024 Project CHIP Authors
3+
* Copyright (c) 2025 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");

src/tracing/esp32_diagnostic_trace/Counter.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2024 Project CHIP Authors
3+
* Copyright (c) 2025 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");

src/tracing/esp32_diagnostic_trace/DiagnosticEntry.cpp

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
*
3+
* Copyright (c) 2025 Project CHIP Authors
4+
* All rights reserved.
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+
*/
118
#include <tracing/esp32_diagnostic_trace/DiagnosticEntry.h>
219
using namespace chip::TLV;
320

src/tracing/esp32_diagnostic_trace/DiagnosticEntry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2024 Project CHIP Authors
3+
* Copyright (c) 2025 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");

src/tracing/esp32_diagnostic_trace/DiagnosticStorage.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2024 Project CHIP Authors
3+
* Copyright (c) 2025 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -71,7 +71,7 @@ CHIP_ERROR CircularDiagnosticBuffer::Retrieve(MutableByteSpan & span, uint32_t &
7171
}
7272
span.reduce_size(successful_written_bytes);
7373
ChipLogDetail(DeviceLayer, "---------------Total Retrieved bytes : %ld----------------\n", successful_written_bytes);
74-
return CHIP_NO_ERROR;
74+
return err;
7575
}
7676

7777
bool CircularDiagnosticBuffer::IsBufferEmpty()

src/tracing/esp32_diagnostic_trace/DiagnosticStorage.h

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
*
3+
* Copyright (c) 2025 Project CHIP Authors
4+
* All rights reserved.
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+
*/
118
#pragma once
219
#include <lib/core/TLVCircularBuffer.h>
320
#include <lib/support/Span.h>
@@ -29,7 +46,7 @@ class CircularDiagnosticBuffer : public chip::TLV::TLVCircularBuffer
2946
*
3047
* This method retrieves the stored diagnostic data and copies it into the
3148
* provided `payload` buffer. If the buffer is too small to hold all the data,
32-
* the method returns the successfully copied entries along with an error code
49+
* still method returns the successfully copied entries along with an error code
3350
* indicating that the buffer was insufficient.
3451
*
3552
* @param payload A reference to a `MutableByteSpan` where the retrieved
@@ -39,6 +56,7 @@ class CircularDiagnosticBuffer : public chip::TLV::TLVCircularBuffer
3956
*
4057
* @retval CHIP_NO_ERROR If the operation succeeded and all data was copied.
4158
* @retval CHIP_ERROR_BUFFER_TOO_SMALL If the buffer was not large enough to hold all data.
59+
* @retval CHIP_ERROR_END_OF_TLV If the end of the TLV stream is reached.
4260
* @retval CHIP_ERROR If any other failure occurred during the operation.
4361
*/
4462
CHIP_ERROR Retrieve(MutableByteSpan & payload, uint32_t & read_entries);

src/tracing/esp32_diagnostic_trace/DiagnosticTracing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/*
33
*
4-
* Copyright (c) 2024 Project CHIP Authors
4+
* Copyright (c) 2025 Project CHIP Authors
55
* All rights reserved.
66
*
77
* Licensed under the Apache License, Version 2.0 (the "License");

src/tracing/esp32_diagnostic_trace/DiagnosticTracing.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/*
44
*
5-
* Copyright (c) 2024 Project CHIP Authors
5+
* Copyright (c) 2025 Project CHIP Authors
66
* All rights reserved.
77
*
88
* Licensed under the Apache License, Version 2.0 (the "License");

src/tracing/esp32_diagnostic_trace/include/matter/tracing/macros_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2024 Project CHIP Authors
3+
* Copyright (c) 2025 Project CHIP Authors
44
* All rights reserved.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)