@@ -29,6 +29,10 @@ using namespace chip::app::Clusters::DiagnosticLogs;
29
29
LogProvider LogProvider::sInstance ;
30
30
LogProvider::CrashLogContext LogProvider::sCrashLogContext ;
31
31
32
+ #if CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
33
+ static uint32_t sIntentSize = CONFIG_END_USER_BUFFER_SIZE;
34
+ #endif
35
+
32
36
namespace {
33
37
bool IsValidIntent (IntentEnum intent)
34
38
{
@@ -77,7 +81,7 @@ size_t LogProvider::GetSizeForIntent(IntentEnum intent)
77
81
{
78
82
case IntentEnum::kEndUserSupport : {
79
83
#if CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
80
- return DIAGNOSTIC_BUFFER_SIZE ;
84
+ return sIntentSize ;
81
85
#else
82
86
return static_cast <size_t >(endUserSupportLogEnd - endUserSupportLogStart);
83
87
#endif
@@ -116,7 +120,7 @@ CHIP_ERROR LogProvider::PrepareLogContextForIntent(LogContext * context, IntentE
116
120
case IntentEnum::kEndUserSupport : {
117
121
#if CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
118
122
DiagnosticStorageImpl & diagnosticStorage = DiagnosticStorageImpl::GetInstance ();
119
- MutableByteSpan endUserSupportSpan (endUserBuffer, DIAGNOSTIC_BUFFER_SIZE );
123
+ MutableByteSpan endUserSupportSpan (endUserBuffer, CONFIG_END_USER_BUFFER_SIZE );
120
124
121
125
if (diagnosticStorage.IsEmptyBuffer ())
122
126
{
@@ -130,6 +134,7 @@ CHIP_ERROR LogProvider::PrepareLogContextForIntent(LogContext * context, IntentE
130
134
ChipLogError (DeviceLayer, " Failed to retrieve data: %s" , chip::ErrorStr (err));
131
135
return err;
132
136
}
137
+ sIntentSize = endUserSupportSpan.size ();
133
138
// Now, assign the span to the EndUserSupport object or whatever is required
134
139
context->EndUserSupport .span = endUserSupportSpan;
135
140
#else
0 commit comments