pyxcp 0.25.2__cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_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.
Files changed (151) 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 +0 -0
  18. pyxcp/asamkeydll.c +116 -0
  19. pyxcp/asamkeydll.sh +2 -0
  20. pyxcp/checksum.py +732 -0
  21. pyxcp/cmdline.py +83 -0
  22. pyxcp/config/__init__.py +1257 -0
  23. pyxcp/config/legacy.py +120 -0
  24. pyxcp/constants.py +47 -0
  25. pyxcp/cpp_ext/__init__.py +0 -0
  26. pyxcp/cpp_ext/aligned_buffer.hpp +168 -0
  27. pyxcp/cpp_ext/bin.hpp +105 -0
  28. pyxcp/cpp_ext/blockmem.hpp +58 -0
  29. pyxcp/cpp_ext/cpp_ext.cpython-310-x86_64-linux-gnu.so +0 -0
  30. pyxcp/cpp_ext/cpp_ext.cpython-311-x86_64-linux-gnu.so +0 -0
  31. pyxcp/cpp_ext/cpp_ext.cpython-312-x86_64-linux-gnu.so +0 -0
  32. pyxcp/cpp_ext/cpp_ext.cpython-313-x86_64-linux-gnu.so +0 -0
  33. pyxcp/cpp_ext/daqlist.hpp +374 -0
  34. pyxcp/cpp_ext/event.hpp +67 -0
  35. pyxcp/cpp_ext/extension_wrapper.cpp +131 -0
  36. pyxcp/cpp_ext/framing.hpp +360 -0
  37. pyxcp/cpp_ext/helper.hpp +280 -0
  38. pyxcp/cpp_ext/mcobject.hpp +248 -0
  39. pyxcp/cpp_ext/sxi_framing.hpp +332 -0
  40. pyxcp/cpp_ext/tsqueue.hpp +46 -0
  41. pyxcp/daq_stim/__init__.py +306 -0
  42. pyxcp/daq_stim/optimize/__init__.py +67 -0
  43. pyxcp/daq_stim/optimize/binpacking.py +41 -0
  44. pyxcp/daq_stim/scheduler.cpp +62 -0
  45. pyxcp/daq_stim/scheduler.hpp +75 -0
  46. pyxcp/daq_stim/stim.cpp +13 -0
  47. pyxcp/daq_stim/stim.cpython-310-x86_64-linux-gnu.so +0 -0
  48. pyxcp/daq_stim/stim.cpython-311-x86_64-linux-gnu.so +0 -0
  49. pyxcp/daq_stim/stim.cpython-312-x86_64-linux-gnu.so +0 -0
  50. pyxcp/daq_stim/stim.cpython-313-x86_64-linux-gnu.so +0 -0
  51. pyxcp/daq_stim/stim.hpp +604 -0
  52. pyxcp/daq_stim/stim_wrapper.cpp +50 -0
  53. pyxcp/dllif.py +100 -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/run_daq.py +165 -0
  63. pyxcp/examples/xcp_policy.py +60 -0
  64. pyxcp/examples/xcp_read_benchmark.py +38 -0
  65. pyxcp/examples/xcp_skel.py +48 -0
  66. pyxcp/examples/xcp_unlock.py +38 -0
  67. pyxcp/examples/xcp_user_supplied_driver.py +43 -0
  68. pyxcp/examples/xcphello.py +79 -0
  69. pyxcp/examples/xcphello_recorder.py +107 -0
  70. pyxcp/master/__init__.py +10 -0
  71. pyxcp/master/errorhandler.py +677 -0
  72. pyxcp/master/master.py +2645 -0
  73. pyxcp/py.typed +0 -0
  74. pyxcp/recorder/.idea/.gitignore +8 -0
  75. pyxcp/recorder/.idea/misc.xml +4 -0
  76. pyxcp/recorder/.idea/modules.xml +8 -0
  77. pyxcp/recorder/.idea/recorder.iml +6 -0
  78. pyxcp/recorder/.idea/sonarlint/issuestore/3/8/3808afc69ac1edb9d760000a2f137335b1b99728 +7 -0
  79. pyxcp/recorder/.idea/sonarlint/issuestore/9/a/9a2aa4db38d3115ed60da621e012c0efc0172aae +0 -0
  80. pyxcp/recorder/.idea/sonarlint/issuestore/b/4/b49006702b459496a8e8c94ebe60947108361b91 +0 -0
  81. pyxcp/recorder/.idea/sonarlint/issuestore/index.pb +7 -0
  82. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/3/8/3808afc69ac1edb9d760000a2f137335b1b99728 +0 -0
  83. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/9/a/9a2aa4db38d3115ed60da621e012c0efc0172aae +0 -0
  84. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/b/4/b49006702b459496a8e8c94ebe60947108361b91 +0 -0
  85. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/index.pb +7 -0
  86. pyxcp/recorder/.idea/vcs.xml +10 -0
  87. pyxcp/recorder/__init__.py +96 -0
  88. pyxcp/recorder/build_clang.cmd +1 -0
  89. pyxcp/recorder/build_clang.sh +2 -0
  90. pyxcp/recorder/build_gcc.cmd +1 -0
  91. pyxcp/recorder/build_gcc.sh +2 -0
  92. pyxcp/recorder/build_gcc_arm.sh +2 -0
  93. pyxcp/recorder/converter/__init__.py +445 -0
  94. pyxcp/recorder/lz4.c +2829 -0
  95. pyxcp/recorder/lz4.h +879 -0
  96. pyxcp/recorder/lz4hc.c +2041 -0
  97. pyxcp/recorder/lz4hc.h +413 -0
  98. pyxcp/recorder/mio.hpp +1714 -0
  99. pyxcp/recorder/reader.hpp +138 -0
  100. pyxcp/recorder/reco.py +278 -0
  101. pyxcp/recorder/recorder.rst +0 -0
  102. pyxcp/recorder/rekorder.cpp +59 -0
  103. pyxcp/recorder/rekorder.cpython-310-x86_64-linux-gnu.so +0 -0
  104. pyxcp/recorder/rekorder.cpython-311-x86_64-linux-gnu.so +0 -0
  105. pyxcp/recorder/rekorder.cpython-312-x86_64-linux-gnu.so +0 -0
  106. pyxcp/recorder/rekorder.cpython-313-x86_64-linux-gnu.so +0 -0
  107. pyxcp/recorder/rekorder.hpp +274 -0
  108. pyxcp/recorder/setup.py +41 -0
  109. pyxcp/recorder/test_reko.py +34 -0
  110. pyxcp/recorder/unfolder.hpp +1354 -0
  111. pyxcp/recorder/wrap.cpp +184 -0
  112. pyxcp/recorder/writer.hpp +302 -0
  113. pyxcp/scripts/__init__.py +0 -0
  114. pyxcp/scripts/pyxcp_probe_can_drivers.py +20 -0
  115. pyxcp/scripts/xcp_examples.py +64 -0
  116. pyxcp/scripts/xcp_fetch_a2l.py +40 -0
  117. pyxcp/scripts/xcp_id_scanner.py +18 -0
  118. pyxcp/scripts/xcp_info.py +144 -0
  119. pyxcp/scripts/xcp_profile.py +26 -0
  120. pyxcp/scripts/xmraw_converter.py +31 -0
  121. pyxcp/stim/__init__.py +0 -0
  122. pyxcp/tests/test_asam_types.py +24 -0
  123. pyxcp/tests/test_binpacking.py +186 -0
  124. pyxcp/tests/test_can.py +1324 -0
  125. pyxcp/tests/test_checksum.py +95 -0
  126. pyxcp/tests/test_daq.py +193 -0
  127. pyxcp/tests/test_daq_opt.py +426 -0
  128. pyxcp/tests/test_frame_padding.py +156 -0
  129. pyxcp/tests/test_framing.py +262 -0
  130. pyxcp/tests/test_master.py +2116 -0
  131. pyxcp/tests/test_transport.py +177 -0
  132. pyxcp/tests/test_utils.py +30 -0
  133. pyxcp/timing.py +60 -0
  134. pyxcp/transport/__init__.py +13 -0
  135. pyxcp/transport/base.py +484 -0
  136. pyxcp/transport/base_transport.hpp +0 -0
  137. pyxcp/transport/can.py +660 -0
  138. pyxcp/transport/eth.py +254 -0
  139. pyxcp/transport/sxi.py +209 -0
  140. pyxcp/transport/transport_ext.hpp +214 -0
  141. pyxcp/transport/transport_wrapper.cpp +249 -0
  142. pyxcp/transport/usb_transport.py +229 -0
  143. pyxcp/types.py +987 -0
  144. pyxcp/utils.py +127 -0
  145. pyxcp/vector/__init__.py +0 -0
  146. pyxcp/vector/map.py +82 -0
  147. pyxcp-0.25.2.dist-info/METADATA +341 -0
  148. pyxcp-0.25.2.dist-info/RECORD +151 -0
  149. pyxcp-0.25.2.dist-info/WHEEL +6 -0
  150. pyxcp-0.25.2.dist-info/entry_points.txt +9 -0
  151. pyxcp-0.25.2.dist-info/licenses/LICENSE +165 -0
