Skip to content

Commit 92053a1

Browse files
committed
PHY: LtePhyEnb: reject non-positive beaconInterval instead of silently disabling beacons
A zero (or negative) cellInfo.beaconInterval previously meant "no beacons", conflating the beacon on/off decision with the interval value. Make a non-positive interval a hard error at initialization so the two knobs stay orthogonal and configuration is predictable: enableBeacons is the on/off switch, beaconInterval is always a positive period. enableBeacons still defaults to enableHandover, so beacon emission is unchanged in every existing simulation and fingerprints are unaffected (full suite 132/132 OK; no baseline sets beaconInterval<=0).
1 parent 67fe989 commit 92053a1

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

src/simu5g/stack/phy/LtePhyEnb.cc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,16 @@ void LtePhyEnb::initialize(int stage)
7171
}
7272

7373
beaconInterval_ = cellInfo_->par("beaconInterval");
74-
bool enableHandover = par("enableHandover");
74+
if (beaconInterval_ <= 0)
75+
throw cRuntimeError("cellInfo.beaconInterval must be positive (got %gs); beacons are "
76+
"switched off with enableBeacons=false, not with a zero interval", beaconInterval_);
7577
bool enableBeacons = par("enableBeacons");
76-
bool beaconsWillFlow = enableBeacons && beaconInterval_ != 0;
7778
// Handover feasibility assessment (and radio link monitoring) in the UEs is driven by
7879
// these beacons, so handover cannot silently work without them.
79-
if (enableHandover && !beaconsWillFlow)
80-
throw cRuntimeError("enableHandover=true requires the eNB to broadcast beacons, but "
81-
"they are disabled (enableBeacons=%s, cellInfo.beaconInterval=%gs); set "
82-
"enableBeacons=true and beaconInterval>0, or set enableHandover=false",
83-
enableBeacons ? "true" : "false", beaconInterval_);
84-
if (beaconsWillFlow) {
80+
if (par("enableHandover").boolValue() && !enableBeacons)
81+
throw cRuntimeError("enableHandover=true requires enableBeacons=true: handover "
82+
"feasibility assessment in the UEs is driven by the eNB's periodic beacons");
83+
if (enableBeacons) {
8584
beaconStarter_ = new cMessage("beaconStarter");
8685
scheduleAt(NOW, beaconStarter_);
8786
}

src/simu5g/stack/phy/LtePhyEnb.ned

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,17 @@ simple LtePhyEnb extends LtePhyBase
2525
@class("LtePhyEnb");
2626

2727
// Marks this eNB as a handover target: its beacons are used by UEs for handover
28-
// feasibility assessment. Requires enableBeacons (beacons are the input to that
29-
// assessment); the module errors out at initialization if beacons are disabled.
28+
// feasibility assessment. Requires enableBeacons=true (the default when handover is
29+
// on); the module errors out at initialization if beacons are disabled while
30+
// handover is enabled.
3031
bool enableHandover = default(false);
3132

3233
// Enables broadcasting periodic beacons (at cellInfo.beaconInterval). Beacons are the
3334
// measurement signal UEs use both for handover feasibility assessment and for radio
34-
// link monitoring (RLF detection), so they are decoupled from enableHandover to allow
35-
// radio link monitoring without handover. Defaults to enableHandover for backward
36-
// compatibility. Broadcasting also requires cellInfo.beaconInterval > 0.
35+
// link monitoring (RLF detection), decoupled from enableHandover so radio link
36+
// monitoring can run without handover. Defaults to enableHandover (beacons flow
37+
// exactly when handover is enabled). cellInfo.beaconInterval must be positive: a
38+
// zero/negative interval is an error -- switch beacons off with enableBeacons=false.
3739
bool enableBeacons = default(enableHandover);
3840

3941
double targetBler = default(0.001);

0 commit comments

Comments
 (0)