Skip to content

Emit CellID from RRC SCell Info (order-independent of ML1) - #2

Closed
shark-fi wants to merge 1 commit into
feat/cell-kv-outputfrom
feat/scat-cellid-from-rrc
Closed

shark-fi wants to merge 1 commit into
feat/cell-kv-outputfrom
feat/scat-cellid-from-rrc

Conversation

@shark-fi

@shark-fi shark-fi commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

Makes --cell-kv capture the CellID reliably. Previously a CellID only appeared when an RRC SCell Info packet had been cached before an ML1 serving measurement fired — the identity is joined onto the ML1 line. If the RRC packet arrived after, or the ML1 serving cadence was sparse, the CellID/TAC/PLMN never reached the output even though the modem logged the serving-cell identity. (A real Mudi/RM520 walk exported 1185 rows with 0 CellIDs for exactly this reason.)

Stacked on fgsect#150 (--cell-kv) — builds directly on its RRC↔ML1 identity join.

What changed

Identity capture is now order-independent:

  • LTE parse_lte_ml1_scell_meas and the NR ML1 serving path cache the latest serving signal per radio ({earfcn/nrarfcn, pci, rsrp[/rsrq/rssi]}).
  • parse_lte_rrc_cell_info / parse_nr_rrc_scell_info, under --cell-kv, emit their own cell=scell line carrying the full identity (plmn/mcc/mnc/tac/cid/band/bwmhz) joined to that cached signal — or nothing when no signal is cached yet (so no all-zero-metric line, which downstream ingest drops; the ML1 join then fills the next measurement instead).

Net: whenever the modem logs an RRC SCell Info and any ML1 serving measurement has occurred (in either order), a --cell-kv line with the CellID is produced.

Example (decoded from real capture vectors)

# RRC SCell Info arrives, ML1 signal already cached for the cell:
LTE: pci=77,earfcn=1825,...,tac=39701,cid=162580531,band=3,bwmhzdl=15,bwmhzul=15 rssi=-60.0,rsrp=-95.5,rsrq=-11.0
NR:  pci=669,earfcn=641760,...,tac=31017,cid=21248152064,band=78,bwmhzdl=90,bwmhzul=90 rssi=0,rsrp=-88.0,rsrq=0
# No ML1 signal cached yet -> emits "" (ML1 join covers it once a measurement arrives)

Tests

New TestCellIdFromRrc covers LTE/NR RRC→kv emission with a cached signal, the empty-when-no-signal case, and ML1 signal caching. Full suite: 98 passing.

Deployment note

The device-side SCAT bundle must include this (and fgsect#150) for the CellID to flow — an older on-device bundle predating the identity join will still export empty CellIDs regardless of this change.

🤖 Generated with Claude Code

--cell-kv only carried a CellID when an RRC SCell Info packet had been cached
*before* an ML1 serving measurement fired (the identity is joined onto the ML1
line). When the RRC packet arrives after — or the ML1 serving cadence is sparse —
the CellID/TAC/PLMN never make it into the output, even though the modem logged
the serving-cell identity.

Make identity capture order-independent by caching the latest ML1 serving signal
(per radio) and having the RRC SCell Info parser emit its own identity-bearing
serving-cell kv line joined to that signal:

- LTE parse_lte_ml1_scell_meas / NR ml1 serving cache {earfcn/nrarfcn, pci, rsrp[/rsrq/rssi]}.
- parse_lte_rrc_cell_info / parse_nr_rrc_scell_info, under --cell-kv, emit a
  cell=scell line with the full identity (plmn/mcc/mnc/tac/cid/band/bwmhz) plus the
  cached signal, or nothing when no signal is cached yet (avoids all-zero-metric
  lines that downstream ingest drops; the ML1 join then fills the next measurement).

Net effect: whenever the modem logs an RRC SCell Info and any ML1 serving
measurement has occurred (in either order), a --cell-kv line with the CellID is
produced. Full suite 98 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shark-fi

shark-fi commented Sep 4, 2026

Copy link
Copy Markdown
Owner Author

Consolidated into fgsect#153 (single PR off master with --cell-kv, --meas-gsmtap, and this order-independent CellID emission). Closing here.

@shark-fi shark-fi closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant