oep-client-python 0.0.10__py3-none-any.whl → 0.0.12__py3-none-any.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.
oep_client/__init__.py CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.0.10"
5
+ __version__ = "0.0.12"
oep_client/capture.py CHANGED
@@ -287,6 +287,10 @@ class LogicCapture(Interface):
287
287
  def stop(self) -> None:
288
288
  self._call(self.STOP)
289
289
 
290
+ def force(self) -> None:
291
+ """Waiting for the trigger: start now (the segment's trigger_index marks where)."""
292
+ self._call(self.FORCE)
293
+
290
294
  def status(self) -> tuple[int, int, int, int]:
291
295
  """-> state, segments done, write position, flags."""
292
296
  return m.Reader(self._call(self.STATUS, locked=False).payload).take("BIQB")
@@ -301,10 +305,15 @@ class LogicCapture(Interface):
301
305
  rd.tail()
302
306
  return out
303
307
 
304
- def wait(self, timeout: float = 5.0) -> list[Segment]:
305
- """Poll status until the one-shot is done (or failed). -> its segments."""
308
+ def wait(self, timeout: float = 5.0, keepalive_s: float = 1.0) -> list[Segment]:
309
+ """Poll status until the one-shot is done (or failed). -> its segments. Waiting for a trigger may take longer
310
+ than the lease: the lock is kept alive every `keepalive_s` (status needs no lock, so it does not)."""
306
311
  deadline = time.monotonic() + timeout
312
+ kept = time.monotonic()
307
313
  while time.monotonic() < deadline:
314
+ if keepalive_s and self.host.session is not None and time.monotonic() - kept >= keepalive_s:
315
+ self.host.keepalive()
316
+ kept = time.monotonic()
308
317
  state = self.status()[0]
309
318
  if state == STATE["done"]:
310
319
  return self.segments()
oep_client/fake.py CHANGED
@@ -120,7 +120,7 @@ def _analog_decl(frontends: list[tuple[int, int, int, int]], max_samples: int) -
120
120
  out = tuple(catalog.tlv(_ANAD["mode"], struct.pack("<BBII", _CAPM[k], 1, max_samples, 8 if k == "repeat" else 1))
121
121
  for k in ("one_shot", "repeat", "streaming"))
122
122
  out += tuple(catalog.tlv(_ANAD["frontend"], struct.pack("<BiiI", *f)) for f in frontends)
