pyxcp 0.22.34__cp314-cp314-macosx_11_0_arm64.whl → 0.22.35__cp314-cp314-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.

Potentially problematic release.


This version of pyxcp might be problematic. Click here for more details.

pyxcp/__init__.py CHANGED
@@ -17,4 +17,4 @@ tb_install(show_locals=True, max_frames=3) # Install custom exception handler.
17
17
 
18
18
  # if you update this manually, do not forget to update
19
19
  # .bumpversion.cfg and pyproject.toml.
20
- __version__ = "0.22.34"
20
+ __version__ = "0.22.35"
pyxcp/config/__init__.py CHANGED
@@ -829,6 +829,7 @@ class General(Configurable):
829
829
  )
830
830
  seed_n_key_dll = Unicode("", allow_none=False, help="Dynamic library used for slave resource unlocking.").tag(config=True)
831
831
  seed_n_key_dll_same_bit_width = Bool(False, help="").tag(config=True)
832
+ custom_dll_loader = Unicode(allow_none=True, default_value=None, help="Use an custom seed and key DLL loader.").tag(config=True)
832
833
  seed_n_key_function = Callable(
833
834
  default_value=None,
834
835
  allow_none=True,
pyxcp/dllif.py CHANGED
@@ -36,9 +36,14 @@ else:
36
36
  raise RuntimeError(f"Platform {sys.platform!r} currently not supported.")
37
37
 
38
38
 
39
- def getKey(logger, dllName: str, privilege: int, seed: bytes, assume_same_bit_width: bool):
39
+ def getKey(logger, loader_cfg: str, dllName: str, privilege: int, seed: bytes, assume_same_bit_width: bool):
40
40
  dllName = str(Path(dllName).absolute()) # Fix loader issues.
41
41
 
42
+ if loader_cfg is not None:
43
+ loader_exe = loader_cfg
44
+ else:
45
+ loader_exe = LOADER
46
+
42
47
  use_ctypes: bool = False
43
48
  if assume_same_bit_width:
44
49
  use_ctypes = True
@@ -70,15 +75,15 @@ def getKey(logger, dllName: str, privilege: int, seed: bytes, assume_same_bit_wi
70
75
  else:
71
76
  try:
72
77
  p0 = subprocess.Popen(
73
- [LOADER, dllName, str(privilege), binascii.hexlify(seed).decode("ascii")],
78
+ [loader_exe, dllName, str(privilege), binascii.hexlify(seed).decode("ascii")],
74
79
  stdout=subprocess.PIPE,
75
80
  shell=False,
76
81
  ) # nosec
77
82
  except FileNotFoundError as exc:
78
- logger.error(f"Could not find executable {LOADER!r} -- {exc}")
83
+ logger.error(f"Could not find executable {loader_exe!r} -- {exc}")
79
84
  return (SeedNKeyResult.ERR_COULD_NOT_LOAD_DLL, None)
80
85
  except OSError as exc:
81
- logger.error(f"Cannot execute {LOADER!r} -- {exc}")
86
+ logger.error(f"Cannot execute {loader_exe!r} -- {exc}")
82
87
  return (SeedNKeyResult.ERR_COULD_NOT_LOAD_DLL, None)
83
88
  key: bytes = b""
84
89
  if p0.stdout:
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env python
2
- """Very basic hello-world example.
3
- """
2
+ """Very basic hello-world example."""
4
3
  from pprint import pprint
5
4
 
6
5
  from pyxcp.cmdline import ArgumentParser
@@ -17,14 +16,14 @@ def callout(master, args):
17
16
 
18
17
 
19
18
  ap = ArgumentParser(description="pyXCP hello world.", callout=callout)
20
- ap.parser.add_argument(
21
- "-d",
22
- "--daq-info",
23
- dest="daq_info",
24
- help="Display DAQ-info",
25
- default=False,
26
- action="store_true",
27
- )
19
+ # ap.parser.add_argument(
20
+ # "-d",
21
+ # "--daq-info",
22
+ # dest="daq_info",
23
+ # help="Display DAQ-info",
24
+ # default=False,
25
+ # action="store_true",
26
+ # )
28
27
 
29
28
  with ap.run() as x:
30
29
  x.connect()
pyxcp/master/master.py CHANGED
@@ -1840,6 +1840,7 @@ class Master:
1840
1840
  self.logger.debug(f"Using seed and key DLL {self.seed_n_key_dll!r}.")
1841
1841
  result, key = getKey(
1842
1842
  self.logger,
1843
+ self.config.custom_dll_loader,
1843
1844
  self.seed_n_key_dll,
1844
1845
  resource_value,
1845
1846
  bytes(seed),
pyxcp/utils.py CHANGED
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env python
2
2
  import datetime
3
- from enum import IntEnum
4
3
  import functools
5
4
  import operator
6
5
  import sys
7
6
  from binascii import hexlify
7
+ from enum import IntEnum
8
8
  from time import perf_counter, sleep
9
+ from typing import Any, List, Optional, Union
9
10
 
10
11
  import chardet
11
12
  import pytz
@@ -13,7 +14,7 @@ import pytz
13
14
  from pyxcp.cpp_ext.cpp_ext import TimestampInfo
14
15
 
15
16
 
16
- def hexDump(arr):
17
+ def hexDump(arr: Union[bytes | bytearray]):
17
18
  if isinstance(arr, (bytes, bytearray)):
18
19
  size = len(arr)
19
20
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyxcp
3
- Version: 0.22.34
3
+ Version: 0.22.35
4
4
  Summary: Universal Calibration Protocol for Python
5
5
  License: LGPLv3
6
6
  Keywords: automotive,ecu,xcp,asam,autosar
@@ -1,18 +1,18 @@
1
- pyxcp-0.22.34.dist-info/RECORD,,
2
- pyxcp-0.22.34.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
3
- pyxcp-0.22.34.dist-info/WHEEL,sha256=liYdTCLVexOWAG0gG4YcAbkur62UTvR8Bty2aoz0VVg,134
4
- pyxcp-0.22.34.dist-info/entry_points.txt,sha256=LkHsEwubm30s4oiyCy0cKj6k97ALvQ6KjAVdyEcqu7g,358
5
- pyxcp-0.22.34.dist-info/METADATA,sha256=P5fVBGrcQlz5CQ2IQOdA0nhGH7TDU_w8QA_8aA0ycss,4085
6
- pyxcp/dllif.py,sha256=kQ2njvx2flt5_EpIvIhT82NLl_LXoKJVc40H7pRi_0U,3213
1
+ pyxcp-0.22.35.dist-info/RECORD,,
2
+ pyxcp-0.22.35.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
3
+ pyxcp-0.22.35.dist-info/WHEEL,sha256=liYdTCLVexOWAG0gG4YcAbkur62UTvR8Bty2aoz0VVg,134
4
+ pyxcp-0.22.35.dist-info/entry_points.txt,sha256=LkHsEwubm30s4oiyCy0cKj6k97ALvQ6KjAVdyEcqu7g,358
5
+ pyxcp-0.22.35.dist-info/METADATA,sha256=1FG4ObUxb7QK7YO8yFEUJioWfGLPbX0gDB5apo2Hz3Q,4085
6
+ pyxcp/dllif.py,sha256=m4e-_dgDLCD6COU5W2LdeYUlib_Xxyxbh977bbS-VAU,3344
7
7
  pyxcp/checksum.py,sha256=aveS0z4vthLXABEFhTqELqFNi7LM6ZzDzq7dD5Xe9oo,11167
8
8
  pyxcp/asamkeydll.sh,sha256=iema12sub6qNE0xAuzwGtx0FmkdaaOKoXalhrtWVaa8,57
9
9
  pyxcp/asamkeydll.c,sha256=l5RHYcEPY_Q07G-W5IjCq0xci8YfUR-3uYt84OOkOJI,2836
10
10
  pyxcp/constants.py,sha256=Yemk_Gi_m78EEU0v-sdGCAodb9dv_vqP969IU3izA2M,1113
11
11
  pyxcp/cmdline.py,sha256=lNg_wedKShu_37RhuTIGlINGLSMrg6UqJmYpqQnJbQI,1477
12
- pyxcp/__init__.py,sha256=7LNlJz6klgG4GffRkpN3uXAom2R7qq6RGG6Or7_iv7M,528
12
+ pyxcp/__init__.py,sha256=Syqs7GgVi938EmpSl12H_YqMJl5dUAfsPZfuDDc-HtE,528
13
13
  pyxcp/types.py,sha256=XJxJUh9bK5Urfia8IHVLJ-NFgQACYBd_n73L-AaeZts,25158
14
14
  pyxcp/timing.py,sha256=hzeQZ3P7ij_bfskoVMi10Iv5S4i_6TQYfnB8PXTX6c4,1645
15
- pyxcp/utils.py,sha256=6WY4Jrdq3W6rYveR_U1JqfmKTWHkwg65LzrhJE6xbyc,3330
15
+ pyxcp/utils.py,sha256=Ax3TNT4OotRdJs_MVz83i7gTinpbOWwPnNVIL9WYTW4,3402
16
16
  pyxcp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  pyxcp/errormatrix.py,sha256=cYcsJ11Qm39DPuaR4BJ9fMpS3Hkphd_ezIQOKjI-pQE,44586
18
18
  pyxcp/asam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -39,7 +39,7 @@ pyxcp/transport/usb_transport.py,sha256=27c19S67BMq1Eup6ViX-SiYpEq93bMTwe031RsE4
39
39
  pyxcp/transport/can.py,sha256=bzKV9Lh5suKdZ5dm3ZEz1osOqkRZNlxrVAW7vr38JSM,14485
40
40
  pyxcp/transport/base.py,sha256=i9VdWqGNqx5LMdFkD8SmmMQSRoDDXAjMRS3p6KD1A8E,15912
41
41
  pyxcp/config/legacy.py,sha256=Uhu_6bp_W8yGmZ2s3TFzf8-5mGwLdeTss56BMYWpsZY,5100
42
- pyxcp/config/__init__.py,sha256=nToBy_zPFQZmCUgRZ1RUjlw-OulCcvoFuGFvPw242z8,41701
42
+ pyxcp/config/__init__.py,sha256=vIYPtzzNI4kUmevpOsSFgbfuBXPq7e2bhIIwWcqPcqQ,41835
43
43
  pyxcp/tests/test_utils.py,sha256=gqv3bhhWfKKdKDkqnELqsOHCfpRRZwlReEy87Ya4Z2w,850
44
44
  pyxcp/tests/test_master.py,sha256=a_Q8Fa49y_3vnrp-VFZ-22cHWjq58RC2daF6EcfbhZc,69434
45
45
  pyxcp/tests/test_daq.py,sha256=mThMsweEwxzIFRQQ88BNz_60OQ-xmC5OamIxHx9VWis,5358
@@ -64,7 +64,7 @@ pyxcp/aml/XCPonUSB.aml,sha256=rPGduH-PE8-tBeELSm3vfkbf62uhlVP6gvJL0OvMclc,4847
64
64
  pyxcp/aml/ifdata_SxI.a2l,sha256=8rAB6HTTAuNlFSrkFpR7fUA702yN4rTTNkw-xspZNV0,303
65
65
  pyxcp/aml/XCPonFlx.aml,sha256=z58FMu6ZF4hVun8WBCuxvDrq6FZ_gj3tZM15G7E8Uvw,4647
66
66
  pyxcp/master/__init__.py,sha256=o3XB9GDwLiqh-KRFC9YTOd0EvxJXDpyrcVxebiwT934,309
67
- pyxcp/master/master.py,sha256=XNnX6oHp2B6eNoIZ_kpoxIZk_3ZUU3L9-d3dDyaQJtE,76337
67
+ pyxcp/master/master.py,sha256=RHw-1OT_dxsAeyChqnimqNRWEDKGP__Mw822D-7lKsY,76388
68
68
  pyxcp/master/errorhandler.py,sha256=C3T0nvn3L5QCE1AD-7dJp-D16YxfcS2OZOb9SwXySuM,14917
69
69
  pyxcp/examples/xcp_read_benchmark.py,sha256=Hl0hrjV3FE-ivswvYOh0MsKiHnk03z7w8lQDYnvfeM8,918
70
70
  pyxcp/examples/conf_eth.toml,sha256=b6bKN-K07gMQHNj7yiyB-HKrkVtZREgPXS4ByQueBs4,190
@@ -76,7 +76,7 @@ pyxcp/examples/conf_can_user.toml,sha256=BqCID-GvaNbA6pbqRbyRMuzKAsJaYVube0ql4Cv
76
76
  pyxcp/examples/xcp_user_supplied_driver.py,sha256=TD8Ggzdb2T9o6Z-VMvuJMREMpzufI5u27ThaadCxhDg,1024
77
77
  pyxcp/examples/xcp_skel.py,sha256=F2g2C79jiYZl0cpRHfzWusfn1ZvodOS_r1Az6aknZL4,1110
78
78
  pyxcp/examples/xcp_unlock.py,sha256=vl2Zv7Z6EuBxI2ZxbGQK6-0tZBVqd72FZllsvIfuJ5w,652
79
- pyxcp/examples/xcphello.py,sha256=1Fzg28dGk3Xhh37SahmsigaEXcCfZFe8f1t9MRAPZDk,2551
79
+ pyxcp/examples/xcphello.py,sha256=yB1YEpxCLuCnjvN5pjZbB3obfSMEEdtfrER57KQ8KE4,2560
80
80
  pyxcp/examples/run_daq.py,sha256=JObp9HtjJphwr5sVQ4Jj3Q5GZHGNCK12tYTfR-6qcr4,5461
81
81
  pyxcp/examples/conf_socket_can.toml,sha256=JB9zHHaya2mDXf0zPY7zEKiBDX2chzBBRxt7h3LxxDk,257
82
82
  pyxcp/examples/conf_sxi.toml,sha256=r81OD0mCLk_h7vrN5MBJk0HFbiWi3bQZtFgFVrW6qcM,118