File tree 4 files changed +6
-4
lines changed
src/tracing/esp32_diagnostic_trace
4 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 21
21
#include < lib/support/logging/CHIPLogging.h>
22
22
#include < tracing/esp32_diagnostic_trace/DiagnosticStorageManager.h>
23
23
24
+ #define TLV_CLOSING_BYTES 4
25
+
24
26
namespace chip {
25
27
namespace Tracing {
26
28
using namespace chip ::TLV;
@@ -105,7 +107,7 @@ CHIP_ERROR DiagnosticStorageImpl::Retrieve(MutableByteSpan & payload)
105
107
(reader.GetTag () == ContextTag (DIAGNOSTICS_TAG::METRIC) || reader.GetTag () == ContextTag (DIAGNOSTICS_TAG::TRACE) ||
106
108
reader.GetTag () == ContextTag (DIAGNOSTICS_TAG::COUNTER)))
107
109
{
108
- if ((reader.GetLengthRead () - writer.GetLengthWritten ()) < writer.GetRemainingFreeLength ())
110
+ if ((reader.GetLengthRead () - writer.GetLengthWritten ()) < ( writer.GetRemainingFreeLength () + TLV_CLOSING_BYTES ))
109
111
{
110
112
err = writer.CopyElement (reader);
111
113
if (err == CHIP_ERROR_BUFFER_TOO_SMALL)
Original file line number Diff line number Diff line change 18
18
19
19
#pragma once
20
20
21
- #include " Diagnostics.h"
21
+ #include < tracing/esp32_diagnostic_trace/ Diagnostics.h>
22
22
#include < lib/core/CHIPError.h>
23
23
#include < lib/support/CHIPMem.h>
24
24
Original file line number Diff line number Diff line change 21
21
#include < esp_log.h>
22
22
#include < lib/core/CHIPError.h>
23
23
#include < tracing/backend.h>
24
- #include < tracing/esp32_diagnostic_trace/DiagnosticStorageManager .h>
24
+ #include < tracing/esp32_diagnostic_trace/Diagnostics .h>
25
25
#include < tracing/metric_event.h>
26
26
27
27
#include < memory>
Original file line number Diff line number Diff line change 17
17
*/
18
18
19
19
#pragma once
20
-
21
20
#include < lib/core/CHIPError.h>
22
21
#include < lib/core/TLVCircularBuffer.h>
23
22
#include < lib/support/Span.h>
@@ -188,6 +187,7 @@ class Counter : public DiagnosticEntry
188
187
uint32_t timestamp_;
189
188
};
190
189
190
+
191
191
/* *
192
192
* @brief Interface for storing and retrieving diagnostic data.
193
193
*/
You can’t perform that action at this time.
0 commit comments