Skip to content

Commit

Permalink
Comment changes (#8616)
Browse files Browse the repository at this point in the history
#### Problem

- Comments in `SystemClock.h` are outdated.
- The various lengths and pointers of a `PacketBuffer` can be hard
  to follow.

#### Change overview

- Fix comments in `SystemClock.h`.
- Add a diagram for `PacketBuffer`.
  • Loading branch information
kpschoedel authored and pull[bot] committed Jul 30, 2021
1 parent 043a926 commit 2258654
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/system/SystemClock.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace Clock {
*
* @note
* This function is reserved for internal use by the CHIP System Layer. Users of the CHIP System
* Layer should call System::Layer::GetMonotonicMicroseconds().
* Layer should call System::Clock::GetMonotonicMicroseconds().
*
* @returns Elapsed time in microseconds since an arbitrary, platform-defined epoch.
*/
Expand All @@ -69,7 +69,7 @@ extern uint64_t GetMonotonicMicroseconds();
*
* @note
* This function is reserved for internal use by the CHIP System Layer. Users of the CHIP System
* Layer should call System::Layer::GetMonotonicMilliseconds().
* Layer should call System::Clock::GetMonotonicMilliseconds().
*
* @returns Elapsed time in milliseconds since an arbitrary, platform-defined epoch.
*/
Expand All @@ -94,7 +94,7 @@ extern uint64_t GetMonotonicMilliseconds();
*
* @note
* This function is reserved for internal use by the CHIP System Layer. Users of the CHIP System
* Layer should call System::Layer::GetUnixTimeMicroseconds().
* Layer should call System::Clock::GetUnixTimeMicroseconds().
*
* @param[out] curTime The current time, expressed as Unix time scaled to microseconds.
*
Expand Down
15 changes: 15 additions & 0 deletions src/system/SystemPacketBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,21 @@ struct pbuf
* @ref chip::chipTLVReader
* @ref chip::chipTLVWriter
*
* ### PacketBuffer format
*
* <pre>
* ┌────────────────────────────────────┐
* │ ┌────────────────────┐ │
* │ │ │◁──────┴───────▷│
* ┏━━━━━━━━┿━━━━━━━┿━┳━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
* ┃ pbuf len payload ┃ reserve ┃ data ┃ unused ┃
* ┗━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━┛
* │ │← ReservedSize() →│← DataLength() →│← AvailableDataLength() →│
* │ │ │← MaxDataLength() → · · · · · · · · · · ·→│
* │ │ Start() │
* │← kStructureSize →│← AllocSize() → · · · · · · · · · · · · · · · · · · · · · · →│
* </pre>
*
*/
class DLL_EXPORT PacketBuffer : private pbuf
{
Expand Down

0 comments on commit 2258654

Please sign in to comment.