Skip to content

Commit

Permalink
Update comment to justify chosen storage size
Browse files Browse the repository at this point in the history
  • Loading branch information
andreilitvin committed Aug 2, 2024
1 parent d427ff2 commit 0717287
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/data-model-provider/ActionReturnStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ class ActionReturnStatus
struct StringStorage
{
// Generally size should be sufficient.
// len("Status<123>, Code 255") == 21 (and then 22 for null terminator. We have slack.)
// The longest status code from StatusCodeList is NO_UPSTREAM_SUBSCRIPTION(197)
// so we need space for one of:
// "NO_UPSTREAM_SUBSCRIPTION(197)\0" = 30 // explicit verbose status code
// "FAILURE(1), Code 255\0") // cluster failure, verbose
// "SUCCESS(0), Code 255\0") // cluster success, verbose
// "Status<197>, Code 255\0") // Cluster failure, non-verbose
//
// CHIP_ERROR has its own (global/static!) storage
chip::StringBuilder<32> formatBuffer;
};
Expand Down

0 comments on commit 0717287

Please sign in to comment.