Detail view: P3 says Lc or Le, and SEARCH RECORD names its target (v2.7.9)

- the P3 row read "0x02 — 2 bytes" for both kinds of P3; the decode now marks
  it (p3_kind): a command that carries data has Lc (the command-data length),
  a case-2 command (APDU_SPEC 'le', e.g. READ BINARY/RECORD, GET RESPONSE,
  SEARCH…) has Le (the expected response length).  The detail row appends
  "· Lc (command data length)" / "· Le (expected response length)"
  («Lc (длина данных команды)» / «Le (ожидаемая длина ответа)»)
- a SEARCH RECORD without an SFI searched the current EF (TS 102 221
  §11.1.7.1) but showed no file at all; it now resolves like READ/UPDATE:
  the SFI's declared file when SFI-addressed (an unresolved SFI stays marked
  "SFI n"), otherwise the current selection — with the stale-selection note
  when that EF is not a record file.  Verified on session 193: the 5.371 s
  search (P2=0x04, no SFI) now shows 4FA1, the 5.434 s one (SFI 2) shows 4F3A
- tests: p3_kind cases (Le/Lc/none) and the SEARCH target cases (current EF,
  SFI-resolved, unknown SFI, transparent selection); a Node pin for the P3
  row and the two new Russian strings; 540 Python + 77 Node tests
- PWA_VERSION/pyproject/version.py 2.7.9, SW cache simtrace-analyser-v89
This commit is contained in:
catarrh committed 2026-10-18 01:34:01 +03:00
1 parent 824405f936
commit b743c6621d
8 files changed
+73 -13

No files matched your search

+24 -7
View File
@@ -3942,6 +3942,14 @@ def decode_message(raw_data, prev=None):
elif cmd_body_len < p3 and not (spec and spec.get('le')):
result['length_mismatch'] = {'kind': 'truncated', 'expected': p3, 'actual': cmd_body_len}
# P3 is the length of the command data (Lc) when the command carries data
# and the expected response length (Le) for a case-2 command — the two are
# otherwise easy to confuse in the detailed view.
if spec and spec.get('le'):
result['p3_kind'] = 'le'
elif cmd_body_len > 0:
result['p3_kind'] = 'lc'
if cmd_body_len > 0:
body = remaining[:cmd_body_len]
result['body'] = {'hex': body.hex(), 'size': cmd_body_len}
@@ -4020,14 +4028,23 @@ def decode_message(raw_data, prev=None):
'raw': body.hex().upper()}
else:
result['file'] = {'sfi': rec_sfi, 'unknown': True, 'ef': f'SFI {rec_sfi}'}
elif ins == 0xA2 and prev and rec_sfi:
# SEARCH RECORD with SFI → attach the target file name (the body
# is a search pattern, not file data).
fid = (prev.get('sfi_map') or {}).get(rec_sfi)
elif ins == 0xA2 and prev and (rec_sfi or prev.get('sel')):
# SEARCH RECORD: the body is a search pattern, not file data. An
# SFI addresses the file it names; without one the search runs in
# the current EF (TS 102 221 §11.1.7.1) — show the target like
# READ/UPDATE do.
sel = prev.get('sel') or {}
fid = (prev.get('sfi_map') or {}).get(rec_sfi) if rec_sfi \
else sel.get('fid')
if fid:
result['file'] = {'fid': fid, 'ef': _file_name(fid, prev.get('df'))}
else:
result['file'] = {'sfi': rec_sfi, 'unknown': True, 'ef': f'SFI {rec_sfi}'}
if not rec_sfi and not _is_record_file(sel):
result['file'] = _stale_file_note(sel)
else:
result['file'] = {'fid': fid,
'ef': _file_name(fid, prev.get('df'))}
elif rec_sfi:
result['file'] = {'sfi': rec_sfi, 'unknown': True,
'ef': f'SFI {rec_sfi}'}
elif ins in (0xB0, 0xB2, 0xD6, 0xDC) and prev and prev.get('sel'):
offset = p1p2.get('offset', 0)
if ins in (0xB2, 0xDC) and not _is_record_file(prev['sel']):
+1 -1
View File
@@ -1,3 +1,3 @@
"""Single source of truth for the SIMtrace Analyser version."""
__version__ = '2.7.8'
__version__ = '2.7.9'