The friendly Operating System for the Internet of Things
Object dump

Allows to print out data dumps of memory regions in a similar fashion to the UNIX's od tool. More...

Detailed Description

See also
od(1)

Files

file  od.h
 

Macros

#define OD_FLAGS_ADDRESS_MASK   (0xc000)
 Bit-mask to extract address offset format settings from flags.
 
#define OD_FLAGS_BYTES_MASK   (0x3e00)
 Bit-mask to extract byte format settings from flags.
 
#define OD_FLAGS_LENGTH_MASK   (0x00f7)
 Bit-mask to extract length information for byte format from flags.
 
#define OD_WIDTH_DEFAULT   (16)
 Default value for parameter width of od()
 

Functions

void od (const void *data, size_t data_len, uint8_t width, uint16_t flags)
 Dumps memory stored at data up to data_len in octal, decimal, or hexadecimal representation to stdout. More...
 
static void od_hex_dump (const void *data, size_t data_len, uint8_t width)
 Dumps memory stored at data up to data_len in octal, decimal, or hexadecimal representation to stdout with flags == OD_FLAGS_ADDRESS_HEX | OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_1. More...
 

Address offset format flags

Flags to define format of the address offset

#define OD_FLAGS_ADDRESS_OCTAL   (0x0000)
 octal address offset
 
#define OD_FLAGS_ADDRESS_HEX   (0x4000)
 hexadecimal address offset
 
#define OD_FLAGS_ADDRESS_DECIMAL   (0x8000)
 decimal address offset
 
#define OD_FLAGS_ADDRESS_NONE   (0xc000)
 no address offset
 

Bytes format flags

Flags to define format of the byte output

#define OD_FLAGS_BYTES_OCTAL   (0x0000)
 Print LENGTH bytes as LENGTH-wide octal integer (LENGTH is defined in the lower significant byte of the flags)
 
#define OD_FLAGS_BYTES_CHAR   (0x2000)
 Print bytes as their represented character in ASCII.
 
#define OD_FLAGS_BYTES_INT   (0x1000)
 Print LENGTH bytes as LENGTH-wide decimal integer (LENGTH is defined in the lower significant byte of the flags)
 
#define OD_FLAGS_BYTES_DECIMAL   (OD_FLAGS_BYTES_INT)
 Alias for OD_FLAGS_BYTES_INT.
 
#define OD_FLAGS_BYTES_UINT   (0x0400)
 Print LENGTH bytes as LENGTH-wide decimal unsigned integer (LENGTH is defined in the lower significant byte of the flags)
 
#define OD_FLAGS_BYTES_HEX   (0x0200)
 Print LENGTH bytes as LENGTH-wide hexadecimal integer (LENGTH is defined in the lower significant byte of the flags)
 

Bytes format length flags

Flags to define format length of the byte output

#define OD_FLAGS_LENGTH_1   (0x0010)
 1 byte
 
#define OD_FLAGS_LENGTH_2   (0x0020)
 2 byte
 
#define OD_FLAGS_LENGTH_4   (0x0000)
 4 byte and default
 
#define OD_FLAGS_LENGTH_8   (0x0080)
 8 byte More...
 
#define OD_FLAGS_LENGTH_CHAR   (OD_FLAGS_LENGTH_1)
 alias for OD_FLAGS_LENGTH_1
 
#define OD_FLAGS_LENGTH_SHORT   (0x0002)
 sizeof(short) byte
 
#define OD_FLAGS_LENGTH_LONG   (0x0004)
 sizeof(long) byte
 

Macro Definition Documentation

#define OD_FLAGS_LENGTH_8   (0x0080)
Warning
not working with newlib-nano

Definition at line 122 of file od.h.

Function Documentation

void od ( const void *  data,
size_t  data_len,
uint8_t  width,
uint16_t  flags 
)
Parameters
[in]dataData to dump.
[in]data_lenLength in bytes of data to output.
[in]widthNumber of bytes per line. If width is 0, OD_WIDTH_DEFAULT is assumed as a default value.
[in]flagsFlags as defined in od_flags_address and od_flags_bytes
static void od_hex_dump ( const void *  data,
size_t  data_len,
uint8_t  width 
)
inlinestatic
Parameters
[in]dataData to dump.
[in]data_lenLength in bytes of data to output.
[in]widthNumber of bytes per line. If width is 0, OD_WIDTH_DEFAULT is assumed as a default value.

Definition at line 156 of file od.h.