Skip to content

Commit

Permalink
esp32_diagnostic_trace: Return actual data size
Browse files Browse the repository at this point in the history
  • Loading branch information
pimpalemahesh committed Dec 18, 2024
1 parent 1453d70 commit 47d12d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ size_t LogProvider::GetSizeForIntent(IntentEnum intent)
{
case IntentEnum::kEndUserSupport: {
#if CONFIG_ENABLE_ESP_DIAGNOSTICS_TRACE
// Returning buffer_size > 1024 bytes to transfer data over BDX otherwise it uses Response Payload.
return CONFIG_END_USER_BUFFER_SIZE;
return DiagnosticStorageImpl::GetInstance().GetDataSize();
#else
return static_cast<size_t>(endUserSupportLogEnd - endUserSupportLogStart);
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ bool DiagnosticStorageImpl::IsEmptyBuffer()
{
return mEndUserCircularBuffer.DataLength() == 0;
}

uint32_t DiagnosticStorageImpl::GetDataSize()
{
return mEndUserCircularBuffer.DataLength();
}
} // namespace Diagnostics
} // namespace Tracing
} // namespace chip
2 changes: 2 additions & 0 deletions src/tracing/esp32_diagnostic_trace/DiagnosticStorageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class DiagnosticStorageImpl : public DiagnosticStorageInterface

bool IsEmptyBuffer();

uint32_t GetDataSize();

private:
DiagnosticStorageImpl(uint8_t * buffer, size_t bufferSize);
DiagnosticStorageImpl();
Expand Down

0 comments on commit 47d12d2

Please sign in to comment.