2021-11-16 06:58:29 +00:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" / >
2022-07-11 17:04:29 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / > < meta name = "generator" content = "Docutils 0.19: https://docutils.sourceforge.io/" / >
2021-11-16 06:58:29 +00:00
< title > Internal design — esp-modem documentation< / title >
< link rel = "stylesheet" type = "text/css" href = "_static/pygments.css" / >
< link rel = "stylesheet" type = "text/css" href = "_static/alabaster.css" / >
< script data-url_root = "./" id = "documentation_options" src = "_static/documentation_options.js" > < / script >
< script src = "_static/jquery.js" > < / script >
< script src = "_static/underscore.js" > < / script >
2022-06-21 16:10:23 +00:00
< script src = "_static/_sphinx_javascript_frameworks_compat.js" > < / script >
2021-11-16 06:58:29 +00:00
< script src = "_static/doctools.js" > < / script >
2022-09-30 08:40:36 +00:00
< script src = "_static/sphinx_highlight.js" > < / script >
2021-11-16 06:58:29 +00:00
< link rel = "index" title = "Index" href = "genindex.html" / >
< link rel = "search" title = "Search" href = "search.html" / >
< link rel = "next" title = "DCE Internal implementation" href = "internal_docs.html" / >
< link rel = "prev" title = "Advanced esp-modem use cases" href = "advanced_api.html" / >
< link rel = "stylesheet" href = "_static/custom.css" type = "text/css" / >
< meta name = "viewport" content = "width=device-width, initial-scale=0.9, maximum-scale=0.9" / >
< / head > < body >
< div class = "document" >
< div class = "documentwrapper" >
< div class = "bodywrapper" >
< div class = "body" role = "main" >
< section id = "internal-design" >
2022-06-21 16:10:23 +00:00
< h1 > Internal design< a class = "headerlink" href = "#internal-design" title = "Permalink to this heading" > ¶< / a > < / h1 >
2021-11-16 06:58:29 +00:00
< section id = "design-decisions" >
2022-06-21 16:10:23 +00:00
< h2 > Design decisions< a class = "headerlink" href = "#design-decisions" title = "Permalink to this heading" > ¶< / a > < / h2 >
2021-11-16 06:58:29 +00:00
< ul class = "simple" >
< li > < p > Use C++ with additional C API< / p > < / li >
< li > < p > Use exceptions< / p >
< ul >
< li > < p > Use macro wrapper over < code class = "docutils literal notranslate" > < span class = "pre" > try-catch< / span > < / code > blocks when exceptions off (use < code class = "docutils literal notranslate" > < span class = "pre" > abort()< / span > < / code > if < code class = "docutils literal notranslate" > < span class = "pre" > THROW()< / span > < / code > )< / p > < / li >
< / ul >
< / li >
< li > < p > Initializes and allocates in the constructor (might throw)< / p >
< ul >
< li > < p > easier code with exceptions ON, with exceptions OFF alloc/init failures are not treated as runtime error (program aborts)< / p > < / li >
< li > < p > break down long initialization in constructor into more private methods< / p > < / li >
< / ul >
< / li >
< li > < p > Implements different devices using inheritance from < code class = "docutils literal notranslate" > < span class = "pre" > GenericModule< / span > < / code > , which is the most general implementation of a common modem< / p >
< ul >
< li > < p > Internally uses templates with device specialization (modeled as < code class = "docutils literal notranslate" > < span class = "pre" > DCE< SpecificModule> < / span > < / code > ) which could be used as well for some special cases,
such as implantation of a minimal device (ModuleIf), add new AT commands (oOnly in compile time), or using the Module with DTE only (no DCE, no Netif) for sending AT commands without network< / p > < / li >
< / ul >
< / li >
< / ul >
< / section >
< section id = "dce-collaboration-model" >
2022-06-21 16:10:23 +00:00
< h2 > DCE collaboration model< a class = "headerlink" href = "#dce-collaboration-model" title = "Permalink to this heading" > ¶< / a > < / h2 >
2021-11-16 06:58:29 +00:00
< p > The diagram describes how the DCE class collaborates with DTE, PPP and the device abstraction< / p >
< p > < img alt = "DCE_architecture" src = "_images/DCE_DTE_collaboration.png" / > < / p >
< / section >
< section id = "terminal-inheritance" >
2022-06-21 16:10:23 +00:00
< h2 > Terminal inheritance< a class = "headerlink" href = "#terminal-inheritance" title = "Permalink to this heading" > ¶< / a > < / h2 >
2021-11-16 06:58:29 +00:00
< p > 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.< / p >
< / section >
< section id = "cmux-terminal" >
2022-06-21 16:10:23 +00:00
< h2 > CMUX terminal< a class = "headerlink" href = "#cmux-terminal" title = "Permalink to this heading" > ¶< / a > < / h2 >
2021-11-16 06:58:29 +00:00
< p > The below diagram depicts the idea of using CMUX terminal mode using the CMuxInstance 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 CMux class, which consumes the original terminal and uses its read/write methods
to multiplex the terminal.< / p >
< p > < img alt = "CMUX Terminal" src = "_images/CMux_collaboration.png" / > < / p >
< / section >
< / section >
< / div >
< / div >
< / div >
< div class = "sphinxsidebar" role = "navigation" aria-label = "main navigation" >
< div class = "sphinxsidebarwrapper" >
< h1 class = "logo" > < a href = "index.html" > esp-modem< / a > < / h1 >
< h3 > Navigation< / h3 >
< ul class = "current" >
< li class = "toctree-l1" > < a class = "reference internal" href = "README.html" > Brief intro< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "api_docs.html" > C interface< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "cxx_api_docs.html" > C++ interface< / a > < / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "advanced_api.html" > Advanced use cases< / a > < / li >
< li class = "toctree-l1 current" > < a class = "current reference internal" href = "#" > Internal design< / a > < ul >
< li class = "toctree-l2" > < a class = "reference internal" href = "#design-decisions" > Design decisions< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "#dce-collaboration-model" > DCE collaboration model< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "#terminal-inheritance" > Terminal inheritance< / a > < / li >
< li class = "toctree-l2" > < a class = "reference internal" href = "#cmux-terminal" > CMUX terminal< / a > < / li >
< / ul >
< / li >
< li class = "toctree-l1" > < a class = "reference internal" href = "internal_docs.html" > Internal implementation< / a > < / li >
< / ul >
< div class = "relations" >
< h3 > Related Topics< / h3 >
< ul >
< li > < a href = "index.html" > Documentation overview< / a > < ul >
< li > Previous: < a href = "advanced_api.html" title = "previous chapter" > Advanced esp-modem use cases< / a > < / li >
< li > Next: < a href = "internal_docs.html" title = "next chapter" > DCE Internal implementation< / a > < / li >
< / ul > < / li >
< / ul >
< / div >
< div id = "searchbox" style = "display: none" role = "search" >
< h3 id = "searchlabel" > Quick search< / h3 >
< div class = "searchformwrapper" >
< form class = "search" action = "search.html" method = "get" >
< input type = "text" name = "q" aria-labelledby = "searchlabel" autocomplete = "off" autocorrect = "off" autocapitalize = "off" spellcheck = "false" / >
< input type = "submit" value = "Go" / >
< / form >
< / div >
< / div >
2022-06-21 16:10:23 +00:00
< script > document . getElementById ( 'searchbox' ) . style . display = "block" < / script >
2021-11-16 06:58:29 +00:00
< / div >
< / div >
< div class = "clearer" > < / div >
< / div >
< div class = "footer" >
© 2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
2022-09-30 08:40:36 +00:00
Powered by < a href = "http://sphinx-doc.org/" > Sphinx 5.2.2< / a >
2021-11-16 06:58:29 +00:00
& < a href = "https://github.com/bitprophet/alabaster" > Alabaster 0.7.12< / a >
|
< a href = "_sources/internal_design.md.txt"
rel="nofollow">Page source< / a >
< / div >
< / body >
< / html >