pyxcp 0.22.23__cp311-cp311-manylinux_2_28_x86_64.manylinux_2_27_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pyxcp might be problematic. Click here for more details.
- pyxcp/__init__.py +20 -0
- pyxcp/aml/EtasCANMonitoring.a2l +82 -0
- pyxcp/aml/EtasCANMonitoring.aml +67 -0
- pyxcp/aml/XCP_Common.aml +408 -0
- pyxcp/aml/XCPonCAN.aml +78 -0
- pyxcp/aml/XCPonEth.aml +33 -0
- pyxcp/aml/XCPonFlx.aml +113 -0
- pyxcp/aml/XCPonSxI.aml +66 -0
- pyxcp/aml/XCPonUSB.aml +106 -0
- pyxcp/aml/ifdata_CAN.a2l +20 -0
- pyxcp/aml/ifdata_Eth.a2l +11 -0
- pyxcp/aml/ifdata_Flx.a2l +94 -0
- pyxcp/aml/ifdata_SxI.a2l +13 -0
- pyxcp/aml/ifdata_USB.a2l +81 -0
- pyxcp/asam/__init__.py +0 -0
- pyxcp/asam/types.py +131 -0
- pyxcp/asamkeydll.c +116 -0
- pyxcp/asamkeydll.sh +2 -0
- pyxcp/checksum.py +722 -0
- pyxcp/cmdline.py +52 -0
- pyxcp/config/__init__.py +1100 -0
- pyxcp/config/legacy.py +120 -0
- pyxcp/constants.py +47 -0
- pyxcp/cpp_ext/__init__.py +0 -0
- pyxcp/cpp_ext/bin.hpp +104 -0
- pyxcp/cpp_ext/blockmem.hpp +58 -0
- pyxcp/cpp_ext/cpp_ext.cpython-310-x86_64-linux-gnu.so +0 -0
- pyxcp/cpp_ext/cpp_ext.cpython-311-x86_64-linux-gnu.so +0 -0
- pyxcp/cpp_ext/cpp_ext.cpython-39-x86_64-linux-gnu.so +0 -0
- pyxcp/cpp_ext/daqlist.hpp +200 -0
- pyxcp/cpp_ext/event.hpp +67 -0
- pyxcp/cpp_ext/extension_wrapper.cpp +96 -0
- pyxcp/cpp_ext/helper.hpp +280 -0
- pyxcp/cpp_ext/mcobject.hpp +246 -0
- pyxcp/cpp_ext/tsqueue.hpp +46 -0
- pyxcp/daq_stim/__init__.py +228 -0
- pyxcp/daq_stim/optimize/__init__.py +67 -0
- pyxcp/daq_stim/optimize/binpacking.py +41 -0
- pyxcp/daq_stim/scheduler.cpp +28 -0
- pyxcp/daq_stim/scheduler.hpp +75 -0
- pyxcp/daq_stim/stim.cpp +13 -0
- pyxcp/daq_stim/stim.cpython-310-x86_64-linux-gnu.so +0 -0
- pyxcp/daq_stim/stim.cpython-311-x86_64-linux-gnu.so +0 -0
- pyxcp/daq_stim/stim.cpython-39-x86_64-linux-gnu.so +0 -0
- pyxcp/daq_stim/stim.hpp +604 -0
- pyxcp/daq_stim/stim_wrapper.cpp +48 -0
- pyxcp/dllif.py +95 -0
- pyxcp/errormatrix.py +878 -0
- pyxcp/examples/conf_can.toml +19 -0
- pyxcp/examples/conf_can_user.toml +16 -0
- pyxcp/examples/conf_can_vector.json +11 -0
- pyxcp/examples/conf_can_vector.toml +11 -0
- pyxcp/examples/conf_eth.toml +9 -0
- pyxcp/examples/conf_nixnet.json +20 -0
- pyxcp/examples/conf_socket_can.toml +12 -0
- pyxcp/examples/conf_sxi.json +9 -0
- pyxcp/examples/conf_sxi.toml +7 -0
- pyxcp/examples/ex_arrow.py +109 -0
- pyxcp/examples/ex_csv.py +85 -0
- pyxcp/examples/ex_excel.py +95 -0
- pyxcp/examples/ex_mdf.py +124 -0
- pyxcp/examples/ex_sqlite.py +128 -0
- pyxcp/examples/run_daq.py +148 -0
- pyxcp/examples/xcp_policy.py +60 -0
- pyxcp/examples/xcp_read_benchmark.py +38 -0
- pyxcp/examples/xcp_skel.py +49 -0
- pyxcp/examples/xcp_unlock.py +38 -0
- pyxcp/examples/xcp_user_supplied_driver.py +54 -0
- pyxcp/examples/xcphello.py +79 -0
- pyxcp/examples/xcphello_recorder.py +107 -0
- pyxcp/master/__init__.py +9 -0
- pyxcp/master/errorhandler.py +436 -0
- pyxcp/master/master.py +2030 -0
- pyxcp/py.typed +0 -0
- pyxcp/recorder/__init__.py +102 -0
- pyxcp/recorder/build_clang.cmd +1 -0
- pyxcp/recorder/build_clang.sh +2 -0
- pyxcp/recorder/build_gcc.cmd +1 -0
- pyxcp/recorder/build_gcc.sh +2 -0
- pyxcp/recorder/build_gcc_arm.sh +2 -0
- pyxcp/recorder/converter/__init__.py +37 -0
- pyxcp/recorder/lz4.c +2829 -0
- pyxcp/recorder/lz4.h +879 -0
- pyxcp/recorder/lz4hc.c +2041 -0
- pyxcp/recorder/lz4hc.h +413 -0
- pyxcp/recorder/mio.hpp +1714 -0
- pyxcp/recorder/reader.hpp +139 -0
- pyxcp/recorder/reco.py +277 -0
- pyxcp/recorder/recorder.rst +0 -0
- pyxcp/recorder/rekorder.cpp +59 -0
- pyxcp/recorder/rekorder.cpython-310-x86_64-linux-gnu.so +0 -0
- pyxcp/recorder/rekorder.cpython-311-x86_64-linux-gnu.so +0 -0
- pyxcp/recorder/rekorder.cpython-39-x86_64-linux-gnu.so +0 -0
- pyxcp/recorder/rekorder.hpp +274 -0
- pyxcp/recorder/setup.py +41 -0
- pyxcp/recorder/test_reko.py +34 -0
- pyxcp/recorder/unfolder.hpp +1332 -0
- pyxcp/recorder/wrap.cpp +189 -0
- pyxcp/recorder/writer.hpp +302 -0
- pyxcp/scripts/__init__.py +0 -0
- pyxcp/scripts/pyxcp_probe_can_drivers.py +20 -0
- pyxcp/scripts/xcp_examples.py +64 -0
- pyxcp/scripts/xcp_fetch_a2l.py +40 -0
- pyxcp/scripts/xcp_id_scanner.py +19 -0
- pyxcp/scripts/xcp_info.py +112 -0
- pyxcp/scripts/xcp_profile.py +27 -0
- pyxcp/stim/__init__.py +0 -0
- pyxcp/tests/test_asam_types.py +24 -0
- pyxcp/tests/test_binpacking.py +186 -0
- pyxcp/tests/test_can.py +1324 -0
- pyxcp/tests/test_checksum.py +95 -0
- pyxcp/tests/test_daq.py +193 -0
- pyxcp/tests/test_frame_padding.py +156 -0
- pyxcp/tests/test_master.py +2006 -0
- pyxcp/tests/test_transport.py +64 -0
- pyxcp/tests/test_utils.py +30 -0
- pyxcp/timing.py +60 -0
- pyxcp/transport/__init__.py +10 -0
- pyxcp/transport/base.py +440 -0
- pyxcp/transport/base_transport.hpp +0 -0
- pyxcp/transport/can.py +443 -0
- pyxcp/transport/eth.py +219 -0
- pyxcp/transport/sxi.py +133 -0
- pyxcp/transport/transport_wrapper.cpp +0 -0
- pyxcp/transport/usb_transport.py +213 -0
- pyxcp/types.py +993 -0
- pyxcp/utils.py +102 -0
- pyxcp/vector/__init__.py +0 -0
- pyxcp/vector/map.py +82 -0
- pyxcp-0.22.23.dist-info/LICENSE +165 -0
- pyxcp-0.22.23.dist-info/METADATA +107 -0
- pyxcp-0.22.23.dist-info/RECORD +134 -0
- pyxcp-0.22.23.dist-info/WHEEL +6 -0
- pyxcp-0.22.23.dist-info/entry_points.txt +8 -0
pyxcp/py.typed
ADDED
|
File without changes
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""XCP Frame Recording Facility.
|
|
3
|
+
"""
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Union
|
|
6
|
+
|
|
7
|
+
from pyxcp.types import FrameCategory
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
try:
|
|
11
|
+
import pandas as pd
|
|
12
|
+
except ImportError:
|
|
13
|
+
HAS_PANDAS = False
|
|
14
|
+
else:
|
|
15
|
+
HAS_PANDAS = True
|
|
16
|
+
|
|
17
|
+
from pyxcp.recorder.rekorder import DaqOnlinePolicy # noqa: F401
|
|
18
|
+
from pyxcp.recorder.rekorder import (
|
|
19
|
+
DaqRecorderPolicy,
|
|
20
|
+
Deserializer,
|
|
21
|
+
MeasurementParameters,
|
|
22
|
+
ValueHolder,
|
|
23
|
+
XcpLogFileDecoder,
|
|
24
|
+
_PyXcpLogFileReader,
|
|
25
|
+
_PyXcpLogFileWriter,
|
|
26
|
+
data_types,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DATA_TYPES = data_types()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@dataclass
|
|
34
|
+
class XcpLogFileHeader:
|
|
35
|
+
""" """
|
|
36
|
+
|
|
37
|
+
version: int
|
|
38
|
+
options: int
|
|
39
|
+
num_containers: int
|
|
40
|
+
record_count: int
|
|
41
|
+
size_uncompressed: int
|
|
42
|
+
size_compressed: int
|
|
43
|
+
compression_ratio: float
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
COUNTER_MAX = 0xFFFF
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class XcpLogFileReader:
|
|
50
|
+
""" """
|
|
51
|
+
|
|
52
|
+
def __init__(self, file_name):
|
|
53
|
+
self._reader = _PyXcpLogFileReader(file_name)
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def header(self):
|
|
57
|
+
return self._reader.get_header()
|
|
58
|
+
|
|
59
|
+
def get_header(self):
|
|
60
|
+
return XcpLogFileHeader(*self._reader.get_header_as_tuple())
|
|
61
|
+
|
|
62
|
+
def get_metadata(self):
|
|
63
|
+
return self._reader.get_metadata()
|
|
64
|
+
|
|
65
|
+
def __iter__(self):
|
|
66
|
+
while True:
|
|
67
|
+
frames = self._reader.next_block()
|
|
68
|
+
if frames is None:
|
|
69
|
+
break
|
|
70
|
+
for category, counter, timestamp, _, payload in frames:
|
|
71
|
+
yield (FrameCategory(category), counter, timestamp, payload)
|
|
72
|
+
|
|
73
|
+
def reset_iter(self):
|
|
74
|
+
self._reader.reset()
|
|
75
|
+
|
|
76
|
+
def as_dataframe(self):
|
|
77
|
+
if HAS_PANDAS:
|
|
78
|
+
df = pd.DataFrame((f for f in self), columns=["category", "counter", "timestamp", "payload"])
|
|
79
|
+
df = df.set_index("timestamp")
|
|
80
|
+
df.counter = df.counter.astype("uint16")
|
|
81
|
+
df.category = df.category.map({v: k for k, v in FrameCategory.__members__.items()}).astype("category")
|
|
82
|
+
return df
|
|
83
|
+
else:
|
|
84
|
+
raise NotImplementedError("method as_dataframe() requires 'pandas' package")
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class XcpLogFileWriter:
|
|
88
|
+
""" """
|
|
89
|
+
|
|
90
|
+
def __init__(self, file_name: str, prealloc=500, chunk_size=1):
|
|
91
|
+
self._writer = _PyXcpLogFileWriter(file_name, prealloc, chunk_size)
|
|
92
|
+
self._finalized = False
|
|
93
|
+
|
|
94
|
+
def __del__(self):
|
|
95
|
+
if not self._finalized:
|
|
96
|
+
self.finalize()
|
|
97
|
+
|
|
98
|
+
def add_frame(self, category: FrameCategory, counter: int, timestamp: float, payload: Union[bytes, bytearray]):
|
|
99
|
+
self._writer.add_frame(category, counter % (COUNTER_MAX + 1), timestamp, len(payload), payload)
|
|
100
|
+
|
|
101
|
+
def finalize(self):
|
|
102
|
+
self._writer.finalize()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
clang++ -std=c++20 -O0 -fvectorize -fexceptions -Rpass=loop-vectorize -ggdb -Wall -Wextra -Weffc++ -DLZ4_DEBUG=1 -DSTANDALONE_REKORDER=1 lz4.cpp rekorder.cpp -o rekorder.exe
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
g++ -std=c++20 -O0 -ggdb -march=native -fexceptions -ffast-math -ftree-vectorize -msse4 -mfpmath=sse -pg -fopt-info-vec-all -Wall -Wextra -Weffc++ -fcoroutines -DLZ4_DEBUG=1 -DSTANDALONE_REKORDER=1 lz4.cpp rekorder.cpp -o rekorder.exe
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from array import array
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from typing import Any, List
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
MAP_TO_ARRAY = {
|
|
8
|
+
"U8": "B",
|
|
9
|
+
"I8": "b",
|
|
10
|
+
"U16": "H",
|
|
11
|
+
"I16": "h",
|
|
12
|
+
"U32": "L",
|
|
13
|
+
"I32": "l",
|
|
14
|
+
"U64": "Q",
|
|
15
|
+
"I64": "q",
|
|
16
|
+
"F32": "f",
|
|
17
|
+
"F64": "d",
|
|
18
|
+
"F16": "f",
|
|
19
|
+
"BF16": "f",
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger("PyXCP")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class Storage:
|
|
27
|
+
name: str
|
|
28
|
+
arrow_type: Any
|
|
29
|
+
arr: array
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class StorageContainer:
|
|
34
|
+
name: str
|
|
35
|
+
arr: List[Storage] = field(default_factory=[])
|
|
36
|
+
ts0: List[int] = field(default_factory=lambda: array("Q"))
|
|
37
|
+
ts1: List[int] = field(default_factory=lambda: array("Q"))
|