Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/fdl/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ impl FdlActiveStation {
if next_address >= next_station && next_station > self.p.address {
// We have reached the end of the GAP, enter waiting state.
GapState::Waiting { rotation_count: 0 }
} else if next_address == next_station && next_station == self.p.address {
// We have reached the end of the GAP, enter waiting state (NS==TS case).
GapState::Waiting { rotation_count: 0 }
} else if next_address >= next_station
&& next_station < self.p.address
&& next_address < self.p.address
Expand Down
19 changes: 19 additions & 0 deletions src/fdl/test_active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,25 @@ fn two_rotations_before_ready() {
fdl_ut.wait_for_matching(|t| t == fdl::Telegram::Token(fdl::TokenTelegram { da: 15, sa: 7 }));
}

/// Test that an active station polls all its GAP fine
#[test]
fn active_station_full_gap_scanned() {
crate::test_utils::prepare_test_logger();
let mut fdl_ut = FdlActiveUnderTest::new(7);

for addr in [8, 3, 6, 8, 11] {
fdl_ut.wait_for_matching(|t| {
if let fdl::Telegram::Data(data_telegram) = t {
data_telegram.is_fdl_status_request().is_some()
&& data_telegram.h.da == addr
&& data_telegram.h.sa == 7
} else {
false
}
});
}
}

/// Test that an active station discovers another active neighbor station.
#[test]
fn active_station_discovers_neighbor() {
Expand Down
Loading