Skip to content

Commit 5396de4

Browse files
committed
docs(modem): Added documentation about mode transitions
Closes espressif#318
1 parent aff571d commit 5396de4

File tree

1 file changed

+56
-4
lines changed

1 file changed

+56
-4
lines changed

docs/esp_modem/en/README.rst

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,68 @@ Common use cases of the esp-modem are also listed as the examples:
8484
connectivity of the esp-modem and provides a WiFi AP that forwards
8585
packets (and uses NAT) to and from the PPPoS connection.
8686

87+
Working modes
88+
~~~~~~~~~~~~~
89+
90+
Modem devices could work in multiple different modes, esp-modem library
91+
uses these states to describe them:
92+
- Standard modes:
93+
- Command mode -- This mode is used for sending AT commands
94+
- Data or PPP mode -- This mode is used for data communication (to create PPPoS tunnel between the device and the library)
95+
- Multiplexing modes:
96+
- CMUX mode -- This mode creates two virtual channels and uses one for sending AT commands and the other one for data communication.
97+
- DUAL mode -- This mode uses two physical channels the same way as CMUX. This mode is supported only by certain devices, usually with USB interface.
98+
- Manual CMUX modes -- These modes are designed for applications to have better control over CMUX mode transitions. It allows setting up the virtual channels,
99+
switching between channels, transitioning between data and command modes for each channel separately, and exiting the CMUX.
100+
101+
Switching between common modes
102+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103+
104+
The diagram below depicts allowed transitions between the most common modes
105+
106+
::
107+
108+
+---------+ +---------+
109+
| COMMAND |<-->| DATA |
110+
+---------+ +---------+
111+
^
112+
|
113+
v
114+
+-------+
115+
| CMUX |
116+
+-------+
117+
118+
Note that it is possible to switch from any mode to the "UNDEF" mode and vice-versa.
119+
120+
Switching between manual modes
121+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122+
123+
The diagram below depicts allowed transitions between manual CMUX modes
124+
125+
::
126+
+------------------------------------
127+
| |
128+
+----------+ +-------------+ +------------+ +----------+
129+
| |<-->| MANUAL_DATA |<-->| MANUAL_CMD |<-->| COMMAND |
130+
| CMUX | +-------------+ +------------+ | (CMUX |
131+
| MANUAL | | | MANUAL |
132+
| | +-------------+ | EXIT) |
133+
| |<-->| MANUAL_SWAP |<-------------------->| |
134+
+----------+ +-------------+ +----------+
135+
| |
136+
+-----------------------------------------------------+
137+
138+
Note that transitioning between "MANUAL_DATA" and "MANUAL_CMD" switches the secondary terminal (dedicated to PPP session) and could be used for recovering data communication if PPP session gets dropped.
139+
87140
Extensibility
88141
-------------
89142

90143
CMUX
91144
~~~~
92145

93-
Implementation of virtual terminals is an experimental feature, which
94-
allows users to also issue commands in the data mode, after creating
95-
multiple virtual terminals, designating some of them solely to data
96-
mode, others solely to command mode.
146+
Implements virtual terminals which allow users to also issue commands in the data mode;
147+
after creating two virtual terminals, designating one of them solely to data mode, and
148+
another one solely to command mode.
97149

98150
DTE’s
99151
~~~~~

0 commit comments

Comments
 (0)