1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Flow control filter chain for KNXnet/IP bus timing simulation.
//!
//! This module provides a production-grade bidirectional filter pipeline that
//! simulates real KNX bus flow control behavior. The architecture mirrors
//! trap-knx's filter chain design:
//!
//! ```text
//! Client → [QueueFilter] → [PaceFilter] → [RetryFilter] → Bus (send path)
//! Client ← [QueueFilter] ← [PaceFilter] ← [RetryFilter] ← Bus (recv path)
//! ```
//!
//! ## Components
//!
//! - [`FilterChain`]: Bidirectional pipeline orchestrator
//! - [`PaceFilter`]: 3-state FSM (P_DOWN/P_IDLE/P_BUSY) enforcing minimum
//! inter-frame delay based on byte_delay + margin
//! - [`QueueFilter`]: 3-priority FIFO (High/Normal/Low) with WaitingForAck
//! backpressure support
//! - [`RetryFilter`]: Retry logic with 3-state circuit breaker
//! (Closed/Open/HalfOpen)
//!
//! ## Bus Timing Model
//!
//! KNX TP1 bus operates at 9600 baud. The PaceFilter enforces realistic
//! inter-frame timing:
//!
//! - **byte_delay**: Time to transmit one byte = 1/9600 * 11 bits ~ 1.146ms
//! - **Frame delay**: byte_delay * frame_length
//! - **Margin**: Additional 50ms safety margin (configurable)
//! - **Total**: frame_delay + margin before next frame can be sent
pub use ;
pub use ;
pub use ;
pub use ;