pyxcp/__init__.py ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env python
2
+ """Universal Calibration Protocol for Python."""
3
+
4
+ from rich import pretty
5
+ from rich.console import Console
6
+ from rich.traceback import install as tb_install
7
+
8
+
9
+ pretty.install()
10
+
11
+ from .master import Master # noqa: F401, E402
12
+ from .transport import Can, Eth, SxI, Usb # noqa: F401, E402
13
+
14
+
15
+ console = Console()
16
+ tb_install(show_locals=True, max_frames=3) # Install custom exception handler.
17
+
18
+ # if you update this manually, do not forget to update
19
+ # .bumpversion.cfg and pyproject.toml.
20
+ __version__ = "0.25.2"
@@ -0,0 +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
@@ -0,0 +1,67 @@
1
+ /*******************************************************************/
2
+ /* */
3
+ /* ASAP2 Meta Language for CAN-Monitoring V1.1 */
4
+ /* Assumes ASAP2 V1.121 */
5
+ /* */
6
+ /* ETAS GmbH */
7
+ /* */
8
+ /* Datatypes: */
9
+ /* */
10
+ /* A2ML ASAP2 Windows Erlaeuuterung */
11
+ /* ------------------------------------------------------- */
12
+ /* uchar UBYTE BYTE unsigned 8 Bit */
13
+ /* char SBYTE char signed 8 Bit */
14
+ /* uint UWORD WORD unsigned integer 16 Bit */
15
+ /* int SWORD int signed integer 16 Bit */
16
+ /* ulong ULONG DWORD unsigned integer 32 Bit */
17
+ /* long SLONG LONG signed integer 32 Bit */
18
+ /* float FLOAT32_IEEE float 32 Bit */
19
+ /* */
20
+ /*******************************************************************/
21
+
22
+
23
+ taggedunion IF_DATA
24
+ {
25
+ "CAN_MONITORING" taggedstruct
26
+ {
27
+ block �TP_BLOB� struct
28
+ {
29
+ ulong; /* Baudrate in kBaud */
30
+ };
31
+ };
32
+ };
33
+
34
+
35
+
36
+
37
+ taggedunion IF_DATA
38
+ {
39
+ "CAN_MONITORING" taggedstruct
40
+ {
41
+ block "QP_BLOB" struct
42
+ {
43
+ long; /* Message identifier */
44
+ char; /* Identifier length */
45
+ char; /* Message length */
46
+ };
47
+ };
48
+ };
49
+
50
+ taggedunion IF_DATA
51
+ {
52
+ "CAN_MONITORING" taggedstruct {
53
+ block "KP_BLOB" struct {
54
+ char; /* Start bit */
55
+ char; /* Number of bits */
56
+ taggedstruct {
57
+ "MULTIPLEX" struct{
58
+ char; /* Start bit */
59
+ char; /* Number of bits */
60
+ char; /* Type and sign */
61
+ char; /* Byte order */
62
+ long; /* Tag */
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
@@ -0,0 +1,408 @@
1
+ /************************************************************************************/
2
+ /* */
3
+ /* ASAP2 meta language for XCP protocol layer V1.0 */
4
+ /* */
5
+ /* 2003-03-03 */
6
+ /* */
7
+ /* Vector Informatik, Schuermans */
8
+ /* */
9
+ /* Datatypes: */
10
+ /* */
11
+ /* A2ML ASAP2 Windows description */
12
+ /* ---------------------------------------------------------------------------------*/
13
+ /* uchar UBYTE BYTE unsigned 8 Bit */
14
+ /* char SBYTE char signed 8 Bit */
15
+ /* uint UWORD WORD unsigned integer 16 Bit */
16
+ /* int SWORD int signed integer 16 Bit */
17
+ /* ulong ULONG DWORD unsigned integer 32 Bit */
18
+ /* long SLONG LONG signed integer 32 Bit */
19
+ /* float FLOAT32_IEEE float 32 Bit */
20
+ /* */
21
+ /************************************************************************************/
22
+
23
+ /*********************** start of PROTOCOL_LAYER ****************************/
24
+
25
+ struct Protocol_Layer { /* At MODULE */
26
+ uint; /* XCP protocol layer version */
27
+ /* e.g. "1.0" = 0x0100 */
28
+ uint; /* T1 [ms] */
29
+ uint; /* T2 [ms] */
30
+ uint; /* T3 [ms] */
31
+ uint; /* T4 [ms] */
32
+ uint; /* T5 [ms] */
33
+ uint; /* T6 [ms] */
34
+ uint; /* T7 [ms] */
35
+ uchar; /* MAX_CTO */
36
+ uint; /* MAX_DTO */
37
+ enum { /* BYTE_ORDER */
38
+ "BYTE_ORDER_MSB_LAST" = 0,
39
+ "BYTE_ORDER_MSB_FIRST" = 1
40
+ };
41
+ enum { /* ADDRESS_GRANULARITY */
42
+ "ADDRESS_GRANULARITY_BYTE" = 1,
43
+ "ADDRESS_GRANULARITY_WORD" = 2,
44
+ "ADDRESS_GRANULARITY_DWORD" = 4
45
+ };
46
+
47
+ taggedstruct { /* optional */
48
+ ("OPTIONAL_CMD" enum { /* XCP-Code of optional command */
49
+ /* supported by the slave */
50
+ "GET_COMM_MODE_INFO" = 0xFB,
51
+ "GET_ID" = 0xFA,
52
+ "SET_REQUEST" = 0xF9,
53
+ "GET_SEED" = 0xF8,
54
+ "UNLOCK" = 0xF7,
55
+ "SET_MTA" = 0xF6,
56
+ "UPLOAD" = 0xF5,
57
+ "SHORT_UPLOAD" = 0xF4,
58
+ "BUILD_CHECKSUM" = 0xF3,
59
+ "TRANSPORT_LAYER_CMD" = 0xF2,
60
+ "USER_CMD" = 0xF1,
61
+ "DOWNLOAD" = 0xF0,
62
+ "DOWNLOAD_NEXT" = 0xEF,
63
+ "DOWNLOAD_MAX" = 0xEE,
64
+ "SHORT_DOWNLOAD" = 0xED,
65
+ "MODIFY_BITS" = 0xEC,
66
+ "SET_CAL_PAGE" = 0xEB,
67
+ "GET_CAL_PAGE" = 0xEA,
68
+ "GET_PAG_PROCESSOR_INFO" = 0xE9,
69
+ "GET_SEGMENT_INFO" = 0xE8,
70
+ "GET_PAGE_INFO" = 0xE7,
71
+ "SET_SEGMENT_MODE" = 0xE6,
72
+ "GET_SEGMENT_MODE" = 0xE5,
73
+ "COPY_CAL_PAGE" = 0xE4,
74
+ "CLEAR_DAQ_LIST" = 0xE3,
75
+ "SET_DAQ_PTR" = 0xE2,
76
+ "WRITE_DAQ" = 0xE1,
77
+ "SET_DAQ_LIST_MODE" = 0xE0,
78
+ "GET_DAQ_LIST_MODE" = 0xDF,
79
+ "START_STOP_DAQ_LIST" = 0xDE,
80
+ "START_STOP_SYNCH" = 0xDD,
81
+ "GET_DAQ_CLOCK" = 0xDC,
82
+ "READ_DAQ" = 0xDB,
83
+ "GET_DAQ_PROCESSOR_INFO" = 0xDA,
84
+ "GET_DAQ_RESOLUTION_INFO" = 0xD9,
85
+ "GET_DAQ_LIST_INFO" = 0xD8,
86
+ "GET_DAQ_EVENT_INFO" = 0xD7,
87
+ "FREE_DAQ" = 0xD6,
88
+ "ALLOC_DAQ" = 0xD5,
89
+ "ALLOC_ODT" = 0xD4,
90
+ "ALLOC_ODT_ENTRY" = 0xD3,
91
+ "PROGRAM_START" = 0xD2,
92
+ "PROGRAM_CLEAR" = 0xD1,
93
+ "PROGRAM" = 0xD0,
94
+ "PROGRAM_RESET" = 0xCF,
95
+ "GET_PGM_PROCESSOR_INFO" = 0xCE,
96
+ "GET_SECTOR_INFO" = 0xCD,
97
+ "PROGRAM_PREPARE" = 0xCC,
98
+ "PROGRAM_FORMAT" = 0xCB,
99
+ "PROGRAM_NEXT" = 0xCA,
100
+ "PROGRAM_MAX" = 0xC9,
101
+ "PROGRAM_VERIFY" = 0xC8,
102
+ "WRITE_DAQ_MULTIPLE" = 0xC7
103
+ })*;
104
+ �COMMUNICATION_MODE_SUPPORTED� taggedunion { /* optional modes supported */
105
+ � BLOCK� taggedstruct {
106
+ "SLAVE"; /* Slave Block Mode supported */
107
+ "MASTER" struct { /* Master Block Mode supported */
108
+ uchar; /* MAX_BS */
109
+ uchar; /* MIN_ST */
110
+ };
111
+ };
112
+ "INTERLEAVED" uchar; /* QUEUE_SIZE */
113
+ };
114
+ "SEED_AND_KEY_EXTERNAL_FUNCTION" char[256]; /* Name of the Seed&Key function */
115
+ /* including file extension */
116
+ /* without path */
117
+ };
118
+ };
119
+ /********************* end of PROTOCOL_LAYER *****************************/
120
+
121
+ /***************************** start of DAQ *********************************/
122
+ struct Daq { /* DAQ supported, at MODULE*/
123
+ enum { /* DAQ_CONFIG_TYPE */
124
+ "STATIC" = 0,
125
+ "DYNAMIC" = 1
126
+ };
127
+ uint; /* MAX_DAQ */
128
+ uint; /* MAX_EVENT_CHANNEL */
129
+ uchar; /* MIN_DAQ */
130
+ enum { /* OPTIMISATION_TYPE */
131
+ "OPTIMISATION_TYPE_DEFAULT" = 0,
132
+ "OPTIMISATION_TYPE_ODT_TYPE_16" = 1,
133
+ "OPTIMISATION_TYPE_ODT_TYPE_32" = 2,
134
+ "OPTIMISATION_TYPE_ODT_TYPE_64" = 3,
135
+ "OPTIMISATION_TYPE_ODT_TYPE_ALIGNMENT" = 4,
136
+ "OPTIMISATION_TYPE_MAX_ENTRY_SIZE" = 5
137
+ };
138
+ enum { /* ADDRESS_EXTENSION */
139
+ "ADDRESS_EXTENSION_FREE" = 0,
140
+ "ADDRESS_EXTENSION_ODT" = 1,
141
+ "ADDRESS_EXTENSION_DAQ" = 3
142
+ };
143
+ enum { /* IDENTIFICATION_FIELD */
144
+ "IDENTIFICATION_FIELD_TYPE_ABSOLUTE" = 0,
145
+ "IDENTIFICATION_FIELD_TYPE_RELATIVE_BYTE" = 1,
146
+ "IDENTIFICATION_FIELD_TYPE_RELATIVE_WORD" = 2,
147
+ "IDENTIFICATION_FIELD_TYPE_RELATIVE_WORD_ALIGNED" = 3
148
+ };
149
+ enum { /* GRANULARITY_ODT_ENTRY_SIZE_DAQ */
150
+ "GRANULARITY_ODT_ENTRY_SIZE_DAQ_BYTE" = 1,
151
+ "GRANULARITY_ODT_ENTRY_SIZE_DAQ_WORD" = 2,
152
+ "GRANULARITY_ODT_ENTRY_SIZE_DAQ_DWORD" = 4,
153
+ "GRANULARITY_ODT_ENTRY_SIZE_DAQ_DLONG" = 8
154
+ };
155
+ uchar; /* MAX_ODT_ENTRY_SIZE_DAQ */
156
+ enum { /* OVERLOAD_INDICATION */
157
+ "NO_OVERLOAD_INDICATION" = 0,
158
+ "OVERLOAD_INDICATION_PID" = 1,
159
+ "OVERLOAD_INDICATION_EVENT" = 2
160
+ };
161
+
162
+ taggedstruct { /* optional */
163
+ "DAQ_ALTERNATING_SUPPORTED" uint; /* Display_Event_Channel_Number */
164
+ "PRESCALER_SUPPORTED";
165
+ "RESUME_SUPPORTED";
166
+ "STORE_DAQ_SUPPORTED";
167
+ block "STIM" struct { /* STIM supported */
168
+ enum { /* GRANULARITY_ODT_ENTRY_SIZE_STIM */
169
+ "GRANULARITY_ODT_ENTRY_SIZE_STIM_BYTE" = 1,
170
+ "GRANULARITY_ODT_ENTRY_SIZE_STIM_WORD" = 2,
171
+ "GRANULARITY_ODT_ENTRY_SIZE_STIM_DWORD" = 4,
172
+ "GRANULARITY_ODT_ENTRY_SIZE_STIM_DLONG" = 8
173
+ };
174
+ uchar; /* MAX_ODT_ENTRY_SIZE_STIM */
175
+ taggedstruct { /* bitwise stimulation */
176
+ "BIT_STIM_SUPPORTED";
177
+ �MIN_ST_STIM� uchar; /* separation time between DTOs */
178
+ /* time in units of 100 microseconds */
179
+ };
180
+ };
181
+
182
+ block "TIMESTAMP_SUPPORTED" struct {
183
+ uint; /* TIMESTAMP_TICKS */
184
+ enum { /* TIMESTAMP_SIZE */
185
+ "NO_TIME_STAMP" = 0,
186
+ "SIZE_BYTE" = 1,
187
+ "SIZE_WORD" = 2,
188
+ "SIZE_DWORD" = 4
189
+ };
190
+ enum { /* RESOLUTION OF TIMESTAMP */
191
+ "UNIT_1NS" = 0,
192
+ "UNIT_10NS" = 1,
193
+ "UNIT_100NS" = 2,
194
+ "UNIT_1US" = 3,
195
+ "UNIT_10US" = 4,
196
+ "UNIT_100US" = 5,
197
+ "UNIT_1MS" = 6,
198
+ "UNIT_10MS" = 7,
199
+ "UNIT_100MS" = 8,
200
+ "UNIT_1S" = 9,
201
+ �UNIT_1PS� = 10,
202
+ �UNIT_10PS� = 11,
203
+ �UNIT_100PS� = 12
204
+ };
205
+
206
+ taggedstruct {
207
+ "TIMESTAMP_FIXED";
208
+ };
209
+ };
210
+ "PID_OFF_SUPPORTED";
211
+
212
+ /************************ start of DAQ_LIST *************************/
213
+ (block "DAQ_LIST" struct { /* DAQ_LIST */
214
+ /* multiple possible */
215
+ uint; /* DAQ_LIST_NUMBER */
216
+ taggedstruct { /* optional */
217
+ "DAQ_LIST_TYPE" enum {
218
+ "DAQ" = 1, /* DIRECTION = DAQ only */
219
+ "STIM" = 2, /* DIRECTION = STIM only */
220
+ "DAQ_STIM" = 3 /* both directions possible */
221
+ /* but not simultaneously */
222
+ };
223
+ "MAX_ODT" uchar; /* MAX_ODT */
224
+ "MAX_ODT_ENTRIES" uchar; /* MAX_ODT_ENTRIES */
225
+ "FIRST_PID" uchar; /* FIRST_PID for this DAQ_LIST */
226
+ "EVENT_FIXED" uint; /* this DAQ_LIST always */
227
+ /* in this event */
228
+ block "PREDEFINED" taggedstruct { /* predefined */
229
+ /* not configurable DAQ_LIST */
230
+ (block �ODT� struct {
231
+ uchar; /* ODT number */
232
+ taggedstruct {
233
+ (�ODT_ENTRY� struct {
234
+ uchar; /* ODT_ENTRY number */
235
+ ulong; /* address of element */
236
+ uchar; /* address extension of element */
237
+ uchar; /* size of element [AG] */
238
+ uchar; /* BIT_OFFSET */
239
+ })*;
240
+ }; /* end of ODT_ENTRY */
241
+ })*; /* end of ODT */
242
+ }; /* end of PREDEFINED */
243
+ };
244
+ })*;
245
+ /********************* end of DAQ_LIST ***************************/
246
+
247
+ /************************* start of EVENT ****************************/
248
+ (block "EVENT" struct { /* EVENT */
249
+ /* multiple possible */
250
+ char[101]; /* EVENT_CHANNEL_NAME */
251
+ char[9]; /* EVENT_CHANNEL_SHORT_NAME */
252
+ uint; /* EVENT_CHANNEL_NUMBER */
253
+ enum {
254
+ "DAQ" = 1, /* only DAQ_LISTs */
255
+ /* with DIRECTION = DAQ */
256
+ "STIM" = 2, /* only DAQ_LISTs */
257
+ /* with DIRECTION = STIM */
258
+ "DAQ_STIM" = 3 /* both kind of DAQ_LISTs */
259
+ };
260
+ uchar; /* MAX_DAQ_LIST */
261
+ uchar; /* EVENT_CHANNEL_TIME_CYCLE */
262
+ uchar; /* EVENT_CHANNEL_TIME_UNIT */
263
+ uchar; /* EVENT_CHANNEL_PRIORITY */
264
+ taggedstruct { /* optional */
265
+ �COMPLEMENTARY_BYPASS_EVENT_CHANNEL_NUMBER� uint;
266
+ �CONSISTENCY� enum {
267
+ �DAQ� = 0,
268
+ �EVENT� = 1
269
+ };
270
+ };
271
+ })*;
272
+ /******************** end of EVENT ********************************/
273
+ }; /*end of optional at DAQ */
274
+ };
275
+ /************************* end of DAQ *************************************/
276
+
277
+ /**************************** start of DAQ_EVENT *****************************/
278
+ taggedunion Daq_Event { /* at MEASUREMENT */
279
+ �FIXED_EVENT_LIST� taggedstruct {
280
+ (�EVENT� uint)* ;
281
+ };
282
+ �VARIABLE� taggedstruct {
283
+ block �AVAILABLE_EVENT_LIST� taggedstruct {
284
+ (�EVENT� uint)*;
285
+ };
286
+ block �DEFAULT_EVENT_LIST� taggedstruct {
287
+ (�EVENT� uint)*;
288
+ };
289
+ };
290
+ };
291
+ /************************* end of DAQ_EVENT *******************************/
292
+
293
+ /**************************** start of PAG ***********************************/
294
+ struct Pag { /* PAG supported, at MODULE */
295
+ uchar; /* MAX_SEGMENTS */
296
+ taggedstruct { /* optional */
297
+ "FREEZE_SUPPORTED";
298
+ };
299
+ };
300
+ /************************* end of PAG *************************************/
301
+
302
+ /**************************** start of PGM ***********************************/
303
+ struct Pgm { /* PGM supported, at MODULE */
304
+ enum {
305
+ "PGM_MODE_ABSOLUTE" = 1,
306
+ "PGM_MODE_FUNCTIONAL" = 2,
307
+ "PGM_MODE_ABSOLUTE_AND_FUNCTIONAL" = 3
308
+ };
309
+ uchar; /* MAX_SECTORS */
310
+ uchar; /* MAX_CTO_PGM */
311
+ taggedstruct { /* optional */
312
+ (block "SECTOR" struct { /* SECTOR */
313
+ /* multiple possible */
314
+ char[101]; /* SECTOR_NAME */
315
+ uchar; /* SECTOR_NUMBER */
316
+ ulong; /* Address */
317
+ ulong; /* Length */
318
+ uchar; /* CLEAR_SEQUENCE_NUMBER */
319
+ uchar; /* PROGRAM_SEQUENCE_NUMBER */
320
+ uchar; /* PROGRAM_METHOD */
321
+ })*; /* end of SECTOR */
322
+ �COMMUNICATION_MODE_SUPPORTED� taggedunion { /* optional modes supported */
323
+ � BLOCK� taggedstruct {
324
+ "SLAVE"; /* Slave Block Mode supported */
325
+ "MASTER" struct { /* Master Block Mode supported */
326
+ uchar; /* MAX_BS_PGM */
327
+ uchar; /* MIN_ST_PGM */
328
+ };
329
+ };
330
+ "INTERLEAVED" uchar; /* QUEUE_SIZE_PGM */
331
+ };
332
+ };
333
+ };
334
+ /************************** end of PGM *************************************/
335
+
336
+ /***************************** start of SEGMENT *******************************/
337
+ struct Segment { /* at MEMORY_SEGMENT */
338
+ uchar; /* SEGMENT_NUMBER */
339
+ uchar; /* number of pages */
340
+ uchar; /* ADDRESS_EXTENSION */
341
+ uchar; /* COMPRESSION_METHOD */
342
+ uchar; /* ENCRYPTION_METHOD */
343
+ taggedstruct { /* optional */
344
+ block "CHECKSUM" struct {
345
+ enum { /* checksum type */
346
+ "XCP_ADD_11" = 1,
347
+ "XCP_ADD_12" = 2,
348
+ "XCP_ADD_14" = 3,
349
+ "XCP_ADD_22" = 4,
350
+ "XCP_ADD_24" = 5,
351
+ "XCP_ADD_44" = 6,
352
+ "XCP_CRC_16" = 7,
353
+ "XCP_CRC_16_CITT" = 8,
354
+ "XCP_CRC_32" = 9,
355
+ "XCP_USER_DEFINED" = 255
356
+ };
357
+ taggedstruct {
358
+ "MAX_BLOCK_SIZE" ulong ; /* maximum block size */
359
+ /* for checksum calculation */
360
+ "EXTERNAL_FUNCTION" char[256]; /* Name of the Checksum function */
361
+ /* including file extension */
362
+ /* without path */
363
+ };
364
+ };
365
+ (block "PAGE" struct { /* PAGES for this SEGMENT */
366
+ /* multiple possible */
367
+ uchar; /* PAGE_NUMBER */
368
+ enum { /* ECU_ACCESS_TYPE */
369
+ "ECU_ACCESS_NOT_ALLOWED" = 0,
370
+ "ECU_ACCESS_WITHOUT_XCP_ONLY" =1,
371
+ "ECU_ACCESS_WITH_XCP_ONLY" = 2,
372
+ "ECU_ACCESS_DONT_CARE" = 3
373
+ };
374
+ enum { /* XCP_READ_ACCESS_TYPE */
375
+ "XCP_READ_ACCESS_NOT_ALLOWED" = 0,
376
+ "XCP_READ_ACCESS_WITHOUT_ECU_ONLY" = 1,
377
+ "XCP_READ_ACCESS_WITH_ECU_ONLY" = 2,
378
+ �XCP_READ_ACCESS_DONT_CARE" = 3
379
+ };
380
+ enum { /* XCP_WRITE_ACCESS_TYPE */
381
+ "XCP_WRITE_ACCESS_NOT_ALLOWED" = 0,
382
+ "XCP_WRITE_ACCESS_WITHOUT_ECU_ONLY" = 1,
383
+ "XCP_WRITE_ACCESS_WITH_ECU_ONLY" = 2,
384
+ "XCP_WRITE_ACCESS_DONT_CARE" = 3
385
+ };
386
+ taggedstruct {
387
+ "INIT_SEGMENT" uchar; /* references segment that initialises this page */
388
+ };
389
+ })*; /* end of PAGE */
390
+ (block "ADDRESS_MAPPING" struct { /* multiple possible */
391
+ ulong; /* source address */
392
+ ulong; /* destination address */
393
+ ulong; /* length */
394
+ })*;
395
+ "PGM_VERIFY" ulong; /* verification value for PGM */
396
+ }; /* end of optional */
397
+ };
398
+ /************************** end of SEGMENT *********************************/
399
+
400
+ /*********************** start of Common Parameters ***************************/
401
+ taggedstruct Common_Parameters {
402
+ block "PROTOCOL_LAYER" struct Protocol_Layer;
403
+ block "SEGMENT" struct Segment;
404
+ block "DAQ" struct Daq;
405
+ block "PAG" struct Pag;
406
+ block "PGM" struct Pgm;
407
+ block "DAQ_EVENT" taggedunion Daq_Event;
408
+ }; /******************** end of Common Parameters *****************************/
pyxcp/aml/XCPonCAN.aml ADDED
@@ -0,0 +1,78 @@
1
+ /************************************************************************************/
2
+ /* */
3
+ /* ASAP2 meta language for XCP on CAN V1.0 */
4
+ /* */
5
+ /* 2003-03-03 */
6
+ /* */
7
+ /* Vector Informatik, Schuermans */
8
+ /* */
9
+ /* Datatypes: */
10
+ /* */
11
+ /* A2ML ASAP2 Windows description */
12
+ /* ---------------------------------------------------------------------------------*/
13
+ /* uchar UBYTE BYTE unsigned 8 Bit */
14
+ /* char SBYTE char signed 8 Bit */
15
+ /* uint UWORD WORD unsigned integer 16 Bit */
16
+ /* int SWORD int signed integer 16 Bit */
17
+ /* ulong ULONG DWORD unsigned integer 32 Bit */
18
+ /* long SLONG LONG signed integer 32 Bit */
19
+ /* float FLOAT32_IEEE float 32 Bit */
20
+ /* */
21
+ /************************************************************************************/
22
+
23
+ /************************ start of CAN **********************************************/
24
+
25
+ struct CAN_Parameters { /* At MODULE */
26
+ uint; /* XCP on CAN version */
27
+ /* e.g. "1.0" = 0x0100 */
28
+ taggedstruct { /* optional */
29
+ "CAN_ID_BROADCAST"� ulong; /* Auto detection CAN-ID */
30
+
31
+ /* master -> slaves */
32
+ /* Bit31= 1: extended identifier */
33
+ "CAN_ID_MASTER"� ulong; /* CMD/STIM CAN-ID */
34
+
35
+ /* master -> slave */
36
+ /* Bit31= 1: extended identifier */
37
+ "CAN_ID_MASTER_INCREMENTAL"; /* master uses range of CAN-IDs */
38
+
39
+ /* start of range = CAN_ID_MASTER */
40
+ /* end of range = CAN_ID_MASTER+MAX_BS(_PGM)-1 */
41
+ "CAN_ID_SLAVE"� ulong; /* RES/ERR/EV/SERV/DAQ CAN-ID */
42
+
43
+ /* slave -> master */
44
+ /* Bit31= 1: extended identifier */
45
+ "BAUDRATE"� ulong; /* BAUDRATE [Hz] */
46
+ "SAMPLE_POINT" uchar; /* sample point */
47
+
48
+ /* [% complete bit time] */
49
+ "SAMPLE_RATE"� enum {
50
+ "SINGLE" = 1, /* 1 sample per bit */
51
+ "TRIPLE" = 3 /* 3 samples per bit */
52
+ };
53
+ "BTL_CYCLES" uchar; /* BTL_CYCLES */
54
+
55
+ /* [slots per bit time] */
56
+ "SJW" uchar; /* length synchr. segment */
57
+
58
+ /* [BTL_CYCLES] */
59
+ "SYNC_EDGE" enum {
60
+ "SINGLE" = 1, /* on falling edge only */
61
+ "DUAL" = 2 /* on falling and rising edge */
62
+ };
63
+ "MAX_DLC_REQUIRED"�; /* master to slave frames */
64
+
65
+ /* always to have DLC = MAX_DLC = 8 */
66
+ (block "DAQ_LIST_CAN_ID"� struct { /* At IF_DATA DAQ */
67
+ uint; /* reference to DAQ_LIST_NUMBER */
68
+ taggedstruct { /* exclusive tags */
69
+ /* either VARIABLE or FIXED */
70
+ "VARIABLE";
71
+ "FIXED" ulong; /* this DAQ_LIST always */
72
+ /* on this CAN_ID */
73
+ };
74
+ })*;
75
+ };
76
+ };
77
+
78
+ /************************* end of CAN ***********************************/