pyxcp 0.23.0__cp311-cp311-win_arm64.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 +732 -0
- pyxcp/cmdline.py +52 -0
- pyxcp/config/__init__.py +1113 -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.cp310-win_arm64.pyd +0 -0
- pyxcp/cpp_ext/cpp_ext.cp311-win_arm64.pyd +0 -0
- pyxcp/cpp_ext/daqlist.hpp +206 -0
- pyxcp/cpp_ext/event.hpp +67 -0
- pyxcp/cpp_ext/extension_wrapper.cpp +100 -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 +232 -0
- pyxcp/daq_stim/optimize/__init__.py +67 -0
- pyxcp/daq_stim/optimize/binpacking.py +41 -0
- pyxcp/daq_stim/scheduler.cpp +62 -0
- pyxcp/daq_stim/scheduler.hpp +75 -0
- pyxcp/daq_stim/stim.cp310-win_arm64.pyd +0 -0
- pyxcp/daq_stim/stim.cp311-win_arm64.pyd +0 -0
- pyxcp/daq_stim/stim.cpp +13 -0
- pyxcp/daq_stim/stim.hpp +604 -0
- pyxcp/daq_stim/stim_wrapper.cpp +50 -0
- pyxcp/dllif.py +100 -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/run_daq.py +163 -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 +44 -0
- pyxcp/examples/xcphello.py +78 -0
- pyxcp/examples/xcphello_recorder.py +107 -0
- pyxcp/master/__init__.py +9 -0
- pyxcp/master/errorhandler.py +442 -0
- pyxcp/master/master.py +2047 -0
- pyxcp/py.typed +0 -0
- pyxcp/recorder/__init__.py +101 -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 +450 -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.cp310-win_arm64.pyd +0 -0
- pyxcp/recorder/rekorder.cp311-win_arm64.pyd +0 -0
- pyxcp/recorder/rekorder.cpp +59 -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 +144 -0
- pyxcp/scripts/xcp_profile.py +27 -0
- pyxcp/scripts/xmraw_converter.py +31 -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_daq_opt.py +426 -0
- pyxcp/tests/test_frame_padding.py +156 -0
- pyxcp/tests/test_master.py +2006 -0
- pyxcp/tests/test_transport.py +81 -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 +556 -0
- pyxcp/transport/eth.py +219 -0
- pyxcp/transport/sxi.py +135 -0
- pyxcp/transport/transport_wrapper.cpp +0 -0
- pyxcp/transport/usb_transport.py +213 -0
- pyxcp/types.py +1000 -0
- pyxcp/utils.py +128 -0
- pyxcp/vector/__init__.py +0 -0
- pyxcp/vector/map.py +82 -0
- pyxcp-0.23.0.dist-info/LICENSE +165 -0
- pyxcp-0.23.0.dist-info/METADATA +107 -0
- pyxcp-0.23.0.dist-info/RECORD +128 -0
- pyxcp-0.23.0.dist-info/WHEEL +4 -0
- pyxcp-0.23.0.dist-info/entry_points.txt +9 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
|
|
3
|
+
from pyxcp.transport.can import pad_frame
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_frame_padding_no_padding_length():
|
|
7
|
+
EXPECTED = (
|
|
8
|
+
(0, 8),
|
|
9
|
+
(1, 8),
|
|
10
|
+
(2, 8),
|
|
11
|
+
(3, 8),
|
|
12
|
+
(4, 8),
|
|
13
|
+
(5, 8),
|
|
14
|
+
(6, 8),
|
|
15
|
+
(7, 8),
|
|
16
|
+
(8, 8),
|
|
17
|
+
(9, 12),
|
|
18
|
+
(10, 12),
|
|
19
|
+
(11, 12),
|
|
20
|
+
(12, 12),
|
|
21
|
+
(13, 16),
|
|
22
|
+
(14, 16),
|
|
23
|
+
(15, 16),
|
|
24
|
+
(16, 16),
|
|
25
|
+
(17, 20),
|
|
26
|
+
(18, 20),
|
|
27
|
+
(19, 20),
|
|
28
|
+
(20, 20),
|
|
29
|
+
(21, 24),
|
|
30
|
+
(22, 24),
|
|
31
|
+
(23, 24),
|
|
32
|
+
(24, 24),
|
|
33
|
+
(25, 32),
|
|
34
|
+
(26, 32),
|
|
35
|
+
(27, 32),
|
|
36
|
+
(28, 32),
|
|
37
|
+
(29, 32),
|
|
38
|
+
(30, 32),
|
|
39
|
+
(31, 32),
|
|
40
|
+
(32, 32),
|
|
41
|
+
(33, 48),
|
|
42
|
+
(34, 48),
|
|
43
|
+
(35, 48),
|
|
44
|
+
(36, 48),
|
|
45
|
+
(37, 48),
|
|
46
|
+
(38, 48),
|
|
47
|
+
(39, 48),
|
|
48
|
+
(40, 48),
|
|
49
|
+
(41, 48),
|
|
50
|
+
(42, 48),
|
|
51
|
+
(43, 48),
|
|
52
|
+
(44, 48),
|
|
53
|
+
(45, 48),
|
|
54
|
+
(46, 48),
|
|
55
|
+
(47, 48),
|
|
56
|
+
(48, 48),
|
|
57
|
+
(49, 64),
|
|
58
|
+
(50, 64),
|
|
59
|
+
(51, 64),
|
|
60
|
+
(52, 64),
|
|
61
|
+
(53, 64),
|
|
62
|
+
(54, 64),
|
|
63
|
+
(55, 64),
|
|
64
|
+
(56, 64),
|
|
65
|
+
(57, 64),
|
|
66
|
+
(58, 64),
|
|
67
|
+
(59, 64),
|
|
68
|
+
(60, 64),
|
|
69
|
+
(61, 64),
|
|
70
|
+
(62, 64),
|
|
71
|
+
(63, 64),
|
|
72
|
+
(64, 64),
|
|
73
|
+
)
|
|
74
|
+
for frame_len in range(65):
|
|
75
|
+
frame = bytes(frame_len)
|
|
76
|
+
padded_frame = pad_frame(frame, padding_value=0, pad_frame=True)
|
|
77
|
+
frame_len = len(padded_frame)
|
|
78
|
+
_, expected_len = EXPECTED[frame_len]
|
|
79
|
+
assert frame_len == expected_len
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
@pytest.mark.skip
|
|
83
|
+
def test_frame_padding_padding_length32():
|
|
84
|
+
EXPECTED = (
|
|
85
|
+
(0, 32),
|
|
86
|
+
(1, 32),
|
|
87
|
+
(2, 32),
|
|
88
|
+
(3, 32),
|
|
89
|
+
(4, 32),
|
|
90
|
+
(5, 32),
|
|
91
|
+
(6, 32),
|
|
92
|
+
(7, 32),
|
|
93
|
+
(8, 32),
|
|
94
|
+
(9, 32),
|
|
95
|
+
(10, 32),
|
|
96
|
+
(11, 32),
|
|
97
|
+
(12, 32),
|
|
98
|
+
(13, 32),
|
|
99
|
+
(14, 32),
|
|
100
|
+
(15, 32),
|
|
101
|
+
(16, 32),
|
|
102
|
+
(17, 32),
|
|
103
|
+
(18, 32),
|
|
104
|
+
(19, 32),
|
|
105
|
+
(20, 32),
|
|
106
|
+
(21, 32),
|
|
107
|
+
(22, 32),
|
|
108
|
+
(23, 32),
|
|
109
|
+
(24, 32),
|
|
110
|
+
(25, 32),
|
|
111
|
+
(26, 32),
|
|
112
|
+
(27, 32),
|
|
113
|
+
(28, 32),
|
|
114
|
+
(29, 32),
|
|
115
|
+
(30, 32),
|
|
116
|
+
(31, 32),
|
|
117
|
+
(32, 32),
|
|
118
|
+
(33, 48),
|
|
119
|
+
(34, 48),
|
|
120
|
+
(35, 48),
|
|
121
|
+
(36, 48),
|
|
122
|
+
(37, 48),
|
|
123
|
+
(38, 48),
|
|
124
|
+
(39, 48),
|
|
125
|
+
(40, 48),
|
|
126
|
+
(41, 48),
|
|
127
|
+
(42, 48),
|
|
128
|
+
(43, 48),
|
|
129
|
+
(44, 48),
|
|
130
|
+
(45, 48),
|
|
131
|
+
(46, 48),
|
|
132
|
+
(47, 48),
|
|
133
|
+
(48, 48),
|
|
134
|
+
(49, 64),
|
|
135
|
+
(50, 64),
|
|
136
|
+
(51, 64),
|
|
137
|
+
(52, 64),
|
|
138
|
+
(53, 64),
|
|
139
|
+
(54, 64),
|
|
140
|
+
(55, 64),
|
|
141
|
+
(56, 64),
|
|
142
|
+
(57, 64),
|
|
143
|
+
(58, 64),
|
|
144
|
+
(59, 64),
|
|
145
|
+
(60, 64),
|
|
146
|
+
(61, 64),
|
|
147
|
+
(62, 64),
|
|
148
|
+
(63, 64),
|
|
149
|
+
(64, 64),
|
|
150
|
+
)
|
|
151
|
+
for frame_len in range(65):
|
|
152
|
+
frame = bytes(frame_len)
|
|
153
|
+
padded_frame = pad_frame(frame, padding_value=0, pad_frame=True)
|
|
154
|
+
frame_len = len(padded_frame)
|
|
155
|
+
_, expected_len = EXPECTED[frame_len]
|
|
156
|
+
assert frame_len == expected_len
|