shell: Export shell_hexdump_line()
This function is useful for other code. Export it along with the default line length in bytes. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
fecdb93c49
commit
84e9c7c63d
2 changed files with 25 additions and 7 deletions
|
@ -36,6 +36,8 @@ extern "C" {
|
|||
|
||||
#define SHELL_CMD_ROOT_LVL (0u)
|
||||
|
||||
#define SHELL_HEXDUMP_BYTES_IN_LINE 16
|
||||
|
||||
/**
|
||||
* @brief Flag indicates that optional arguments will be treated as one,
|
||||
* unformatted argument.
|
||||
|
@ -783,6 +785,24 @@ void shell_fprintf(const struct shell *shell, enum shell_vt100_color color,
|
|||
void shell_vfprintf(const struct shell *shell, enum shell_vt100_color color,
|
||||
const char *fmt, va_list args);
|
||||
|
||||
/**
|
||||
* @brief Print a line of data in hexadecimal format.
|
||||
*
|
||||
* Each line shows the offset, bytes and then ASCII representation.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* 00008010: 20 25 00 20 2f 48 00 08 80 05 00 20 af 46 00
|
||||
* | %. /H.. ... .F. |
|
||||
*
|
||||
* @param[in] shell Pointer to the shell instance.
|
||||
* @param[in] offset Offset to show for this line.
|
||||
* @param[in] data Pointer to data.
|
||||
* @param[in] len Length of data.
|
||||
*/
|
||||
void shell_hexdump_line(const struct shell *shell, unsigned int offset,
|
||||
const uint8_t *data, size_t len);
|
||||
|
||||
/**
|
||||
* @brief Print data in hexadecimal format.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue