pyxcp 0.22.2__cp313-cp313-win_amd64.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.

Files changed (140) hide show
  1. pyxcp/__init__.py +20 -0
  2. pyxcp/aml/EtasCANMonitoring.a2l +82 -0
  3. pyxcp/aml/EtasCANMonitoring.aml +67 -0
  4. pyxcp/aml/XCP_Common.aml +408 -0
  5. pyxcp/aml/XCPonCAN.aml +78 -0
  6. pyxcp/aml/XCPonEth.aml +33 -0
  7. pyxcp/aml/XCPonFlx.aml +113 -0
  8. pyxcp/aml/XCPonSxI.aml +66 -0
  9. pyxcp/aml/XCPonUSB.aml +106 -0
  10. pyxcp/aml/ifdata_CAN.a2l +20 -0
  11. pyxcp/aml/ifdata_Eth.a2l +11 -0
  12. pyxcp/aml/ifdata_Flx.a2l +94 -0
  13. pyxcp/aml/ifdata_SxI.a2l +13 -0
  14. pyxcp/aml/ifdata_USB.a2l +81 -0
  15. pyxcp/asam/__init__.py +0 -0
  16. pyxcp/asam/types.py +131 -0
  17. pyxcp/asamkeydll.c +116 -0
  18. pyxcp/asamkeydll.sh +2 -0
  19. pyxcp/checksum.py +722 -0
  20. pyxcp/cmdline.py +52 -0
  21. pyxcp/config/__init__.py +1089 -0
  22. pyxcp/config/legacy.py +120 -0
  23. pyxcp/constants.py +47 -0
  24. pyxcp/cpp_ext/__init__.py +8 -0
  25. pyxcp/cpp_ext/bin.hpp +104 -0
  26. pyxcp/cpp_ext/blockmem.hpp +58 -0
  27. pyxcp/cpp_ext/cpp_ext.cp310-win_amd64.pyd +0 -0
  28. pyxcp/cpp_ext/cpp_ext.cp311-win_amd64.pyd +0 -0
  29. pyxcp/cpp_ext/cpp_ext.cp312-win_amd64.pyd +0 -0
  30. pyxcp/cpp_ext/cpp_ext.cp313-win_amd64.pyd +0 -0
  31. pyxcp/cpp_ext/cpp_ext.cp38-win_amd64.pyd +0 -0
  32. pyxcp/cpp_ext/cpp_ext.cp39-win_amd64.pyd +0 -0
  33. pyxcp/cpp_ext/daqlist.hpp +197 -0
  34. pyxcp/cpp_ext/event.hpp +67 -0
  35. pyxcp/cpp_ext/extension_wrapper.cpp +94 -0
  36. pyxcp/cpp_ext/helper.hpp +264 -0
  37. pyxcp/cpp_ext/mcobject.hpp +241 -0
  38. pyxcp/cpp_ext/tsqueue.hpp +46 -0
  39. pyxcp/daq_stim/__init__.py +226 -0
  40. pyxcp/daq_stim/optimize/__init__.py +67 -0
  41. pyxcp/daq_stim/optimize/binpacking.py +41 -0
  42. pyxcp/daq_stim/scheduler.cpp +28 -0
  43. pyxcp/daq_stim/scheduler.hpp +75 -0
  44. pyxcp/daq_stim/stim.cp310-win_amd64.pyd +0 -0
  45. pyxcp/daq_stim/stim.cp311-win_amd64.pyd +0 -0
  46. pyxcp/daq_stim/stim.cp312-win_amd64.pyd +0 -0
  47. pyxcp/daq_stim/stim.cp313-win_amd64.pyd +0 -0
  48. pyxcp/daq_stim/stim.cp38-win_amd64.pyd +0 -0
  49. pyxcp/daq_stim/stim.cp39-win_amd64.pyd +0 -0
  50. pyxcp/daq_stim/stim.cpp +13 -0
  51. pyxcp/daq_stim/stim.hpp +604 -0
  52. pyxcp/daq_stim/stim_wrapper.cpp +48 -0
  53. pyxcp/dllif.py +95 -0
  54. pyxcp/errormatrix.py +878 -0
  55. pyxcp/examples/conf_can.toml +19 -0
  56. pyxcp/examples/conf_can_user.toml +16 -0
  57. pyxcp/examples/conf_can_vector.json +11 -0
  58. pyxcp/examples/conf_can_vector.toml +11 -0
  59. pyxcp/examples/conf_eth.toml +9 -0
  60. pyxcp/examples/conf_nixnet.json +20 -0
  61. pyxcp/examples/conf_socket_can.toml +12 -0
  62. pyxcp/examples/conf_sxi.json +9 -0
  63. pyxcp/examples/conf_sxi.toml +7 -0
  64. pyxcp/examples/ex_arrow.py +109 -0
  65. pyxcp/examples/ex_mdf.py +124 -0
  66. pyxcp/examples/ex_sqlite.py +128 -0
  67. pyxcp/examples/run_daq.py +146 -0
  68. pyxcp/examples/xcp_policy.py +60 -0
  69. pyxcp/examples/xcp_read_benchmark.py +38 -0
  70. pyxcp/examples/xcp_skel.py +49 -0
  71. pyxcp/examples/xcp_unlock.py +38 -0
  72. pyxcp/examples/xcp_user_supplied_driver.py +54 -0
  73. pyxcp/examples/xcphello.py +79 -0
  74. pyxcp/examples/xcphello_recorder.py +107 -0
  75. pyxcp/master/__init__.py +9 -0
  76. pyxcp/master/errorhandler.py +436 -0
  77. pyxcp/master/master.py +2029 -0
  78. pyxcp/py.typed +0 -0
  79. pyxcp/recorder/__init__.py +102 -0
  80. pyxcp/recorder/build_clang.cmd +1 -0
  81. pyxcp/recorder/build_clang.sh +2 -0
  82. pyxcp/recorder/build_gcc.cmd +1 -0
  83. pyxcp/recorder/build_gcc.sh +2 -0
  84. pyxcp/recorder/build_gcc_arm.sh +2 -0
  85. pyxcp/recorder/converter/__init__.py +37 -0
  86. pyxcp/recorder/lz4.c +2829 -0
  87. pyxcp/recorder/lz4.h +879 -0
  88. pyxcp/recorder/lz4hc.c +2041 -0
  89. pyxcp/recorder/lz4hc.h +413 -0
  90. pyxcp/recorder/mio.hpp +1714 -0
  91. pyxcp/recorder/reader.hpp +139 -0
  92. pyxcp/recorder/reco.py +277 -0
  93. pyxcp/recorder/recorder.rst +0 -0
  94. pyxcp/recorder/rekorder.cp310-win_amd64.pyd +0 -0
  95. pyxcp/recorder/rekorder.cp311-win_amd64.pyd +0 -0
  96. pyxcp/recorder/rekorder.cp312-win_amd64.pyd +0 -0
  97. pyxcp/recorder/rekorder.cp313-win_amd64.pyd +0 -0
  98. pyxcp/recorder/rekorder.cp38-win_amd64.pyd +0 -0
  99. pyxcp/recorder/rekorder.cp39-win_amd64.pyd +0 -0
  100. pyxcp/recorder/rekorder.cpp +59 -0
  101. pyxcp/recorder/rekorder.hpp +274 -0
  102. pyxcp/recorder/setup.py +41 -0
  103. pyxcp/recorder/test_reko.py +34 -0
  104. pyxcp/recorder/unfolder.hpp +1249 -0
  105. pyxcp/recorder/wrap.cpp +189 -0
  106. pyxcp/recorder/writer.hpp +302 -0
  107. pyxcp/scripts/__init__.py +0 -0
  108. pyxcp/scripts/pyxcp_probe_can_drivers.py +20 -0
  109. pyxcp/scripts/xcp_fetch_a2l.py +40 -0
  110. pyxcp/scripts/xcp_id_scanner.py +19 -0
  111. pyxcp/scripts/xcp_info.py +109 -0
  112. pyxcp/scripts/xcp_profile.py +27 -0
  113. pyxcp/stim/__init__.py +0 -0
  114. pyxcp/tests/test_asam_types.py +24 -0
  115. pyxcp/tests/test_binpacking.py +184 -0
  116. pyxcp/tests/test_can.py +1324 -0
  117. pyxcp/tests/test_checksum.py +95 -0
  118. pyxcp/tests/test_daq.py +188 -0
  119. pyxcp/tests/test_frame_padding.py +153 -0
  120. pyxcp/tests/test_master.py +2006 -0
  121. pyxcp/tests/test_transport.py +64 -0
  122. pyxcp/tests/test_utils.py +30 -0
  123. pyxcp/timing.py +60 -0
  124. pyxcp/transport/__init__.py +10 -0
  125. pyxcp/transport/base.py +436 -0
  126. pyxcp/transport/base_transport.hpp +0 -0
  127. pyxcp/transport/can.py +443 -0
  128. pyxcp/transport/eth.py +219 -0
  129. pyxcp/transport/sxi.py +133 -0
  130. pyxcp/transport/transport_wrapper.cpp +0 -0
  131. pyxcp/transport/usb_transport.py +213 -0
  132. pyxcp/types.py +993 -0
  133. pyxcp/utils.py +102 -0
  134. pyxcp/vector/__init__.py +0 -0
  135. pyxcp/vector/map.py +82 -0
  136. pyxcp-0.22.2.dist-info/LICENSE +165 -0
  137. pyxcp-0.22.2.dist-info/METADATA +107 -0
  138. pyxcp-0.22.2.dist-info/RECORD +140 -0
  139. pyxcp-0.22.2.dist-info/WHEEL +4 -0
  140. pyxcp-0.22.2.dist-info/entry_points.txt +7 -0
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env python
2
+ """Create / convert pyxcp profiles (configurations).
3
+ """
4
+
5
+ import sys
6
+
7
+ from pyxcp.cmdline import ArgumentParser
8
+
9
+
10
+ def main():
11
+ if len(sys.argv) == 1:
12
+ sys.argv.append("profile")
13
+ elif len(sys.argv) >= 2 and sys.argv[1] != "profile":
14
+ sys.argv.insert(1, "profile")
15
+
16
+ ap = ArgumentParser(description="Create / convert pyxcp profiles (configurations).")
17
+
18
+ try:
19
+ with ap.run() as x: # noqa: F841
20
+ pass
21
+ except FileNotFoundError as e:
22
+ print(f"Error: {e}")
23
+ sys.exit(1)
24
+
25
+
26
+ if __name__ == "__main__":
27
+ main()
pyxcp/stim/__init__.py ADDED
File without changes
@@ -0,0 +1,24 @@
1
+ import pytest
2
+
3
+ from pyxcp.asam import types
4
+
5
+
6
+ def testEncodeUint32_0():
7
+ assert types.A_Uint32("<").encode(3415750566) == b"\xa67\x98\xcb"
8
+
9
+
10
+ def testDecodeUint32_0():
11
+ assert types.A_Uint32("<").decode((0xA6, 0x37, 0x98, 0xCB)) == 3415750566
12
+
13
+
14
+ def testLittleEndian():
15
+ assert isinstance(types.AsamBaseType(types.INTEL), types.AsamBaseType)
16
+
17
+
18
+ def testBigEndian():
19
+ assert isinstance(types.AsamBaseType(types.MOTOROLA), types.AsamBaseType)
20
+
21
+
22
+ def testInvalidByteOrderRaisesTypeError():
23
+ with pytest.raises(ValueError):
24
+ types.AsamBaseType("#")
@@ -0,0 +1,184 @@
1
+ import pytest
2
+
3
+ from pyxcp.daq_stim.optimize import McObject, make_continuous_blocks
4
+ from pyxcp.daq_stim.optimize.binpacking import Bin, first_fit_decreasing
5
+
6
+
7
+ @pytest.fixture
8
+ def blocks():
9
+ return [
10
+ McObject(name="", address=0x000E10BA, length=2),
11
+ McObject(name="", address=0x000E10BE, length=2),
12
+ McObject(name="", address=0x000E41F4, length=4),
13
+ McObject(name="", address=0x000E51FC, length=4),
14
+ McObject(name="", address=0x00125288, length=4),
15
+ McObject(name="", address=0x00125294, length=4),
16
+ McObject(name="", address=0x001252A1, length=1),
17
+ McObject(name="", address=0x001252A4, length=4),
18
+ McObject(name="", address=0x00125438, length=3),
19
+ McObject(name="", address=0x0012543C, length=1),
20
+ ]
21
+
22
+
23
+ def test_pack_to_single_bin(blocks):
24
+ BIN_SIZE = 253
25
+ bins = first_fit_decreasing(items=blocks, bin_size=BIN_SIZE)
26
+
27
+ assert len(bins) == 1
28
+ bin0 = bins[0]
29
+ assert bin0.residual_capacity == BIN_SIZE - 29
30
+ assert bin0.entries == [
31
+ McObject(name="", address=0x000E41F4, length=4),
32
+ McObject(name="", address=0x000E51FC, length=4),
33
+ McObject(name="", address=0x00125288, length=4),
34
+ McObject(name="", address=0x00125294, length=4),
35
+ McObject(name="", address=0x001252A4, length=4),
36
+ McObject(name="", address=0x00125438, length=3),
37
+ McObject(name="", address=0x000E10BA, length=2),
38
+ McObject(name="", address=0x000E10BE, length=2),
39
+ McObject(name="", address=0x001252A1, length=1),
40
+ McObject(name="", address=0x0012543C, length=1),
41
+ ]
42
+
43
+
44
+ def test_pack_empty_block_set():
45
+ BIN_SIZE = 253
46
+ bins = first_fit_decreasing(items=[], bin_size=BIN_SIZE)
47
+ assert bins == [Bin(size=BIN_SIZE)]
48
+
49
+
50
+ def test_pack_to_multiple_bins1(blocks):
51
+ BIN_SIZE = 6
52
+ bins = first_fit_decreasing(items=blocks, bin_size=BIN_SIZE)
53
+ assert len(bins) == 6
54
+ bin0, bin1, bin2, bin3, bin4, bin5 = bins
55
+ assert bin0.residual_capacity == 0
56
+ assert bin0.entries == [
57
+ McObject(name="", address=0x000E41F4, length=4),
58
+ McObject(name="", address=0x000E10BA, length=2),
59
+ ]
60
+ assert bin1.residual_capacity == 0
61
+ assert bin1.entries == [
62
+ McObject(name="", address=0x000E51FC, length=4),
63
+ McObject(name="", address=0x000E10BE, length=2),
64
+ ]
65
+ assert bin2.residual_capacity == 0
66
+ assert bin2.entries == [
67
+ McObject(name="", address=0x00125288, length=4),
68
+ McObject(name="", address=0x001252A1, length=1),
69
+ McObject(name="", address=0x0012543C, length=1),
70
+ ]
71
+ assert bin3.residual_capacity == 2
72
+ assert bin3.entries == [McObject(name="", address=0x00125294, length=4)]
73
+ assert bin4.residual_capacity == 2
74
+ assert bin4.entries == [McObject(name="", address=0x001252A4, length=4)]
75
+ assert bin5.residual_capacity == 3
76
+ assert bin5.entries == [McObject(name="", address=0x00125438, length=3)]
77
+
78
+
79
+ def test_binpacking_raises(blocks):
80
+ BIN_SIZE = 7
81
+ with pytest.raises(ValueError):
82
+ first_fit_decreasing(items=[McObject(name="", address=0x1000, length=32)], bin_size=BIN_SIZE)
83
+
84
+
85
+ def test_binpacking_works(blocks):
86
+ BIN_SIZE = 7
87
+ first_fit_decreasing(items=[McObject(name="", address=0x1000, length=7)], bin_size=BIN_SIZE)
88
+
89
+
90
+ def test_make_continuous_blocks1():
91
+ BLOCKS = [
92
+ McObject(name="", address=0x000E0002, length=2),
93
+ McObject(name="", address=0x000E0008, ext=23, length=4),
94
+ McObject(name="", address=0x000E0004, length=4),
95
+ McObject(name="", address=0x000E000C, ext=23, length=4),
96
+ McObject(name="", address=0x000E0000, length=2),
97
+ ]
98
+ bins = make_continuous_blocks(chunks=BLOCKS)
99
+ assert bins == [
100
+ McObject(
101
+ name="",
102
+ address=917504,
103
+ ext=0,
104
+ length=8,
105
+ components=[
106
+ McObject(name="", address=917504, ext=0, length=2, components=[]),
107
+ McObject(name="", address=917506, ext=0, length=2, components=[]),
108
+ McObject(name="", address=917508, ext=0, length=4, components=[]),
109
+ ],
110
+ ),
111
+ McObject(
112
+ name="",
113
+ address=917512,
114
+ ext=23,
115
+ length=8,
116
+ components=[
117
+ McObject(name="", address=917512, ext=23, length=4, components=[]),
118
+ McObject(name="", address=917516, ext=23, length=4, components=[]),
119
+ ],
120
+ ),
121
+ ]
122
+
123
+
124
+ def test_make_continuous_blocks2():
125
+ BLOCKS = [
126
+ McObject(name="", address=0x000E0002, length=2),
127
+ McObject(name="", address=0x000E0008, length=4),
128
+ McObject(name="", address=0x000E0004, length=4),
129
+ McObject(name="", address=0x000E000C, length=4),
130
+ McObject(name="", address=0x000E0000, length=2),
131
+ ]
132
+ bins = make_continuous_blocks(chunks=BLOCKS)
133
+ assert bins == [
134
+ McObject(
135
+ name="",
136
+ address=917504,
137
+ ext=0,
138
+ length=16,
139
+ components=[
140
+ McObject(name="", address=917504, ext=0, length=2, components=[]),
141
+ McObject(name="", address=917506, ext=0, length=2, components=[]),
142
+ McObject(name="", address=917508, ext=0, length=4, components=[]),
143
+ McObject(name="", address=917512, ext=0, length=4, components=[]),
144
+ McObject(name="", address=917516, ext=0, length=4, components=[]),
145
+ ],
146
+ )
147
+ ]
148
+
149
+
150
+ def test_make_continuous_blocks3():
151
+ BLOCKS = [
152
+ McObject(name="", address=0x000E0002, ext=0x01, length=2),
153
+ McObject(name="", address=0x000E0008, ext=0x03, length=4),
154
+ McObject(name="", address=0x000E0004, ext=0x02, length=4),
155
+ McObject(name="", address=0x000E000C, ext=0x04, length=4),
156
+ McObject(name="", address=0x000E0000, ext=0x00, length=2),
157
+ ]
158
+ bins = make_continuous_blocks(chunks=BLOCKS)
159
+ assert bins == [
160
+ McObject(
161
+ name="", address=917504, ext=0, length=2, components=[McObject(name="", address=917504, ext=0, length=2, components=[])]
162
+ ),
163
+ McObject(
164
+ name="", address=917506, ext=1, length=2, components=[McObject(name="", address=917506, ext=1, length=2, components=[])]
165
+ ),
166
+ McObject(
167
+ name="", address=917508, ext=2, length=4, components=[McObject(name="", address=917508, ext=2, length=4, components=[])]
168
+ ),
169
+ McObject(
170
+ name="", address=917512, ext=3, length=4, components=[McObject(name="", address=917512, ext=3, length=4, components=[])]
171
+ ),
172
+ McObject(
173
+ name="", address=917516, ext=4, length=4, components=[McObject(name="", address=917516, ext=4, length=4, components=[])]
174
+ ),
175
+ ]
176
+
177
+
178
+ def test_mc_object_len_zero():
179
+ with pytest.raises(ValueError):
180
+ McObject(name="", address=0, ext=0, length=0)
181
+
182
+
183
+ def test_mc_object_ok():
184
+ McObject(name="", address=0, ext=0, length=1)