Skip to content

Commit

Permalink
pw_sys_io: Doxygenify TryReadByte()
Browse files Browse the repository at this point in the history
Change-Id: Ied2e1004d22e62714d32cd308848c178fe4ff89c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/153190
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Kayce Basques <kayce@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Kayce Basques <kayce@google.com>
  • Loading branch information
Kayce Basques authored and CQ Bot Account committed Jun 26, 2023
1 parent 7d1c4f2 commit 3985099
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions pw_sys_io/docs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ implementation.
API reference
=============
.. doxygenfunction:: pw::sys_io::ReadByte(std::byte* dest)
.. doxygenfunction:: pw::sys_io::TryReadByte(std::byte* dest)

Dependencies
============
Expand Down
18 changes: 11 additions & 7 deletions pw_sys_io/public/pw_sys_io/sys_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,20 @@ namespace pw::sys_io {
/// @warning Do not build production projects on top of `pw_sys_io`.
///
/// @returns
/// * @pw_status{OK} - A byte was successfully read.
/// * @pw_status{OK} - A byte was successfully read and is in `dest`.
/// * @pw_status{RESOURCE_EXHAUSTED} - The underlying source vanished.
Status ReadByte(std::byte* dest);

// Read a single byte from the sys io backend, if available.
// Implemented by: Backend
//
// Returns OkStatus() - A byte was successfully read, and is in dest.
// Status::Unavailable() - No byte is available to read; try later.
// Status::Unimplemented() - Not supported on this target.
/// Reads a single byte from the `pw_sys_io` backend, if available.
///
/// @pre This function must be implemented by the `pw_sys_io` backend.
///
/// @warning Do not build production projects on top of `pw_sys_io`.
///
/// @returns
/// * @pw_status{OK} - A byte was successfully read and is in `dest`.
/// * @pw_status{UNAVAILABLE} - No byte is available to read; try later.
/// * @pw_status{UNIMPLEMENTED} - The function is not supported on this target.
Status TryReadByte(std::byte* dest);

// Write a single byte out the sys io backend.
Expand Down

0 comments on commit 3985099

Please sign in to comment.