Crate dlt_sys

Source
Expand description

Low-level FFI bindings to the COVESA DLT (Diagnostic Log and Trace) C library (libdlt).

§Overview

dlt-sys provides unsafe Rust bindings to the COVESA DLT daemon C library. This crate is intended to be used as a foundation for higher-level safe Rust abstractions (see dlt-rs).

Note: This crate only implements functionality required for dlt-rs and does not cover the entire libdlt API.

§Features

  • Direct FFI bindings to libdlt functions
  • Custom C wrapper for improved API ergonomics
  • Support for all DLT log levels and message types
  • Optional trace_load_ctrl feature for load control support

§Prerequisites

libdlt and its development headers must be installed on your system.

§Usage

This is a low-level crate with unsafe APIs. Most users should use dlt-rs instead for a safe, idiomatic Rust API.

§Cargo Features

  • trace_load_ctrl - Enable DLT load control support
  • generate-bindings - Regenerate bindings from C headers (development only)

§Safety

All functions in this crate are unsafe as they directly call C library functions. Proper usage requires understanding of:

  • DLT library initialization and cleanup
  • Memory management across FFI boundaries
  • Thread safety considerations

For safe abstractions, use the dlt-rs crate.

§References

Structs§

DltContext
DltContextData

Constants§

DLT_ID_SIZE
DltLogLevelType_DLT_LOG_DEBUG
DltLogLevelType_DLT_LOG_DEFAULT
DltLogLevelType_DLT_LOG_ERROR
DltLogLevelType_DLT_LOG_FATAL
DltLogLevelType_DLT_LOG_INFO
DltLogLevelType_DLT_LOG_MAX
DltLogLevelType_DLT_LOG_OFF
DltLogLevelType_DLT_LOG_VERBOSE
DltLogLevelType_DLT_LOG_WARN
DltReturnValue_DLT_RETURN_BUFFER_FULL
DltReturnValue_DLT_RETURN_ERROR
DltReturnValue_DLT_RETURN_FILESZERR
DltReturnValue_DLT_RETURN_LOAD_EXCEEDED
DltReturnValue_DLT_RETURN_LOGGING_DISABLED
DltReturnValue_DLT_RETURN_OK
DltReturnValue_DLT_RETURN_PIPE_ERROR
DltReturnValue_DLT_RETURN_PIPE_FULL
DltReturnValue_DLT_RETURN_TRUE
DltReturnValue_DLT_RETURN_USER_BUFFER_FULL
DltReturnValue_DLT_RETURN_WRONG_PARAMETER
DltTimestampType_DLT_AUTO_TIMESTAMP
DltTimestampType_DLT_USER_TIMESTAMP
DltTraceStatusType_DLT_TRACE_STATUS_DEFAULT
DltTraceStatusType_DLT_TRACE_STATUS_MAX
DltTraceStatusType_DLT_TRACE_STATUS_OFF
DltTraceStatusType_DLT_TRACE_STATUS_ON

Functions§

createContext
createContextData
dltFree
dltUserLogWriteBool
dltUserLogWriteFinish
dltUserLogWriteFloat32
dltUserLogWriteFloat64
dltUserLogWriteInt
dltUserLogWriteInt64
dltUserLogWriteStart
dltUserLogWriteString
dltUserLogWriteUint
dltUserLogWriteUint64
freeContext
freeContextData
getContextId
getContextLogLevel
getContextTraceStatus
logDlt
logDltInt
logDltString
logDltUint
registerApplication
registerContext
registerLogLevelChangedCallback
setContextDataUserTimestamp
unregisterApplicationFlushBufferedLogs
unregisterContext

Type Aliases§

DltLogLevelType
DltReturnValue
DltTimestampType
DltTraceStatusType