pyxcp 0.22.33__cp310-cp310-macosx_11_0_arm64.whl → 0.22.35__cp310-cp310-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.33"
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),
@@ -1,5 +1,4 @@
1
- """Convert pyXCPs .xmraw files to common data formats.
2
- """
1
+ """Convert pyXCPs .xmraw files to common data formats."""
3
2
 
4
3
  import csv
5
4
  import logging
@@ -318,8 +317,7 @@ class MdfConverter(CollectRows, XcpLogFileDecoder):
318
317
  time_flags=FLAG_HD_TIME_OFFSET_VALID,
319
318
  )
320
319
  hdr.comment = f"""<HDcomment><TX>Timezone: {timestamp_info.timezone}</TX></HDcomment>""" # Test-Comment.
321
- mdf4 = MDF(version="4.10")
322
- mdf4.header = hdr
320
+ mdf4 = MDF(version="4.10", header=hdr)
323
321
  for idx, arr in enumerate(self.tables):
324
322
  signals = []
325
323
  timestamps = arr.timestamp0
@@ -369,7 +367,8 @@ class SqliteConverter(XcpLogFileDecoder):
369
367
  self.create_table(sc)
370
368
  self.logger.info(f"Creating table {sc.name!r}.")
371
369
  self.insert_stmt[sc.name] = (
372
- f"""INSERT INTO {sc.name}({', '.join(['timestamp0', 'timestamp1'] + [r.name for r in sc.arr])}) VALUES({', '.join(["?" for _ in range(len(sc.arr) + 2)])})"""
370
+ f"""INSERT INTO {sc.name}({', '.join(['timestamp0', 'timestamp1'] + [r.name for r in sc.arr])})"""
371
+ f""" VALUES({', '.join(["?" for _ in range(len(sc.arr) + 2)])})"""
373
372
  )
374
373
 
375
374
  def on_finalize(self) -> None:
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.33
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.33.dist-info/RECORD,,
2
- pyxcp-0.22.33.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
3
- pyxcp-0.22.33.dist-info/WHEEL,sha256=LYpYYCEq2c6ymHhOSnJTe4ux3ULYSEUrqCKSUjEORwM,134
4
- pyxcp-0.22.33.dist-info/entry_points.txt,sha256=LkHsEwubm30s4oiyCy0cKj6k97ALvQ6KjAVdyEcqu7g,358
5
- pyxcp-0.22.33.dist-info/METADATA,sha256=zHbq_bYJyscMuwsVQIVMmftnTjW2UyAb-aUog3Ywejo,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=LYpYYCEq2c6ymHhOSnJTe4ux3ULYSEUrqCKSUjEORwM,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=3avbYsnOI83QI9CeqBD2d0RG5opFrCMDCZZ9xWj3PZY,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
@@ -35,7 +35,7 @@ pyxcp/transport/usb_transport.py,sha256=27c19S67BMq1Eup6ViX-SiYpEq93bMTwe031RsE4
35
35
  pyxcp/transport/can.py,sha256=bzKV9Lh5suKdZ5dm3ZEz1osOqkRZNlxrVAW7vr38JSM,14485
36
36
  pyxcp/transport/base.py,sha256=i9VdWqGNqx5LMdFkD8SmmMQSRoDDXAjMRS3p6KD1A8E,15912
37
37
  pyxcp/config/legacy.py,sha256=Uhu_6bp_W8yGmZ2s3TFzf8-5mGwLdeTss56BMYWpsZY,5100
38
- pyxcp/config/__init__.py,sha256=nToBy_zPFQZmCUgRZ1RUjlw-OulCcvoFuGFvPw242z8,41701
38
+ pyxcp/config/__init__.py,sha256=vIYPtzzNI4kUmevpOsSFgbfuBXPq7e2bhIIwWcqPcqQ,41835
39
39
  pyxcp/tests/test_utils.py,sha256=gqv3bhhWfKKdKDkqnELqsOHCfpRRZwlReEy87Ya4Z2w,850
40
40
  pyxcp/tests/test_master.py,sha256=a_Q8Fa49y_3vnrp-VFZ-22cHWjq58RC2daF6EcfbhZc,69434
41
41
  pyxcp/tests/test_daq.py,sha256=mThMsweEwxzIFRQQ88BNz_60OQ-xmC5OamIxHx9VWis,5358
