Skip to main content

A pyre-python library to handle AUTOSAR DLT.

Project description

PyDLT

A pyre-python library to handle AUTOSAR DLT protocol, which is based on AUTOSAR Specification of Diagnostic Log and Trace V1.2.0 R4.0 Rev3, Section 7.7 Protocol Specification.

Quick Start

Write messages to DLT file

from pydlt import (
    ArgumentString,
    DltFileWriter,
    DltMessage,
    MessageLogInfo,
    MessageType,
    StorageHeader,
)

# Create DLT message
msg1 = DltMessage.create_verbose_message(
    [ArgumentString("hello, pydlt!")],
    MessageType.DLT_TYPE_LOG,
    MessageLogInfo.DLT_LOG_INFO,
    "App",
    "Ctx",
    message_counter=0,
    str_header=StorageHeader(0, 0, "Ecu"),
)
print(msg1)
# > 1970/01/01 00:00:00.000000 0 Ecu App Ctx log info verbose 1 hello, pydlt!
msg2 = DltMessage.create_non_verbose_message(
    0,
    b"\x01\x02\x03",
    message_counter=1,
    str_header=StorageHeader(0, 0, "Ecu"),
)
print(msg2)
# > 1970/01/01 00:00:00.000000 1 Ecu non-verbose [0] 010203

# Write DLT messages to file
with DltFileWriter("<path to DLT file>") as writer:
    writer.write_messages([msg1, msg2])

Read messages from DLT file

from pydlt import DltFileReader

# Read DLT messages from file
for msg in DltFileReader("<path to DLT file>"):
    # Print overview of each DLT message
    print(msg)

Limitation

The following format of Type Info in a Payload has not been supported.

  • TYPE_LENGTH_128BIT
  • TYPE_ARRAY
  • VARIABLE_INFO
  • FIXED_POINT
  • TRACE_INFO
  • TYPE_STRUCT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydlt-0.3.5.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydlt-0.3.5-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file pydlt-0.3.5.tar.gz.

File metadata

  • Download URL: pydlt-0.3.5.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.0 Linux/6.8.0-1021-azure

File hashes

Hashes for pydlt-0.3.5.tar.gz
Algorithm Hash digest
SHA256 1c1bd64181c1165b48f566aa5a89edcf9501043f90d2f9be2ddbc73c7771c579
MD5 4aeaaab92faa732c2acfbc8a2cfb6d35
BLAKE2b-256 ebc89fefbde75fa01c58be45e9d1c2f582e600f830c134ef8abb659b6039335c

See more details on using hashes here.

File details

Details for the file pydlt-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: pydlt-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.11.0 Linux/6.8.0-1021-azure

File hashes

Hashes for pydlt-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 020fd1e4dc4af3ec74ed34a1cca86f33b16250b90324016f885b72ff24bf171f
MD5 4f3a7a360bba080e3066c67321b8c44b
BLAKE2b-256 ecf1bdd043a9fa9c608c64e54bb3ede7469e8251f564dd8443a896715f6b31b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page