You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parsing logic for J1939/21 Transport Protocols (including Broadcast Announce Messages [BAM] and Connection Management [TP.CM / TP.DT]) is tightly coupled within the same classes handling standard parameter group network distribution or ECU address configuration.
Spawning simultaneous multi-packet operations (e.g., concurrently receiving a multi-page diagnostic payload from one node while transmitting engine configuration parameters to another) leads to complex, fragile state tracking.
The lack of isolated protocol state machines makes it extremely difficult to track partial session failures, trace bit-level corruption, or test edge-case protocol failures independently.
Proposed Architecture Fix
Implement an explicit, decoupled, layered software architecture pattern:
+-------------------------------------------------------------+
| Application Layer |
| (Controller Applications: DM1, DM2, etc.) |
+-------------------------------------------------------------+
^
| Fully assembled PGN/Payload
v
+-------------------------------------------------------------+
| Transport / Network Layer |
| (Stateful TP.CM/TP.DT Managers & Address Claim Managers) |
+-------------------------------------------------------------+
^
| Filtered J1939 Frames
v
+-------------------------------------------------------------+
| Data Link Layer |
| (Async Bus IO & J1939 ID Router) |
+-------------------------------------------------------------+
Introduce dedicated, lifecycle-managed TransportSession state machine classes.
When an RTS or BAM frame is intercepted by the Data Link Router, it instantiates an isolated TransportSession instance that manages its own packet offsets, timers, and byte reconstruction buffers.
The parent class is notified only when assembly succeeds, or when an explicit timeout exception is raised.
The parsing logic for J1939/21 Transport Protocols (including Broadcast Announce Messages [BAM] and Connection Management [TP.CM / TP.DT]) is tightly coupled within the same classes handling standard parameter group network distribution or ECU address configuration.
Proposed Architecture Fix
Implement an explicit, decoupled, layered software architecture pattern:
Note
See #33 for Data Link Layer
TransportSessionstate machine classes.RTSorBAMframe is intercepted by the Data Link Router, it instantiates an isolatedTransportSessioninstance that manages its own packet offsets, timers, and byte reconstruction buffers.