8 #ifndef __STERNUM_TRACE_API_H__
9 #define __STERNUM_TRACE_API_H__
18 #include "trace_protocol_user_definition.h"
19 #include "error_codes.h"
20 #include "device_type.h"
96 #define STERNUM_ADS_TRACE(TRACE, ...) sternum_trace_dynamic(TRACE, ## __VA_ARGS__, END_OF_ARGUMENTS)
121 #define STERNUM_ADS_TRACEF(TRACE, ARG_ROLE, MAX_LENGTH, FORMAT, ...) sternum_trace_string_format(TRACE, ARG_ROLE, MAX_LENGTH, FORMAT, ## __VA_ARGS__)
124 #define END_OF_ARGUMENTS 0
125 #define POINTER_DEREFERENCE_INDICATOR 0x8000
126 #define UNSIGNED_INTEGER_TYPE 0
127 #define SIGNED_INTEGER_TYPE 1
129 #define POINTER_TYPE 3
130 #define BLOB_TYPE (4 | POINTER_DEREFERENCE_INDICATOR)
131 #define STRING_TYPE (5 | POINTER_DEREFERENCE_INDICATOR)
133 #define ARGUMENT_STRING(ARG_ROLE, MAX_SIZE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)STRING_TYPE, (unsigned int)MAX_SIZE, (char*)(ARG_VALUE)
134 #define ARGUMENT_BLOB(ARG_ROLE, SIZE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)BLOB_TYPE, (unsigned int)SIZE, (uint8_t*)(ARG_VALUE)
135 #define ARGUMENT_INTEGER(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)SIGNED_INTEGER_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
136 #define ARGUMENT_UINTEGER(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)UNSIGNED_INTEGER_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
137 #define ARGUMENT_POINTER(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)POINTER_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
138 #define ARGUMENT_FLOAT(ARG_ROLE, ARG_VALUE) (unsigned int)ARG_ROLE, (unsigned int)FLOAT_TYPE, (unsigned int)sizeof(ARG_VALUE), (ARG_VALUE)
140 sternum_code_t sternum_trace_dynamic(
int trace_event_type, ...);
141 sternum_code_t sternum_trace_string_format(uint16_t trace_event_type, uint16_t argument_role_type, uint16_t max_length,
const char* format, ...);
163 void trace_error(
unsigned int error_code,
const char* message,
const char* file_name,
unsigned int line);
175 #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_firmware_update_finish(void)
Trace firmware update finished.
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_signal_strength_report(unsigned int communication_type, int signal_strength)
Trace signal strength.
void trace_error(unsigned int error_code, const char *message, const char *file_name, unsigned int line)
Trace error.