Improved the up/down detection logic. Max up detection delay is the polling period. Max down detection delay is the polling period plus the heartbeat period.