pyxcp 0.25.5__cp312-cp312-macosx_11_0_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.
Files changed (153) 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 +71 -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-darwin.so +0 -0
  30. pyxcp/cpp_ext/cpp_ext.cpython-311-darwin.so +0 -0
  31. pyxcp/cpp_ext/cpp_ext.cpython-312-darwin.so +0 -0
  32. pyxcp/cpp_ext/daqlist.hpp +374 -0
  33. pyxcp/cpp_ext/event.hpp +67 -0
  34. pyxcp/cpp_ext/extension_wrapper.cpp +208 -0
  35. pyxcp/cpp_ext/framing.hpp +360 -0
  36. pyxcp/cpp_ext/helper.hpp +280 -0
  37. pyxcp/cpp_ext/mcobject.hpp +248 -0
  38. pyxcp/cpp_ext/sxi_framing.hpp +332 -0
  39. pyxcp/cpp_ext/tsqueue.hpp +46 -0
  40. pyxcp/daq_stim/__init__.py +291 -0
  41. pyxcp/daq_stim/optimize/__init__.py +67 -0
  42. pyxcp/daq_stim/optimize/binpacking.py +41 -0
  43. pyxcp/daq_stim/scheduler.cpp +62 -0
  44. pyxcp/daq_stim/scheduler.hpp +75 -0
  45. pyxcp/daq_stim/stim.cpp +13 -0
  46. pyxcp/daq_stim/stim.cpython-310-darwin.so +0 -0
  47. pyxcp/daq_stim/stim.cpython-311-darwin.so +0 -0
  48. pyxcp/daq_stim/stim.cpython-312-darwin.so +0 -0
  49. pyxcp/daq_stim/stim.hpp +604 -0
  50. pyxcp/daq_stim/stim_wrapper.cpp +50 -0
  51. pyxcp/dllif.py +100 -0
  52. pyxcp/errormatrix.py +878 -0
  53. pyxcp/examples/conf_can.toml +19 -0
  54. pyxcp/examples/conf_can_user.toml +16 -0
  55. pyxcp/examples/conf_can_vector.json +11 -0
  56. pyxcp/examples/conf_can_vector.toml +11 -0
  57. pyxcp/examples/conf_eth.toml +9 -0
  58. pyxcp/examples/conf_nixnet.json +20 -0
  59. pyxcp/examples/conf_socket_can.toml +12 -0
  60. pyxcp/examples/run_daq.py +165 -0
  61. pyxcp/examples/xcp_policy.py +60 -0
  62. pyxcp/examples/xcp_read_benchmark.py +38 -0
  63. pyxcp/examples/xcp_skel.py +48 -0
  64. pyxcp/examples/xcp_unlock.py +36 -0
  65. pyxcp/examples/xcp_user_supplied_driver.py +43 -0
  66. pyxcp/examples/xcphello.py +65 -0
  67. pyxcp/examples/xcphello_recorder.py +107 -0
  68. pyxcp/master/__init__.py +10 -0
  69. pyxcp/master/errorhandler.py +677 -0
  70. pyxcp/master/master.py +2641 -0
  71. pyxcp/py.typed +0 -0
  72. pyxcp/recorder/.idea/.gitignore +8 -0
  73. pyxcp/recorder/.idea/misc.xml +4 -0
  74. pyxcp/recorder/.idea/modules.xml +8 -0
  75. pyxcp/recorder/.idea/recorder.iml +6 -0
  76. pyxcp/recorder/.idea/sonarlint/issuestore/3/8/3808afc69ac1edb9d760000a2f137335b1b99728 +7 -0
  77. pyxcp/recorder/.idea/sonarlint/issuestore/9/a/9a2aa4db38d3115ed60da621e012c0efc0172aae +0 -0
  78. pyxcp/recorder/.idea/sonarlint/issuestore/b/4/b49006702b459496a8e8c94ebe60947108361b91 +0 -0
  79. pyxcp/recorder/.idea/sonarlint/issuestore/index.pb +7 -0
  80. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/3/8/3808afc69ac1edb9d760000a2f137335b1b99728 +0 -0
  81. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/9/a/9a2aa4db38d3115ed60da621e012c0efc0172aae +0 -0
  82. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/b/4/b49006702b459496a8e8c94ebe60947108361b91 +0 -0
  83. pyxcp/recorder/.idea/sonarlint/securityhotspotstore/index.pb +7 -0
  84. pyxcp/recorder/.idea/vcs.xml +10 -0
  85. pyxcp/recorder/__init__.py +96 -0
  86. pyxcp/recorder/build_clang.cmd +1 -0
  87. pyxcp/recorder/build_clang.sh +2 -0
  88. pyxcp/recorder/build_gcc.cmd +1 -0
  89. pyxcp/recorder/build_gcc.sh +2 -0
  90. pyxcp/recorder/build_gcc_arm.sh +2 -0
  91. pyxcp/recorder/converter/__init__.py +444 -0
  92. pyxcp/recorder/lz4.c +2829 -0
  93. pyxcp/recorder/lz4.h +879 -0
  94. pyxcp/recorder/lz4hc.c +2041 -0
  95. pyxcp/recorder/lz4hc.h +413 -0
  96. pyxcp/recorder/mio.hpp +1714 -0
  97. pyxcp/recorder/reader.hpp +138 -0
  98. pyxcp/recorder/reco.py +278 -0
  99. pyxcp/recorder/recorder.rst +0 -0
  100. pyxcp/recorder/rekorder.cpp +59 -0
  101. pyxcp/recorder/rekorder.cpython-310-darwin.so +0 -0
  102. pyxcp/recorder/rekorder.cpython-311-darwin.so +0 -0
  103. pyxcp/recorder/rekorder.cpython-312-darwin.so +0 -0
  104. pyxcp/recorder/rekorder.hpp +274 -0
  105. pyxcp/recorder/setup.py +41 -0
  106. pyxcp/recorder/test_reko.py +34 -0
  107. pyxcp/recorder/unfolder.hpp +1354 -0
  108. pyxcp/recorder/wrap.cpp +184 -0
  109. pyxcp/recorder/writer.hpp +302 -0
  110. pyxcp/scripts/__init__.py +0 -0
  111. pyxcp/scripts/pyxcp_probe_can_drivers.py +20 -0
  112. pyxcp/scripts/xcp_examples.py +64 -0
  113. pyxcp/scripts/xcp_fetch_a2l.py +40 -0
  114. pyxcp/scripts/xcp_id_scanner.py +18 -0
  115. pyxcp/scripts/xcp_info.py +159 -0
  116. pyxcp/scripts/xcp_profile.py +26 -0
  117. pyxcp/scripts/xmraw_converter.py +31 -0
  118. pyxcp/stim/__init__.py +0 -0
  119. pyxcp/tests/test_asam_types.py +24 -0
  120. pyxcp/tests/test_binpacking.py +186 -0
  121. pyxcp/tests/test_can.py +1324 -0
  122. pyxcp/tests/test_checksum.py +95 -0
  123. pyxcp/tests/test_daq.py +193 -0
  124. pyxcp/tests/test_daq_opt.py +426 -0
  125. pyxcp/tests/test_frame_padding.py +156 -0
  126. pyxcp/tests/test_framing.py +262 -0
  127. pyxcp/tests/test_master.py +2116 -0
  128. pyxcp/tests/test_transport.py +177 -0
  129. pyxcp/tests/test_utils.py +30 -0
  130. pyxcp/timing.py +60 -0
  131. pyxcp/transport/__init__.py +13 -0
  132. pyxcp/transport/base.py +484 -0
  133. pyxcp/transport/base_transport.hpp +0 -0
  134. pyxcp/transport/can.py +660 -0
  135. pyxcp/transport/eth.py +254 -0
  136. pyxcp/transport/hdf5_policy.py +167 -0
  137. pyxcp/transport/sxi.py +209 -0
  138. pyxcp/transport/transport_ext.cpython-310-darwin.so +0 -0
  139. pyxcp/transport/transport_ext.cpython-311-darwin.so +0 -0
  140. pyxcp/transport/transport_ext.cpython-312-darwin.so +0 -0
  141. pyxcp/transport/transport_ext.hpp +214 -0
  142. pyxcp/transport/transport_wrapper.cpp +249 -0
  143. pyxcp/transport/usb_transport.py +229 -0
  144. pyxcp/types.py +987 -0
  145. pyxcp/utils/__init__.py +127 -0
  146. pyxcp/utils/cli.py +78 -0
  147. pyxcp/vector/__init__.py +0 -0
  148. pyxcp/vector/map.py +82 -0
  149. pyxcp-0.25.5.dist-info/METADATA +341 -0
  150. pyxcp-0.25.5.dist-info/RECORD +153 -0
  151. pyxcp-0.25.5.dist-info/WHEEL +6 -0
  152. pyxcp-0.25.5.dist-info/entry_points.txt +9 -0
  153. pyxcp-0.25.5.dist-info/licenses/LICENSE +165 -0
