Go to the documentation of this file. 70 #ifndef DLT_USER_MACROS_H 71 #define DLT_USER_MACROS_H 93 #define DLT_DECLARE_CONTEXT(CONTEXT) \ 104 #define DLT_IMPORT_CONTEXT(CONTEXT) \ 105 extern DltContext CONTEXT; 112 #define DLT_REGISTER_APP(APPID,DESCRIPTION) do {\ 113 (void)dlt_check_library_version(_DLT_PACKAGE_MAJOR_VERSION, _DLT_PACKAGE_MINOR_VERSION ); \ 114 (void)dlt_register_app( APPID, DESCRIPTION);} while(0) 120 #define DLT_UNREGISTER_APP() do{\ 121 (void)dlt_unregister_app();} while(0) 129 #define DLT_REGISTER_CONTEXT(CONTEXT,CONTEXTID,DESCRIPTION) do{\ 130 (void)dlt_register_context(&(CONTEXT), CONTEXTID, DESCRIPTION);} while(0) 142 #define DLT_REGISTER_CONTEXT_LL_TS(CONTEXT,CONTEXTID,DESCRIPTION,LOGLEVEL,TRACESTATUS) do{\ 143 (void)dlt_register_context_ll_ts(&(CONTEXT), CONTEXTID, DESCRIPTION, LOGLEVEL, TRACESTATUS);} while(0) 149 #define DLT_UNREGISTER_CONTEXT(CONTEXT) do{\ 150 (void)dlt_unregister_context(&(CONTEXT));} while(0) 158 #define DLT_REGISTER_INJECTION_CALLBACK(CONTEXT, SERVICEID, CALLBACK) do{\ 159 (void)dlt_register_injection_callback(&(CONTEXT),SERVICEID, CALLBACK);} while(0) 166 #define DLT_REGISTER_LOG_LEVEL_CHANGED_CALLBACK(CONTEXT, CALLBACK) do{\ 167 (void)dlt_register_log_level_changed_callback(&(CONTEXT),CALLBACK);} while(0) 182 #define DLT_LOG(CONTEXT,LOGLEVEL,ARGS...) \ 184 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 186 DltContextData log_local; \ 188 dlt_local = dlt_user_log_write_start(&CONTEXT,&log_local,LOGLEVEL); \ 192 (void)dlt_user_log_write_finish(&log_local); \ 214 #define DLT_LOG_ID(CONTEXT,LOGLEVEL,MSGID,ARGS...) \ 216 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 218 DltContextData log_local; \ 220 dlt_local = dlt_user_log_write_start_id(&CONTEXT,&log_local,LOGLEVEL,MSGID); \ 224 (void)dlt_user_log_write_finish(&log_local); \ 234 #define DLT_STRING(TEXT) \ 235 (void)dlt_user_log_write_string(&log_local,TEXT) 241 #define DLT_CSTRING(TEXT) \ 242 (void)dlt_user_log_write_constant_string(&log_local,TEXT) 248 #define DLT_UTF8(TEXT) \ 249 (void)dlt_user_log_write_utf8_string(&log_local,TEXT) 255 #define DLT_BOOL(BOOL_VAR) \ 256 (void)dlt_user_log_write_bool(&log_local,BOOL_VAR) 262 #define DLT_FLOAT32(FLOAT32_VAR) \ 263 (void)dlt_user_log_write_float32(&log_local,FLOAT32_VAR) 269 #define DLT_FLOAT64(FLOAT64_VAR) \ 270 (void)dlt_user_log_write_float64(&log_local,FLOAT64_VAR) 276 #define DLT_INT(INT_VAR) \ 277 (void)dlt_user_log_write_int(&log_local,INT_VAR) 279 #define DLT_INT8(INT_VAR) \ 280 (void)dlt_user_log_write_int8(&log_local,INT_VAR) 282 #define DLT_INT16(INT_VAR) \ 283 (void)dlt_user_log_write_int16(&log_local,INT_VAR) 285 #define DLT_INT32(INT_VAR) \ 286 (void)dlt_user_log_write_int32(&log_local,INT_VAR) 288 #define DLT_INT64(INT_VAR) \ 289 (void)dlt_user_log_write_int64(&log_local,INT_VAR) 295 #define DLT_UINT(UINT_VAR) \ 296 (void)dlt_user_log_write_uint(&log_local,UINT_VAR) 298 #define DLT_UINT8(UINT_VAR) \ 299 (void)dlt_user_log_write_uint8(&log_local,UINT_VAR) 301 #define DLT_UINT16(UINT_VAR) \ 302 (void)dlt_user_log_write_uint16(&log_local,UINT_VAR) 304 #define DLT_UINT32(UINT_VAR) \ 305 (void)dlt_user_log_write_uint32(&log_local,UINT_VAR) 307 #define DLT_UINT64(UINT_VAR) \ 308 (void)dlt_user_log_write_uint64(&log_local,UINT_VAR) 315 #define DLT_RAW(BUF,LEN) \ 316 (void)dlt_user_log_write_raw(&log_local,BUF,LEN) 317 #define DLT_HEX8(UINT_VAR) \ 318 (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX8) 319 #define DLT_HEX16(UINT_VAR) \ 320 (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX16) 321 #define DLT_HEX32(UINT_VAR) \ 322 (void)dlt_user_log_write_uint32_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX32) 323 #define DLT_HEX64(UINT_VAR) \ 324 (void)dlt_user_log_write_uint64_formatted(&log_local,UINT_VAR,DLT_FORMAT_HEX64) 325 #define DLT_BIN8(UINT_VAR) \ 326 (void)dlt_user_log_write_uint8_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN8) 327 #define DLT_BIN16(UINT_VAR) \ 328 (void)dlt_user_log_write_uint16_formatted(&log_local,UINT_VAR,DLT_FORMAT_BIN16) 333 #define DLT_PTR(PTR_VAR) \ 334 (void)dlt_user_log_write_ptr(&log_local, PTR_VAR) 345 #define DLT_TRACE_NETWORK(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ 347 if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ 349 (void)dlt_user_trace_network(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \ 362 #define DLT_TRACE_NETWORK_TRUNCATED(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ 364 if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ 366 (void)dlt_user_trace_network_truncated(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD, 1); \ 379 #define DLT_TRACE_NETWORK_SEGMENTED(CONTEXT,TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD) \ 381 if ((CONTEXT).trace_status_ptr && *((CONTEXT).trace_status_ptr)==DLT_TRACE_STATUS_ON) \ 383 (void)dlt_user_trace_network_segmented(&(CONTEXT),TYPE,HEADERLEN,HEADER,PAYLOADLEN,PAYLOAD); \ 393 #define DLT_LOG_STRING(CONTEXT,LOGLEVEL,TEXT) \ 395 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 397 (void)dlt_log_string(&(CONTEXT), LOGLEVEL, TEXT); \ 408 #define DLT_LOG_STRING_INT(CONTEXT,LOGLEVEL,TEXT,INT_VAR) \ 410 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 412 (void)dlt_log_string_int(&(CONTEXT), LOGLEVEL, TEXT, INT_VAR); \ 423 #define DLT_LOG_STRING_UINT(CONTEXT,LOGLEVEL,TEXT,UINT_VAR) \ 425 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 427 (void)dlt_log_string_uint(&(CONTEXT),LOGLEVEL,TEXT,UINT_VAR); \ 437 #define DLT_LOG_UINT(CONTEXT,LOGLEVEL,UINT_VAR) \ 439 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 441 (void)dlt_log_uint(&(CONTEXT),LOGLEVEL,UINT_VAR); \ 451 #define DLT_LOG_INT(CONTEXT,LOGLEVEL,INT_VAR) \ 453 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 455 (void)dlt_log_int(&(CONTEXT),LOGLEVEL,INT_VAR); \ 466 #define DLT_LOG_RAW(CONTEXT,LOGLEVEL,BUF,LEN) \ 468 if(dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL)==DLT_RETURN_TRUE) \ 470 (void)dlt_log_raw(&(CONTEXT),LOGLEVEL,BUF,LEN); \ 477 #define DLT_LOG_MARKER() \ 479 (void)dlt_log_marker(); \ 486 #define DLT_VERBOSE_MODE() do { \ 487 (void)dlt_verbose_mode();} while(0) 493 #define DLT_NONVERBOSE_MODE() do {\ 494 (void)dlt_nonverbose_mode();} while(0) 502 #define DLT_SET_APPLICATION_LL_TS_LIMIT(LOGLEVEL, TRACESTATUS) do {\ 503 (void)dlt_set_application_ll_ts_limit(LOGLEVEL, TRACESTATUS);} while(0) 509 #define DLT_ENABLE_LOCAL_PRINT() do {\ 510 (void)dlt_enable_local_print();} while(0) 516 #define DLT_DISABLE_LOCAL_PRINT() do {\ 517 (void)dlt_disable_local_print();} while(0) 525 #define DLT_IS_LOG_LEVEL_ENABLED(CONTEXT,LOGLEVEL) \ 526 (dlt_user_is_logLevel_enabled(&CONTEXT,LOGLEVEL) == DLT_RETURN_TRUE)