1
0
Fork 0

set timeout state based solely on age

This commit is contained in:
Kevin Matz 2022-12-02 15:33:22 -05:00
parent 9548145629
commit a443299204
1 changed files with 3 additions and 2 deletions

View File

@ -313,6 +313,9 @@ void Universe::rx_timeout_(bool add_now)
else if (status_ == DMX_ACTIVE && age() >= E111_DATA_LOSS_TIMEOUT)
// E1.11 DMX timeout period may be different the the rx_timeout_period
setStatus(DMX_LOST);
else if (age() >= rx_timeout_period_)
// setStatus will be reimplimented to set the correct status
setStatus(RX_TIMEOUT);
auto elapsed = [] (auto& a, auto& b) {
return std::chrono::duration_cast<std::chrono::milliseconds>(a - b).count();
@ -327,8 +330,6 @@ void Universe::rx_timeout_(bool add_now)
else
rx_times_.pop();
}
if (rx_times_.empty() && status_ != DMX_NULL)
setStatus(RX_TIMEOUT);
}
} // namespace DMX