Macros related to logging. More...

Macros

#define GOS_DUMP_DEFAULT_FLAGS GOS_DUMP_FLAGS (16, 1, LITTLE, ADD_SPACE, PRINT_ADDRESSES, PRINT_ASCII)
#define GOS_DUMP_UINT8_BUFFER (buffer, length, msg) gos_dump_buffer (buffer, length, msg, GOS_DUMP_FLAGS (16, 1, LITTLE, ADD_SPACE, PRINT_ADDRESSES, PRINT_ASCII))
#define GOS_DUMP_FLAGS (row_len, word_len, endian, space, address, ascii)
#define GOS_LOG (msg, ...) gos_log (msg, ## __VA_ARGS__)
General logging macro.
#define GOS_VLOG (msg, arg_list) gos_vlog (msg, arg_list)
General logging macro.

Enumerations

enum gos_dump_flags_t { ,
GOS_DUMP_ROW_LEN_2 = (1 << 0 ),
GOS_DUMP_ROW_LEN_4 = (2 << 0 ),
GOS_DUMP_ROW_LEN_8 = (3 << 0 ),
GOS_DUMP_ROW_LEN_16 = (4 << 0 ),
GOS_DUMP_ROW_LEN_32 = (5 << 0 ),
GOS_DUMP_WORD_LEN_1 = (0 << 3 ),
GOS_DUMP_WORD_LEN_2 = (1 << 3 ),
GOS_DUMP_WORD_LEN_4 = (2 << 3 ),
GOS_DUMP_ENDIAN_LITTLE = (0 << 5 ),
GOS_DUMP_ENDIAN_BIG = (1 << 5 ),
GOS_DUMP_NO_SPACE = (0 << 6 ),
GOS_DUMP_ADD_SPACE = (1 << 6 ),
GOS_DUMP_NO_ADDRESSES = (0 << 7 ),
GOS_DUMP_PRINT_ADDRESSES = (1 << 7 ),
GOS_DUMP_NO_ASCII = (0 << 8 ),
GOS_DUMP_PRINT_ASCII = (1 << 8 )
}

Detailed Description

Macros related to logging.

Macro Definition Documentation

GOS_DUMP_DEFAULT_FLAGS

#define GOS_DUMP_DEFAULT_FLAGS GOS_DUMP_FLAGS (16, 1, LITTLE, ADD_SPACE, PRINT_ADDRESSES, PRINT_ASCII)

Macro for default log dump flags

  • 16 words per row
  • 1 byte per word
  • Little-endian
  • Add spaces between words
  • Print addresses
  • Print ASCII

GOS_DUMP_FLAGS

#define GOS_DUMP_FLAGS ( row_len,
word_len,
endian,
space,
address,
ascii
)
Value:
(GOS_DUMP_ROW_LEN_ ## row_len | \
GOS_DUMP_WORD_LEN_ ## word_len | \
GOS_DUMP_ENDIAN_ ## endian | \
GOS_DUMP_ ## space | \
GOS_DUMP_ ## address | \
GOS_DUMP_ ## ascii )

Macros for creating dump flags

Parameters
row_len Row length - 1, 2, 4, 8, 16, 32
word_len Word length - 1, 2, 4
endian - Endianness of word - BIG / LITTLE
space - Add spaces between words - NO_SPACE / ADD_SPACE
address - Print buffer addresses - NO_ADDRESSES / PRINT_ADDRESSES
ascii - Print buffer ASCII representation - NO_ASCII / PRINT_ASCII
Examples:
file/file_encrypt/decrypt.c , file/file_encrypt/encrypt.c , security/aes_ctr/main.c , test/spi_loop_back/main.c , utility/buffer_dump/main.c , utility/msgpack/read_write_buffer.c , and utility/msgpack/read_write_stream.c .

GOS_DUMP_UINT8_BUFFER

#define GOS_DUMP_UINT8_BUFFER ( buffer,
length,
msg
) gos_dump_buffer (buffer, length, msg, GOS_DUMP_FLAGS (16, 1, LITTLE, ADD_SPACE, PRINT_ADDRESSES, PRINT_ASCII))

Helper macro to dump a byte buffer

Parameters
buffer The byte buffer to dump
length Length of byte buffer
msg Message to print with dump
Examples:
demo/secure_element/commands.c .

Enumeration Type Documentation

gos_dump_flags_t

Flags for gos_dump_buffer()

See GOS_DUMP_FLAGS for a helper macro to generate the flags.

Enumerator
GOS_DUMP_ROW_LEN_2

!< Dump row length of 1 word

GOS_DUMP_ROW_LEN_4

!< Dump row length of 2 words

GOS_DUMP_ROW_LEN_8

!< Dump row length of 4 words

GOS_DUMP_ROW_LEN_16

!< Dump row length of 8 words

GOS_DUMP_ROW_LEN_32

!< Dump row length of 16 words

GOS_DUMP_WORD_LEN_1

!< Dump row length of 32 words

GOS_DUMP_WORD_LEN_2

!< Dump word length of 1 byte

GOS_DUMP_WORD_LEN_4

!< Dump word length of 2 bytes

GOS_DUMP_ENDIAN_LITTLE

!< Dump word length of 4 bytes

GOS_DUMP_ENDIAN_BIG

!< Dump words are little endian

GOS_DUMP_NO_SPACE

!< Dump words are bug endian

GOS_DUMP_ADD_SPACE

!< Dump words have no spaces between them

GOS_DUMP_NO_ADDRESSES

!< Dump words have spaces between them

GOS_DUMP_PRINT_ADDRESSES

!< Dump does not contains addresses

GOS_DUMP_NO_ASCII

!< Dump contains addresses

GOS_DUMP_PRINT_ASCII

!< Dump does not print ASCII corresponding to each row