pyxcp/cmdline.py ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ Parse (transport-layer specific) command line parameters
4
+ and create a XCP master instance.
5
+ """
6
+
7
+ import argparse
8
+ import warnings
9
+
10
+ from pyxcp.config import ( # noqa: F401
11
+ create_application,
12
+ get_application,
13
+ reset_application,
14
+ )
15
+ from pyxcp.master import Master
16
+ from pyxcp.utils.cli import StrippingParser
17
+
18
+
19
+ warnings.simplefilter("always")
20
+
21
+
22
+ class ArgumentParser:
23
+ """Argument parser for pyXCP applications.
24
+
25
+ This class provides a way to add custom command-line arguments to pyXCP applications.
26
+ It also supports a callout function that will be called with the master instance and
27
+ the parsed arguments.
28
+ """
29
+
30
+ def __init__(self, user_parser=None, description=None, *args, **kws):
31
+ if isinstance(user_parser, argparse.ArgumentParser):
32
+ self._parser = StrippingParser(user_parser)
33
+ self._callout = None
34
+ else:
35
+ # Create a default parser. user_parser might be a callout function or None.
36
+ parser = argparse.ArgumentParser(description=description)
37
+ self._parser = StrippingParser(parser)
38
+ self._callout = user_parser
39
+ self._description = description
40
+ self.args = None
41
+
42
+ def run(self, policy=None, transport_layer_interface=None):
43
+ """Create and configure a synchronous master instance.
44
+
45
+ Args:
46
+ policy: Optional policy to use for the master
47
+ transport_layer_interface: Optional transport layer interface to use
48
+
49
+ Returns:
50
+ A configured master instance
51
+ """
52
+ self.args = self._parser.parse_and_strip()
53
+
54
+ # Create the application with custom arguments and callout
55
+ application = get_application(options=[], callout=self._callout)
56
+
57
+ # Create the master instance
58
+ master = Master(
59
+ application.transport.layer, config=application, policy=policy, transport_layer_interface=transport_layer_interface
60
+ )
61
+
62
+ # If there's a callout function, call it with the master and args
63
+ if application.callout is not None and hasattr(application, "custom_args"):
64
+ args = application.custom_args.get_args()
65
+ application.callout(master, args)
66
+
67
+ return master
68
+
69
+ @property
70
+ def parser(self):
71
+ return self._parser.parser