pyxcp 0.21.10__cp311-cp311-win32.whl → 0.22.1__cp311-cp311-win32.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.
- CMakeLists.txt +117 -0
- pyxcp/__init__.py +12 -20
- pyxcp/aml/EtasCANMonitoring.a2l +82 -83
- pyxcp/aml/XCP_Common.aml +0 -1
- pyxcp/aml/XCPonUSB.aml +1 -1
- pyxcp/aml/ifdata_CAN.a2l +0 -1
- pyxcp/aml/ifdata_Eth.a2l +0 -1
- pyxcp/aml/ifdata_Flx.a2l +0 -1
- pyxcp/aml/ifdata_SxI.a2l +0 -1
- pyxcp/aml/ifdata_USB.a2l +0 -1
- pyxcp/asam/types.py +4 -4
- pyxcp/asamkeydll.c +0 -1
- pyxcp/checksum.py +0 -1
- pyxcp/cmdline.py +32 -50
- pyxcp/config/__init__.py +1089 -0
- pyxcp/config/legacy.py +120 -0
- pyxcp/constants.py +12 -13
- pyxcp/cpp_ext/__init__.py +8 -0
- pyxcp/cpp_ext/bin.hpp +104 -0
- pyxcp/cpp_ext/blockmem.hpp +58 -0
- pyxcp/cpp_ext/cpp_ext.cp312-win_amd64.pyd +0 -0
- pyxcp/cpp_ext/daqlist.hpp +197 -0
- pyxcp/cpp_ext/event.hpp +67 -0
- pyxcp/cpp_ext/extension_wrapper.cpp +94 -0
- pyxcp/cpp_ext/helper.hpp +264 -0
- pyxcp/cpp_ext/mcobject.hpp +241 -0
- pyxcp/cpp_ext/tsqueue.hpp +46 -0
- pyxcp/daq_stim/__init__.py +226 -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.cp312-win_amd64.pyd +0 -0
- pyxcp/daq_stim/stim.cpp +13 -0
- pyxcp/daq_stim/stim.hpp +604 -0
- pyxcp/daq_stim/stim_wrapper.cpp +48 -0
- pyxcp/dllif.py +21 -18
- pyxcp/errormatrix.py +5 -3
- pyxcp/examples/conf_can.toml +4 -2
- pyxcp/examples/conf_can_vector.json +9 -9
- pyxcp/examples/conf_can_vector.toml +4 -2
- pyxcp/examples/conf_eth.toml +5 -2
- pyxcp/examples/conf_nixnet.json +18 -18
- pyxcp/examples/conf_sxi.json +7 -7
- pyxcp/examples/ex_arrow.py +109 -0
- pyxcp/examples/ex_mdf.py +124 -0
- pyxcp/examples/ex_sqlite.py +128 -0
- pyxcp/examples/run_daq.py +146 -0
- pyxcp/examples/xcp_policy.py +6 -7
- pyxcp/examples/xcp_read_benchmark.py +8 -6
- pyxcp/examples/xcp_skel.py +0 -2
- pyxcp/examples/xcp_unlock.py +1 -1
- pyxcp/examples/xcp_user_supplied_driver.py +1 -2
- pyxcp/examples/xcphello.py +6 -3
- pyxcp/examples/xcphello_recorder.py +4 -4
- pyxcp/master/__init__.py +1 -2
- pyxcp/master/errorhandler.py +107 -74
- pyxcp/master/master.py +198 -117
- pyxcp/py.typed +0 -0
- pyxcp/recorder/__init__.py +27 -6
- pyxcp/recorder/converter/__init__.py +37 -0
- pyxcp/recorder/lz4.c +129 -51
- pyxcp/recorder/lz4.h +45 -28
- pyxcp/recorder/lz4hc.c +560 -156
- pyxcp/recorder/lz4hc.h +1 -1
- pyxcp/recorder/mio.hpp +721 -767
- pyxcp/recorder/reader.hpp +139 -0
- pyxcp/recorder/reco.py +5 -8
- pyxcp/recorder/rekorder.cp312-win_amd64.pyd +0 -0
- pyxcp/recorder/rekorder.cpp +18 -22
- pyxcp/recorder/rekorder.hpp +200 -587
- pyxcp/recorder/setup.py +11 -10
- pyxcp/recorder/test_reko.py +2 -3
- pyxcp/recorder/unfolder.hpp +1249 -0
- pyxcp/recorder/wrap.cpp +171 -9
- pyxcp/recorder/writer.hpp +302 -0
- pyxcp/scripts/pyxcp_probe_can_drivers.py +0 -2
- pyxcp/scripts/xcp_fetch_a2l.py +15 -10
- pyxcp/scripts/xcp_id_scanner.py +2 -6
- pyxcp/scripts/xcp_info.py +98 -63
- pyxcp/scripts/xcp_profile.py +27 -0
- pyxcp/stim/__init__.py +0 -0
- pyxcp/tests/test_asam_types.py +2 -2
- pyxcp/tests/test_binpacking.py +184 -0
- pyxcp/tests/test_can.py +1132 -38
- pyxcp/tests/test_checksum.py +2 -1
- pyxcp/tests/test_daq.py +188 -0
- pyxcp/tests/test_frame_padding.py +3 -3
- pyxcp/tests/test_master.py +42 -31
- pyxcp/tests/test_transport.py +12 -12
- pyxcp/tests/test_utils.py +2 -5
- pyxcp/timing.py +0 -2
- pyxcp/transport/__init__.py +9 -9
- pyxcp/transport/base.py +142 -124
- pyxcp/transport/base_transport.hpp +0 -0
- pyxcp/transport/can.py +194 -167
- pyxcp/transport/eth.py +80 -82
- pyxcp/transport/sxi.py +106 -60
- pyxcp/transport/transport_wrapper.cpp +0 -0
- pyxcp/transport/usb_transport.py +65 -83
- pyxcp/types.py +69 -20
- pyxcp/utils.py +47 -16
- pyxcp/vector/map.py +1 -3
- {pyxcp-0.21.10.dist-info → pyxcp-0.22.1.dist-info}/METADATA +27 -22
- pyxcp-0.22.1.dist-info/RECORD +126 -0
- {pyxcp-0.21.10.dist-info → pyxcp-0.22.1.dist-info}/WHEEL +1 -1
- {pyxcp-0.21.10.dist-info → pyxcp-0.22.1.dist-info}/entry_points.txt +1 -0
- pyxcp/config.py +0 -57
- pyxcp/cxx/asynchiofactory.hpp +0 -24
- pyxcp/cxx/blocking_client.cpp +0 -44
- pyxcp/cxx/blocking_socket.cpp +0 -43
- pyxcp/cxx/blocking_socket.hpp +0 -558
- pyxcp/cxx/concurrent_queue.hpp +0 -60
- pyxcp/cxx/eth.hpp +0 -57
- pyxcp/cxx/exceptions.hpp +0 -30
- pyxcp/cxx/iasyncioservice.hpp +0 -31
- pyxcp/cxx/iresource.hpp +0 -17
- pyxcp/cxx/isocket.hpp +0 -22
- pyxcp/cxx/linux/epoll.cpp +0 -51
- pyxcp/cxx/linux/epoll.hpp +0 -87
- pyxcp/cxx/linux/lit_tester.cpp +0 -19
- pyxcp/cxx/linux/socket.hpp +0 -234
- pyxcp/cxx/linux/timeout.hpp +0 -81
- pyxcp/cxx/memoryblock.hpp +0 -42
- pyxcp/cxx/pool.hpp +0 -81
- pyxcp/cxx/poolmgr.cpp +0 -6
- pyxcp/cxx/poolmgr.hpp +0 -31
- pyxcp/cxx/test_queue.cpp +0 -69
- pyxcp/cxx/timestamp.hpp +0 -84
- pyxcp/cxx/utils.cpp +0 -38
- pyxcp/cxx/utils.hpp +0 -29
- pyxcp/cxx/win/iocp.cpp +0 -242
- pyxcp/cxx/win/iocp.hpp +0 -42
- pyxcp/cxx/win/perhandledata.hpp +0 -24
- pyxcp/cxx/win/periodata.hpp +0 -97
- pyxcp/cxx/win/socket.hpp +0 -185
- pyxcp/cxx/win/timeout.hpp +0 -83
- pyxcp/examples/conf_can.json +0 -20
- pyxcp/examples/conf_eth.json +0 -8
- pyxcp/logger.py +0 -67
- pyxcp/tests/test_config.py +0 -62
- pyxcp/transport/candriver/__init__.py +0 -2
- pyxcp/transport/candriver/pc_canalystii.py +0 -27
- pyxcp/transport/candriver/pc_etas.py +0 -25
- pyxcp/transport/candriver/pc_gsusb.py +0 -23
- pyxcp/transport/candriver/pc_iscan.py +0 -23
- pyxcp/transport/candriver/pc_ixxat.py +0 -27
- pyxcp/transport/candriver/pc_kvaser.py +0 -39
- pyxcp/transport/candriver/pc_neovi.py +0 -31
- pyxcp/transport/candriver/pc_nican.py +0 -23
- pyxcp/transport/candriver/pc_nixnet.py +0 -23
- pyxcp/transport/candriver/pc_pcan.py +0 -25
- pyxcp/transport/candriver/pc_seeed.py +0 -28
- pyxcp/transport/candriver/pc_serial.py +0 -27
- pyxcp/transport/candriver/pc_slcan.py +0 -29
- pyxcp/transport/candriver/pc_socketcan.py +0 -23
- pyxcp/transport/candriver/pc_systec.py +0 -29
- pyxcp/transport/candriver/pc_usb2can.py +0 -30
- pyxcp/transport/candriver/pc_vector.py +0 -34
- pyxcp/transport/candriver/python_can.py +0 -101
- pyxcp/transport/cxx_ext/CMakeLists.txt +0 -51
- pyxcp/transport/cxx_ext/setup.py +0 -49
- pyxcp/transport/cxx_ext/tests/test_basic_socket.cpp +0 -39
- pyxcp/transport/cxx_ext/tests/test_pool.cpp +0 -39
- pyxcp/transport/cxx_ext/tests/test_timestamp.cpp +0 -27
- pyxcp-0.21.10.dist-info/RECORD +0 -147
- rekorder.cp311-win32.pyd +0 -0
- {pyxcp-0.21.10.dist-info/licenses → pyxcp-0.22.1.dist-info}/LICENSE +0 -0
CMakeLists.txt
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
|
|
2
|
+
cmake_minimum_required(VERSION 3.7...3.29)
|
|
3
|
+
project(pyxcp_extensions LANGUAGES C CXX)
|
|
4
|
+
|
|
5
|
+
find_package(Python COMPONENTS Interpreter Development)
|
|
6
|
+
find_package(pybind11 CONFIG)
|
|
7
|
+
|
|
8
|
+
SET(CMAKE_C_STANDARD 17)
|
|
9
|
+
set(CMAKE_CXX_STANDARD 23)
|
|
10
|
+
|
|
11
|
+
message( STATUS "Found pybind11 v${pybind11_VERSION} ${pybind11_VERSION_TYPE}: ${pybind11_INCLUDE_DIRS}")
|
|
12
|
+
|
|
13
|
+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/dist")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
SET(GCC_N_CLANG_BASE_OPTIONS "-std=c++23 -Wall -Wextra -Wpedantic -Warray-bounds -mtune=native -fexceptions")
|
|
17
|
+
|
|
18
|
+
SET(MSVC_BASE_OPTIONS "/W3 /permissive- /EHsc /bigobj /Zc:__cplusplus /std:c++latest")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
23
|
+
if (MSVC)
|
|
24
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} /Od /fsanitize=address /Zi")
|
|
25
|
+
else()
|
|
26
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} -Og -g3 -ggdb --fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -fsanitize=bounds") # -fsanitize=hwaddress
|
|
27
|
+
endif()
|
|
28
|
+
else ()
|
|
29
|
+
if (MSVC)
|
|
30
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} /Ox")
|
|
31
|
+
else()
|
|
32
|
+
SET(MSVC_BASE_OPTIONS "${MSVC_BASE_OPTIONS} -O3 --fomit-frame-pointer")
|
|
33
|
+
endif()
|
|
34
|
+
endif ()
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
38
|
+
set(ENV{MACOSX_DEPLOYMENT_TARGET} "11.0")
|
|
39
|
+
SET(GCC_N_CLANG_EXTRA_OPTIONS "-stdlib=libc++")
|
|
40
|
+
message("Platform is Darwin")
|
|
41
|
+
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
42
|
+
message("Platform is WINDOWS")
|
|
43
|
+
SET(MSVC_EXTRA_OPTIONS "")
|
|
44
|
+
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
45
|
+
SET(GCC_N_CLANG_EXTRA_OPTIONS "-fvisibility=hidden -g0") # -fcoroutines
|
|
46
|
+
message("Platform is LINUX")
|
|
47
|
+
endif()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
IF (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
|
51
|
+
|
|
52
|
+
ELSEIF (CMAKE_C_COMPILER_ID MATCHES "Clang")
|
|
53
|
+
|
|
54
|
+
ELSEIF (CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
55
|
+
|
|
56
|
+
ELSE ()
|
|
57
|
+
|
|
58
|
+
ENDIF ()
|
|
59
|
+
|
|
60
|
+
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
61
|
+
|
|
62
|
+
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
63
|
+
|
|
64
|
+
ELSEIF (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
|
65
|
+
|
|
66
|
+
ELSE ()
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
ENDIF ()
|
|
70
|
+
|
|
71
|
+
message("Compiling C with: " ${CMAKE_C_COMPILER_ID})
|
|
72
|
+
message("Compiling Cpp with: " ${CMAKE_CXX_COMPILER_ID})
|
|
73
|
+
|
|
74
|
+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
75
|
+
|
|
76
|
+
set(EXTENSION_INCS ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/cpp_ext)
|
|
77
|
+
|
|
78
|
+
pybind11_add_module(rekorder pyxcp/recorder/wrap.cpp pyxcp/recorder/lz4.c pyxcp/recorder/lz4hc.c)
|
|
79
|
+
pybind11_add_module(cpp_ext pyxcp/cpp_ext/extension_wrapper.cpp)
|
|
80
|
+
pybind11_add_module(stim pyxcp/daq_stim/stim_wrapper.cpp pyxcp/daq_stim/stim.cpp pyxcp/daq_stim/scheduler.cpp)
|
|
81
|
+
|
|
82
|
+
target_include_directories(rekorder PRIVATE ${EXTENSION_INCS} ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/recorder)
|
|
83
|
+
target_include_directories(cpp_ext PRIVATE ${EXTENSION_INCS})
|
|
84
|
+
target_include_directories(stim PRIVATE ${EXTENSION_INCS} ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/daq_stim)
|
|
85
|
+
|
|
86
|
+
target_compile_options(rekorder PUBLIC "-DEXTENSION_NAME=pyxcp.recorder.rekorder")
|
|
87
|
+
target_compile_options(cpp_ext PUBLIC "-DEXTENSION_NAME=pyxcp.cpp_ext.cpp_ext")
|
|
88
|
+
target_compile_options(stim PUBLIC "-DEXTENSION_NAME=pyxcp.daq_stim.stim")
|
|
89
|
+
|
|
90
|
+
add_executable(asamkeydll ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/asamkeydll.c)
|
|
91
|
+
# set_target_properties(MyTarget PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
|
|
92
|
+
|
|
93
|
+
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
94
|
+
# CMAKE_SYSTEM_NAME STREQUAL "Windows"
|
|
95
|
+
endif()
|
|
96
|
+
|
|
97
|
+
IF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
98
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_N_CLANG_BASE_OPTIONS} ${GCC_N_CLANG_EXTRA_OPTIONS}")
|
|
99
|
+
target_link_options(cpp_ext PUBLIC -flto=auto)
|
|
100
|
+
target_link_options(stim PUBLIC -flto=auto)
|
|
101
|
+
target_link_options(rekorder PUBLIC -flto=auto)
|
|
102
|
+
ELSEIF (CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
|
103
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MSVC_BASE_OPTIONS} ${MSVC_EXTRA_OPTIONS}")
|
|
104
|
+
ENDIF()
|
|
105
|
+
|
|
106
|
+
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
107
|
+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" -fuse-ld=lld)
|
|
108
|
+
ENDIF()
|
|
109
|
+
|
|
110
|
+
# target_include_directories(preprocessor PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pya2l/extensions>)
|
|
111
|
+
# target_link_libraries(preprocessor pybind11::headers)
|
|
112
|
+
# set_target_properties(preprocessor PROPERTIES INTERPROCEDURAL_OPTIMIZATION ON CXX_VISIBILITY_PRESET ON VISIBILITY_INLINES_HIDDEN ON)
|
|
113
|
+
|
|
114
|
+
install(TARGETS rekorder LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/recorder)
|
|
115
|
+
install(TARGETS cpp_ext LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/cpp_ext)
|
|
116
|
+
install(TARGETS stim LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/daq_stim)
|
|
117
|
+
# install(TARGETS asamkeydll LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pyxcp/)
|
pyxcp/__init__.py
CHANGED
|
@@ -1,28 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
|
-
|
|
3
|
-
"""Universal Calibration Protocol for Python"""
|
|
4
|
-
import sys
|
|
2
|
+
"""Universal Calibration Protocol for Python."""
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
from win_precise_time import sleep as wpsleep
|
|
10
|
-
from win_precise_time import time as wptime
|
|
4
|
+
from rich import pretty
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from rich.traceback import install as tb_install
|
|
11
7
|
|
|
12
|
-
import time
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
time.time = wptime
|
|
9
|
+
pretty.install()
|
|
16
10
|
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
from .master import Master # noqa: F401, E402
|
|
12
|
+
from .transport import Can, Eth, SxI, Usb # noqa: F401, E402
|
|
19
13
|
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
from .transport import Eth
|
|
24
|
-
from .transport import SxI
|
|
25
|
-
from .transport import Usb
|
|
15
|
+
console = Console()
|
|
16
|
+
tb_install(show_locals=True, max_frames=3) # Install custom exception handler.
|
|
26
17
|
|
|
27
|
-
# if you update this manually, do not forget to update
|
|
28
|
-
|
|
18
|
+
# if you update this manually, do not forget to update
|
|
19
|
+
# .bumpversion.cfg and pyproject.toml.
|
|
20
|
+
__version__ = "0.22.1"
|
pyxcp/aml/EtasCANMonitoring.a2l
CHANGED
|
@@ -1,83 +1,82 @@
|
|
|
1
|
-
ASAP2_VERSION 1 30
|
|
2
|
-
/begin PROJECT
|
|
3
|
-
aProjectName
|
|
4
|
-
"description of project"
|
|
5
|
-
|
|
6
|
-
/begin HEADER
|
|
7
|
-
"project"
|
|
8
|
-
VERSION "1.0"
|
|
9
|
-
PROJECT_NO "1.0"
|
|
10
|
-
/end HEADER
|
|
11
|
-
|
|
12
|
-
/begin MODULE
|
|
13
|
-
aModuleName
|
|
14
|
-
"description of module"
|
|
15
|
-
|
|
16
|
-
/begin MOD_PAR
|
|
17
|
-
""
|
|
18
|
-
/end MOD_PAR
|
|
19
|
-
|
|
20
|
-
/begin IF_DATA CAN_MONITORING
|
|
21
|
-
/begin TP_BLOB
|
|
22
|
-
500
|
|
23
|
-
/end TP_BLOB
|
|
24
|
-
/end IF_DATA
|
|
25
|
-
|
|
26
|
-
/begin MEASUREMENT
|
|
27
|
-
aMeasurementName
|
|
28
|
-
"description of measurement"
|
|
29
|
-
ULONG
|
|
30
|
-
aConversionName
|
|
31
|
-
0
|
|
32
|
-
0.0
|
|
33
|
-
0
|
|
34
|
-
1000
|
|
35
|
-
/begin IF_DATA CAN_MONITORING
|
|
36
|
-
/begin KP_BLOB
|
|
37
|
-
0x0 32
|
|
38
|
-
/end KP_BLOB
|
|
39
|
-
/end IF_DATA
|
|
40
|
-
FORMAT ""
|
|
41
|
-
BYTE_ORDER MSB_LAST
|
|
42
|
-
BIT_MASK 0xFFFFFFFF
|
|
43
|
-
/end MEASUREMENT
|
|
44
|
-
|
|
45
|
-
/begin COMPU_METHOD
|
|
46
|
-
aConversionName
|
|
47
|
-
"description of conversion"
|
|
48
|
-
RAT_FUNC
|
|
49
|
-
"%f5.2"
|
|
50
|
-
""
|
|
51
|
-
COEFFS 0 1.0 0.0 0 0 1
|
|
52
|
-
/end COMPU_METHOD
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/begin FRAME
|
|
62
|
-
aFrameName
|
|
63
|
-
"description of frame"
|
|
64
|
-
0
|
|
65
|
-
0
|
|
66
|
-
/begin IF_DATA CAN_MONITORING
|
|
67
|
-
QP_BLOB 0x0200 0 8
|
|
68
|
-
/end IF_DATA
|
|
69
|
-
FRAME_MEASUREMENT aMeasurementName
|
|
70
|
-
/end FRAME
|
|
71
|
-
|
|
72
|
-
/begin FUNCTION
|
|
73
|
-
aFunctionName
|
|
74
|
-
"description of function"
|
|
75
|
-
/begin OUT_MEASUREMENT
|
|
76
|
-
aMeasurementName
|
|
77
|
-
/end OUT_MEASUREMENT
|
|
78
|
-
/end FUNCTION
|
|
79
|
-
|
|
80
|
-
/end MODULE
|
|
81
|
-
|
|
82
|
-
/end PROJECT
|
|
83
|
-
|
|
1
|
+
ASAP2_VERSION 1 30
|
|
2
|
+
/begin PROJECT
|
|
3
|
+
aProjectName
|
|
4
|
+
"description of project"
|
|
5
|
+
|
|
6
|
+
/begin HEADER
|
|
7
|
+
"project"
|
|
8
|
+
VERSION "1.0"
|
|
9
|
+
PROJECT_NO "1.0"
|
|
10
|
+
/end HEADER
|
|
11
|
+
|
|
12
|
+
/begin MODULE
|
|
13
|
+
aModuleName
|
|
14
|
+
"description of module"
|
|
15
|
+
|
|
16
|
+
/begin MOD_PAR
|
|
17
|
+
""
|
|
18
|
+
/end MOD_PAR
|
|
19
|
+
|
|
20
|
+
/begin IF_DATA CAN_MONITORING
|
|
21
|
+
/begin TP_BLOB
|
|
22
|
+
500
|
|
23
|
+
/end TP_BLOB
|
|
24
|
+
/end IF_DATA
|
|
25
|
+
|
|
26
|
+
/begin MEASUREMENT
|
|
27
|
+
aMeasurementName
|
|
28
|
+
"description of measurement"
|
|
29
|
+
ULONG
|
|
30
|
+
aConversionName
|
|
31
|
+
0
|
|
32
|
+
0.0
|
|
33
|
+
0
|
|
34
|
+
1000
|
|
35
|
+
/begin IF_DATA CAN_MONITORING
|
|
36
|
+
/begin KP_BLOB
|
|
37
|
+
0x0 32
|
|
38
|
+
/end KP_BLOB
|
|
39
|
+
/end IF_DATA
|
|
40
|
+
FORMAT ""
|
|
41
|
+
BYTE_ORDER MSB_LAST
|
|
42
|
+
BIT_MASK 0xFFFFFFFF
|
|
43
|
+
/end MEASUREMENT
|
|
44
|
+
|
|
45
|
+
/begin COMPU_METHOD
|
|
46
|
+
aConversionName
|
|
47
|
+
"description of conversion"
|
|
48
|
+
RAT_FUNC
|
|
49
|
+
"%f5.2"
|
|
50
|
+
""
|
|
51
|
+
COEFFS 0 1.0 0.0 0 0 1
|
|
52
|
+
/end COMPU_METHOD
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/begin FRAME
|
|
62
|
+
aFrameName
|
|
63
|
+
"description of frame"
|
|
64
|
+
0
|
|
65
|
+
0
|
|
66
|
+
/begin IF_DATA CAN_MONITORING
|
|
67
|
+
QP_BLOB 0x0200 0 8
|
|
68
|
+
/end IF_DATA
|
|
69
|
+
FRAME_MEASUREMENT aMeasurementName
|
|
70
|
+
/end FRAME
|
|
71
|
+
|
|
72
|
+
/begin FUNCTION
|
|
73
|
+
aFunctionName
|
|
74
|
+
"description of function"
|
|
75
|
+
/begin OUT_MEASUREMENT
|
|
76
|
+
aMeasurementName
|
|
77
|
+
/end OUT_MEASUREMENT
|
|
78
|
+
/end FUNCTION
|
|
79
|
+
|
|
80
|
+
/end MODULE
|
|
81
|
+
|
|
82
|
+
/end PROJECT
|
pyxcp/aml/XCP_Common.aml
CHANGED
pyxcp/aml/XCPonUSB.aml
CHANGED
pyxcp/aml/ifdata_CAN.a2l
CHANGED
pyxcp/aml/ifdata_Eth.a2l
CHANGED
pyxcp/aml/ifdata_Flx.a2l
CHANGED
pyxcp/aml/ifdata_SxI.a2l
CHANGED
pyxcp/aml/ifdata_USB.a2l
CHANGED
pyxcp/asam/types.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
import struct
|
|
4
3
|
|
|
4
|
+
|
|
5
5
|
INTEL = "<"
|
|
6
6
|
MOTOROLA = ">"
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ MOTOROLA = ">"
|
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
class AsamBaseType
|
|
18
|
+
class AsamBaseType:
|
|
19
19
|
"""Base class for ASAM codecs.
|
|
20
20
|
|
|
21
21
|
Note
|
|
@@ -51,7 +51,7 @@ class AsamBaseType(object):
|
|
|
51
51
|
bytes
|
|
52
52
|
Encoded value.
|
|
53
53
|
"""
|
|
54
|
-
return struct.pack("{
|
|
54
|
+
return struct.pack(f"{self.byteorder}{self.FMT}", value)
|
|
55
55
|
|
|
56
56
|
def decode(self, value):
|
|
57
57
|
"""Decode a value.
|
|
@@ -68,7 +68,7 @@ class AsamBaseType(object):
|
|
|
68
68
|
data-type
|
|
69
69
|
data-type is determined by derived class.
|
|
70
70
|
"""
|
|
71
|
-
return struct.unpack("{
|
|
71
|
+
return struct.unpack(f"{self.byteorder}{self.FMT}", bytes(value))[0]
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
class A_Uint8(AsamBaseType):
|
pyxcp/asamkeydll.c
CHANGED
pyxcp/checksum.py
CHANGED
pyxcp/cmdline.py
CHANGED
|
@@ -1,68 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
|
-
# -*- coding: utf-8 -*-
|
|
3
2
|
"""
|
|
4
3
|
Parse (transport-layer specific) command line parameters
|
|
5
4
|
and create a XCP master instance.
|
|
6
5
|
"""
|
|
7
|
-
import argparse
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
import warnings
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
from pyxcp.config import create_application
|
|
10
12
|
from pyxcp.master import Master
|
|
11
|
-
from pyxcp.transport.can import registered_drivers
|
|
12
|
-
from pyxcp.transport.can import try_to_install_system_supplied_drivers
|
|
13
13
|
|
|
14
|
-
try_to_install_system_supplied_drivers()
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
warnings.simplefilter("always")
|
|
17
16
|
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
@dataclass
|
|
19
|
+
class Option:
|
|
20
|
+
short_opt: str
|
|
21
|
+
long_opt: str = ""
|
|
22
|
+
dest: str = ""
|
|
23
|
+
help: str = ""
|
|
24
|
+
type: str = ""
|
|
25
|
+
default: str = ""
|
|
21
26
|
|
|
22
|
-
Parameter
|
|
23
|
-
---------
|
|
24
|
-
callout: callable
|
|
25
|
-
Process user-supplied arguments.
|
|
26
|
-
"""
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
self.callout = callout
|
|
30
|
-
kws.update(formatter_class=argparse.RawDescriptionHelpFormatter, add_help=True)
|
|
31
|
-
self._parser = argparse.ArgumentParser(*args, **kws)
|
|
32
|
-
self._parser.add_argument(
|
|
33
|
-
"-c",
|
|
34
|
-
"--config-file",
|
|
35
|
-
type=argparse.FileType("r"),
|
|
36
|
-
dest="conf",
|
|
37
|
-
help="File to read (extended) parameters from.",
|
|
38
|
-
)
|
|
39
|
-
self._parser.add_argument(
|
|
40
|
-
"-l",
|
|
41
|
-
"--loglevel",
|
|
42
|
-
choices=["ERROR", "WARN", "INFO", "DEBUG"],
|
|
43
|
-
default="INFO",
|
|
44
|
-
)
|
|
45
|
-
self._parser.epilog = "To get specific help on transport layers\nuse <layer> -h, e.g. {} eth -h".format(self._parser.prog)
|
|
46
|
-
self._args = []
|
|
28
|
+
class FakeParser:
|
|
47
29
|
|
|
48
|
-
|
|
49
|
-
def args(self):
|
|
50
|
-
return self._args
|
|
30
|
+
options: List[Option] = []
|
|
51
31
|
|
|
52
|
-
def
|
|
53
|
-
""
|
|
54
|
-
self.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
32
|
+
def add_argument(self, short_opt: str, long_opt: str = "", dest: str = "", help: str = "", type: str = "", default: str = ""):
|
|
33
|
+
warnings.warn("Argument parser extension is currently not supported.", DeprecationWarning, 2)
|
|
34
|
+
self.options.append(Option(short_opt, long_opt, dest, help, type, default))
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class ArgumentParser:
|
|
38
|
+
def __init__(self, callout=None, *args, **kws):
|
|
39
|
+
self._parser = FakeParser()
|
|
40
|
+
if callout is not None:
|
|
41
|
+
warnings.warn("callout argument is currently not supported.", DeprecationWarning, 2)
|
|
42
|
+
|
|
43
|
+
def run(self, policy=None, transport_layer_interface=None):
|
|
44
|
+
application = create_application(self.parser.options)
|
|
45
|
+
master = Master(
|
|
46
|
+
application.transport.layer, config=application, policy=policy, transport_layer_interface=transport_layer_interface
|
|
47
|
+
)
|
|
66
48
|
return master
|
|
67
49
|
|
|
68
50
|
@property
|