@@ -60,7 +60,7 @@ pyxcp/aml/XCPonUSB.aml,sha256=rPGduH-PE8-tBeELSm3vfkbf62uhlVP6gvJL0OvMclc,4847
60
60
  pyxcp/aml/ifdata_SxI.a2l,sha256=8rAB6HTTAuNlFSrkFpR7fUA702yN4rTTNkw-xspZNV0,303
61
61
  pyxcp/aml/XCPonFlx.aml,sha256=z58FMu6ZF4hVun8WBCuxvDrq6FZ_gj3tZM15G7E8Uvw,4647
62
62
  pyxcp/master/__init__.py,sha256=o3XB9GDwLiqh-KRFC9YTOd0EvxJXDpyrcVxebiwT934,309
63
- pyxcp/master/master.py,sha256=XNnX6oHp2B6eNoIZ_kpoxIZk_3ZUU3L9-d3dDyaQJtE,76337
63
+ pyxcp/master/master.py,sha256=RHw-1OT_dxsAeyChqnimqNRWEDKGP__Mw822D-7lKsY,76388
64
64
  pyxcp/master/errorhandler.py,sha256=C3T0nvn3L5QCE1AD-7dJp-D16YxfcS2OZOb9SwXySuM,14917
65
65
  pyxcp/examples/xcp_read_benchmark.py,sha256=Hl0hrjV3FE-ivswvYOh0MsKiHnk03z7w8lQDYnvfeM8,918
66
66
  pyxcp/examples/conf_eth.toml,sha256=b6bKN-K07gMQHNj7yiyB-HKrkVtZREgPXS4ByQueBs4,190
@@ -72,7 +72,7 @@ pyxcp/examples/conf_can_user.toml,sha256=BqCID-GvaNbA6pbqRbyRMuzKAsJaYVube0ql4Cv
72
72
  pyxcp/examples/xcp_user_supplied_driver.py,sha256=TD8Ggzdb2T9o6Z-VMvuJMREMpzufI5u27ThaadCxhDg,1024
73
73
  pyxcp/examples/xcp_skel.py,sha256=F2g2C79jiYZl0cpRHfzWusfn1ZvodOS_r1Az6aknZL4,1110
74
74
  pyxcp/examples/xcp_unlock.py,sha256=vl2Zv7Z6EuBxI2ZxbGQK6-0tZBVqd72FZllsvIfuJ5w,652
75
- pyxcp/examples/xcphello.py,sha256=1Fzg28dGk3Xhh37SahmsigaEXcCfZFe8f1t9MRAPZDk,2551
75
+ pyxcp/examples/xcphello.py,sha256=yB1YEpxCLuCnjvN5pjZbB3obfSMEEdtfrER57KQ8KE4,2560
76
76
  pyxcp/examples/run_daq.py,sha256=JObp9HtjJphwr5sVQ4Jj3Q5GZHGNCK12tYTfR-6qcr4,5461
77
77
  pyxcp/examples/conf_socket_can.toml,sha256=JB9zHHaya2mDXf0zPY7zEKiBDX2chzBBRxt7h3LxxDk,257
78
78
  pyxcp/examples/conf_sxi.toml,sha256=r81OD0mCLk_h7vrN5MBJk0HFbiWi3bQZtFgFVrW6qcM,118
@@ -109,7 +109,7 @@ pyxcp/recorder/lz4hc.h,sha256=U_uN3Q2wIi3_dbEceJ16xHJZGotUiBTcnL6O5ARPi8M,20179
109
109
  pyxcp/recorder/lz4.c,sha256=k5b33lJ7yENd6cdWn7eZjlZUWoS088LYCMAjXAF3RTk,118145
110
110
  pyxcp/recorder/build_gcc.sh,sha256=uvMhL4faEJmhG_8rzSOxEBRRqrACC0kmZgaERN8GkUs,209
111
111
  pyxcp/recorder/unfolder.hpp,sha256=3gJKT2eMOZuT8o_M2NFLthdUIWd460vdwzlHaf-fQII,47998
112
- pyxcp/recorder/converter/__init__.py,sha256=Byq0X0xl5iFZfFstJQPbT1z-7TWLtBpchZABYDW57eA,14447
112
+ pyxcp/recorder/converter/__init__.py,sha256=mqzH3jxGpFrtS2dHyfDLCYKeJycav3_-6z8svlI07eU,14452
113
113
  pyxcp/stim/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
114
114
  pyxcp/vector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
115
  pyxcp/vector/map.py,sha256=dSxM15eXvZh6izITdJmFxr1rplDUlfaJUbtrm2Xv-dE,2224