BGAPI Trace#

BGAPI trace utility for tracing BGAPI commands and events.

The functions provided by this component are automatically called by the BGAPI protocol implementation when a command is processed or an event is delivered to the application. The application does not need to and must not call these functions directly.

Enumerations#

enum
sli_bgapi_trace_message_type_command = 0x0
sli_bgapi_trace_message_type_response = 0x1
sli_bgapi_trace_message_type_event = 0x2
}

Specifies the full type of a BGAPI message.

Functions#

void
sli_bgapi_trace_output_message(sli_bgapi_trace_message_type_t type, uint32_t header, const void *data)

Enumeration Documentation#

sli_bgapi_trace_message_type_t#

sli_bgapi_trace_message_type_t

Specifies the full type of a BGAPI message.

Enumerator
sli_bgapi_trace_message_type_command

(0x0) The message is a BGAPI command

sli_bgapi_trace_message_type_response

(0x1) The message is a BGAPI response

sli_bgapi_trace_message_type_event

(0x2) The message is a BGAPI event


Function Documentation#

sli_bgapi_trace_init#

void sli_bgapi_trace_init (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Initialize BGAPI tracing.


sli_bgapi_trace_output_message#

void sli_bgapi_trace_output_message (sli_bgapi_trace_message_type_t type, uint32_t header, const void * data)
Parameters
TypeDirectionArgument NameDescription
sli_bgapi_trace_message_type_t[in]type

The BGAPI message type

uint32_t[in]header

The BGAPI message header

const void *[in]data

The BGAPI message payload data

Output a BGAPI message to the trace channel.


sli_bgapi_trace_start#

void sli_bgapi_trace_start (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Start the BGAPI Trace.

This function is not used by normal applications. In the default configuration the BGAPI Trace will start automatically at application initialization time so that all BGAPI messages get traced. To avoid the RTT writes from blocking the application execution, something on the host computer side needs to read the RTT buffer. This may be inconvenient in situations where the user would like to use one application image for both a normal run where RTT is not read, and for taking debug traces using BGAPI Trace.

To faciliate using one image for both normal runs and for tracing, special applications (typically for example a test application used in automated testing) may define SLI_BGAPI_TRACE_DISABLE_AUTO_START as a global #define macro when building the application. When that macro is defined, the BGAPI Trace is not started automatically and the application can run normally even without anything reading RTT. When the application wants to start tracing in this configuration, it can do so by calling this function sli_bgapi_trace_start().

Use sli_bgapi_trace_stop() to stop the BGAPI Trace if needed.


sli_bgapi_trace_stop#

void sli_bgapi_trace_stop (void )
Parameters
TypeDirectionArgument NameDescription
voidN/A

Stop the BGAPI Trace.

This function is not used by normal applications. See sli_bgapi_trace_start() for a description of special situations where this function might be useful.