123
- return out + (catalog.tlv(_ANAD["channels"], bytes([4, 0b100])), # s 16
123
+ return out + (catalog.tlv(_ANAD["channels"], bytes([4, 1 << 4])), # s 16 (bit i = 2^i)
124
124
  catalog.tlv(_ANAD["trigger"], struct.pack("<BI", 0b11001, max_samples - 1)), # immediate, cross up / down
125
125
  catalog.u32(_ANAD["max_read"], 4096), catalog.u16(_ANAD["segment_ring"], 8),
126
126
  catalog.u32(FEATURES, 0b001))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: oep-client-python
3
- Version: 0.0.10
3
+ Version: 0.0.12
4
4
  Summary: Open Embedded Probe (OEP) v1 host: serial / USB / TCP transports, the session rules, the standard interfaces, and a fake probe
5
5
  Project-URL: Homepage, https://github.com/Open-Embedded-Probe/oep-client-python
6
6
  Project-URL: Repository, https://github.com/Open-Embedded-Probe/oep-client-python
@@ -1,7 +1,7 @@
1
- oep_client/__init__.py,sha256=W4Jmi9TS_xd7VSEtxOeaXMp33zr8gXCFqH9a0VwBDy0,164
1
+ oep_client/__init__.py,sha256=YvJHYTjvF0MlHW--fxOEg7Csbh7ecalzfHDJu3T9umk,164
2
2
  oep_client/__main__.py,sha256=qtVGdpAHULBtLY2SedabJf-uwDZZhMf_YmrbqRzM57U,14669
3
3
  oep_client/arm.py,sha256=JLyUhLSPcmsk73schZcaJYoOKuHzrvnU8kPmfrEvVuo,12331
4
- oep_client/capture.py,sha256=mL_C2_5hK9D9nR_F4f4YNN-uaRVegMN-8vnwHR7rQkg,24962
4
+ oep_client/capture.py,sha256=e4GtLr4DpZQKngJnm4KLqK7TztL3FCbLa-JoVwfyMHw,25501
5
5
  oep_client/catalog.py,sha256=EqAQnSgHFxGbCO2GQ_Ee-uheJKbBBUUpL1-0qHfNMXU,6574
6
6
  oep_client/ch32_flash.py,sha256=Fc-6jEj15cQtMSKmfC5dmDetMXJ8hAdAuJ9d9odwrsA,12651
7
7
  oep_client/cobs.py,sha256=hqddQI_X7rsBvBvcP_MBE3bXPyB13-Azjqp_9JfdQ1g,2288
@@ -12,7 +12,7 @@ oep_client/decode.py,sha256=M-bRARrA2qGZLoJn0BdXeTb4WjL_2Hb2nk_g1IGXIw4,2382
12
12
  oep_client/dump.py,sha256=GAnmu2abuDmGmbWcbbEfC3EUuPp5Hady9vQVNcQ-724,6743
13
13
  oep_client/endpoint.py,sha256=aa9znMaedjEnMDNcGsV-4gxTZJSd6IxNyPpcJM2PEzk,87244
14
14
  oep_client/esp32_targets.py,sha256=b8tNH-nb2KC-XgNfWg5l3TO0cyhZOF-gJajaVxNVSGQ,4988
15
- oep_client/fake.py,sha256=jTaiii8DtByI_CyUYVRoUnGT05k5OdIerSdQig4HKrk,18096
15
+ oep_client/fake.py,sha256=18zEHdvJzgEEqDZ2Dk2hcE_bct2UKGegc38FobmiYpM,18111
16
16
  oep_client/fake_capture.py,sha256=6BadaybnZ0jRDfxjnkLXttw65rkoPgsIY5FvAWKxMg8,22812
17
17
  oep_client/fake_serial.py,sha256=nXpbBuPl9sAh5BdoWSsa5EDYvPC7VLOvaBYrslGlniA,4659
18
18
  oep_client/fake_serve.py,sha256=CzJ_TO_gWVNPP0r5ggQ57rgwAgBapunGI0YtyW8MrRM,15133
@@ -30,8 +30,8 @@ oep_client/rp2350.py,sha256=7OMyj270k3AY1e3-ljicPwOjf9jOlokbT6QNkA0b0yY,4227
30
30
  oep_client/target.py,sha256=R8BvYfFfYNhZF0MysJkNb8b69YgBlmeGXNX8ReZIe5k,1068
31
31
  oep_client/uiapduino.py,sha256=IEPG3LbZPksi8g3wmAf6T0CRWSfYKW1_qrH_GBVQdxY,6090
32
32
  oep_client/usb_stream.py,sha256=VJMCxsOlQCk005FcS92pqTh33fRSFBizoL__L0VbUMA,10242
33
- oep_client_python-0.0.10.dist-info/METADATA,sha256=K29Cy_nfBC_19RrkZ_hZQtD9nzLoW1oTWw9rinSp8Hc,8590
34
- oep_client_python-0.0.10.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
35
- oep_client_python-0.0.10.dist-info/entry_points.txt,sha256=h6_8QX89Ww1ogALEGG5g4kspT3IOV6O51lwKqf5BWco,49
36
- oep_client_python-0.0.10.dist-info/licenses/LICENSE,sha256=ntlalztb3L1OaNAxmQdHlubu5fVhjMc9oRZi3PeQhXg,1076
37
- oep_client_python-0.0.10.dist-info/RECORD,,
33
+ oep_client_python-0.0.12.dist-info/METADATA,sha256=pk-QatI6HI-xSEd4Nq4f2ek3dRH79yP-52VteuvI1cY,8590
34
+ oep_client_python-0.0.12.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
35
+ oep_client_python-0.0.12.dist-info/entry_points.txt,sha256=h6_8QX89Ww1ogALEGG5g4kspT3IOV6O51lwKqf5BWco,49
36
+ oep_client_python-0.0.12.dist-info/licenses/LICENSE,sha256=ntlalztb3L1OaNAxmQdHlubu5fVhjMc9oRZi3PeQhXg,1076
37
+ oep_client_python-0.0.12.dist-info/RECORD,,