Add --cell-kv machine-readable LTE/5G-NR cell measurement output#150
Open
shark-fi wants to merge 2 commits into
Open
Add --cell-kv machine-readable LTE/5G-NR cell measurement output#150shark-fi wants to merge 2 commits into
shark-fi wants to merge 2 commits into
Conversation
Add a --cell-kv flag (Qualcomm) that emits LTE and 5G-NR serving and neighbor cell measurements as single-line key=value records for machine parsing, instead of the human-readable stdout. Each record has the form: pci=..,earfcn=..,earfcn_ul=..,frequency=..,protocol=lte|nr,cell=scell|ncell, plmn=..,mcc=..,mnc=..,tac=..,cid=..,band=..,bwmhzdl=..,bwmhzul=.. rssi=..,rsrp=..,rsrq=.. Details: - util: dl_earfcn_to_frequency_hz() (3GPP TS 36.101 DL band table) and nrarfcn_to_frequency_hz() (TS 38.104 global raster) give center frequency in Hz; format_cell_kv()/format_plmn() build the record; real LTE UL-EARFCN via calculate_ul_earfcn(). - LTE (diagltelogparser) and NR (diagnrlogparser) serving and neighbor cell measurements emit the record; NR beam parsing is preserved (offsets still advance) but beams are not emitted as records. - Stateful join: RRC SCell Info packets populate a per-radio serving-cell identity cache (plmn/mcc/mnc/tac/cid/band/bandwidth) that is merged onto the matching ML1 serving-cell measurement, guarded on (earfcn, pci) so stale identity is never attached to a different cell. Default (no --cell-kv) output is unchanged; existing tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Cover the util helpers (dl_earfcn_to_frequency_hz, nrarfcn_to_frequency_hz, format_plmn, serving_identity_fields match-guard), LTE/NR serving and neighbor cell key=value records, the RRC SCell Info -> serving-cell cache population, and the stateful identity join (hit, mismatch-guard, and neighbor-not-enriched) using existing real capture vectors. Also asserts default (no --cell-kv) output is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--cell-kvflag (Qualcomm) that emits LTE and 5G-NR serving and neighbor cell measurements as single-linekey=valuerecords to stdout, for machine parsing / ingestion into external tooling. Without the flag, output is unchanged.Record format:
Example (LTE serving cell, with RRC identity joined in):
What's included
util:dl_earfcn_to_frequency_hz()(3GPP TS 36.101 DL band table) andnrarfcn_to_frequency_hz()(TS 38.104 global raster) return center frequency in Hz;format_cell_kv()/format_plmn()build the record; LTE UL-EARFCN via the existingcalculate_ul_earfcn().diagltelogparser) and NR (diagnrlogparser): serving and neighbor cell measurements emit the record. NR beam parsing is preserved (byte offsets still advance) but beams are not emitted as records.(earfcn, pci)so stale identity is never attached to a different cell; neighbor cells remain identity-zeroed.Compatibility / tests
--cell-kv) output is byte-identical; the full existing test suite passes (81 tests).Notes
frequencyis in Hz;bwmhzdl/ulin MHz.🤖 Generated with Claude Code