Address code-review nits for BAD_FCS support

- decode.py: use the GSMTAP_FLAG_BAD_FCS constant instead of a literal
  0x01 in gsmtap_flag_names() (import from ..gsmtap); no behavior change.
- tests: add a DB round-trip test (insert_message with BAD_FCS flag →
  get_messages → decoded.errors) covering the end-to-end path, not just
  the direct decode_sniff_msg call.
This commit is contained in:
catarrh committed 2026-08-26 22:11:29 +03:00
1 parent 66094a0114
commit 79acb3773f
2 files changed
+17 -1

No files matched your search

+3 -1
View File
@@ -4,6 +4,8 @@ Pure Python, no dependencies. Decodes raw TPDU bytes captured by
the SIMtrace2 sniffer into structured dicts for the PWA to display.
"""
from ..gsmtap import GSMTAP_FLAG_BAD_FCS
# ──────────────────── Status Word names ────────────────────
SW_NAMES = {
@@ -4038,7 +4040,7 @@ def gsmtap_flag_names(flags):
desynced TPDU (mis-framed exchange / implausible status word).
"""
names = []
if flags & 0x01:
if flags & GSMTAP_FLAG_BAD_FCS:
names.append('bad FCS (desynced)')
return names or None