|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Bounded byte-stream composition helpers for mdl diagnostics. More...
Go to the source code of this file.
Enumerations | |
| enum | mdl_cli_part_limit_t : uint8_t { k_mdl_cli_part_limit = 16 } |
| Maximum fragments accepted by one CLI diagnostic operation. More... | |
Functions | |
| ra8_err_t | priv_mdl_cli_put_parts (ra8_io_stream_t *stream, const char *const *parts, size_t count) |
| Write a bounded ordered vector of NUL-terminated text fragments. | |
| ra8_err_t | priv_mdl_cli_reject_parts (ra8_io_stream_t *stream, const char *const *parts, size_t count) |
| Write a rejection diagnostic and return invalid-argument status. | |
Bounded byte-stream composition helpers for mdl diagnostics.
Implements fixed-fragment and bounded integer rendering over the injected diagnostic stream without variadic formatting.
Definition in file mdl_cli_stream.c.
| enum mdl_cli_part_limit_t : uint8_t |
Maximum fragments accepted by one CLI diagnostic operation.
| Enumerator | |
|---|---|
| k_mdl_cli_part_limit | Fixed bound for ordered text fragments. |
Definition at line 14 of file mdl_cli_stream.c.
| ra8_err_t priv_mdl_cli_put_parts | ( | ra8_io_stream_t * | stream, |
| const char *const * | parts, | ||
| size_t | count ) |
Write a bounded ordered vector of NUL-terminated text fragments.
| [in,out] | stream | Bound destination stream. |
| [in] | parts | Array of borrowed text pointers. |
| [in] | count | Number of entries in parts. |
| k_ra8_ok | Every fragment was accepted in order. |
| k_ra8_err_null_ptr | A required pointer or fragment was null. |
| k_ra8_err_invalid_size | count exceeds the fixed fragment ceiling. |
| other | The destination rejected a fragment. |
parts covers count readable pointer entries. Writes fragments in order through the injected stream. The first sink error stops later writes and is returned unchanged.
Definition at line 18 of file mdl_cli_stream.c.
References k_mdl_cli_part_limit, k_ra8_err_invalid_size, k_ra8_err_null_ptr, k_ra8_ok, ra8_io_stream_puts(), RA8_LOOP_BOUND, and RA8_PRIV.
Referenced by internal_cli_reject_limit(), internal_cli_usage_actions(), internal_cli_usage_discovery(), mdl_cli_usage(), and priv_mdl_cli_reject_parts().
| ra8_err_t priv_mdl_cli_reject_parts | ( | ra8_io_stream_t * | stream, |
| const char *const * | parts, | ||
| size_t | count ) |
Write a rejection diagnostic and return invalid-argument status.
| [in,out] | stream | Bound diagnostic stream. |
| [in] | parts | Ordered fragments forming one complete diagnostic. |
| [in] | count | Number of entries in parts. |
| k_ra8_err_invalid_arg | Every diagnostic fragment was accepted. |
| other | Argument validation or destination write failed first. |
parts includes any required prefix and newline. stream is exclusively owned for the call. Writes fragments in order through the injected stream. The first sink error stops later writes and is returned unchanged.
Definition at line 41 of file mdl_cli_stream.c.
References k_ra8_err_invalid_arg, k_ra8_ok, priv_mdl_cli_put_parts(), and RA8_PRIV.
Referenced by internal_cli_invalid(), internal_cli_parse_chapter_pick(), internal_cli_reject_integer(), internal_cli_reject_limit(), internal_cli_validate_num_ranges(), internal_prepare_run_policy(), and internal_validate_allowed_args().