pyxcp 0.23.3__cp311-cp311-macosx_11_0_arm64.whl → 0.23.4__cp311-cp311-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.23.3"
20
+ __version__ = "0.23.4"
@@ -31,7 +31,6 @@ DAQ_TIMESTAMP_SIZE = {
31
31
 
32
32
  class DaqProcessor:
33
33
  def __init__(self, daq_lists: List[DaqList]):
34
- # super().__init__()
35
34
  self.daq_lists = daq_lists
36
35
  self.log = get_application().log
37
36
 
pyxcp/transport/base.py CHANGED
@@ -222,6 +222,10 @@ class BaseTransport(metaclass=abc.ABCMeta):
222
222
  self.finish_listener()
223
223
  self.listener.join()
224
224
 
225
+ # Ensure the close event is cleared before starting a new listener thread.
226
+ if hasattr(self, "closeEvent"):
227
+ self.closeEvent.clear()
228
+
225
229
  self.listener = threading.Thread(target=self.listen)
226
230
  self.listener.start()
227
231
 
@@ -368,16 +372,16 @@ class BaseTransport(metaclass=abc.ABCMeta):
368
372
  self.timer_restart_event.set()
369
373
 
370
374
  def process_response(self, response: bytes, length: int, counter: int, recv_timestamp: int) -> None:
371
- if counter == self.counter_received:
372
- self.logger.warning(f"Duplicate message counter {counter} received from the XCP slave")
373
- if self._debug:
374
- self.logger.debug(f"<- L{length} C{counter} {hexDump(response[:512])}")
375
- return
376
- self.counter_received = counter
375
+ # Important: determine PID first so duplicate counter handling can be applied selectively.
377
376
  pid = response[0]
377
+
378
378
  if pid >= 0xFC:
379
+ # Do not drop RESPONSE/EVENT/SERV frames even if the transport counter repeats.
380
+ # Some slaves may reuse the counter while DAQ traffic is active, and we must not lose
381
+ # command responses; otherwise request() can stall until timeout.
379
382
  if self._debug:
380
383
  self.logger.debug(f"<- L{length} C{counter} {hexDump(response)}")
384
+ self.counter_received = counter
381
385
  if pid >= 0xFE:
382
386
  self.resQueue.append(response)
383
387
  with self.policy_lock:
@@ -391,6 +395,15 @@ class BaseTransport(metaclass=abc.ABCMeta):
391
395
  with self.policy_lock:
392
396
  self.policy.feed(types.FrameCategory.SERV, self.counter_received, self.timestamp.value, response)
393
397
  else:
398
+ # DAQ traffic: Some transports reuse or do not advance the counter for DAQ frames.
399
+ # Do not drop DAQ frames on duplicate counters to avoid losing measurements.
400
+ if counter == self.counter_received:
401
+ self.logger.debug(f"Duplicate message counter {counter} received (DAQ) - not dropping")
402
+ # DAQ still flowing – reset request timeout window to avoid false timeouts while
403
+ # the slave is busy but has not yet responded to a command.
404
+ self.timer_restart_event.set()
405
+ # Fall through and process the frame as usual.
406
+ self.counter_received = counter
394
407
  if self._debug:
395
408
  self.logger.debug(f"<- L{length} C{counter} ODT_Data[0:8] {hexDump(response[:8])}")
396
409
  if self.first_daq_timestamp is None:
@@ -399,6 +412,9 @@ class BaseTransport(metaclass=abc.ABCMeta):
399
412
  timestamp = recv_timestamp
400
413
  else:
401
414
  timestamp = 0
415
+ # DAQ activity indicates the slave is alive/busy; keep extending the wait window for any
416
+ # outstanding request, similar to EV_CMD_PENDING behavior on stacks that don't emit it.
417
+ self.timer_restart_event.set()
402
418
  with self.policy_lock:
403
419
  self.policy.feed(types.FrameCategory.DAQ, self.counter_received, timestamp, response)
404
420
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyxcp
3
- Version: 0.23.3
3
+ Version: 0.23.4
4
4
  Summary: Universal Calibration Protocol for Python
5
5
  License: LGPLv3
6
6
  Keywords: automotive,ecu,xcp,asam,autosar
@@ -4,7 +4,7 @@ pyxcp/asamkeydll.sh,sha256=iema12sub6qNE0xAuzwGtx0FmkdaaOKoXalhrtWVaa8,57
4
4
  pyxcp/asamkeydll.c,sha256=l5RHYcEPY_Q07G-W5IjCq0xci8YfUR-3uYt84OOkOJI,2836
5
5
  pyxcp/constants.py,sha256=Yemk_Gi_m78EEU0v-sdGCAodb9dv_vqP969IU3izA2M,1113
6
6
  pyxcp/cmdline.py,sha256=EoN-_AJm0lz1egPzNcmIFO2Uqo4c0lBXSAB25Uc6N9Q,2441
7
- pyxcp/__init__.py,sha256=xnPPit4jAVldx2bKWWiSZtRc0VT5AvbgWRINbIEhBGM,527
7
+ pyxcp/__init__.py,sha256=IyyaS5_zWWbL0LDLYQGbYeYSk5m5OF7PdDajHj8cq_E,527
8
8
  pyxcp/types.py,sha256=XJxJUh9bK5Urfia8IHVLJ-NFgQACYBd_n73L-AaeZts,25158
9
9
  pyxcp/timing.py,sha256=hzeQZ3P7ij_bfskoVMi10Iv5S4i_6TQYfnB8PXTX6c4,1645
10
10
  pyxcp/utils.py,sha256=Ax3TNT4OotRdJs_MVz83i7gTinpbOWwPnNVIL9WYTW4,3402
@@ -13,7 +13,7 @@ pyxcp/errormatrix.py,sha256=cYcsJ11Qm39DPuaR4BJ9fMpS3Hkphd_ezIQOKjI-pQE,44586
13
13
  pyxcp/asam/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  pyxcp/asam/types.py,sha256=V4wSCGI1pXn0EsBemDyaHTBgY2wkV_BeLShnDIGGgDE,2310
15
15
  pyxcp/daq_stim/stim.cpp,sha256=sABgEfbQlt5kXbzAsndyhaDFWRWTJw3jJlNfanIVrRs,164
16
- pyxcp/daq_stim/__init__.py,sha256=HAfOpn4yeb4DYNZHr6pzpFGHisXbKEytXJ6KUatDMTk,9328
16
+ pyxcp/daq_stim/__init__.py,sha256=Lm-FCoXyY6Y51571nAa4OA4LU50NqCYffj_cnryjir4,9299
17
17
  pyxcp/daq_stim/scheduler.cpp,sha256=2XW9PmxrJR8DfYMVszGwBX-KANVviwPcUNBvnjw5MlM,1443
18
18
  pyxcp/daq_stim/stim.hpp,sha256=1DwAhkY7XJN14aD2BxLJ4O1j4_a6RvpePIbAG1U8iOA,17904
19
19
  pyxcp/daq_stim/stim.cpython-310-darwin.so,sha256=pE7imb11QMYyQv8HTO54EmnJrS5GsocxWJJT5vCPHyw,237784
@@ -29,7 +29,7 @@ pyxcp/transport/base_transport.hpp,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
29
29
  pyxcp/transport/__init__.py,sha256=wIeYkGygucYdXEzymJcDvimnwZgqJY8KRv7Mk__aUSU,428
30
30
  pyxcp/transport/usb_transport.py,sha256=27c19S67BMq1Eup6ViX-SiYpEq93bMTwe031RsE4Xm0,8130
31
31
  pyxcp/transport/can.py,sha256=uFPG_Caf1BwIo2pKheZLs0VfPth1KoEPxuKtI2qt9as,18250
32
- pyxcp/transport/base.py,sha256=i9VdWqGNqx5LMdFkD8SmmMQSRoDDXAjMRS3p6KD1A8E,15912
32
+ pyxcp/transport/base.py,sha256=_jjoTGEIbzxR5rsBbSmxnlvoUI-Kr4VomWhH58z4RBk,17074
33
33
  pyxcp/config/legacy.py,sha256=Uhu_6bp_W8yGmZ2s3TFzf8-5mGwLdeTss56BMYWpsZY,5100
34
34
  pyxcp/config/__init__.py,sha256=z9bXNb2Hp-h2ZtASCyGk3JWP3OGoOL5Hmvazl-L_ANE,45258
35
35
  pyxcp/tests/test_utils.py,sha256=gqv3bhhWfKKdKDkqnELqsOHCfpRRZwlReEy87Ya4Z2w,850
@@ -121,8 +121,8 @@ pyxcp/cpp_ext/bin.hpp,sha256=0CatarJ7jFewlg9EIxsDPxC4wnORHutx-1PLHpf9iqw,2457
121
121
  pyxcp/cpp_ext/cpp_ext.cpython-311-darwin.so,sha256=fzNGtnJwuLv2Ner1sg8quHySZ5yh4SqjHM0-I8oHqP8,321600
122
122
  pyxcp/cpp_ext/daqlist.hpp,sha256=Q1Gejo8i1rP2PzyUh4UHJ2z-kG0WNnkbBj7N8DAdzaM,7071
123
123
  pyxcp/cpp_ext/cpp_ext.cpython-310-darwin.so,sha256=5sPtzwLXzXBbJ2zI2kGk0gF83xnDHvKbt0XasjPfe1c,321520
124
- pyxcp-0.23.3.dist-info/RECORD,,
125
- pyxcp-0.23.3.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
126
- pyxcp-0.23.3.dist-info/WHEEL,sha256=X6-NY9fCWtbM4tHMrme4ihtrUdAQgjDgPOLr1IYsKV8,134
127
- pyxcp-0.23.3.dist-info/entry_points.txt,sha256=LkHsEwubm30s4oiyCy0cKj6k97ALvQ6KjAVdyEcqu7g,358
128
- pyxcp-0.23.3.dist-info/METADATA,sha256=wQmqlFOaiVIYsJGLg5m2M0aHyit3Ofwl7T1FEjWiWNg,11688
124
+ pyxcp-0.23.4.dist-info/RECORD,,
125
+ pyxcp-0.23.4.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
126
+ pyxcp-0.23.4.dist-info/WHEEL,sha256=X6-NY9fCWtbM4tHMrme4ihtrUdAQgjDgPOLr1IYsKV8,134
127
+ pyxcp-0.23.4.dist-info/entry_points.txt,sha256=LkHsEwubm30s4oiyCy0cKj6k97ALvQ6KjAVdyEcqu7g,358
128
+ pyxcp-0.23.4.dist-info/METADATA,sha256=hFSek7Gb_hDy_HhSaLoPqtKp1C8p44CMs9KFdKuge1g,11688
File without changes