7 #ifndef __STERNUM_TRACE_API_H__
8 #define __STERNUM_TRACE_API_H__
18 #include "sternum_sdk/private/trace_dynamic.h"
19 #include "sternum_sdk/user/trace_protocol_user_definition.h"
94 #define STERNUM_ADS_TRACE(TRACE, ...) sternum_trace_dynamic(TRACE, ##__VA_ARGS__, END_OF_ARGUMENTS)
119 #define STERNUM_ADS_TRACEF(TRACE, ARG_ROLE, MAX_LENGTH, FORMAT, ...) sternum_trace_string_format(TRACE, ARG_ROLE, MAX_LENGTH, FORMAT, ## __VA_ARGS__)
121 #define END_OF_ARGUMENTS 0
122 #define POINTER_DEREFERENCE_INDICATOR 0x8000
123 #define UNSIGNED_INTEGER_TYPE 0
124 #define SIGNED_INTEGER_TYPE 1
126 #define POINTER_TYPE 3
127 #define BLOB_TYPE (4 | POINTER_DEREFERENCE_INDICATOR)
128 #define STRING_TYPE (5 | POINTER_DEREFERENCE_INDICATOR)
130 #define ARGUMENT_STRING(ARG_ROLE, MAX_SIZE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)STRING_TYPE, (unsigned int)MAX_SIZE, (char*)(ARG_VALUE)
131 #define ARGUMENT_BLOB(ARG_ROLE, SIZE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)BLOB_TYPE, (unsigned int)SIZE, (uint8_t*)(ARG_VALUE)
132 #define ARGUMENT_INTEGER(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)SIGNED_INTEGER_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
133 #define ARGUMENT_UINTEGER(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)UNSIGNED_INTEGER_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
134 #define ARGUMENT_POINTER(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)POINTER_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
135 #define ARGUMENT_FLOAT(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)FLOAT_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
168 void trace_error(
unsigned int error_code,
const char* message,
const char* file_name,
unsigned int line);
180 #define STERNUM_ADS_TRACE_ERROR(error_code, message) trace_error(error_code, message, __FILE__, __LINE__)
void trace_reboot_reason(const char *reboot_reason)
Trace reboot reason.
void trace_battery_health(unsigned int capacity_percent, unsigned int voltage_mV)
Trace battery health.
void trace_firmware_update_start(const char *firmware_version, const char *firmware_hash, const char *hash_algorithm)
Trace firmware update start.
void trace_error(unsigned int error_code, const char *message, const char *file_name, unsigned int line)
Trace error.
void trace_coredump(const char *message)
Trace coredump after crash was detected.
void trace_signal_strength_report(unsigned int communication_type, int signal_strength_db)
Trace signal strength.
void trace_firmware_update_finish()
Trace firmware update finished.