From 90be6f9d566e12fe0822bae71ed87177feb25ba2 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Mon, 8 Mar 2021 19:28:54 +0100 Subject: [PATCH] Added internal desing document --- esp_modem/docs/internal_desing.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 esp_modem/docs/internal_desing.md diff --git a/esp_modem/docs/internal_desing.md b/esp_modem/docs/internal_desing.md new file mode 100644 index 000000000..25d48969f --- /dev/null +++ b/esp_modem/docs/internal_desing.md @@ -0,0 +1,30 @@ +# Internal design + +## Design decisions + +* Use C++ (lambdas) wit C API +* Use exceptions (implement nothrow? possibly using `assert()`) +* Initializes and allocates in the constructor (might throw) +* Implements different devices with template specialization +* Specific device abstraction overrides methods, but does not use virtual function dispatch (modeled as `DCE`) + +## DCE collaboration model + +The diagram describes how the DCE class collaborates with DTE, PPP and the device abstraction + +![DCE_architecture](DCE_DTE_collaboration.png) + +## Terminal inheritance + +Terminal is a class which can read or write data, and can handle callbacks when data are available. UART specialization +is provided implementing these method using the uart driver. + +![TerminalInheritance](Terminal_inheritance.png) + +## CMUX terminal + +The below diagram depicts the idea of using CMUX terminal mode using the CMUXedTerminal class which is a terminal +(it implements the basic read/write methods) interfacing arbitrary number of virtual terminals, +but at the same time it is also composed of another terminal, the real terminal, which is multiplexed. + +![CMUX Terminal](CMux_collaboration.png)