Add LL1 Serving Cell Timing messages

This log should provide constant feedback about the serving cell's LTE
timing advance value.
This commit is contained in:
Will Greenberg
2026-06-26 11:19:33 -07:00
parent 3a7f512842
commit 892c833344
8 changed files with 73 additions and 26 deletions
+33
View File
@@ -0,0 +1,33 @@
use deku::prelude::*;
#[derive(Debug, Clone, PartialEq, DekuRead, DekuWrite)]
#[deku(bit_order = "lsb", ctx = "_: deku::ctx::Order")]
pub struct ServingCellTiming {
#[deku(assert_eq = "1")]
pub version: u8,
#[deku(bits = 5, assert = "*num_records <= 20")]
pub num_records: u8,
#[deku(bits = 4, assert = "*starting_sub_fn <= 9")]
pub starting_sub_fn: u8,
#[deku(bits = 10, pad_bits_after = "5", assert = "*starting_system_fn <= 1023")]
pub starting_system_fn: u16,
#[deku(bits = 19, pad_bits_after = "13", assert = "*starting_dl_frame_timing_offs <= 307200")]
pub starting_dl_frame_timing_offs: u32, // in Ts units
#[deku(bits = 19, assert = "*starting_ul_frame_timing_offs <= 307200")]
pub starting_ul_frame_timing_offs: u32, // in Ts units
#[deku(bits = 11, pad_bits_after = "2")]
pub starting_ul_timing_advance: u16, // in 16 Ts units
#[deku(count = "*num_records")]
pub timing_adjustment: Vec<TimingAdjustment>,
}
#[derive(Debug, Clone, PartialEq, DekuRead, DekuWrite)]
#[deku(bit_order = "lsb", ctx = "_: deku::ctx::Order")]
pub struct TimingAdjustment {
#[deku(bits = 11, assert = "(-512..=511).contains(dl_frame_timing_adjustment)")]
pub dl_frame_timing_adjustment: i16, // in Ts units
#[deku(bits = 5, assert = "(-16..=15).contains(ul_frame_timing_adjustment)")]
pub ul_frame_timing_adjustment: i8, // in Ts units
#[deku(bits = 8, assert = "(-128..=127).contains(timing_advance)")]
pub timing_advance: i8, // in 16 Ts units
}
+2 -1
View File
@@ -18,7 +18,8 @@ pub struct Subpacket {
pub id: u8,
pub version: u8,
pub size: u16,
#[deku(ctx = "*id, *version, *size")]
// size includes the header length, so subtract that
#[deku(ctx = "*id, *version, *size - 4")]
pub body: SubpacketBody,
}
+13 -3
View File
@@ -3,8 +3,9 @@
use chrono::{DateTime, FixedOffset};
use deku::prelude::*;
pub mod ll1;
pub mod mac;
pub mod measurement;
pub mod ml1;
pub mod rrc;
#[derive(Debug, Clone, PartialEq, DekuRead, DekuWrite)]
@@ -79,14 +80,23 @@ pub enum LogBody {
},
#[deku(id = "0xb17f")]
LteMl1ServingCellMeasurementAndEvaluation {
data: measurement::serving_cell::MeasurementAndEvaluation,
data: ml1::serving_cell::MeasurementAndEvaluation,
},
#[deku(id = "0xb180")]
LteMl1NeighborCellsMeasurements {
data: measurement::neighbor_cells::Measurements,
data: ml1::neighbor_cells::Measurements,
},
#[deku(id = "0xb062")]
LteMacRachResponse { packet: mac::Packet },
#[deku(id = "0xb063")]
LteMacDl { packet: mac::Packet },
#[deku(id = "0xb064")]
LteMacUl { packet: mac::Packet },
#[deku(id = "0xb114")]
LteLl1ServingCellTiming {
#[deku(ctx = "deku::ctx::Order::Lsb0")]
data: ll1::ServingCellTiming,
}
}
#[derive(Debug, Clone, PartialEq, DekuRead, DekuWrite)]
+2 -1
View File
@@ -166,8 +166,9 @@ impl Message {
match body {
LogBody::LteRrcOtaMessage { .. } => true,
LogBody::LteMacRachResponse { .. } => true,
LogBody::LteMl1NeighborCellsMeasurements { .. } => true,
LogBody::Nas4GMessage { .. } => true,
_ => false,
_ => false
}
}
}