From dd66dda11e81e7c31a74adedfe6253fb0689fae4 Mon Sep 17 00:00:00 2001 From: Jin Fang Cheng Cheng Date: Thu, 28 Jun 2018 14:06:26 +0800 Subject: [PATCH] Fix the typo and tables. --- docs/en/api-guides/blufi.rst | 69 +++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 20 deletions(-) diff --git a/docs/en/api-guides/blufi.rst b/docs/en/api-guides/blufi.rst index 429c5d9e6..96a196ba6 100644 --- a/docs/en/api-guides/blufi.rst +++ b/docs/en/api-guides/blufi.rst @@ -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