From 14d4310586454abbfb18bb84a723590901cff4e0 Mon Sep 17 00:00:00 2001 From: RobertoRoos Date: Tue, 11 Feb 2025 14:40:40 +0100 Subject: [PATCH] Added PlantUML diagram to protocols --- sphinx/doc/cpp_protocol.rst | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/sphinx/doc/cpp_protocol.rst b/sphinx/doc/cpp_protocol.rst index 78249091..830d38bf 100644 --- a/sphinx/doc/cpp_protocol.rst +++ b/sphinx/doc/cpp_protocol.rst @@ -65,6 +65,41 @@ Standard layer implementations can be used to construct the following stacks (to :cpp:class:`stored::TerminalLayer`, :cpp:class:`stored::XsimLayer` +Protocol layers make an onion shape either around a debugger or a synchronizer. +Following the example of the lossless UART: + +.. uml:: + + left to right direction + + component "StdioLayer" { + () "Decode" as decode3 + () "Encode" as encode3 + + component "TerminalLayer" { + () "Decode" as decode2 + () "Encode" as encode2 + + component "AsciiEscapeLayer" { + () "Decode" as decode1 + () "Encode" as encode1 + + component "Synchronizer / Debugger" as core { + } + } + } + } + + [In] --> decode3 + decode3 --> decode2 + decode2 --> decode1 + decode1 --> core + + core --> encode1 + encode1 --> encode2 + encode2 --> encode3 + encode3 --> [Out] + If you have to implement you own protocol layer, start with :cpp:class:`stored::ProtocolLayer`. Especially, override :cpp:func:`stored::ProtocolLayer::encode()` for messages passed down the stack