mirror of
https://github.com/apache/nuttx.git
synced 2026-06-09 02:44:53 +08:00
stream/hexdump: add hexdump stream to dump binary to syslog
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -225,6 +225,14 @@ struct lib_bufferedoutstream_s
|
||||
char buffer[CONFIG_STREAM_OUT_BUFFER_SIZE];
|
||||
};
|
||||
|
||||
struct lib_hexdumpstream_s
|
||||
{
|
||||
struct lib_outstream_s public;
|
||||
FAR struct lib_outstream_s *backend;
|
||||
int pending;
|
||||
char buffer[CONFIG_STREAM_HEXDUMP_BUFFER_SIZE + 1];
|
||||
};
|
||||
|
||||
/* This is a special stream that does buffered character I/O. NOTE that is
|
||||
* CONFIG_SYSLOG_BUFFER is not defined, it is the same as struct
|
||||
* lib_outstream_s
|
||||
@@ -413,6 +421,25 @@ void lib_rawsostream(FAR struct lib_rawsostream_s *outstream, int fd);
|
||||
void lib_bufferedoutstream(FAR struct lib_bufferedoutstream_s *outstream,
|
||||
FAR struct lib_outstream_s *backend);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_hexdumpstream
|
||||
*
|
||||
* Description:
|
||||
* Convert binary stream to hex and redirect to syslog
|
||||
*
|
||||
* Input Parameters:
|
||||
* stream - User allocated, uninitialized instance of struct
|
||||
* lib_bufferedoutstream_s to be initialized.
|
||||
* backend - Stream backend port.
|
||||
*
|
||||
* Returned Value:
|
||||
* None (User allocated instance initialized).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void lib_hexdumpstream(FAR struct lib_hexdumpstream_s *stream,
|
||||
FAR struct lib_outstream_s *backend);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_lowoutstream
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user