|
|
@@ -41,7 +41,7 @@ The following uses Station as an example to illustrate the core parts of the pro
|
|
|
|
|
|
2. The data lengths before and after symmetric encryption/decryption must stay the same. It also supports in-place encryption and decryption.
|
|
|
|
|
|
-The flow chat of BluFi
|
|
|
+The flow chart of BluFi
|
|
|
-----------------------
|
|
|
|
|
|
.. seqdiag::
|
|
|
@@ -77,35 +77,64 @@ The frame formats for the communication between the mobile phone App and ESP32 a
|
|
|
|
|
|
The frame format with no fragment (8 bit):
|
|
|
|
|
|
-+------------+---------------+-----------------+-------------+----------------+----------------+
|
|
|
-| LSB - Type | Frame Control | Sequence Number | Data Length | Data | MSB - CheckSum |
|
|
|
-+============+===============+=================+=============+================+================+
|
|
|
-| 1 | 1 | 1 | 1 | ${Data Length} | 2 |
|
|
|
-+------------+---------------+-----------------+-------------+----------------+----------------+
|
|
|
++-----------------+----------------+
|
|
|
+| Description | Value |
|
|
|
++=================+================+
|
|
|
+| LSB - Type | 1 |
|
|
|
++-----------------+----------------+
|
|
|
+| Frame Control | 1 |
|
|
|
++-----------------+----------------+
|
|
|
+| Sequence Number | 1 |
|
|
|
++-----------------+----------------+
|
|
|
+| Data Length | 1 |
|
|
|
++-----------------+----------------+
|
|
|
+| Data | ${Data Length} |
|
|
|
++-----------------+----------------+
|
|
|
+| MSB - CheckSum | 2 |
|
|
|
++-----------------+----------------+
|
|
|
|
|
|
If the **Frame Ctrl** bit is enabled, the **Total length** bit indicates the length of remaining part of the frame. It can tell the remote how much memory needs to be alloced.
|
|
|
|
|
|
The frame format with fragments(8 bit):
|
|
|
|
|
|
-+------------+--------------------+----------------+------------+-------------------------------------------+----------------+
|
|
|
-| LSB - Type | FrameControl(Frag) | SequenceNumber | DataLength | Data | MSB - CheckSum |
|
|
|
-+ + + + +----------------------+--------------------+ +
|
|
|
-| | | | | Total Content Length | Content | |
|
|
|
-+============+====================+================+============+======================+====================+================+
|
|
|
-| 1 | 1 | 1 | 1 | 2 | ${Data Length} - 2 | 2 |
|
|
|
-+------------+--------------------+----------------+------------+----------------------+--------------------+----------------+
|
|
|
++--------------------+-------------------------------------------+
|
|
|
+| Description | Value |
|
|
|
++====================+===========================================+
|
|
|
+| LSB - Type | 1 |
|
|
|
++--------------------+-------------------------------------------+
|
|
|
+| FrameControl(Frag) | 1 |
|
|
|
++--------------------+-------------------------------------------+
|
|
|
+| SequenceNumber | 1 |
|
|
|
++--------------------+-------------------------------------------+
|
|
|
+| DataLength | 1 |
|
|
|
++--------------------+----------------------+--------------------+
|
|
|
+| | Total Content Length | 2 |
|
|
|
++ Data +----------------------+--------------------+
|
|
|
+| | Content | ${Data Length} - 2 |
|
|
|
++--------------------+----------------------+--------------------+
|
|
|
+| MSB - CheckSum | 2 |
|
|
|
++--------------------+-------------------------------------------+
|
|
|
|
|
|
Normally, the control frame does not contain data bits, except for Ack Frame.
|
|
|
|
|
|
The format of Ack Frame(8 bit):
|
|
|
|
|
|
-+------------------+----------------+------------------+--------------+-----------------------+----------------+
|
|
|
-| LSB - Type (Ack) | Frame Control | SequenceNumber | Data Length | Data | MSB - CheckSum |
|
|
|
-+ + + + +-----------------------+ +
|
|
|
-| | | | | Acked Sequence Number | |
|
|
|
-+==================+================+==================+==============+=======================+================+
|
|
|
-| 1 | 1 | 1 | 1 | 1 | 2 |
|
|
|
-+------------------+----------------+------------------+--------------+-----------------------+----------------+
|
|
|
++------------------+--------------------------------------------+
|
|
|
+| Description | Value |
|
|
|
++------------------+--------------------------------------------+
|
|
|
+| LSB - Type (Ack) | 1 |
|
|
|
++------------------+--------------------------------------------+
|
|
|
+| Frame Control | 1 |
|
|
|
++------------------+--------------------------------------------+
|
|
|
+| SequenceNumber | 1 |
|
|
|
++------------------+--------------------------------------------+
|
|
|
+| DataLength | 1 |
|
|
|
++------------------+-----------------------+--------------------+
|
|
|
++ Data + Acked Sequence Number + 2 +
|
|
|
+| | | |
|
|
|
++------------------+-----------------------+--------------------+
|
|
|
+| MSB - CheckSum | 2 |
|
|
|
++------------------+--------------------------------------------+
|
|
|
|
|
|
1. Type
|
|
|
|