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
Release history Release notifications | RSS feed
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.4.tar.gz
(14.3 kB
view details)
Built Distribution
pydlt-0.3.4-py3-none-any.whl
(16.9 kB
view details)
File details
Details for the file pydlt-0.3.4.tar.gz
.
File metadata
- Download URL: pydlt-0.3.4.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.0 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9c1a88886d4810cc19b3c487a1a9a3705412e5b2f92121b5ca91a84ec9fddf7 |
|
MD5 | f6666e9ba778b1948b46ba11ae8f7c79 |
|
BLAKE2b-256 | 8fb01513b6a68f5aa8e7244d7eb77210d93afcf7558ec6a9087bbf936baccc84 |
File details
Details for the file pydlt-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: pydlt-0.3.4-py3-none-any.whl
- Upload date:
- Size: 16.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.0 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1089ec785a292974b6bc431596c1e4c27b1ea682023da57b154452da9b551622 |
|
MD5 | 6d812f7d75089789ebac6b7e8e1881d1 |
|
BLAKE2b-256 | 30a4663a9ac6cfb49d2d4c5deb42ec2154d13daad744f394309046f1533ae677 |